diff options
author | Steven Day <steve@mysociety.org> | 2012-11-15 17:39:07 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-11-26 12:46:43 +0000 |
commit | b6061833fdcf893d89ba32d9e49140ac140f5b41 (patch) | |
tree | 40f5ed411c73649a0254e532dc7f74ba6762089f /perllib/FixMyStreet/Map | |
parent | 9714afa826567226900044ead02241d2454a0d34 (diff) |
Add a server-side map module for zurich maps - very borked
Diffstat (limited to 'perllib/FixMyStreet/Map')
-rw-r--r-- | perllib/FixMyStreet/Map/Zurich.pm | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Map/Zurich.pm b/perllib/FixMyStreet/Map/Zurich.pm index da234bdd1..a913b39bc 100644 --- a/perllib/FixMyStreet/Map/Zurich.pm +++ b/perllib/FixMyStreet/Map/Zurich.pm @@ -13,13 +13,28 @@ use base 'FixMyStreet::Map::FMS'; use strict; sub map_type { - return 'OpenLayers.Layer.WMTS_18'; + return 'OpenLayers.Layer.WMTS'; } -sub map_tile_base { - 'http://www.wmts.stadt-zuerich.ch/Luftbild/MapServer/WMTS/tile/1.0.0/Luftbild'; +sub map_template { + return 'zurich'; } -# TODO - we need to use swiss coordinate system, projection: EPSG:4326ß +sub base_tile_url { + return 'http://www.wmts.stadt-zuerich.ch/Luftbild/MapServer/WMTS/tile/'; +} + +# TODO - totally wrong probably - how do we actually do this? +sub map_tiles { + my ( $self, %params ) = @_; + my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} ); + my $tile_url = $self->base_tile_url(); + return [ + "$tile_url/$z/" . ($x - 1) . "/" . ($y - 1), + "$tile_url/$z/$x/" . ($y - 1), + "$tile_url/$z/" . ($x - 1) . "/$y", + "$tile_url/$z/$x/$y", + ]; +} 1;
\ No newline at end of file |