23 |
|
|
24 |
#ifdef ENABLE_OSM_GPS_MAP |
#ifdef ENABLE_OSM_GPS_MAP |
25 |
#include "osm-gps-map.h" |
#include "osm-gps-map.h" |
26 |
|
#include "osm-gps-map-osd-classic.h" |
27 |
#endif |
#endif |
28 |
|
|
29 |
#define MAP_SOURCE OSM_GPS_MAP_SOURCE_OPENSTREETMAP |
#define MAP_SOURCE OSM_GPS_MAP_SOURCE_OPENSTREETMAP |
68 |
} |
} |
69 |
|
|
70 |
static void |
static void |
71 |
cb_map_gps(map_context_t *context) { |
cb_map_gps(osd_button_t but, map_context_t *context) { |
72 |
pos_t *refpos = get_pos(context->appdata); |
if(but == OSD_GPS) { |
73 |
if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) { |
pos_t *refpos = get_pos(context->appdata); |
74 |
osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), |
if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) { |
75 |
refpos->lat, refpos->lon, GPS_DEFAULT_ZOOM); |
osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), |
76 |
} else { |
refpos->lat, refpos->lon, GPS_DEFAULT_ZOOM); |
77 |
/* no coordinates given: display the entire world */ |
} else { |
78 |
osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), |
/* no coordinates given: display the entire world */ |
79 |
0.0, 0.0, 1); |
osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), |
80 |
|
0.0, 0.0, 1); |
81 |
|
} |
82 |
} |
} |
83 |
} |
} |
84 |
|
|
95 |
|
|
96 |
/* ... and enable "goto" button if it's valid */ |
/* ... and enable "goto" button if it's valid */ |
97 |
osm_gps_map_osd_enable_gps (OSM_GPS_MAP(context->widget), |
osm_gps_map_osd_enable_gps (OSM_GPS_MAP(context->widget), |
98 |
OSM_GPS_MAP_OSD_GPS_CALLBACK(ok?cb_map_gps:NULL), context); |
OSM_GPS_MAP_OSD_CALLBACK(ok?cb_map_gps:NULL), context); |
99 |
|
|
100 |
if(ok) { |
if(ok) { |
101 |
float heading = NAN; |
float heading = NAN; |
147 |
context->appdata->map.pos.lat, |
context->appdata->map.pos.lat, |
148 |
context->appdata->map.pos.lon, |
context->appdata->map.pos.lon, |
149 |
context->appdata->map.zoom); |
context->appdata->map.zoom); |
150 |
|
|
151 |
return FALSE; |
return FALSE; |
152 |
} |
} |
153 |
|
|
467 |
|
|
468 |
g_free(path); |
g_free(path); |
469 |
|
|
470 |
|
osm_gps_map_osd_classic_init(OSM_GPS_MAP(context->widget)); |
471 |
|
|
472 |
char *name = NULL; |
char *name = NULL; |
473 |
#ifdef USE_MAEMO |
#ifdef USE_MAEMO |
474 |
if(!appdata->cur_gpx) { |
if(!appdata->cur_gpx) { |