aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/maps/openlayers.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/base/maps/openlayers.html')
-rw-r--r--templates/web/base/maps/openlayers.html34
1 files changed, 16 insertions, 18 deletions
diff --git a/templates/web/base/maps/openlayers.html b/templates/web/base/maps/openlayers.html
index 3c00c479c..b9dc0747c 100644
--- a/templates/web/base/maps/openlayers.html
+++ b/templates/web/base/maps/openlayers.html
@@ -5,34 +5,32 @@
[% END %]
<input type="hidden" name="zoom" value="[% map.zoom %]">
-<script type="text/javascript">
-var fixmystreet = fixmystreet || {};
-$.extend(fixmystreet, {
- 'area': [ [% map.area.join(',') %] ],
- 'all_pins': '[% all_pins %]',
- 'latitude': [% map.latitude %],
- 'longitude': [% map.longitude %],
+<div id="js-map-data"
+ data-area="[% map.area.join(',') %]"
+ data-all_pins='[% all_pins %]'
+ data-latitude=[% map.latitude %]
+ data-longitude=[% map.longitude %]
[% IF map.any_zoom -%]
- 'zoomToBounds': 1,
+ data-zoomToBounds=1
[%- END %]
[% IF map.zoom -%]
- 'zoom': [% map.zoom %],
+ data-zoom=[% map.zoom %]
[%- END %]
- 'pin_prefix': '[% c.config.ADMIN_BASE_URL IF admin %][% c.cobrand.path_to_pin_icons %]',
- 'numZoomLevels': [% map.numZoomLevels %],
- 'zoomOffset': [% map.zoomOffset %],
- 'map_type': [% map.map_type %],
+ data-pin_prefix='[% c.config.ADMIN_BASE_URL IF admin %][% c.cobrand.path_to_pin_icons %]',
+ data-numZoomLevels=[% map.numZoomLevels %]
+ data-zoomOffset=[% map.zoomOffset %]
+ data-map_type=[% map.map_type %]
[% IF include_key -%]
- 'key': '[% c.config.BING_MAPS_API_KEY %]',
+ data-key='[% c.config.BING_MAPS_API_KEY %]'
[%- END %]
- 'pins': [% INCLUDE maps/pins_js.html %]
-});
-</script>
+>
+</div>
<div id="map_box" aria-hidden="true">
[% pre_map %]
<div id="map">
- [% INCLUDE 'maps/noscript_map.html' %]
+ [% INCLUDE 'maps/noscript_map.html' js = 1 %]
</div>
+ <script src="[% version('/cobrands/fixmystreet/map.js') %]"></script>
[% IF map.copyright %]
<div class="olControlAttribution" style="position: absolute;">[% map.copyright %]</div>
[% END %]