#include <glib/gi18n.h>
#include "osm.h"
+#include "map_ids.h"
#include "vikmapslayer.h"
#include "vikslippymapsource.h"
#include "vikwmscmapsource.h"
void osm_init () {
VikMapSource *mapnik_type =
VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
- "id", 13,
+ "id", MAP_ID_OSM_MAPNIK,
"label", "OpenStreetMap (Mapnik)",
"name", "OSM-Mapnik",
"hostname", "tile.openstreetmap.org",
NULL));
VikMapSource *cycle_type =
VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
- "id", 17,
+ "id", MAP_ID_OSM_CYCLE,
"label", "OpenStreetMap (Cycle)",
"name", "OSM-Cycle",
"hostname", "tile.opencyclemap.org",
NULL));
VikMapSource *transport_type =
VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
- "id", 20,
+ "id", MAP_ID_OSM_TRANSPORT,
"label", "OpenStreetMap (Transport)",
"name", "OSM-Transport",
"hostname", "tile2.opencyclemap.org",
NULL));
VikMapSource *mapquest_type =
VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
- "id", 19,
+ "id", MAP_ID_MAPQUEST_OSM,
"name", "OSM-MapQuest",
"label", "OpenStreetMap (MapQuest)",
"hostname", "otile1.mqcdn.com",
NULL));
VikMapSource *hot_type =
VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
- "id", 22,
+ "id", MAP_ID_OSM_HUMANITARIAN,
"name", "OSM-Humanitarian",
"label", "OpenStreetMap (Humanitarian)",
"hostname", "c.tile.openstreetmap.fr",
// NB no cache needed for this type!!
VikMapSource *direct_type =
VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
- "id", 21,
+ "id", MAP_ID_OSM_ON_DISK,
"label", _("On Disk OSM Tile Format"),
// For using your own generated data assumed you know the license already!
"copyright", "© OpenStreetMap contributors", // probably
// NB no cache needed for this type!!
VikMapSource *mbtiles_type =
VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
- "id", 23,
+ "id", MAP_ID_MBTILES,
"label", _("MBTiles File"),
// For using your own generated data assumed you know the license already!
"copyright", "© OpenStreetMap contributors", // probably
// NB no cache needed for this type!!
VikMapSource *metatiles_type =
VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
- "id", 24,
+ "id", MAP_ID_OSM_METATILES,
"label", _("OSM Metatiles"),
// For using your own generated data assumed you know the license already!
"copyright", "© OpenStreetMap contributors", // probably
// Webtools
VikWebtoolCenter *webtool = NULL;
- webtool = vik_webtool_center_new_with_members ( _("OSM (view)"), "http://openstreetmap.org/?lat=%s&lon=%s&zoom=%d" );
+ webtool = vik_webtool_center_new_with_members ( _("OSM (view)"), "http://www.openstreetmap.org/?lat=%s&lon=%s&zoom=%d" );
vik_ext_tools_register ( VIK_EXT_TOOL ( webtool ) );
g_object_unref ( webtool );
vik_ext_tools_register ( VIK_EXT_TOOL ( webtool ) );
g_object_unref ( webtool );
+ // Note the use of positional parameters
+ webtool = vik_webtool_center_new_with_members ( _("OSM (query)"), "http://www.openstreetmap.org/query?lat=%1$s&lon=%2$s#map=%3$d/%1$s/%2$s" );
+ vik_ext_tools_register ( VIK_EXT_TOOL ( webtool ) );
+ g_object_unref ( webtool );
+
webtool = vik_webtool_center_new_with_members ( _("OSM (render)"), "http://www.informationfreeway.org/?lat=%s&lon=%s&zoom=%d&layers=B0000F000F" );
vik_ext_tools_register ( VIK_EXT_TOOL ( webtool ) );
g_object_unref ( webtool );
// Datasource
VikWebtoolDatasource *vwtds = NULL;
- vwtds = vik_webtool_datasource_new_with_members ( _("OpenStreetMap Notes"), "http://api.openstreetmap.org/api/0.6/notes.gpx?bbox=%s,%s,%s,%s&closed=0", "LBRT", NULL, NULL );
+ vwtds = vik_webtool_datasource_new_with_members ( _("OpenStreetMap Notes"), "http://api.openstreetmap.org/api/0.6/notes.gpx?bbox=%s,%s,%s,%s&closed=0", "LBRT", NULL, NULL, NULL );
vik_ext_tool_datasources_register ( VIK_EXT_TOOL ( vwtds ) );
g_object_unref ( vwtds );
g_object_unref ( namefinder );
// Not really OSM but can't be bothered to create somewhere else to put it...
- webtool = vik_webtool_center_new_with_members ( _("Wikimedia Toolserver GeoHack"), "http://toolserver.org/~geohack/geohack.php?params=%s;%s" );
+ webtool = vik_webtool_center_new_with_members ( _("Wikimedia Toolserver GeoHack"), "http://tools.wmflabs.org/geohack/geohack.php?params=%s;%s" );
vik_ext_tools_register ( VIK_EXT_TOOL ( webtool ) );
g_object_unref ( webtool );