Hi,

There are no caching mechanism in current elm_map.
So, too many network resources are wasted because elm_map keeps only
two grids and already downloaded images are downloaded again and
again. (This also slows the map loading speed)
I have changed this grid management policy.

I have done followings.
1. Create all grids (all zoom levels) when elm_map_add() is called (No
memory overhead because of sparse matrix)
2. Clear all grids when map object is deleted.
3. Loads necessary grids and unloads unused grids when zoom level is changed.

Changed grid management have one weakness that memory and tmp size can
grow bigger while map object is live.
I think it may need API such as elm_map_cache_size_set().

Finally, I restore the gi->have values. The removal of this is my mistake.
gi->have is needed because I cannot know whether this file is
downloading (just opened and not written) or downloaded state even if
image file exists.

Please review this patch.

Thanks

-- 
BRs,
Kim.
Index: src/lib/elm_map.c
===================================================================
--- src/lib/elm_map.c	(리비전 65898)
+++ src/lib/elm_map.c	(작업 사본)
@@ -21,9 +21,9 @@
 typedef struct _Name_Dump Name_Dump;
 typedef struct _Track_Dump Track_Dump;
 
-#define DEST_DIR_ZOOM_PATH "/tmp/elm_map/%d/%d/"
-#define DEST_DIR_PATH DEST_DIR_ZOOM_PATH"%d/"
-#define DEST_FILE_PATH "%s%d.png"
+#define CACHE_ROOT_PATH   "/tmp/elm_map"
+#define CACHE_PATH        CACHE_ROOT_PATH"/%d/%d/%d/"
+#define CACHE_FILE_PATH   "%s%d.png"
 #define DEST_ROUTE_XML_FILE "/tmp/elm_map-route-XXXXXX"
 #define DEST_NAME_XML_FILE "/tmp/elm_map-name-XXXXXX"
 
@@ -247,6 +247,7 @@
 {
    Widget_Data *wd;
    Grid *g;
+   int zoom;
    Evas_Object *img;
    //Evas_Object *txt;
    const char *file;
@@ -254,7 +255,7 @@
    struct {
         int x, y, w, h;
    } src, out;
-
+   Eina_Bool have : 1;
    Ecore_File_Download_Job *job;
    int try_num;
 };
@@ -503,8 +504,6 @@
 static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
                              Evas_Callback_Type type, void *event_info);
 static void grid_place(Evas_Object *obj, Grid *g, Evas_Coord px, Evas_Coord py, Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh);
-static void grid_clear(Evas_Object *obj, Grid *g);
-static Grid *grid_create(Evas_Object *obj);
 static void grid_load(Evas_Object *obj, Grid *g);
 
 static void _process_download_list(Evas_Object *obj);
@@ -630,7 +629,7 @@
    coord_into_geo = eina_module_symbol_get(m, "map_module_coord_into_geo");
    if ((!source) || (!zoom_min) || (!zoom_max) || (!url) || (!route_source) || (!route_url) || (!name_url) || (!geo_into_coord) || (!coord_into_geo))
      {
-        ERR("could not find map_module_source_get() in module \"%s\": %s", file, eina_error_msg_get(eina_error_get()));
+        WRN("could not find map_module_source_get() in module \"%s\": %s", file, eina_error_msg_get(eina_error_get()));
         eina_module_unload(m);
         return EINA_FALSE;
      }
@@ -906,7 +905,6 @@
    int g_xx, g_yy, g_hh, g_ww;
 
    if (!wd) return;
-   if (g != eina_list_data_get(wd->grids)) return;
 
    ax = 0;
    ay = 0;
@@ -1102,52 +1100,6 @@
 }
 
 static void
