diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-12-03 11:13:19 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-12-03 11:13:19 +0000 |
commit | 429f5b61f56519914dd38c0e62d0709d4d380dee (patch) | |
tree | 0f7d4ae24050cff3b9b22b741366dd47b99a2e75 /web/js/map-OpenLayers.js | |
parent | 6ba4943e11f6c9a05c907a948d1f3a67f518031d (diff) | |
parent | 2cf8ba561104a67d5d6e8d2eca0d0a6fe91ccff5 (diff) |
Merge branch 'zurich-maps'
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r-- | web/js/map-OpenLayers.js | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 0a5f339f5..85ab09889 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -137,7 +137,7 @@ function fixmystreet_onload() { styleMap: pin_layer_style_map }; if (fixmystreet.page == 'around') { - fixmystreet.bbox_strategy = new OpenLayers.Strategy.BBOX({ ratio: 1 }); + fixmystreet.bbox_strategy = fixmystreet.bbox_strategy || new OpenLayers.Strategy.BBOX({ ratio: 1 }); pin_layer_options.strategies = [ fixmystreet.bbox_strategy ]; pin_layer_options.protocol = new OpenLayers.Protocol.HTTP({ url: '/ajax', @@ -250,23 +250,35 @@ function fixmystreet_onload() { $(function(){ - set_map_config(); + // Set specific map config - some other JS included in the + // template should define this + set_map_config(); - fixmystreet.map = new OpenLayers.Map("map", { - controls: fixmystreet.controls, - displayProjection: new OpenLayers.Projection("EPSG:4326") - }); + // Create the basics of the map + fixmystreet.map = new OpenLayers.Map( + "map", OpenLayers.Util.extend({ + controls: fixmystreet.controls, + displayProjection: new OpenLayers.Projection("EPSG:4326") + }, fixmystreet.map_options) + ); if ($('html').hasClass('mobile') && fixmystreet.page == 'around') { $('#fms_pan_zoom').css({ top: '2.75em !important' }); } + // Set it up our way fixmystreet.layer_options = OpenLayers.Util.extend({ zoomOffset: fixmystreet.zoomOffset, transitionEffect: 'resize', numZoomLevels: fixmystreet.numZoomLevels }, fixmystreet.layer_options); - var layer = new fixmystreet.map_type("", fixmystreet.layer_options); + + var layer; + if (fixmystreet.layer_options.matrixIds) { + layer = new fixmystreet.map_type(fixmystreet.layer_options); + } else { + layer = new fixmystreet.map_type("", fixmystreet.layer_options); + } fixmystreet.map.addLayer(layer); if (!fixmystreet.map.getCenter()) { |