aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-wms-base.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2019-12-09 17:13:10 +0000
committerStruan Donald <struan@exo.org.uk>2020-02-17 14:10:08 +0000
commit1b8f50e5a3ea0a08c88cc5676467743ab03741b2 (patch)
treece76350e8510c13dbe68e0809158fd072ab9d423 /web/js/map-wms-base.js
parent998886ee5d70151871f57147914529a5f463f37c (diff)
base files for displaying WMS maps
Basic config and setup files for using WMS based map tiles. These still require config in appropriate cobrand perl and javascript files
Diffstat (limited to 'web/js/map-wms-base.js')
-rw-r--r--web/js/map-wms-base.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/web/js/map-wms-base.js b/web/js/map-wms-base.js
new file mode 100644
index 000000000..54b88bfe3
--- /dev/null
+++ b/web/js/map-wms-base.js
@@ -0,0 +1,20 @@
+// Functionality required by all OpenLayers WMS base maps
+
+fixmystreet.maps.setup_wms_base_map = function() {
+ fixmystreet.map_type = OpenLayers.Layer.WMS;
+
+ fixmystreet.map_options = {
+ maxExtent: this.layer_bounds,
+ units: 'm'
+ };
+
+ fixmystreet.layer_options = [];
+ $.each(fixmystreet.wms_config.layer_names, function(i, v) {
+ fixmystreet.layer_options.push(OpenLayers.Util.extend({
+ projection: new OpenLayers.Projection(fixmystreet.wms_config.map_projection),
+ name: v,
+ layer: v,
+ url: fixmystreet.wms_config.tile_urls[i]
+ }, fixmystreet.wms_config));
+ });
+};