static gboolean
map_cb_button_press(GtkWidget * widget, GdkEventButton * event)
{
-gdouble lat, lon;
-guint poi_id;
-gint ux, uy;
-
_cmenu_position_x = event->x + 0.5;
_cmenu_position_y = event->y + 0.5;
return FALSE;
}
- ux=x2unit(_cmenu_position_x);
- uy=y2unit(_cmenu_position_y);
-
- unit2latlon(ux, uy, lat, lon);
- if (map_poi_find_at_latlon(lat, lon, &poi_id)==TRUE) {
- g_printf("POI: %d\n", poi_id);
- g_idle_add_full(G_PRIORITY_HIGH_IDLE,(GSourceFunc)map_cb_show_poi_info_dialog, GINT_TO_POINTER(poi_id), NULL);
- } else {
- map_drag_start(event->x, event->y);
- }
+ map_drag_start(event->x, event->y);
return FALSE;
break;
case 2:
static gboolean
map_cb_button_release(GtkWidget *widget, GdkEventButton *event)
{
+gdouble lat, lon;
+guint poi_id;
+gint ux, uy;
+
g_printf("BtnRelease\n");
switch (event->button) {
case 1:
case MAP_MODE_SET_ROUTE_TO:
break;
default:
- map_drag_stop(event->x, event->y);
+ ux=x2unit(_cmenu_position_x);
+ uy=y2unit(_cmenu_position_y);
+
+ unit2latlon(ux, uy, lat, lon);
+ if (map_poi_find_at_latlon(lat, lon, &poi_id)==TRUE) {
+ g_printf("POI: %d\n", poi_id);
+ g_idle_add_full(G_PRIORITY_HIGH_IDLE,(GSourceFunc)map_cb_show_poi_info_dialog, GINT_TO_POINTER(poi_id), NULL);
+ }
if (map_data_needs_refresh==TRUE) {
map_data_needs_refresh=FALSE;
map_render_data();
g_idle_add_full(G_PRIORITY_HIGH_IDLE,(GSourceFunc)map_update_location_from_center, NULL, NULL);
}
+ map_drag_stop(event->x, event->y);
break;
}
break;