aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-05-14 17:20:29 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-05-14 17:20:29 +0100
commit2087ef326b3d031a5b54f61a400919bda41f28bb (patch)
treef58efdc9cf6c61a726f2aa7e8f84dec1cf95e516 /web/js/map-OpenLayers.js
parent88efd2d6415d9d95c0f428ee29da1a637e92bbd1 (diff)
Actually, just initially make sure zoom is at least 13.
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 7ffdc7f34..054a67767 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -84,9 +84,10 @@ function fixmystreet_onload() {
if (bounds) {
var center = bounds.getCenterLonLat();
var z = fixmystreet.map.getZoomForExtent(bounds);
- if ( z >= 13 || !$('html').hasClass('mobile') ) {
- fixmystreet.map.setCenter(center, z, false, true);
+ if ( z < 13 && $('html').hasClass('mobile') ) {
+ z = 13;
}
+ fixmystreet.map.setCenter(center, z, false, true);
}
});
}
@@ -182,10 +183,12 @@ function fixmystreet_onload() {
if ( fixmystreet.zoomToBounds ) {
var bounds = fixmystreet.markers.getDataExtent();
if (bounds) {
+ var center = bounds.getCenterLonLat();
var z = fixmystreet.map.getZoomForExtent(bounds);
- if ( z >= 13 || !$('html').hasClass('mobile') ) {
- fixmystreet.map.zoomToExtent( bounds );
+ if ( z < 13 && $('html').hasClass('mobile') ) {
+ z = 13;
}
+ fixmystreet.map.setCenter(center, z);
}
}