Method that attempts to get maps between far apart points only appears to work 
in Mercator (LATLON) mode. Thus only do this when in LATLON mode (i.e. it is 
skipped when in UTM mode)
---
 src/viktrwlayer.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/viktrwlayer.c b/src/viktrwlayer.c
index 98f8ed1..fbe1017 100644
--- a/src/viktrwlayer.c
+++ b/src/viktrwlayer.c
@@ -3959,15 +3959,19 @@ void vik_track_download_map(VikTrack *tr, VikMapsLayer 
*vml, VikViewport *vvp, g
       new_map = TRUE;
   }
 
-  /* fill-ins for far apart points */
-  GList *cur_rect, *next_rect;
   GList *fillins = NULL;
-  for (cur_rect = rects_to_download;
-      (next_rect = cur_rect->next) != NULL;
-      cur_rect = cur_rect->next) {
-    if ((wh.lon < ABS(GLRECT(cur_rect)->center.east_west - 
GLRECT(next_rect)->center.east_west)) ||
-        (wh.lat < ABS(GLRECT(cur_rect)->center.north_south - 
GLRECT(next_rect)->center.north_south))) {
-      fillins = add_fillins(fillins, &GLRECT(cur_rect)->center, 
&GLRECT(next_rect)->center, &wh);
+  /* 'fillin' doesn't work in UTM mode - potentially ending up in massive loop 
continually allocating memory - hence don't do it */
+  /* seems that ATM the function get_next_coord works only for LATLON */
+  if ( cur_coord->mode == VIK_COORD_LATLON ) {
+    /* fill-ins for far apart points */
+    GList *cur_rect, *next_rect;
+    for (cur_rect = rects_to_download;
+        (next_rect = cur_rect->next) != NULL;
+        cur_rect = cur_rect->next) {
+      if ((wh.lon < ABS(GLRECT(cur_rect)->center.east_west - 
GLRECT(next_rect)->center.east_west)) ||
+         (wh.lat < ABS(GLRECT(cur_rect)->center.north_south - 
GLRECT(next_rect)->center.north_south))) {
+       fillins = add_fillins(fillins, &GLRECT(cur_rect)->center, 
&GLRECT(next_rect)->center, &wh);
+      }
     }
   }
 
-- 
1.7.1


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to