aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-02-05 21:37:02 +0000
committerStruan Donald <struan@exo.org.uk>2020-02-17 14:10:08 +0000
commit998886ee5d70151871f57147914529a5f463f37c (patch)
treec673038a7fe8d9340c7bf06fa13c0878a486157d
parent019a2833453c931a91241004e7ff449ab4d82a35 (diff)
Fix WMTS map display.
Non-JS clicking does not work if map tiles are scaled.
-rw-r--r--templates/web/base/maps/noscript_map_wmts.html46
-rw-r--r--web/cobrands/bristol/base.scss4
-rw-r--r--web/cobrands/buckinghamshire/base.scss4
3 files changed, 16 insertions, 38 deletions
diff --git a/templates/web/base/maps/noscript_map_wmts.html b/templates/web/base/maps/noscript_map_wmts.html
index 2b1c5e73c..45de9926e 100644
--- a/templates/web/base/maps/noscript_map_wmts.html
+++ b/templates/web/base/maps/noscript_map_wmts.html
@@ -1,32 +1,18 @@
-<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 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>
-
-[% 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/web/cobrands/bristol/base.scss b/web/cobrands/bristol/base.scss
index dea303f42..836b27009 100644
--- a/web/cobrands/bristol/base.scss
+++ b/web/cobrands/bristol/base.scss
@@ -117,10 +117,6 @@ label {
@extend %bold-font;
}
-#map #drag .square-map__tile {
- position: static;
-}
-
// uses important because btn also uses it
#highways .segmented-control--radio input:checked + label.btn {
color: $g7 !important;
diff --git a/web/cobrands/buckinghamshire/base.scss b/web/cobrands/buckinghamshire/base.scss
index 1d9edf02f..ec3dd006c 100644
--- a/web/cobrands/buckinghamshire/base.scss
+++ b/web/cobrands/buckinghamshire/base.scss
@@ -82,10 +82,6 @@ label {
@extend %bold-font;
}
-#map #drag .square-map__tile {
- position: static;
-}
-
// uses important because btn also uses it
#highways .segmented-control--radio input:checked + label.btn {
color: $g7 !important;