diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-03-02 13:30:41 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-03-02 13:30:41 +0000 |
commit | 4eab56c784bb53d2e174e7b7101da7eba49a1a02 (patch) | |
tree | 0c21b2562dc8d8ba8670f7e4d8ccb153f72c3418 | |
parent | 7dd734be0ee3efb57199879e6b86fe1605fe23ee (diff) |
Enable scroll wheel if mobile full screen map view.
-rw-r--r-- | web/js/map-OpenLayers.js | 3 | ||||
-rw-r--r-- | web/js/map-bing-ol.js | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index a95325d34..7789159c1 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -395,6 +395,9 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { }, trigger: function(e) { + if (typeof fixmystreet.nav_control != 'undefined') { + fixmystreet.nav_control.disableZoomWheel(); + } var lonlat = fixmystreet.map.getLonLatFromViewPortPx(e.xy); if (fixmystreet.page == 'new') { /* Already have a pin */ diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 8f0ba4da0..89b274b18 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -3,10 +3,17 @@ function set_map_config(perm) { if ($('#map_permalink').length) { permalink_id = 'map_permalink'; } + + var nav_opts = { zoomWheelEnabled: false }; + if (fixmystreet.page == 'around' && $('html').hasClass('mobile')) { + nav_opts = {}; + } + fixmystreet.nav_control = new OpenLayers.Control.Navigation(nav_opts); + fixmystreet.controls = [ new OpenLayers.Control.Attribution(), new OpenLayers.Control.ArgParser(), - new OpenLayers.Control.Navigation({ zoomWheelEnabled: false }), + fixmystreet.nav_control, new OpenLayers.Control.Permalink(permalink_id), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; |