Geography : first try to solve bug 5053.

svn: r18025
This commit is contained in:
Serge Noiraud 2011-08-11 07:51:17 +00:00
parent 85fd6b0886
commit fb0095ca72

View File

@ -223,6 +223,7 @@ class osmGpsMap():
self.osm.layer_remove(layer) self.osm.layer_remove(layer)
def zoom_changed(self, zoom): def zoom_changed(self, zoom):
_LOG.debug("zoom_changed : %d" % self.osm.props.zoom)
config.set("geography.zoom",self.osm.props.zoom) config.set("geography.zoom",self.osm.props.zoom)
self.save_center(self.osm.props.latitude, self.osm.props.longitude) self.save_center(self.osm.props.latitude, self.osm.props.longitude)
@ -257,8 +258,17 @@ class osmGpsMap():
""" """
Save the longitude and lontitude in case we switch between maps. Save the longitude and lontitude in case we switch between maps.
""" """
_LOG.debug("save_center : %s,%s" % (lat, lon) )
if ( -90.0 < lat < +90.0 ) and ( -180.0 < lon < +180.0 ):
config.set("geography.center-lat",lat) config.set("geography.center-lat",lat)
config.set("geography.center-lon",lon) config.set("geography.center-lon",lon)
else:
_LOG.debug("save_center : new coordinates : %s,%s" % (lat, lon) )
_LOG.debug("save_center : old coordinates : %s,%s" % (lat, lon) )
# osmgpsmap bug ? reset to prior values to avoid osmgpsmap problems.
self.osm.set_center_and_zoom(config.get("geography.center-lat"),
config.get("geography.center-lon"),
config.get("geography.zoom") )
def activate_selection_zoom(self, osm, event): def activate_selection_zoom(self, osm, event):
if self.end_selection is not None: if self.end_selection is not None: