--- trunk/src/map-tool.c 2009/08/20 18:54:06 69 +++ trunk/src/map-tool.c 2009/08/23 19:38:15 73 @@ -23,6 +23,7 @@ #ifdef ENABLE_OSM_GPS_MAP #include "osm-gps-map.h" +#include "osm-gps-map-osd-classic.h" #endif #define MAP_SOURCE OSM_GPS_MAP_SOURCE_OPENSTREETMAP @@ -67,15 +68,17 @@ } static void -cb_map_gps(map_context_t *context) { - pos_t *refpos = get_pos(context->appdata); - if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) { - osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), - refpos->lat, refpos->lon, GPS_DEFAULT_ZOOM); - } else { - /* no coordinates given: display the entire world */ - osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), - 0.0, 0.0, 1); +cb_map_gps(osd_button_t but, map_context_t *context) { + if(but == OSD_GPS) { + pos_t *refpos = get_pos(context->appdata); + if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) { + osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), + refpos->lat, refpos->lon, GPS_DEFAULT_ZOOM); + } else { + /* no coordinates given: display the entire world */ + osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), + 0.0, 0.0, 1); + } } } @@ -92,7 +95,7 @@ /* ... and enable "goto" button if it's valid */ osm_gps_map_osd_enable_gps (OSM_GPS_MAP(context->widget), - OSM_GPS_MAP_OSD_GPS_CALLBACK(ok?cb_map_gps:NULL), context); + OSM_GPS_MAP_OSD_CALLBACK(ok?cb_map_gps:NULL), context); if(ok) { float heading = NAN; @@ -144,7 +147,7 @@ context->appdata->map.pos.lat, context->appdata->map.pos.lon, context->appdata->map.zoom); - + return FALSE; } @@ -464,6 +467,8 @@ g_free(path); + osm_gps_map_osd_classic_init(OSM_GPS_MAP(context->widget)); + char *name = NULL; #ifdef USE_MAEMO if(!appdata->cur_gpx) {