aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-05-14 17:08:35 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-05-14 17:08:35 +0100
commit88efd2d6415d9d95c0f428ee29da1a637e92bbd1 (patch)
tree6fc9e67cd9ead0a4c23bbdeccb64fce7e560201d /web/js/map-OpenLayers.js
parentcdab6130e12d5932de5a80987eb0eebca43d8f31 (diff)
Have a minimum zoom on mobile version.
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index f11ae3ed9..7ffdc7f34 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -83,7 +83,10 @@ function fixmystreet_onload() {
var bounds = area.getDataExtent();
if (bounds) {
var center = bounds.getCenterLonLat();
- fixmystreet.map.setCenter(center, fixmystreet.map.getZoomForExtent(bounds), false, true);
+ var z = fixmystreet.map.getZoomForExtent(bounds);
+ if ( z >= 13 || !$('html').hasClass('mobile') ) {
+ fixmystreet.map.setCenter(center, z, false, true);
+ }
}
});
}
@@ -178,7 +181,12 @@ function fixmystreet_onload() {
if ( fixmystreet.zoomToBounds ) {
var bounds = fixmystreet.markers.getDataExtent();
- if (bounds) { fixmystreet.map.zoomToExtent( bounds ); }
+ if (bounds) {
+ var z = fixmystreet.map.getZoomForExtent(bounds);
+ if ( z >= 13 || !$('html').hasClass('mobile') ) {
+ fixmystreet.map.zoomToExtent( bounds );
+ }
+ }
}
$('#hide_pins_link').click(function(e) {