]> git.street.me.uk Git - andy/viking.git/commitdiff
Adding Maplint OpenStreetMap layer
authorGuilhem Bonnefille <guilhem.bonnefille@gmail.com>
Sat, 28 Apr 2007 14:57:43 +0000 (14:57 +0000)
committerGuilhem Bonnefille <guilhem.bonnefille@gmail.com>
Sat, 28 Apr 2007 14:57:43 +0000 (14:57 +0000)
ChangeLog
src/osm.c
src/osm.h

index d30cc69c5cb73d18f554f17e24cd09395e80dcd3..a5e84f4d200df8802aefe539740f14a1a448b96d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-04-28
+Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
+       * OpenSourceMap slippy maps (in osm.c) -- Maplink tiles
+
 2007-04-23
 Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
        * OpenSourceMap slippy maps (in osm.c) -- Osmarender and Mapnik
index 0c5eed74216cca40f3e1bd3c08f56d033b63da4b..da5358ec52c85c781b0e7f0ec17f09866a723617 100644 (file)
--- a/src/osm.c
+++ b/src/osm.c
 /* initialisation */
 void osm_init () {
   VikMapsLayer_MapType osmarender_type = { 12, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, osm_coord_to_mapcoord, osm_mapcoord_to_center_coord, osm_osmarender_download };
-  VikMapsLayer_MapType mapnik_type = { 13, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, osm_coord_to_mapcoord, osm_mapcoord_to_center_coord, osm_mapnik_download };
+  VikMapsLayer_MapType mapnik_type = { 13, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, osm_coord_to_mapcoord, osm_mapcoord_to_center_coord, osm_mapnik_download };  VikMapsLayer_MapType maplint_type = { 14, 256, 256, VIK_VIEWPORT_DRAWMODE_MERCATOR, osm_coord_to_mapcoord, osm_mapcoord_to_center_coord, osm_maplint_download };
+
   maps_layer_register_type("OpenStreetMap (Osmarender)", 12, &osmarender_type);
   maps_layer_register_type("OpenStreetMap (Mapnik)", 13, &mapnik_type);
+  maps_layer_register_type("OpenStreetMap (Maplint)", 14, &maplint_type);
 }
 
 /* 1 << (x) is like a 2**(x) */
@@ -81,6 +83,16 @@ void osm_mapcoord_to_center_coord ( MapCoord *src, VikCoord *dest )
   dest->north_south = DEMERCLAT(180 - ((src->y+0.5) / GZ(17) * socalled_mpp * 360));
 }
 
+/* Maplint tiles
+ * Ex: http://dev.openstreetmap.org/~ojw/Tiles/maplint.php/10/517/375.png
+ */
+void osm_maplint_download ( MapCoord *src, const gchar *dest_fn )
+{
+   gchar *uri = g_strdup_printf ( "/~ojw/Tiles/maplint.php/%d/%d/%d.png", 17-src->scale, src->x, src->y );
+   a_http_download_get_url ( "dev.openstreetmap.org", uri, dest_fn );
+   g_free ( uri );
+}
+
 void osm_mapnik_download ( MapCoord *src, const gchar *dest_fn )
 {
    gchar *uri = g_strdup_printf ( "/osamrender/%d/%d/%d.png", 17-src->scale, src->x, src->y );
index 8e16bb473c0953261bde61f328c88c0355805812..fe259d190a141155d198a3e8246fde5ffbaf972e 100644 (file)
--- a/src/osm.h
+++ b/src/osm.h
@@ -33,6 +33,7 @@ guint8 osm_zoom ( gdouble mpp );
 
 gboolean osm_coord_to_mapcoord ( const VikCoord *src, gdouble xzoom, gdouble yzoom, MapCoord *dest );
 void osm_mapcoord_to_center_coord ( MapCoord *src, VikCoord *dest );
+void osm_maplint_download ( MapCoord *src, const gchar *dest_fn );
 void osm_mapnik_download ( MapCoord *src, const gchar *dest_fn );
 void osm_osmarender_download ( MapCoord *src, const gchar *dest_fn );