diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bristol.pm | 2 | ||||
-rw-r--r-- | templates/web/bristol/maps/noscript_map.html | 32 |
2 files changed, 33 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bristol.pm b/perllib/FixMyStreet/Cobrand/Bristol.pm index 4648802bd..b11a52643 100644 --- a/perllib/FixMyStreet/Cobrand/Bristol.pm +++ b/perllib/FixMyStreet/Cobrand/Bristol.pm @@ -20,7 +20,7 @@ sub example_places { } sub map_type { - 'OSM'; + 'Bristol'; } sub default_link_zoom { 6 } diff --git a/templates/web/bristol/maps/noscript_map.html b/templates/web/bristol/maps/noscript_map.html new file mode 100644 index 000000000..987aa76a6 --- /dev/null +++ b/templates/web/bristol/maps/noscript_map.html @@ -0,0 +1,32 @@ +<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 %] + 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 %] + |