diff options
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 |