{
gint ilat, ilon;
gdouble lat,lon, dist;
-gboolean fs;
+gboolean fs, check_place=FALSE;
static gboolean inp=FALSE;
/* We run the gtk mainloop in progress callback so we can be called again, we don't like that */
if (dist>15000.0) {
osm_way_free(map_loc.street);
map_loc.street=osm_find_nearest_way(ilat, ilon);
+ check_place=FALSE;
+ } else {
+ check_place=FALSE;
}
} else {
osm_way_free(map_loc.street);
map_loc.street=osm_find_nearest_way(ilat, ilon);
+ check_place=TRUE;
}
_map_location_known=map_loc.street ? TRUE : FALSE;
_map_location_dist=map_loc.street ? map_loc.street->dist : 900000.0;
-fs=osm_find_nearest_place(NODE_PLACE_SUBURB, ilat, ilon, &map_loc.secondary);
+if (check_place==TRUE) {
+fs=osm_find_nearest_place(NODE_PLACE_SUBURB, ilat, ilon, &map_loc.secondary);
if (fs==TRUE && map_loc.secondary && map_loc.secondary->isin!=0) {
if (osm_place_get(map_loc.secondary->isin, ilat, ilon, &map_loc.primary)==FALSE) {
if (osm_find_nearest_place(NODE_PLACE_CITY, ilat, ilon, &map_loc.primary)==TRUE)
g_printf("Unknown\n");
}
+}
map_set_place_information(map_loc.street, map_loc.primary, map_loc.secondary);
osm_progress_set_widget(_db, NULL);