Dear all,

I have fixed osm url for acquiring map tiles correctly.
I have added Mapquest & Mapquest open aerial map sources.
I have referred
http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames for fixing and
adding new url.

Mapint is deprecated, so I remove it.
Please refer
http://gis.638310.n2.nabble.com/Retiring-Maplint-off-www-osm-org-td4660182.html
http://wiki.openstreetmap.org/wiki/Maplint
for more information.

Please review this patch.

Thanks.
-- 
BRs,
Kim.
Index: src/lib/elm_map.c
===================================================================
--- src/lib/elm_map.c	(리비전 65729)
+++ src/lib/elm_map.c	(작업 사본)
@@ -76,7 +76,8 @@ typedef struct _Map_Sources_Tab
 static char *_mapnik_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom);
 static char *_osmarender_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom);
 static char *_cyclemap_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom);
-static char *_maplint_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom);
+static char *_mapquest_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom);
+static char *_mapquest_aerial_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom);
 
 static char *_yours_url_cb(Evas_Object *obj __UNUSED__, char *type_name, int method, double flon, double flat, double tlon, double tlat);
 /*
@@ -89,8 +90,9 @@ static Map_Sources_Tab default_map_sourc
 {
      {"Mapnik", 0, 18, _mapnik_url_cb, ELM_MAP_ROUTE_SOURCE_YOURS, _yours_url_cb, _nominatim_url_cb, NULL, NULL},
      {"Osmarender", 0, 17, _osmarender_url_cb, ELM_MAP_ROUTE_SOURCE_YOURS, _yours_url_cb, _nominatim_url_cb, NULL, NULL},
-     {"CycleMap", 0, 17, _cyclemap_url_cb, ELM_MAP_ROUTE_SOURCE_YOURS, _yours_url_cb, _nominatim_url_cb, NULL, NULL},
-     {"Maplint", 12, 16, _maplint_url_cb, ELM_MAP_ROUTE_SOURCE_YOURS, _yours_url_cb, _nominatim_url_cb, NULL, NULL},
+     {"CycleMap", 0, 16, _cyclemap_url_cb, ELM_MAP_ROUTE_SOURCE_YOURS, _yours_url_cb, _nominatim_url_cb, NULL, NULL},
+     {"MapQuest", 0, 18, _mapquest_url_cb, ELM_MAP_ROUTE_SOURCE_YOURS, _yours_url_cb, _nominatim_url_cb, NULL, NULL},
+     {"MapQuest Open Aerial", 0, 11, _mapquest_aerial_url_cb, ELM_MAP_ROUTE_SOURCE_YOURS, _yours_url_cb, _nominatim_url_cb, NULL, NULL},
 };
 
 struct _Url_Data
@@ -667,10 +669,10 @@ source_init(void *data)
    Widget_Data *wd = elm_widget_data_get(data);
    Map_Sources_Tab *s;
    Eina_List *l;
-   int idx;
+   unsigned int idx;
 
    if (!wd) return;
-   for (idx = 0; idx < 4; idx++)
+   for (idx = 0; idx < sizeof(default_map_sources_tab)/sizeof(Map_Sources_Tab); idx++)
      {
         s = calloc(1, sizeof(Map_Sources_Tab));
         EINA_SAFETY_ON_NULL_RETURN(s);
@@ -4975,8 +4977,8 @@ static char *
 _mapnik_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
 {
    char buf[PATH_MAX];
-   snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png";,
-          zoom, x, y);
+   snprintf(buf, sizeof(buf), "http://%c.tile.openstreetmap.org/%d/%d/%d.png";, ((x+y+zoom)%3)+'a', zoom, x, y);
+   DBG("%s", buf);
    return strdup(buf);
 }
 
@@ -4984,9 +4986,8 @@ static char *
 _osmarender_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
 {
    char buf[PATH_MAX];
-   snprintf(buf, sizeof(buf),
-            "http://tah.openstreetmap.org/Tiles/tile/%d/%d/%d.png";,
-            zoom, x, y);
+   snprintf(buf, sizeof(buf), "http://%c.tah.openstreetmap.org/Tiles/tile/%d/%d/%d.png";, ((x+y+zoom)%3)+'a', zoom, x, y);
+   DBG("%s", buf);
    return strdup(buf);
 }
 
@@ -4994,19 +4995,24 @@ static char *
 _cyclemap_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
 {
    char buf[PATH_MAX];
-   snprintf(buf, sizeof(buf),
-            "http://andy.sandbox.cloudmade.com/tiles/cycle/%d/%d/%d.png";,
-            zoom, x, y);
+   snprintf(buf, sizeof(buf), "http://%c.tile.opencyclemap.org/cycle/%d/%d/%d.png";, ((x+y+zoom)%3)+'a', zoom, x, y);
+   DBG("%s", buf);
+   return strdup(buf);
+}
+
+static char *
+_mapquest_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
+{
+   char buf[PATH_MAX];
+   snprintf(buf, sizeof(buf), "http://otile%d.mqcdn.com/tiles/1.0.0/osm/%d/%d/%d.png";, ((x+y+zoom)%4)+1, zoom, x, y);
    return strdup(buf);
 }
 
 static char *
-_maplint_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
+_mapquest_aerial_url_cb(Evas_Object *obj __UNUSED__, int x, int y, int zoom)
 {
    char buf[PATH_MAX];
-   snprintf(buf, sizeof(buf),
-            "http://tah.openstreetmap.org/Tiles/maplint/%d/%d/%d.png";,
-            zoom, x, y);
+   snprintf(buf, sizeof(buf), "http://oatile%d.mqcdn.com/naip/%d/%d/%d.png";, ((x+y+zoom)%4)+1, zoom, x, y);
    return strdup(buf);
 }
 
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to