561 |
context->area->appdata->settings && |
context->area->appdata->settings && |
562 |
context->area->appdata->settings->enable_gps; |
context->area->appdata->settings->enable_gps; |
563 |
|
|
564 |
|
pos_t pos = { NAN, NAN }; |
565 |
gboolean gps_fix = gps_on && |
gboolean gps_fix = gps_on && |
566 |
gps_get_pos(context->area->appdata, NULL, NULL); |
gps_get_pos(context->area->appdata, &pos, NULL); |
567 |
|
|
568 |
/* ... and enable "goto" button if it's valid */ |
/* ... and enable "goto" button if it's valid */ |
569 |
osm_gps_map_osd_enable_gps(OSM_GPS_MAP(context->map.widget), |
osm_gps_map_osd_enable_gps(OSM_GPS_MAP(context->map.widget), |
570 |
OSM_GPS_MAP_OSD_CALLBACK(gps_fix?cb_map_gps:NULL), context); |
OSM_GPS_MAP_OSD_CALLBACK(gps_fix?cb_map_gps:NULL), context); |
571 |
|
|
572 |
|
if(gps_fix) { |
573 |
|
g_object_set(context->map.widget, "gps-track-highlight-radius", 0, NULL); |
574 |
|
osm_gps_map_draw_gps(OSM_GPS_MAP(context->map.widget), |
575 |
|
pos.lat, pos.lon, NAN); |
576 |
|
} else |
577 |
|
osm_gps_map_clear_gps(OSM_GPS_MAP(context->map.widget)); |
578 |
|
|
579 |
return TRUE; |
return TRUE; |
580 |
} |
} |
581 |
|
|