-grid_clear(Evas_Object *obj, Grid *g)
-{
-   ELM_CHECK_WIDTYPE(obj, widtype);
-   Widget_Data *wd = elm_widget_data_get(obj);
-   char buf[PATH_MAX];
-
-   if (!wd) return;
-   if (!g->grid) return;
-
-   Eina_Iterator *it = eina_matrixsparse_iterator_new(g->grid);
-   Eina_Matrixsparse_Cell *cell;
-
-   snprintf(buf, sizeof(buf), DEST_DIR_ZOOM_PATH, wd->id, g->zoom);
-   ecore_file_recursive_rm(buf);
-
-   EINA_ITERATOR_FOREACH(it, cell)
-     {
-        Grid_Item *gi = eina_matrixsparse_cell_data_get(cell);
-        evas_object_del(gi->img);
-        //evas_object_del(gi->txt);
-
-        wd->download_list = eina_list_remove(wd->download_list, gi);
-
-        if (gi->job)
-          {
-             DBG("DOWNLOAD abort %s", gi->file);
-             ecore_file_download_abort(gi->job);
-             ecore_file_remove(gi->file);
-             gi->job = NULL;
-             wd->try_num--;
-          }
-        if (gi->file)
-          eina_stringshare_del(gi->file);
-        if (gi->source)
-          eina_stringshare_del(gi->source);
-
-        free(gi);
-     }
-   eina_matrixsparse_free(g->grid);
-   eina_iterator_free(it);
-   g->grid = NULL;
-   g->gw = 0;
-   g->gh = 0;
-}
-
-static void
 _tile_update(Grid_Item *gi)
 {
    evas_object_image_file_set(gi->img, gi->file, NULL);
@@ -1156,11 +1108,13 @@
      {
         ERR("Image loading error (%s): %s", gi->file, evas_load_error_str(err));
         ecore_file_remove(gi->file);
+        gi->have = EINA_FALSE;
      }
    else
      {
         obj_rotate_zoom(gi->wd->obj, gi->img);
         evas_object_show(gi->img);
+        gi->have = EINA_TRUE;
         //evas_object_text_text_set(gi->txt, gi->file);
         //evas_object_show(gi->txt);
      }
@@ -1177,16 +1131,17 @@
      {
         DBG("Download success from %s to %s", gi->source, gi->file);
         _tile_update(gi);
+        gi->wd->finish_num++;
      }
    else
      {
-        DBG("Download failed from %s to %s (%d) ", gi->source, gi->file, status);
+        WRN("Download failed from %s to %s (%d) ", gi->source, gi->file, status);
         ecore_file_remove(gi->file);
+        gi->have = EINA_FALSE;
      }
 
-   gi->wd->finish_num++;
-   gi->wd->download_num--;
    evas_object_smart_callback_call(gi->wd->obj, SIG_DOWNLOADED, NULL);
+   gi->wd->download_num--;
    if (!gi->wd->download_num)
      {
         edje_object_signal_emit(elm_smart_scroller_edje_object_get(gi->wd->scr), "elm,state,busy,stop", "elm");
@@ -1210,7 +1165,7 @@
    gw = wd->size.w;
    gh = wd->size.h;
 
-   EINA_LIST_FOREACH_SAFE(wd->download_list, l, ll, gi)
+   EINA_LIST_REVERSE_FOREACH_SAFE(wd->download_list, l, ll, gi)
      {
         xx = gi->out.x;
         yy = gi->out.y;
@@ -1235,15 +1190,19 @@
                                  cvx, cvy, cvw, cvh))
           {
              wd->download_list = eina_list_remove(wd->download_list, gi);
+             continue;
+          }
+        if (gi->zoom != wd->zoom)
+          {
+             wd->download_list = eina_list_remove(wd->download_list, gi);
+             continue;
           }
-     }
 
