aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-06-29 16:33:05 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-06-29 22:44:06 +0100
commit18466c1477b47c7d8abf186d78f4ba21df9c18ff (patch)
treeccad58f3ecda6bcf4cb4e9b86d337f86dc0b087c
parent00567425ca491a8fc69770246357a4569f450455 (diff)
On Your Reports page, zoom map out to cover markers shown.
-rw-r--r--templates/web/default/maps/openlayers.html3
-rw-r--r--web/js/map-OpenLayers.js3
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() );
+ }
});