aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map/Zurich.pm
blob: a913b39bce6d27ec20c0cf270543221a62406044 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl
#
# FixMyStreet:Map::Zurich
# Zurich have their own tileserver serving aerial photos instead
# of street maps.
#
# Copyright (c) 2012 UK Citizens Online Democracy. All rights reserved.
# Email: steve@mysociety.org; WWW: http://www.mysociety.org/

package FixMyStreet::Map::Zurich;
use base 'FixMyStreet::Map::FMS';

use strict;

sub map_type {
    return 'OpenLayers.Layer.WMTS';
}

sub map_template {
	return 'zurich';
}

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;