From 2087ef326b3d031a5b54f61a400919bda41f28bb Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 14 May 2012 17:20:29 +0100 Subject: Actually, just initially make sure zoom is at least 13. --- web/js/map-OpenLayers.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'web/js/map-OpenLayers.js') 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); } } -- cgit v1.2.3