-   EINA_LIST_REVERSE_FOREACH_SAFE(wd->download_list, l, ll, gi)
-     {
         if (gi->wd->download_num >= MAX_CONCURRENT_DOWNLOAD) break;
 
+        DBG("Download request from %s to %s", gi->source, gi->file);
         Eina_Bool ret = ecore_file_download_full(gi->source, gi->file, _tile_downloaded, NULL, gi, &(gi->job), wd->ua);
-        if (!ret || !gi->job) ERR("Can't start to download from %s to %s", gi->source, gi->file);
+        if (!ret || !gi->job) WRN("Can't start to download from %s to %s", gi->source, gi->file);
         else
           {
              gi->wd->download_num++;
@@ -1261,39 +1220,119 @@
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
 
-   if (!eina_list_data_find(wd->download_list, gi)) wd->download_list = eina_list_append(wd->download_list, gi);
+   wd->download_list = eina_list_remove(wd->download_list, gi);
+   wd->download_list = eina_list_append(wd->download_list, gi);
    _process_download_list(obj);
 }
 
-static Grid *
-grid_create(Evas_Object *obj)
+static void
+grid_create_all(Evas_Object *obj)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+   ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    Grid *g;
+   int zoom = 0;
 
-   if ((!wd) || (!wd->src)) return NULL;
-   g = calloc(1, sizeof(Grid));
+   EINA_SAFETY_ON_NULL_RETURN(wd);
+   EINA_SAFETY_ON_NULL_RETURN(wd->src);
 
-   g->zoom = wd->zoom;
-   g->tsize = wd->tsize;
-   g->wd = wd;
+   for (zoom = wd->src->zoom_min; zoom <= wd->src->zoom_max; zoom++)
+     {
+        g = calloc(1, sizeof(Grid));
+        g->zoom = zoom;
+        g->tsize = wd->tsize;
+        g->wd = wd;
+        int size =  pow(2.0, g->zoom);
+        g->gw = size;
+        g->gh = size;
+        g->w = g->tsize * g->gw;
+        g->h = g->tsize * g->gh;
 
-   if (g->zoom > wd->src->zoom_max) return NULL;
-   if (g->zoom < wd->src->zoom_min) return NULL;
+        g->grid = eina_matrixsparse_new(g->gh, g->gw, NULL, NULL);
+        wd->grids = eina_list_append(wd->grids, g);
+     }
+}
 
-   int size =  pow(2.0, wd->zoom);
-   g->gw = size;
-   g->gh = size;
+static void
+grid_clear_all(Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   Grid *g;
+   Grid_Item *gi;
 
-   g->w = g->tsize * g->gw;
-   g->h = g->tsize * g->gh;
+   EINA_SAFETY_ON_NULL_RETURN(wd);
 
-   g->grid = eina_matrixsparse_new(g->gh, g->gw, NULL, NULL);
+   EINA_LIST_FREE(wd->grids, g)
+     {
+        Eina_Iterator *it = eina_matrixsparse_iterator_new(g->grid);
+        Eina_Matrixsparse_Cell *cell;
+
+        EINA_ITERATOR_FOREACH(it, cell)
+          {
+             gi = eina_matrixsparse_cell_data_get(cell);
+             evas_object_del(gi->img);
+             //evas_object_del(gi->txt);
+
+             if (gi->job)
+               {
+                  DBG("DOWNLOAD abort %s", gi->file);
+                  ecore_file_download_abort(gi->job);
+                  ecore_file_remove(gi->file);
+                  gi->have = EINA_FALSE;
+                  gi->job = NULL;
+                  wd->try_num--;
+               }
+             if (gi->file)   eina_stringshare_del(gi->file);
+             if (gi->source) eina_stringshare_del(gi->source);
+             free(gi);
+          }
+        eina_matrixsparse_free(g->grid);
+        eina_iterator_free(it);
+        free(g);
+     }
+
+   EINA_LIST_FREE(wd->download_list, gi);
+   if (!ecore_file_recursive_rm(CACHE_ROOT_PATH)) WRN("Deletion of %s failed", CACHE_ROOT_PATH);
+
+}
+
+static void
+grid_unload(Evas_Object *obj, Grid *g)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+
+   Eina_Iterator *it;
+   Eina_Matrixsparse_Cell *cell;
+   Grid_Item *gi;
+
+   EINA_SAFETY_ON_NULL_RETURN(wd);
+
+   it = eina_matrixsparse_iterator_new(g->grid);
+   EINA_ITERATOR_FOREACH(it, cell)
+     {
+        gi = eina_matrixsparse_cell_data_get(cell);
 
-   return g;
+        if (gi->have)
+          {
+             evas_object_hide(gi->img);
+             //evas_object_hide(gi->txt);
+             evas_object_image_file_set(gi->img, NULL, NULL);
+          }
+        else if (gi->job)
+          {
+             DBG("DOWNLOAD abort %s", gi->file);
+             ecore_file_download_abort(gi->job);
+             ecore_file_remove(gi->file);
+             gi->job = NULL;
+             wd->try_num--;
+          }
+     }
+   eina_iterator_free(it);
 }
 
