aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/bristol/maps
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/bristol/maps')
-rw-r--r--templates/web/bristol/maps/fms.html13
-rw-r--r--templates/web/bristol/maps/noscript_map.html70
-rw-r--r--templates/web/bristol/maps/openlayers.html49
3 files changed, 132 insertions, 0 deletions
diff --git a/templates/web/bristol/maps/fms.html b/templates/web/bristol/maps/fms.html
new file mode 100644
index 000000000..a1a2a3f7b
--- /dev/null
+++ b/templates/web/bristol/maps/fms.html
@@ -0,0 +1,13 @@
+[% map_js = BLOCK %]
+<!-- <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=en-GB"></script> -->
+<script type="text/javascript" src="[% version('/js/OpenLayers.2.11.zurich.js') %]"></script>
+<script type="text/javascript" src="[% version('/js/OpenLayers.Projection.OrdnanceSurvey.js') %]"></script>
+<script type="text/javascript" src="[% version('/js/map-OpenLayers.js') %]"></script>
+<script type="text/javascript" src="[% version('/js/map-wmts-bristol.js') %]"></script>
+<script type="text/javascript" src="[% version('/js/jquery.ba-hashchange.min.js') %]"></script>
+<!--[if lte IE 6]>
+ <link rel="stylesheet" href="/js/OpenLayers-2.13.1/theme/default/ie6-style.css" type="text/css">
+<![endif]-->
+[% END %]
+
+[% map_html = INCLUDE maps/openlayers.html %]
diff --git a/templates/web/bristol/maps/noscript_map.html b/templates/web/bristol/maps/noscript_map.html
new file mode 100644
index 000000000..5c2a2c064
--- /dev/null
+++ b/templates/web/bristol/maps/noscript_map.html
@@ -0,0 +1,70 @@
+<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 compass %]
+ </div>
+</div>
+
+[% BLOCK compass %]
+[%
+ north = c.uri_with( { lat = map.compass.north.0, lon = map.compass.north.1, zoom = map.zoom } )
+ south = c.uri_with( { lat = map.compass.south.0, lon = map.compass.south.1, zoom = map.zoom } )
+ east = c.uri_with( { lat = map.compass.east.0, lon = map.compass.east.1, zoom = map.zoom } )
+ west = c.uri_with( { lat = map.compass.west.0, lon = map.compass.west.1, zoom = map.zoom } )
+ world = c.uri_with( { zoom = 0 } );
+ SET zoom_in = c.uri_with( { lat = map.latitude, lon = map.longitude, zoom = map.zoom + 1 } ) IF map.zoom < map.numZoomLevels - 1;
+ SET zoom_out = c.uri_with( { lat = map.latitude, lon = map.longitude, zoom = map.zoom - 1 } ) IF map.zoom > 0;
+ SET zoom_in = '#' IF map.zoom >= map.numZoomLevels - 1;
+ SET zoom_out = '#' IF map.zoom <= 0;
+%]
+<div style="position: absolute; left: 4px; top: 4px;" class="olControlPanZoom olControlNoSelect" unselectable="on">
+ <div style="position: absolute; left: 13px; top: 4px; width: 18px; height: 18px;"><a rel="nofollow" href="[% north %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/north-mini.png" border="0"></a></div>
+ <div style="position: absolute; left: 4px; top: 22px; width: 18px; height: 18px;"><a rel="nofollow" href="[% west %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/west-mini.png" border="0"></a></div>
+ <div style="position: absolute; left: 22px; top: 22px; width: 18px; height: 18px;"><a rel="nofollow" href="[% east %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/east-mini.png" border="0"></a></div>
+ <div style="position: absolute; left: 13px; top: 40px; width: 18px; height: 18px;"><a rel="nofollow" href="[% south %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/south-mini.png" border="0"></a></div>
+ <div style="position: absolute; left: 13px; top: 63px; width: 18px; height: 18px;"><a rel="nofollow" href="[% zoom_in %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/zoom-plus-mini.png" border="0"></a></div>
+ <div style="position: absolute; left: 13px; top: 81px; width: 18px; height: 18px;"><a rel="nofollow" href="[% world %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/zoom-world-mini.png" border="0"></a></div>
+ <div style="position: absolute; left: 13px; top: 99px; width: 18px; height: 18px;"><a rel="nofollow" href="[% zoom_out %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/zoom-minus-mini.png" border="0"></a></div>
+</div>
+[% END %]
+
+
+[% BLOCK pin %]
+
+[% IF pin.id %]
+<a title="[% pin.title | html %]" href="[% c.uri_for('/report/' _ pin.id) %]">
+[%- END -%]
+<img
+ data-foo="[% pin.px %],[% pin.py %]/ [% map.tile_size %]*[% map.cols %],[% map.rows %]"
+ border="0"
+ class="pin"
+ src="[% c.uri_for( c.cobrand.path_to_pin_icons _ 'pin-' _ pin.colour _ '.png') %]"
+ alt="[% loc('Problem') %]"
+ style="
+ top: [% pin.py / ( map.tile_size * map.rows ) * 100 %]%;
+ left: [% pin.px / ( map.tile_size * map.cols ) * 100 %]%;
+ position: absolute;
+ margin-left: -24px; /* Half of 48px wide image */
+ margin-top: -64px; /* All of 64px tall image */
+ "
+>
+[%- IF pin.id -%]
+</a>
+[% END %]
+
+[% END %]
diff --git a/templates/web/bristol/maps/openlayers.html b/templates/web/bristol/maps/openlayers.html
new file mode 100644
index 000000000..4b178e21a
--- /dev/null
+++ b/templates/web/bristol/maps/openlayers.html
@@ -0,0 +1,49 @@
+[% IF map.clickable %]
+ [% map.img_type = 'input type="image"' %]
+[% ELSE %]
+ [% map.img_type = 'img' %]
+[% END %]
+
+<input type="hidden" name="zoom" value="[% map.zoom %]">
+<script type="text/javascript">
+var fixmystreet = {
+ 'page': '[% page %]',
+ 'area': [ [% map.area.join(',') %] ],
+ 'all_pins': '[% all_pins %]',
+ 'latitude': [% map.latitude %],
+ 'longitude': [% map.longitude %],
+[% IF map.any_zoom -%]
+ 'zoomToBounds': 1,
+[%- END %]
+[% IF map.zoom -%]
+ 'zoom': [% map.zoom %],
+[%- END %]
+ 'pin_prefix': '[% c.cobrand.path_to_pin_icons %]',
+ 'numZoomLevels': [% map.numZoomLevels %],
+ 'zoomOffset': [% map.zoomOffset %],
+ 'map_type': [% map.map_type %],
+ 'pins': [% INCLUDE maps/pins_js.html %],
+
+ 'wmts_config': {
+ 'map_projection': '[% map.map_projection %]',
+ 'tile_dpi': [% map.tile_dpi %],
+ 'tile_url': '[% map.tile_url %]',
+ 'tile_suffix': '[% map.tile_suffix %]',
+ 'layer_name': '[% map.layer_name %]',
+ 'layer_style': '[% map.layer_style %]',
+ 'matrix_set': '[% map.matrix_set %]',
+ 'scales': [% map.scales %],
+ 'origin_x': [% map.origin_x %],
+ 'origin_y': [% map.origin_y %]
+ }
+}
+</script>
+<div id="map_box" aria-hidden="true">
+ [% pre_map %]
+ <div id="map">
+ [% INCLUDE 'maps/noscript_map.html' %]
+ </div>
+ [% IF map.copyright %]
+ <div class="olControlAttribution" style="position: absolute;">[% map.copyright %]</div>
+ [% END %]
+