diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/base/maps/noscript_map_base_wmx.html | 18 | ||||
-rw-r--r-- | templates/web/base/maps/noscript_map_wmts.html | 32 | ||||
-rw-r--r-- | templates/web/base/maps/openlayers.html | 4 | ||||
-rw-r--r-- | templates/web/base/maps/wms.html | 4 | ||||
-rw-r--r-- | templates/web/base/maps/wms_config.html | 13 | ||||
-rw-r--r-- | templates/web/base/maps/wmts.html | 2 |
6 files changed, 38 insertions, 35 deletions
diff --git a/templates/web/base/maps/noscript_map_base_wmx.html b/templates/web/base/maps/noscript_map_base_wmx.html new file mode 100644 index 000000000..45de9926e --- /dev/null +++ b/templates/web/base/maps/noscript_map_base_wmx.html @@ -0,0 +1,18 @@ +<div class="noscript"> + <div id="[% nsm_prefix %]drag"> + [%- FOR row IN map.tiles -%] + [%- FOR tile IN row -%] + [%- top_px = tile.row_offset * map.tile_size -%] + [%- left_px = tile.col_offset * map.tile_size %] + <[% map.img_type | safe %] + alt="[% tile.alt %]" + id="[% nsm_prefix %]t[% tile.dotted_id %]" + name="tile_[% tile.dotted_id %]" + src="[% tile.src %]" + style="width: [% map.tile_size %]px; top: [% top_px %]px; left: [% left_px %]px"> + [%- END -%] + [% END %] + </div> + <div id="[% nsm_prefix %]pins">[% FOR pin IN map.pins %][% INCLUDE 'maps/pin.html' %][% END %]</div> + [% INCLUDE 'maps/_compass.html' %] +</div> diff --git a/templates/web/base/maps/noscript_map_wmts.html b/templates/web/base/maps/noscript_map_wmts.html deleted file mode 100644 index 2b1c5e73c..000000000 --- a/templates/web/base/maps/noscript_map_wmts.html +++ /dev/null @@ -1,32 +0,0 @@ -<div class="noscript square-map__outer"> - <div class="square-map__inner"> - <div id="[% nsm_prefix %]drag"> - [%- FOR row IN map.tiles -%] - [%- FOR tile IN row -%] - [%- top_px = tile.row_offset * map.tile_size -%] - [%- left_px = tile.col_offset * map.tile_size %] - <[% map.img_type | safe %] - class="square-map__tile" - alt="[% tile.alt %]" - id="[% nsm_prefix %]t[% tile.dotted_id %]" - name="tile_[% tile.dotted_id %]" - src="[% tile.src %]" - style="width: [% 100 / map.cols %]%; height: auto; float: left;"> - [%- END -%] - [% END %] - </div> - <div id="[% nsm_prefix %]pins">[% FOR pin IN map.pins %][% INCLUDE pin %][% END %]</div> - [% INCLUDE 'maps/_compass.html' %] - </div> -</div> - -[% BLOCK pin %] -[% - SET pin_top = pin.py / ( map.tile_size * map.rows ) * 100; - SET pin_left = pin.px / ( map.tile_size * map.cols ) * 100; - # -24px half of 48px wide image, -64px all of 64px tall image - INCLUDE 'maps/pin.html' - pin_style = 'top:' _ pin_top _ '%; left:' _ pin_left _ '%; position:absolute; margin-left:-24px; margin-top:-64px;' -%] -[% END %] - diff --git a/templates/web/base/maps/openlayers.html b/templates/web/base/maps/openlayers.html index 5002d4243..48a2f0890 100644 --- a/templates/web/base/maps/openlayers.html +++ b/templates/web/base/maps/openlayers.html @@ -33,8 +33,8 @@ <div id="map_box" aria-hidden="true"> [% pre_map %] <div id="map"> - [% IF noscript_map_template == 'maps/noscript_map_wmts.html' %] - [% INCLUDE 'maps/noscript_map_wmts.html' js = 1 %] + [% IF noscript_map_template == 'maps/noscript_map_base_wmx.html' %] + [% INCLUDE 'maps/noscript_map_base_wmx.html' js = 1 %] [% ELSE %] [% INCLUDE 'maps/noscript_map.html' js = 1 %] [% END %] diff --git a/templates/web/base/maps/wms.html b/templates/web/base/maps/wms.html new file mode 100644 index 000000000..93fcb95dd --- /dev/null +++ b/templates/web/base/maps/wms.html @@ -0,0 +1,4 @@ +[% map_html = BLOCK %] +[% INCLUDE maps/openlayers.html noscript_map_template = 'maps/noscript_map_base_wmx.html' %] +[% INCLUDE maps/wms_config.html %] +[% END %] diff --git a/templates/web/base/maps/wms_config.html b/templates/web/base/maps/wms_config.html new file mode 100644 index 000000000..f7fe3510c --- /dev/null +++ b/templates/web/base/maps/wms_config.html @@ -0,0 +1,13 @@ +<script nonce="[% csp_nonce %]"> + var fixmystreet = window.fixmystreet || {}; + fixmystreet.wms_config = { + 'map_projection': '[% map.map_projection %]', + 'tile_urls': [% map.tile_urls | safe %], + 'tile_size': [% map.tile_size %], + 'layer_names': [% map.layer_names | safe %], + 'wms_version': '[% map.wms_version %]', + 'format': '[% map.format %]', + 'scales': [% map.scales | safe %], + 'requestEncoding': "REST" + }; +</script> diff --git a/templates/web/base/maps/wmts.html b/templates/web/base/maps/wmts.html index d955f6985..25c9065a3 100644 --- a/templates/web/base/maps/wmts.html +++ b/templates/web/base/maps/wmts.html @@ -1,4 +1,4 @@ [% map_html = BLOCK %] -[% INCLUDE maps/openlayers.html noscript_map_template = 'maps/noscript_map_wmts.html' %] +[% INCLUDE maps/openlayers.html noscript_map_template = 'maps/noscript_map_base_wmx.html' %] [% INCLUDE maps/wmts_config.html %] [% END %] |