From: Emmanuel Rodriguez Date: Fri, 12 Jun 2009 03:35:01 +0000 (-0400) Subject: Add parameters to map sources constructors X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bee0880850542260b409f320de98e26e83e21d0d;p=libchamplain Add parameters to map sources constructors --- diff --git a/champlain/champlain-map-source-desc.h b/champlain/champlain-map-source-desc.h index e0113a8..32cf5f1 100644 --- a/champlain/champlain-map-source-desc.h +++ b/champlain/champlain-map-source-desc.h @@ -61,6 +61,7 @@ struct _ChamplainMapSourceDesc { gint max_zoom_level; ChamplainMapProjection projection; ChamplainMapSourceConstructor constructor; + gchar *uri_format; gpointer data; }; diff --git a/champlain/champlain-map-source-factory.c b/champlain/champlain-map-source-factory.c index 0245b52..a1d010d 100644 --- a/champlain/champlain-map-source-factory.c +++ b/champlain/champlain-map-source-factory.c @@ -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)); } diff --git a/champlain/champlain-map-source-factory.h b/champlain/champlain-map-source-factory.h index e0bfb93..8bd869e 100644 --- a/champlain/champlain-map-source-factory.h +++ b/champlain/champlain-map-source-factory.h @@ -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"