aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-05-18 12:38:33 +0100
committerStruan Donald <struan@exo.org.uk>2012-05-18 12:38:33 +0100
commitaa59f68fcb9b26673662033c4c2d72835420ab4a (patch)
treeef8e3686bba54440d30789a473c7807a1cb02806
parent69284dad6f9b645eff9abe84b09463c0bf32fc24 (diff)
do not zoom out too far onby default on around page on mobile as it gets very cluttered
-rw-r--r--web/js/map-OpenLayers.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 4e728e5f8..35020e1f7 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -82,7 +82,11 @@ 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') ) {
+ z = 13;
+ }
+ fixmystreet.map.setCenter(center, z, false, true);
}
});
}
@@ -177,7 +181,14 @@ function fixmystreet_onload() {
if ( fixmystreet.zoomToBounds ) {
var bounds = fixmystreet.markers.getDataExtent();
- if (bounds) { fixmystreet.map.zoomToExtent( bounds ); }
+ if (bounds) {
+ var center = bounds.getCenterLonLat();
+ var z = fixmystreet.map.getZoomForExtent(bounds);
+ if ( z < 13 && $('html').hasClass('mobile') ) {
+ z = 13;
+ }
+ fixmystreet.map.setCenter(center, z);
+ }
}
$('#hide_pins_link').click(function(e) {