diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-12-01 15:05:34 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-08 14:44:31 +0100 |
commit | 5d31be89ccabddb1dec66e505b91cc26a72ba2fb (patch) | |
tree | a7df5c4f9abca3a000b8d30cc48c542c50a3e337 /www/js | |
parent | 64cc9c6c2c1b5ada438fd6e874e812739c259b1a (diff) |
Allow map buffer ratio to be customised.
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/config.js-example | 6 | ||||
-rw-r--r-- | www/js/map-OpenLayers.js | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/www/js/config.js-example b/www/js/config.js-example index 6260aef..a221cb0 100644 --- a/www/js/config.js-example +++ b/www/js/config.js-example @@ -52,7 +52,11 @@ var CONFIG = { // If this is true then the user must login as the first step after // installing the app, and before making any reports. - LOGIN_REQUIRED: false + LOGIN_REQUIRED: false, + + // The ratio of the data bounds to the viewport bounds (in each dimension). + // See http://dev.openlayers.org/releases/OpenLayers-2.13.1/doc/apidocs/files/OpenLayers/Strategy/BBOX-js.html + MAP_LOADING_RATIO: 2 }; diff --git a/www/js/map-OpenLayers.js b/www/js/map-OpenLayers.js index d458641..a3fdc9d 100644 --- a/www/js/map-OpenLayers.js +++ b/www/js/map-OpenLayers.js @@ -128,7 +128,7 @@ function fixmystreet_onload() { fixmystreet.map.addLayer(fixmystreet.report_location); if (fixmystreet.page == 'around') { - fixmystreet.bbox_strategy = new OpenLayers.Strategy.BBOX({ ratio: 1 }); + fixmystreet.bbox_strategy = new OpenLayers.Strategy.BBOX({ ratio: CONFIG.MAP_LOADING_RATIO }); pin_layer_options.strategies = [ fixmystreet.bbox_strategy ]; pin_layer_options.protocol = new OpenLayers.Protocol.HTTP({ url: CONFIG.FMS_URL + '/ajax', |