From: Michael J. Rubinsky Date: Thu, 4 Mar 2010 23:59:56 +0000 (-0500) Subject: Only set zoom level when initially loading an event with a location set. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6a5b9132db7b994e1d1a93a4cffc43310b8d4a82;p=horde.git Only set zoom level when initially loading an event with a location set. Honor the current zoom level for all map operations, except when first opening an event with a location set. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 8ed11020b..4849779c8 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -3949,7 +3949,9 @@ KronolithCore = { if ($('kronolithEventLocationLat').value) { var ll = { lat:$('kronolithEventLocationLat').value, lon: $('kronolithEventLocationLon').value }; - this.placeMapMarker(ll, true); + + // @TODO: a default/configurable default zoom level? + this.placeMapMarker(ll, true, 8); } //@TODO: check for Location field - and if present, but no lat/lon value, attempt to // geocode it. @@ -4031,7 +4033,7 @@ KronolithCore = { * Place the event marker on the map, ensuring it exists. * See note in onGeocode about zoomlevel */ - placeMapMarker: function(ll, center) + placeMapMarker: function(ll, center, zoom) { if (!this.mapMarker) { this.mapMarker = this.map.addMarker( @@ -4047,8 +4049,7 @@ KronolithCore = { $('kronolithEventLocationLon').value = ll.lon; $('kronolithEventLocationLat').value = ll.lat; if (center) { - this.map.setCenter(ll, 8); - //this.map.zoomToFit(); + this.map.setCenter(ll, zoom); } },