#include "utils.h"
#include "map.h"
#include "osm.h"
+#include "db.h"
#include "osm-db.h"
#include "poi.h"
#include "route.h"
map_pixbuf_scale_inplace(pixbuf, zoff,
(tilex - ((tilex >> zoff) << zoff)) << (TILE_SIZE_P2 - zoff),
(tiley - ((tiley >> zoff) << zoff)) << (TILE_SIZE_P2 - zoff));
+#ifdef DEBUG
g_printf("I: %s (%d)\n", buffer, zoff);
+#endif
}
}
}
gboolean map_render_tile_idle(map_tile_rdata *mtr)
{
-g_printf("IDLE RENDER\n");
map_render_tile(mtr->tilex, mtr->tiley, mtr->destx, mtr->desty, FALSE);
-/*
-gtk_widget_queue_draw_area(_map_widget, mtr->destx, mtr->desty,
- TILE_SIZE_PIXELS, TILE_SIZE_PIXELS);
-*/
+gtk_widget_queue_draw_area(_map_widget, mtr->destx, mtr->desty, TILE_SIZE_PIXELS, TILE_SIZE_PIXELS);
g_slice_free(map_tile_rdata, mtr);
-
return FALSE;
}
gdouble lat,lon, dist;
PoiInfo *p;
gboolean fs;
+static gboolean inp=FALSE;
-unit2latlon(x, y, lat, lon);
+/* We run the gtk mainloop in progress callback so we can be called again, we don't like that */
+if (inp==TRUE)
+ return;
+inp=TRUE;
+unit2latlon(x, y, lat, lon);
ilat=lat2mp_int(lat);
ilon=lon2mp_int(lon);
+osm_progress_set_widget(_db, _progress_item);
+
/* Check if we are still near the same way as last time */
if (map_loc.street && osm_way_distance(ilat, ilon, map_loc.street->node_f, map_loc.street->node_t, &dist)==TRUE) {
if (dist>15000.0) {
}
map_set_place_information(map_loc.street, map_loc.primary, map_loc.secondary, p);
+osm_progress_set_widget(_db, NULL);
+inp=FALSE;
}
gboolean map_cb_scroll_event(GtkWidget * widget, GdkEventScroll * event)
poi_db_create(*db);
if (poi_db_prepare(*db)==FALSE)
g_printerr("Failed to prepare POI SQL statements");
- if (osm_db_prepare(*db)==FALSE)
+ if (osm_db_prepare(*db)==FALSE) {
g_printerr("Failed to prepare OSM SQL statements");
+ g_printf("SQLITE: %s\n", sqlite3_errmsg(*db));
+ }
return TRUE;
}
return FALSE;
gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), _toolbar_fullscreen_item, -1);
#endif
-item = gtk_separator_tool_item_new();
+item=gtk_separator_tool_item_new();
gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1);
-#ifndef WITH_HILDON
-/* Add a progress bar to our toolbar if we are using plain gtk */
-item = gtk_tool_item_new();
+item=gtk_tool_item_new();
_progress_item=gtk_progress_bar_new();
gtk_container_add(item, _progress_item);
gtk_toolbar_insert (GTK_TOOLBAR (_toolbar), item, -1);
-#else
-/* Hildon uses progress information box */
-#endif
}
void mapper_init_variables(void)
gtk_widget_show_all(vbox_main);
#endif
+ /* gtk_widget_hide(_progress_item); */
+
gtk_box_pack_start(GTK_BOX(mapvbox), info_banner.container, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(mapvbox), hbox, TRUE, TRUE, 0);