+
 static void
 grid_load(Evas_Object *obj, Grid *g)
 {
@@ -1306,7 +1345,9 @@
    Eina_Matrixsparse_Cell *cell;
    Grid_Item *gi;
 
-   if ((!wd) || (!wd->src)) return;
+   EINA_SAFETY_ON_NULL_RETURN(wd);
+   EINA_SAFETY_ON_NULL_RETURN(wd->src);
+
    evas_object_geometry_get(wd->pan_smart, &ox, &oy, &ow, &oh);
    evas_output_viewport_get(evas_object_evas_get(wd->obj), &cvx, &cvy, &cvw, &cvh);
 
@@ -1349,20 +1390,20 @@
                                  ww, hh,
                                  cvx, cvy, cvw, cvh))
           {
-             if (ecore_file_exists(gi->file))
+             if (gi->have)
                {
                   evas_object_hide(gi->img);
+                  //evas_object_hide(gi->txt);
                   evas_object_image_file_set(gi->img, NULL, NULL);
                }
              else if (gi->job)
                {
-                  DBG("DOWNLOAD abort %s", gi->file);
+                  DBG("Download abort: %s", gi->file);
                   ecore_file_download_abort(gi->job);
                   ecore_file_remove(gi->file);
                   gi->job = NULL;
                   wd->try_num--;
                }
-             //evas_object_hide(gi->txt);
           }
      }
    eina_iterator_free(it);
@@ -1385,12 +1426,17 @@
           {
              gi = eina_matrixsparse_data_idx_get(g->grid, y, x);
 
-             if ((!gi) && (g != eina_list_data_get(wd->grids)))
-               continue;
-
              if (!gi)
                {
+                  char buf[PATH_MAX], buf2[PATH_MAX];
+                  char *source;
+
                   gi = calloc(1, sizeof(Grid_Item));
+
+                  gi->wd = wd;
+                  gi->g = g;
+                  gi->zoom = g->zoom;
+
                   gi->src.x = x * g->tsize;
                   gi->src.y = y * g->tsize;
                   gi->src.w = g->tsize;
@@ -1401,12 +1447,8 @@
                   gi->out.w = gi->src.w;
                   gi->out.h = gi->src.h;
 
-                  gi->wd = wd;
-                  gi->g = g;
-
                   gi->img = evas_object_image_add(evas_object_evas_get(obj));
-                  evas_object_image_scale_hint_set
-                     (gi->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
+                  evas_object_image_scale_hint_set(gi->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
                   evas_object_image_filled_set(gi->img, 1);
 
                   evas_object_smart_member_add(gi->img, wd->pan_smart);
@@ -1422,63 +1464,31 @@
                   elm_widget_sub_object_add(obj, gi->txt);
                   evas_object_pass_events_set(gi->txt, EINA_TRUE);
 */
-                  eina_matrixsparse_data_idx_set(g->grid, y, x, gi);
-
-                  gi->job = NULL;
-                  gi->file = NULL;
-                  gi->source = NULL;
-               }
-
-             if (!gi->job)
-               {
-                  char buf[PATH_MAX], buf2[PATH_MAX];
-                  char *source;
-
-                  snprintf(buf, sizeof(buf), DEST_DIR_PATH, wd->id, g->zoom, x);
-                  if (!ecore_file_exists(buf))
-                    ecore_file_mkpath(buf);
-
-                  snprintf(buf2, sizeof(buf2), DEST_FILE_PATH, buf, y);
-
-                  source = wd->src->url_cb(obj, x, y, g->zoom);
-                  if ((!source) || (strlen(source)==0)) continue;
-
+                  snprintf(buf, sizeof(buf), CACHE_PATH, wd->id, g->zoom, x);
+                  snprintf(buf2, sizeof(buf2), CACHE_FILE_PATH, buf, y);
+                  if (!ecore_file_exists(buf)) ecore_file_mkpath(buf);
                   eina_stringshare_replace(&gi->file, buf2);
-                  eina_stringshare_replace(&gi->source, source);
 
-                  if ((ecore_file_exists(gi->file)) || (g == eina_list_data_get(wd->grids)))
+                  source = wd->src->url_cb(obj, x, y, g->zoom);
+                  if ((!source) || (strlen(source)==0))
                     {
-                       if (ecore_file_exists(gi->file))
-                         {
-                           DBG("file exists: %s", gi->file);
-                           _tile_update(gi);
-                         }
-                       else
-                         {
-                            DBG("added to download list: %s", gi->file);
-                            _add_download_list(obj, gi);
-                         }
+                       eina_stringshare_replace(&gi->source, NULL);
+                       WRN("Getting source url failed: %s", gi->file);
                     }
+                  else eina_stringshare_replace(&gi->source, source);
                   if (source) free(source);
-               }
-          }
-     }
-}
 
