Geography : bug #6718 : The active place must have valid coordinates to set center and zoom.

svn: r22282
This commit is contained in:
Serge Noiraud 2013-05-13 20:10:04 +00:00
parent 6d8d8a3b6b
commit 04e3543274

View File

@ -264,9 +264,10 @@ class GeoPlaces(GeoGraphyView):
self._create_one_place(place) self._create_one_place(place)
if place_x: if place_x:
place = dbstate.db.get_place_from_handle(place_x) place = dbstate.db.get_place_from_handle(place_x)
self.osm.set_center_and_zoom(float(place.get_latitude()), if ( place.get_latitude() != "" and place.get_longitude() != "" ):
float(place.get_longitude()), self.osm.set_center_and_zoom(float(place.get_latitude()),
int(config.get("geography.zoom"))) float(place.get_longitude()),
int(config.get("geography.zoom")))
_LOG.debug(" stop createmap.") _LOG.debug(" stop createmap.")
_LOG.debug("%s" % time.strftime("begin sort : " _LOG.debug("%s" % time.strftime("begin sort : "
"%a %d %b %Y %H:%M:%S", time.gmtime())) "%a %d %b %Y %H:%M:%S", time.gmtime()))