diff options
Diffstat (limited to 't/map')
-rw-r--r-- | t/map/cheshireeast.t | 18 | ||||
-rw-r--r-- | t/map/tests.t | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/t/map/cheshireeast.t b/t/map/cheshireeast.t new file mode 100644 index 000000000..a90a1606e --- /dev/null +++ b/t/map/cheshireeast.t @@ -0,0 +1,18 @@ +use Test::More; +use FixMyStreet::Map::CheshireEast; + +# https://maps-cache.cheshiresharedservices.gov.uk/maps/?wmts/CE_OS_AllBasemaps_COLOUR/oscce_grid/10/10187/8134.jpeg&KEY=3a3f5c60eca1404ea114e6941c9d3895 +my $tiles = FixMyStreet::Map::CheshireEast->map_tiles(x_tile => 10187, y_tile => 8134, zoom_act => 10); +$tiles = [ map { m{(\d+/\d+/\d+)}; $1; } @$tiles ]; +is_deeply $tiles, [ '10/10186/8133', '10/10187/8133', '10/10186/8134', '10/10187/8134' ]; + +use Data::Dumper; +my ($x, $y) = FixMyStreet::Map::CheshireEast->latlon_to_tile_with_adjust(53.150624, -2.386809, 10); +is $x, 10187; +is $y, 8134; + +my ($lat, $lon) = FixMyStreet::Map::CheshireEast->tile_to_latlon(10187, 8134, 10); +is sprintf("%.6f", $lat), 53.150624; +is sprintf("%.6f", $lon), -2.386809; + +done_testing(); diff --git a/t/map/tests.t b/t/map/tests.t index 499447ad5..02ec4e69d 100644 --- a/t/map/tests.t +++ b/t/map/tests.t @@ -7,6 +7,7 @@ my $requires = { 'Bromley' => 'map-fms.js', 'Buckinghamshire' => 'map-wmts-buckinghamshire.js', 'Lincolnshire' => 'lincolnshire/assets.js', + 'CheshireEast' => 'map-cheshireeast.js', 'FMS' => 'map-fms.js', 'Google' => 'map-google.js', 'GoogleOL' => 'map-google-ol.js', |