#include "map.h"
#include "osm.h"
#include "osm-db.h"
+#include "poi.h"
#include "route.h"
#include "gps.h"
#include "bt.h"
}
void
-map_set_place_information(osm_place *s, osm_place *mp, osm_place *sp)
+map_set_place_information(osm_place *s, osm_place *mp, osm_place *sp, PoiInfo *p)
{
gchar buffer[256];
-snprintf(buffer, sizeof(buffer), "On %s%s%s%s%s",
+snprintf(buffer, sizeof(buffer), "On %s%s%s%s%s%s%s",
s->name ? s->name : "Unknown street",
+ (p && p->label) ? " near " : "",
+ (p && p->label) ? p->label : "",
sp->name ? " in " : "",
sp->name ? sp->name : "",
- mp->name ? " near " : "",
+ mp->name ? " in City " : "",
mp->name ? mp->name : "");
gtk_label_set_label(GTK_LABEL(_info_banner), buffer);
}
osm_place street;
osm_place mplace;
osm_place splace;
+PoiInfo *p;
ux = x2unit((gint) (x + 0.5));
uy = y2unit((gint) (y + 0.5));
osm_find_nearest_way(ilat, ilon, &street);
#endif
+p=poi_find_nearest(lat, lon);
+
if (osm_find_nearest_place(NODE_PLACE_SUBURB, ilat, ilon, &splace)==TRUE)
g_printf("Near suburb: %s (%d)\n", splace.name, splace.isin);
}
-map_set_place_information(&street, &mplace, &splace);
+map_set_place_information(&street, &mplace, &splace, p);
}
gboolean map_cb_scroll_event(GtkWidget * widget, GdkEventScroll * event)
"select p.lat, p.lon, p.label, c.label, c.icon, c.color"
" from poi p, category c "
" where c.enabled = 1 and p.cat_id = c.cat_id "
- " and p.lat between $LAT-0.15 and $LAT+0.15 "
- " and p.lon between $LON-0.15 and $LAT+0.15 "
+ " and p.lat between $LAT-0.11 and $LAT+0.11 "
+ " and p.lon between $LON-0.11 and $LAT+0.11 "
" order by (($LAT - p.lat) * ($LAT - p.lat) "
"+ ($LON - p.lon) * ($LON - p.lon)) limit 1",
-1, &_stmt_select_nearest_poi, NULL);