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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
use Test::More;
use FixMyStreet::Map::FMS;
# Z NI Aerial
my $expected = {
10 => {
0 => {
0 => 'ch/1010100100.*?=G,L',
1 => 'ch/1010100100.*?A,G,L',
},
1 => {
0 => 'ch/1010100100.*?=G,L',
1 => 'ch/1010100100.*?A,G,L',
},
},
13 => {
0 => {
0 => 'r3131010100100.*?mmOS',
1 => 'ch/3131010100100.*?A,G,L',
},
1 => {
0 => 'ch/3131010100100.*?=G,L',
1 => 'ch/3131010100100.*?A,G,L',
},
},
16 => {
0 => {
0 => 'oml/16/32420/21504',
1 => 'ch/0313131010100100.*?A,G,L',
},
1 => {
0 => 'ch/0313131010100100.*?=G,L',
1 => 'ch/0313131010100100.*?A,G,L',
},
},
};
subtest "Correct tiles with various parameters" => sub {
for my $aerial (0, 1) {
for my $ni (0, 1) {
for my $zoom (qw(10 13 16)) {
my $tiles = FixMyStreet::Map::FMS->map_tiles(
x_tile => 32421, y_tile => 21505, zoom_act => $zoom,
aerial => $aerial,
latitude => $ni ? 55 : 51,
longitude => $ni ? -6 : -2,
);
my $wanted = $expected->{$zoom}{$ni}{$aerial};
like $tiles->[0], qr/$wanted/, "with zoom $zoom, NI $ni, aerial $aerial";
}
}
}
};
done_testing();
|