diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-17 16:35:42 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-08-17 16:36:50 +0100 |
commit | 1897528940634df65483024e4f9421d2c3476da0 (patch) | |
tree | 4833ceadf5182fc97852e86b178b5913b13b18d3 /perllib/FixMyStreet/Map/WMTSBase.pm | |
parent | b0db6ccae8f2e2c35b2c503baf0f86b269435f9b (diff) |
[Zurich] Fix server side map tile URL generation.
@scales does not include the hidden zoom levels, so we need to offset
the matrix ID to be correct in the URL but not do so to calculate the
tile row and column.
Diffstat (limited to 'perllib/FixMyStreet/Map/WMTSBase.pm')
-rw-r--r-- | perllib/FixMyStreet/Map/WMTSBase.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/Map/WMTSBase.pm b/perllib/FixMyStreet/Map/WMTSBase.pm index c0e002e6a..909ada1d6 100644 --- a/perllib/FixMyStreet/Map/WMTSBase.pm +++ b/perllib/FixMyStreet/Map/WMTSBase.pm @@ -241,7 +241,7 @@ sub latlon_to_tile($$$$) { lon => $tile_params->{origin_x}, lat => $tile_params->{origin_y} }; - my $res = $scales[$matrix_id] / + my $res = $scales[$zoom] / ($tile_params->{inches_per_unit} * $tile_params->{dpi}); # OpenLayers.INCHES_PER_UNIT[units] * OpenLayers.DOTS_PER_INCH @@ -282,13 +282,12 @@ sub tile_to_latlon { my ($self, $fx, $fy, $zoom) = @_; my $tile_params = $self->tile_parameters; - my $matrix_id = $zoom + $self->zoom_parameters->{id_offset}; my @scales = $self->scales; my $tileOrigin = { lon => $tile_params->{origin_x}, lat => $tile_params->{origin_y} }; - my $res = $scales[$matrix_id] / + my $res = $scales[$zoom] / ($tile_params->{inches_per_unit} * $tile_params->{dpi}); # OpenLayers.INCHES_PER_UNIT[units] * OpenLayers.DOTS_PER_INCH |