]> err.no Git - libchamplain/commitdiff
Add parameters to map sources constructors
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Fri, 12 Jun 2009 03:35:01 +0000 (23:35 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Fri, 12 Jun 2009 03:35:01 +0000 (23:35 -0400)
champlain/champlain-map-source-desc.h
champlain/champlain-map-source-factory.c
champlain/champlain-map-source-factory.h

index e0113a8f9d163049c4c64884916991b21485bb3c..32cf5f16b77eae8eace3e563f96eedeecee15003 100644 (file)
@@ -61,6 +61,7 @@ struct _ChamplainMapSourceDesc {
   gint max_zoom_level;
   ChamplainMapProjection projection;
   ChamplainMapSourceConstructor constructor;
+  gchar *uri_format;
   gpointer data;
 };
 
index 0245b52c18dce4ff95b0a18543febe369eb46ce5..a1d010d0febde322e5f981e49d5cca269027f6ce 100644 (file)
@@ -166,7 +166,8 @@ ChamplainMapSourceDesc OSM_MAPNIK_DESC =
     18,
     CHAMPLAIN_MAP_PROJECTION_MERCATOR,
     champlain_map_source_new_generic,
-    "http://tile.openstreetmap.org/#Z#/#X#/#Y#.png"
+    "http://tile.openstreetmap.org/#Z#/#X#/#Y#.png",
+    NULL
   };
 
 static
@@ -180,7 +181,8 @@ ChamplainMapSourceDesc OSM_OSMARENDER_DESC =
     18,
     CHAMPLAIN_MAP_PROJECTION_MERCATOR,
     champlain_map_source_new_generic,
-    "http://tah.openstreetmap.org/Tiles/tile/#Z#/#X#/#Y#.png"
+    "http://tah.openstreetmap.org/Tiles/tile/#Z#/#X#/#Y#.png",
+    NULL
   };
 
 static
@@ -194,7 +196,8 @@ ChamplainMapSourceDesc OSM_CYCLEMAP_DESC =
     18,
     CHAMPLAIN_MAP_PROJECTION_MERCATOR,
     champlain_map_source_new_generic,
-    "http://andy.sandbox.cloudmade.com/tiles/cycle/#Z#/#X#/#Y#.png"
+    "http://andy.sandbox.cloudmade.com/tiles/cycle/#Z#/#X#/#Y#.png",
+    NULL
   };
 
 static
@@ -208,7 +211,8 @@ ChamplainMapSourceDesc OAM_DESC =
     17,
     CHAMPLAIN_MAP_PROJECTION_MERCATOR,
     champlain_map_source_new_generic,
-    "http://tile.openaerialmap.org/tiles/1.0.0/openaerialmap-900913/#Z#/#X#/#Y#.jpg"
+    "http://tile.openaerialmap.org/tiles/1.0.0/openaerialmap-900913/#Z#/#X#/#Y#.jpg",
+    NULL
   };
 
 static
@@ -222,7 +226,8 @@ ChamplainMapSourceDesc MFF_RELIEF_DESC =
     11,
     CHAMPLAIN_MAP_PROJECTION_MERCATOR,
     champlain_map_source_new_generic,
-    "http://maps-for-free.com/layer/relief/z#Z#/row#Y#/#Z#_#X#-#Y#.jpg"
+    "http://maps-for-free.com/layer/relief/z#Z#/row#Y#/#Z#_#X#-#Y#.jpg",
+    NULL
   };
 
 static void
@@ -345,7 +350,7 @@ champlain_map_source_factory_register (ChamplainMapSourceFactory *factory,
 
 static ChamplainMapSource *
 champlain_map_source_new_generic (
-     ChamplainMapSourceDesc *desc, gpointer data)
+     ChamplainMapSourceDesc *desc, gpointer user_data)
 {
   return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full (
       desc->id,
@@ -356,5 +361,5 @@ champlain_map_source_new_generic (
       desc->max_zoom_level,
       256,
       desc->projection,
-      (const gchar *)desc->data));
+      desc->uri_format));
 }
index e0bfb932555c86a6144e3237e448dec1ff5c6a0c..8bd869ed4fca60d2b4d5e78082412f96f235afec 100644 (file)
@@ -67,7 +67,7 @@ ChamplainMapSource * champlain_map_source_factory_create (ChamplainMapSourceFact
 gboolean
 champlain_map_source_factory_register (ChamplainMapSourceFactory *factory,
     ChamplainMapSourceDesc *desc, ChamplainMapSourceConstructor constructor,
-    gpointer data);
+    gpointer user_data);
 
 #define CHAMPLAIN_MAP_SOURCE_OSM_MAPNIK "osm::mapnik"
 #define CHAMPLAIN_MAP_SOURCE_OSM_OSMARENDER "osm::osmarender"