diff options
-rw-r--r-- | templates/web/default/maps/openlayers.html | 3 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/templates/web/default/maps/openlayers.html b/templates/web/default/maps/openlayers.html index 7da732913..b7cf705b0 100644 --- a/templates/web/default/maps/openlayers.html +++ b/templates/web/default/maps/openlayers.html @@ -9,6 +9,9 @@ var fixmystreet = { 'latitude': [% map.latitude %], 'longitude': [% map.longitude %], +[% IF map.any_zoom -%] + 'zoomToBounds': 1, +[%- END %] [% IF map.zoom -%] 'zoom': [% map.zoom %], [%- END %] diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 83e535f1c..e4de17764 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -65,6 +65,9 @@ YAHOO.util.Event.onContentReady('map', function() { fixmystreet.markers.addMarker(marker); } fixmystreet.map.addLayer(fixmystreet.markers); + if ( fixmystreet.zoomToBounds ) { + fixmystreet.map.zoomToExtent( fixmystreet.markers.getDataExtent() ); + } }); |