66 |
return NULL; |
return NULL; |
67 |
} |
} |
68 |
|
|
69 |
/* TODO: This needs to be wired to the GPS button in osm_gps_map */ |
static void |
70 |
#if 0 |
cb_map_gps(map_context_t *context) { |
|
static gboolean |
|
|
cb_map_gps(GtkButton *button, map_context_t *context) { |
|
71 |
pos_t *refpos = get_pos(context->appdata); |
pos_t *refpos = get_pos(context->appdata); |
72 |
if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) { |
if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) { |
73 |
osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), |
osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), |
77 |
osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), |
osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget), |
78 |
0.0, 0.0, 1); |
0.0, 0.0, 1); |
79 |
} |
} |
|
|
|
|
return FALSE; |
|
80 |
} |
} |
|
#endif |
|
81 |
|
|
82 |
static int dist2pixel(map_context_t *context, float km, float lat) { |
static int dist2pixel(map_context_t *context, float km, float lat) { |
83 |
return 1000.0*km/osm_gps_map_get_scale(OSM_GPS_MAP(context->widget)); |
return 1000.0*km/osm_gps_map_get_scale(OSM_GPS_MAP(context->widget)); |
91 |
gboolean ok = (refpos!= NULL) && !isnan(refpos->lat) && !isnan(refpos->lon); |
gboolean ok = (refpos!= NULL) && !isnan(refpos->lat) && !isnan(refpos->lon); |
92 |
|
|
93 |
/* ... and enable "goto" button if it's valid */ |
/* ... and enable "goto" button if it's valid */ |
94 |
/* TODO: gtk_widget_set_sensitive(context->gps, ok); */ |
osm_gps_map_osd_enable_gps (OSM_GPS_MAP(context->widget), |
95 |
|
OSM_GPS_MAP_OSD_GPS_CALLBACK(ok?cb_map_gps:NULL), context); |
96 |
|
|
97 |
if(ok) { |
if(ok) { |
98 |
float heading = NAN; |
float heading = NAN; |
321 |
#ifndef BIG_BALLOONS |
#ifndef BIG_BALLOONS |
322 |
cairo_set_font_size (cr, 14.0); |
cairo_set_font_size (cr, 14.0); |
323 |
#else |
#else |
324 |
cairo_set_font_size (cr, 24.0); |
cairo_set_font_size (cr, 22.0); |
325 |
#endif |
#endif |
326 |
|
|
327 |
if(cache->name) { |
if(cache->name) { |
512 |
g_signal_connect(G_OBJECT(context->widget), "button-release-event", |
g_signal_connect(G_OBJECT(context->widget), "button-release-event", |
513 |
G_CALLBACK(on_map_button_release_event), context); |
G_CALLBACK(on_map_button_release_event), context); |
514 |
|
|
|
/* TODO: gtk_widget_set_sensitive(context->gps, FALSE); */ |
|
|
|
|
515 |
/* install handler for timed updates of the gps button */ |
/* install handler for timed updates of the gps button */ |
516 |
context->handler_id = gtk_timeout_add(1000, map_gps_update, context); |
context->handler_id = gtk_timeout_add(1000, map_gps_update, context); |
517 |
|
|