aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2019-05-21 14:46:15 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-05-28 14:41:06 +0100
commit418ed096e7c79c8ccde9a2eb5023a7a4f0210402 (patch)
tree7f3412df851704d5877a7d308a8499840a5f7997
parentd6f264c35a4aef78e1c9df75a63aee0eecbd9a7b (diff)
[UK Councils] Use shared template files for WMTS base maps
-rw-r--r--perllib/FixMyStreet/Map/Bristol.pm2
-rw-r--r--perllib/FixMyStreet/Map/Buckinghamshire.pm2
-rw-r--r--perllib/FixMyStreet/Map/UKCouncilWMTS.pm2
-rw-r--r--templates/web/base/maps/noscript_map_wmts.html (renamed from templates/web/bristol/maps/noscript_map.html)0
-rw-r--r--templates/web/base/maps/openlayers.html3
-rw-r--r--templates/web/base/maps/wmts.html4
-rw-r--r--templates/web/bristol/maps/bristol.html4
-rw-r--r--templates/web/buckinghamshire/maps/buckinghamshire.html4
8 files changed, 8 insertions, 13 deletions
diff --git a/perllib/FixMyStreet/Map/Bristol.pm b/perllib/FixMyStreet/Map/Bristol.pm
index e32026ee4..32f5724f5 100644
--- a/perllib/FixMyStreet/Map/Bristol.pm
+++ b/perllib/FixMyStreet/Map/Bristol.pm
@@ -32,8 +32,6 @@ sub copyright {
return '&copy; BCC';
}
-sub map_template { 'bristol' }
-
sub map_javascript { [
'/vendor/OpenLayers/OpenLayers.wmts.js',
'/js/map-OpenLayers.js',
diff --git a/perllib/FixMyStreet/Map/Buckinghamshire.pm b/perllib/FixMyStreet/Map/Buckinghamshire.pm
index 0e1a7f493..d24077f70 100644
--- a/perllib/FixMyStreet/Map/Buckinghamshire.pm
+++ b/perllib/FixMyStreet/Map/Buckinghamshire.pm
@@ -35,8 +35,6 @@ sub copyright {
return '&copy; BCC';
}
-sub map_template { 'buckinghamshire' }
-
sub map_javascript { [
'/vendor/OpenLayers/OpenLayers.wmts.js',
'/vendor/OpenLayers.Projection.OrdnanceSurvey.js',
diff --git a/perllib/FixMyStreet/Map/UKCouncilWMTS.pm b/perllib/FixMyStreet/Map/UKCouncilWMTS.pm
index c1a729f85..da0720f06 100644
--- a/perllib/FixMyStreet/Map/UKCouncilWMTS.pm
+++ b/perllib/FixMyStreet/Map/UKCouncilWMTS.pm
@@ -47,4 +47,6 @@ sub reproject_to_latlon($$$) {
return ($lat, $lon);
}
+sub map_template { 'wmts' }
+
1;
diff --git a/templates/web/bristol/maps/noscript_map.html b/templates/web/base/maps/noscript_map_wmts.html
index 987aa76a6..987aa76a6 100644
--- a/templates/web/bristol/maps/noscript_map.html
+++ b/templates/web/base/maps/noscript_map_wmts.html
diff --git a/templates/web/base/maps/openlayers.html b/templates/web/base/maps/openlayers.html
index 2f748cb19..02f6cb131 100644
--- a/templates/web/base/maps/openlayers.html
+++ b/templates/web/base/maps/openlayers.html
@@ -33,7 +33,8 @@
<div id="map_box" aria-hidden="true">
[% pre_map %]
<div id="map">
- [% INCLUDE 'maps/noscript_map.html' js = 1 %]
+ [% DEFAULT noscript_map_template = 'maps/noscript_map.html' %]
+ [% INCLUDE $noscript_map_template js = 1 %]
</div>
[% IF map.copyright %]
<div class="olControlAttribution" style="position: absolute;">[% map.copyright %]</div>
diff --git a/templates/web/base/maps/wmts.html b/templates/web/base/maps/wmts.html
new file mode 100644
index 000000000..d955f6985
--- /dev/null
+++ b/templates/web/base/maps/wmts.html
@@ -0,0 +1,4 @@
+[% map_html = BLOCK %]
+[% INCLUDE maps/openlayers.html noscript_map_template = 'maps/noscript_map_wmts.html' %]
+[% INCLUDE maps/wmts_config.html %]
+[% END %]
diff --git a/templates/web/bristol/maps/bristol.html b/templates/web/bristol/maps/bristol.html
deleted file mode 100644
index 1dcc82635..000000000
--- a/templates/web/bristol/maps/bristol.html
+++ /dev/null
@@ -1,4 +0,0 @@
-[% map_html = BLOCK %]
-[% INCLUDE maps/openlayers.html %]
-[% INCLUDE maps/wmts_config.html %]
-[% END %]
diff --git a/templates/web/buckinghamshire/maps/buckinghamshire.html b/templates/web/buckinghamshire/maps/buckinghamshire.html
deleted file mode 100644
index 1dcc82635..000000000
--- a/templates/web/buckinghamshire/maps/buckinghamshire.html
+++ /dev/null
@@ -1,4 +0,0 @@
-[% map_html = BLOCK %]
-[% INCLUDE maps/openlayers.html %]
-[% INCLUDE maps/wmts_config.html %]
-[% END %]