diff options
Diffstat (limited to 'templates/web/default/maps')
-rw-r--r-- | templates/web/default/maps/bing.html | 18 | ||||
-rw-r--r-- | templates/web/default/maps/fms.html | 11 | ||||
-rw-r--r-- | templates/web/default/maps/google.html | 17 | ||||
-rw-r--r-- | templates/web/default/maps/openlayers.html | 86 | ||||
-rw-r--r-- | templates/web/default/maps/osm-streetview.html | 9 | ||||
-rw-r--r-- | templates/web/default/maps/osm.html | 9 | ||||
-rw-r--r-- | templates/web/default/maps/pins_js.html | 4 | ||||
-rw-r--r-- | templates/web/default/maps/tilma/openlayers.html | 26 | ||||
-rw-r--r-- | templates/web/default/maps/tilma/original.html | 88 |
9 files changed, 268 insertions, 0 deletions
diff --git a/templates/web/default/maps/bing.html b/templates/web/default/maps/bing.html new file mode 100644 index 000000000..6b7114199 --- /dev/null +++ b/templates/web/default/maps/bing.html @@ -0,0 +1,18 @@ +[% 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="/js/map-bing.js"></script> +[% END %] + +[% map_html = BLOCK %] +<script type="text/javascript"> +var fixmystreet = { + 'key': '[% map.key %]', + 'latitude': [% map.latitude %], + 'longitude': [% map.longitude %], + 'pins': [% INCLUDE maps/pins_js.html %] +} +</script> +<div id="map_box"> + [% pre_map %] + <div id="map"></div> +[% END %] diff --git a/templates/web/default/maps/fms.html b/templates/web/default/maps/fms.html new file mode 100644 index 000000000..36fd48467 --- /dev/null +++ b/templates/web/default/maps/fms.html @@ -0,0 +1,11 @@ +[% 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="/jslib/OpenLayers-2.10/OpenLayers.js"></script> +<script type="text/javascript" src="/js/map-OpenLayers.js"></script> +<script type="text/javascript" src="/js/map-bing-ol.js"></script> +[% END %] + +[% map_html = BLOCK %] +[% INCLUDE maps/openlayers.html %] +[% END %] + diff --git a/templates/web/default/maps/google.html b/templates/web/default/maps/google.html new file mode 100644 index 000000000..2e326734b --- /dev/null +++ b/templates/web/default/maps/google.html @@ -0,0 +1,17 @@ +[% map_js = BLOCK %] +<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> +<script type="text/javascript" src="/js/map-google.js"></script> +[% END %] + +[% map_html = BLOCK %] +<script type="text/javascript"> +var fixmystreet = { + 'latitude': [% map.latitude %], + 'longitude': [% map.longitude %], + 'pins': [% INCLUDE maps/pins_js.html %] +} +</script> +<div id="map_box"> + [% pre_map %] + <div id="map"></div> +[% END %] diff --git a/templates/web/default/maps/openlayers.html b/templates/web/default/maps/openlayers.html new file mode 100644 index 000000000..ae670ce13 --- /dev/null +++ b/templates/web/default/maps/openlayers.html @@ -0,0 +1,86 @@ +[% 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 = { + 'latitude': [% map.latitude %], + 'longitude': [% map.longitude %], +[% IF map.zoom -%] + 'zoom': [% map.zoom %], +[%- END %] + 'map_type': [% map.map_type %], + 'pins': [% INCLUDE maps/pins_js.html %] +} +</script> +<div id="map_box"> + [% pre_map %] + <div id="map"><noscript> + <div id="drag"><[% map.img_type %] + alt="NW map tile" id="t2.2" + name="tile_[% map.x_tile - 1 %].[% map.y_tile - 1 %]" + src="[% map.tiles.0 %]" + style="top:0; left:0;"><[% map.img_type %] + alt="NE map tile" id="t2.3" + name="tile_[% map.x_tile %].[% map.y_tile - 1 %]" + src="[% map.tiles.1 %]" + style="top:0px; left:256px;"><br><[% map.img_type %] + alt="SW map tile" id="t3.2" + name="tile_[% map.x_tile - 1 %].[% map.y_tile %]" + src="[% map.tiles.2 %]" + style="top:256px; left:0;"><[% map.img_type %] + alt="SE map tile" id="t3.3" + name="tile_[% map.x_tile %].[% map.y_tile %]" + src="[% map.tiles.3 %]" + style="top:256px; left:256px;"></div> + <div id="pins">[% FOR pin IN map.pins %][% INCLUDE pin %][% END %]</div> + [% INCLUDE compass %] + </noscript></div> + <p id="copyright"> + [% map.copyright %] + </p> + + +[% 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( { zoom = map.zoom + 1 } ) IF map.zoom < map.zoom_levels - 1; + SET zoom_out = c.uri_with( { zoom = map.zoom - 1 } ) IF map.zoom > 0; + SET zoom_in = '#' IF map.zoom >= map.zoom_levels - 1; + SET zoom_out = '#' IF map.zoom <= 0; +%] +<div style="position: absolute; left: 4px; top: 4px; z-index: 1007;" class="olControlPanZoom olControlNoSelect" unselectable="on"> + <div style="position: absolute; left: 13px; top: 4px; width: 18px; height: 18px;"><a href="[% north %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/north-mini.png" border="0"></a></div> + <div style="position: absolute; left: 4px; top: 22px; width: 18px; height: 18px;"><a href="[% west %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/west-mini.png" border="0"></a></div> + <div style="position: absolute; left: 22px; top: 22px; width: 18px; height: 18px;"><a href="[% east %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/east-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 40px; width: 18px; height: 18px;"><a href="[% south %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/south-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 63px; width: 18px; height: 18px;"><a href="[% zoom_in %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/zoom-plus-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 81px; width: 18px; height: 18px;"><a href="[% world %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/zoom-world-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 99px; width: 18px; height: 18px;"><a href="[% zoom_out %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/zoom-minus-mini.png" border="0"></a></div> +</div> +[% END %] + + +[% BLOCK pin %] + +[% cols = { + red = 'R', green = 'G', blue = 'B', purple = 'P', + } +%] +[% IF pin.id %] +<a title="[% pin.title | html %]" href="[% c.uri_for('/report/' _ pin.id) %]"> +[%- END -%] +<img border="0" class="pin" src="[% c.uri_for('/i/pin' _ cols.${pin.colour} _ '.gif') %]" + alt="[% loc('Problem') %]" style="top:[% pin.py - 59 %]px; left:[% pin.px %]px; position: absolute;"> +[%- IF pin.id -%] +</a> +[% END %] + +[% END %] diff --git a/templates/web/default/maps/osm-streetview.html b/templates/web/default/maps/osm-streetview.html new file mode 100644 index 000000000..ba8d1fba4 --- /dev/null +++ b/templates/web/default/maps/osm-streetview.html @@ -0,0 +1,9 @@ +[% map_js = BLOCK %] +<script type="text/javascript" src="/jslib/OpenLayers-2.10/OpenLayers.js"></script> +<script type="text/javascript" src="/js/map-OpenLayers.js"></script> +<script type="text/javascript" src="/js/map-streetview.js"></script> +[% END %] + +[% map_html = BLOCK %] +[% INCLUDE maps/openlayers.html %] +[% END %] diff --git a/templates/web/default/maps/osm.html b/templates/web/default/maps/osm.html new file mode 100644 index 000000000..c6529566e --- /dev/null +++ b/templates/web/default/maps/osm.html @@ -0,0 +1,9 @@ +[% map_js = BLOCK %] +<script type="text/javascript" src="/jslib/OpenLayers-2.10/OpenLayers.js"></script> +<script type="text/javascript" src="/js/map-OpenLayers.js"></script> +<script type="text/javascript" src="/js/map-OpenStreetMap.js"></script> +[% END %] + +[% map_html = BLOCK %] +[% INCLUDE maps/openlayers.html %] +[% END %] diff --git a/templates/web/default/maps/pins_js.html b/templates/web/default/maps/pins_js.html new file mode 100644 index 000000000..4a5814b15 --- /dev/null +++ b/templates/web/default/maps/pins_js.html @@ -0,0 +1,4 @@ +[ [% FOR pin IN map.pins -%] + [ [% pin.latitude %], [% pin.longitude %], '[% pin.colour %]', '[% pin.id %]', '[% pin.title %]' ] + [%- IF !loop.last %],[% END %] +[% END %] ] diff --git a/templates/web/default/maps/tilma/openlayers.html b/templates/web/default/maps/tilma/openlayers.html new file mode 100644 index 000000000..c8ae53bfe --- /dev/null +++ b/templates/web/default/maps/tilma/openlayers.html @@ -0,0 +1,26 @@ +[% map_js = BLOCK %] +<script type="text/javascript" src="/jslib/OpenLayers-2.10/OpenLayers.js"></script> +<script type="text/javascript" src="/js/map-OpenLayers.js"></script> +<script type="text/javascript" src="/js/map-tilma-ol.js"></script> +<script type="text/javascript" src="/js/OpenLayers.Projection.OrdnanceSurvey.js"></script> +[% END %] + +[% map_html = BLOCK %] +<script type="text/javascript"> +var fixmystreet = { + 'tilewidth': [% map.tilewidth %], + 'tileheight': [% map.tilewidth %], + 'latitude': [% map.latitude %], + 'longitude': [% map.longitude %], + 'pins': [% INCLUDE maps/pins_js.html %], + 'tile_type': '[% map.tile_type %]', + 'maxResolution': [% map.maxResolution %] +}; +</script> +<div id="map_box"> + [% pre_map %] + <div id="map"> + [% '<div id="watermark"></div>' IF map.watermark %] + </div> + <p id="copyright">[% map.copyright %]</p> +[% END %] diff --git a/templates/web/default/maps/tilma/original.html b/templates/web/default/maps/tilma/original.html new file mode 100644 index 000000000..e02a974f8 --- /dev/null +++ b/templates/web/default/maps/tilma/original.html @@ -0,0 +1,88 @@ +[% map_js = BLOCK %] +<script type="text/javascript" src="/js/map-tilma.js"></script> +[% END %] + +[% map_html = BLOCK %] + +[% IF !map.tiles %] + <div id="map_box"> + <div id="map"><div id="drag"> + [% loc("Unable to fetch the map tiles from the tile server.") %] + </div></div> + [% RETURN %] +[% END %] + +[% IF map.clickable %] +<input type="hidden" name="x" id="formX" value="[% map.x %]"> +<input type="hidden" name="y" id="formY" value="[% map.y %]"> + [% map.img_type = 'input type="image"' %] +[% ELSE %] + [% map.img_type = 'img' %] +[% END %] +<script type="text/javascript"> +[% c.cobrand.root_path_js %] +var fixmystreet = { + 'x': [% map.x - 3 %], + 'y': [% map.y - 3 %], + 'start_x': [% map.px %], + 'start_y': [% map.py %], + 'tile_type': '[% map.tile_type %]', + 'tilewidth': [% map.tilewidth %], + 'tileheight': [% map.tilewidth %] +}; +</script> +<div id="map_box"> + [% pre_map %] + <div id="map"><div id="drag"> + <[% map.img_type %] + alt="NW map tile" id="t2.2" name="tile_[% map.x - 1 %].[% map.y %]" src="[% map.url %][% map.tileids.0.0 %]" style="top:0px; left:0;"><[% map.img_type %] + alt="NE map tile" id="t2.3" name="tile_[% map.x %].[% map.y %]" src="[% map.url %][% map.tileids.0.1 %]" style="top:0px; left:[% map.tilewidth %]px;"><br><[% map.img_type %] + alt="SW map tile" id="t3.2" name="tile_[% map.x - 1 %].[% map.y - 1 %]" src="[% map.url %][% map.tileids.1.0 %]" style="top:[% map.tilewidth %]px; left:0;"><[% map.img_type %] + alt="SE map tile" id="t3.3" name="tile_[% map.x %].[% map.y - 1 %]" src="[% map.url %][% map.tileids.1.1 %]" style="top:[% map.tilewidth %]px; left:[% map.tilewidth %]px;"> + <div id="pins">[% FOR pin IN map.pins %][% INCLUDE pin %][% END %]</div> + </div> + [% '<div id="watermark"></div>' IF map.watermark %] + [% INCLUDE compass %] + </div> + <p id="copyright">[% map.copyright %]</p> +[% END %] + + +[% BLOCK pin %] + +[% num = '' IF !num or num > 9; + cols = { + red = 'R', green = 'G', blue = 'B', purple = 'P', + } +%] +[% IF pin.id %] +<a title="[% pin.title | html %]" href="[% c.uri_for('/report/' _ pin.id) %]"> +[%- END -%] +<img class="pin" src="[% c.uri_for('/i/pin' _ cols.${pin.colour} _ num _ '.gif') %]" + alt="[% loc('Problem') %]" style="top:[% pin.py - 59 %]px; left:[% pin.px %]px; position: absolute;"> +[%- IF pin.id -%] +</a> +[% END %] + +[% END %] + + +[% BLOCK compass %] + <table cellpadding="0" cellspacing="0" border="0" id="compass"> + <tr valign="bottom"> + <td align="right"><a href="[% c.req.uri_with( { x => map.x - 1, y => map.y + 1 } ) %]"><img src="[% c.uri_for('/i/arrow-northwest.gif') %]" alt="NW" width=11 height=11></a></td> + <td align="center"><a href="[% c.req.uri_with( { x => map.x, y => map.y + 1 } ) %]"><img src="[% c.uri_for('/i/arrow-north.gif') %]" vspace="3" alt="N" width=13 height=11></a></td> + <td><a href="[% c.req.uri_with( { x => map.x + 1, y => map.y + 1 } ) %]"><img src="[% c.uri_for('/i/arrow-northeast.gif') %]" alt="NE" width=11 height=11></a></td> + </tr> + <tr> + <td><a href="[% c.req.uri_with( { x => map.x - 1, y => map.y } ) %]"><img src="[% c.uri_for('/i/arrow-west.gif') %]" hspace="3" alt="W" width=11 height=13></a></td> + <td align="center"><a href="$recentre"><img src="[% c.uri_for('/i/rose.gif') %]" alt="Recentre" width=35 height=34></a></td> + <td><a href="[% c.req.uri_with( { x => map.x + 1, y => map.y } ) %]"><img src="[% c.uri_for('/i/arrow-east.gif') %]" hspace="3" alt="E" width=11 height=13></a></td> + </tr> + <tr valign="top"> + <td align="right"><a href="[% c.req.uri_with( { x => map.x - 1, y => map.y - 1 } ) %]"><img src="[% c.uri_for('/i/arrow-southwest.gif') %]" alt="SW" width=11 height=11></a></td> + <td align="center"><a href="[% c.req.uri_with( { x => map.x, y => map.y - 1 } ) %]"><img src="[% c.uri_for('/i/arrow-south.gif') %]" vspace="3" alt="S" width=13 height=11></a></td> + <td><a href="[% c.req.uri_with( { x => map.x + 1, y => map.y - 1 } ) %]"><img src="[% c.uri_for('/i/arrow-southeast.gif') %]" alt="SE" width=11 height=11></a></td> + </tr> + </table> +[% END %] |