-static void
-grid_clearall(Evas_Object *obj)
-{
-   ELM_CHECK_WIDTYPE(obj, widtype);
-   Widget_Data *wd = elm_widget_data_get(obj);
-   Grid *g;
+                  gi->have = EINA_FALSE;
+                  gi->job = NULL;
 
-   if (!wd) return;
-   EINA_LIST_FREE(wd->grids, g)
-     {
-        grid_clear(obj, g);
-        free(g);
+                  eina_matrixsparse_data_idx_set(g->grid, y, x, gi);
+               }
+
+             if      (gi->have) _tile_update(gi);
+             else if (!gi->job) _add_download_list(obj, gi);
+             else               DBG("Downloading is in progress: %s from %s", gi->file, gi->source);
+          }
      }
-   wd->download_list = eina_list_free(wd->download_list);
 }
 
 static void
@@ -1933,6 +1943,7 @@
         wd->wheel_zoom += 0.1;
         if (wd->wheel_zoom >= 2.0) wd->wheel_zoom = 2.0;
      }
+
    if (!wd->paused)
      {
         wd->pinch.level = pow(2.0, wd->wheel_zoom);
@@ -2104,7 +2115,7 @@
    Eina_List *l;
 
    if (!wd) return;
-   grid_clearall(obj);
+   grid_clear_all(obj);
    for (i = 0; i <= wd->zoom_max; i++)
      {
         if (!wd->markers[i]) continue;
@@ -2303,14 +2314,18 @@
    Evas_Coord ox, oy, ow, oh;
    Eina_List *l;
    Grid *g;
-   if (!sd) return;
+
+   EINA_SAFETY_ON_NULL_RETURN(sd);
+   EINA_SAFETY_ON_NULL_RETURN(sd->wd);
+
    evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
    rect_place(sd->wd->obj, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
    EINA_LIST_FOREACH(sd->wd->grids, l, g)
      {
-        if (sd->wd->zoom == g->zoom) grid_load(sd->wd->obj, g);
+        if (sd->wd->zoom == g->zoom)     grid_load(sd->wd->obj, g);
+        else if (sd->wd->zoom-1 != g->zoom && sd->wd->zoom+1 != g->zoom)  grid_unload(sd->wd->obj, g); // remain only adjacent grids
         grid_place(sd->wd->obj, g, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
-        marker_place(sd->wd->obj, g, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
+        if (sd->wd->zoom == g->zoom) marker_place(sd->wd->obj, g, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
         if (!sd->wd->zoom_animator) route_place(sd->wd->obj, g, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
         if (!sd->wd->zoom_animator) track_place(sd->wd->obj, g, sd->wd->pan_x, sd->wd->pan_y, ox, oy, ow, oh);
      }
@@ -2999,9 +3014,15 @@
 
    if (wd->grids)
      {
+        Eina_List *l;
+        Grid *g;
         Evas_Coord ox, oy, ow, oh;
         evas_object_geometry_get(wd->obj, &ox, &oy, &ow, &oh);
-        route_place(wd->obj, eina_list_data_get(wd->grids), wd->pan_x, wd->pan_y, ox, oy, ow, oh);
+        EINA_LIST_FOREACH(wd->grids, l, g)
+          {
+             if (wd->zoom == g->zoom) break;
+          }
+        route_place(wd->obj, g, wd->pan_x, wd->pan_y, ox, oy, ow, oh);
      }
    edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr),
                            "elm,state,busy,stop", "elm");
@@ -3211,6 +3232,8 @@
    wd->sep_maps_markers = evas_object_rectangle_add(evas_object_evas_get(obj));
    evas_object_smart_member_add(wd->sep_maps_markers, wd->pan_smart);
 
+   grid_create_all(obj);
+
    wd->paused = EINA_TRUE;
    elm_map_zoom_set(obj, 0);
    wd->paused = EINA_FALSE;
@@ -3239,7 +3262,6 @@
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    Eina_List *l;
-   Grid *g, *g_zoom = NULL;
    Evas_Coord rx, ry, rw, rh;
    Evas_Object *p;
    Elm_Map_Route *r;
@@ -3312,31 +3334,11 @@
           }
         wd->zoom = z;
      }
+
    wd->size.nw = pow(2.0, wd->zoom) * wd->tsize;
    wd->size.nh = pow(2.0, wd->zoom) * wd->tsize;
-
-   g = grid_create(obj);
-   if (g)
-     {
-        if (eina_list_count(wd->grids) > 1)
-          {
-             g_zoom = eina_list_last(wd->grids)->data;
-             wd->grids = eina_list_remove(wd->grids, g_zoom);
-             grid_clear(obj, g_zoom);
-             free(g_zoom);
-          }
-        wd->grids = eina_list_prepend(wd->grids, g);
-     }
-   else
-     {
-        EINA_LIST_FREE(wd->grids, g)
-          {
-             grid_clear(obj, g);
-             free(g);
-          }
-     }
-
    wd->t = 1.0;
+
    if ((wd->size.w > 0) && (wd->size.h > 0))
      {
         wd->size.spos.x = (double)(rx + (rw / 2)) / (double)wd->size.ow;
@@ -3921,9 +3923,15 @@
 
    if (wd->grids)
      {
+        Eina_List *l;
+        Grid *g;
         Evas_Coord ox, oy, ow, oh;
         evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
-        marker_place(obj, eina_list_data_get(wd->grids), wd->pan_x, wd->pan_y, ox, oy, ow, oh);
+        EINA_LIST_FOREACH(wd->grids, l, g)
+          {
+             if (wd->zoom == g->zoom) break;
+          }
+        marker_place(obj, g, wd->pan_x, wd->pan_y, ox, oy, ow, oh);
      }
 
    return marker;
@@ -4000,9 +4008,15 @@
 
    if (wd->grids)
      {
+        Eina_List *l;
+        Grid *g;
         Evas_Coord ox, oy, ow, oh;
         evas_object_geometry_get(wd->obj, &ox, &oy, &ow, &oh);
-        marker_place(wd->obj, eina_list_data_get(wd->grids), wd->pan_x, wd->pan_y, ox, oy, ow, oh);
+        EINA_LIST_FOREACH(wd->grids, l, g)
+          {
+             if (wd->zoom == g->zoom) break;
+          }
+        marker_place(wd->obj, g, wd->pan_x, wd->pan_y, ox, oy, ow, oh);
      }
 #else
    (void) marker;
@@ -4251,9 +4265,15 @@
    clas->hide = hide;
    if (wd->grids)
      {
+        Eina_List *l;
+        Grid *g;
         Evas_Coord ox, oy, ow, oh;
         evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
-        marker_place(obj, eina_list_data_get(wd->grids), wd->pan_x, wd->pan_y, ox, oy, ow, oh);
+        EINA_LIST_FOREACH(wd->grids, l, g)
+          {
+             if (wd->zoom == g->zoom) break;
+          }
+        marker_place(obj, g, wd->pan_x, wd->pan_y, ox, oy, ow, oh);
      }
 #else
    (void) obj;
@@ -4350,7 +4370,6 @@
    Widget_Data *wd = elm_widget_data_get(obj);
    Map_Sources_Tab *s;
    Eina_List *l;
-   Grid *grid;
    int zoom;
 
    if (!wd) return;
@@ -4360,7 +4379,7 @@
         if (!wd->src->url_cb) return;
      }
 
-   EINA_LIST_FREE(wd->grids, grid) grid_clear(obj, grid);
+   grid_clear_all(obj);
    EINA_LIST_FOREACH(wd->map_sources_tab, l, s)
      {
         if (!strcmp(s->name, source_name))
@@ -4379,6 +4398,7 @@
         if (wd->src->zoom_min > zoom)
           zoom = wd->src->zoom_min;
      }
+   grid_create_all(obj);
    elm_map_zoom_set(obj, zoom);
 #else
    (void) obj;
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to