aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map/FMS.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-08-22 10:57:10 +0100
committerStruan Donald <struan@exo.org.uk>2012-08-22 10:57:10 +0100
commit2e0a4e8ec45579e4e5c9cf8aa123d5ab215b9703 (patch)
treec13e3c59b686e01460dc7960547f7e9c53c288bd /perllib/FixMyStreet/Map/FMS.pm
parentb99c5ff97b29a27eeba52ed24385ac30388e875c (diff)
parent88a7d38dffa3dabdf0f85573b254cea9c8ab232b (diff)
Merge remote-tracking branch 'origin/master' into fmb-read-only
Conflicts: .gitignore bin/make_css conf/general.yml-example perllib/FixMyStreet/App/Controller/Council.pm perllib/FixMyStreet/App/Controller/Report/New.pm perllib/FixMyStreet/Cobrand/Default.pm templates/web/default/around/around_index.html templates/web/default/index.html templates/web/emptyhomes/index.html templates/web/fixmystreet/around/around_index.html templates/web/fixmystreet/index.html web/fixmystreet_app_cgi.cgi web/fixmystreet_app_fastcgi.cgi
Diffstat (limited to 'perllib/FixMyStreet/Map/FMS.pm')
-rw-r--r--perllib/FixMyStreet/Map/FMS.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm
index b1dd29002..e7aa46784 100644
--- a/perllib/FixMyStreet/Map/FMS.pm
+++ b/perllib/FixMyStreet/Map/FMS.pm
@@ -42,8 +42,10 @@ sub map_tile_base {
}
sub map_tiles {
- my ($self, $x, $y, $z) = @_;
- if ($z >= 16) {
+ my ( $self, %params ) = @_;
+ my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} );
+ my $ni = in_northern_ireland_box( $params{latitude}, $params{longitude} );
+ if (!$ni && $z >= 16) {
my ($tile_sep, $tile_base) = $self->map_tile_base;
return [
sprintf($tile_base, 'a' . $tile_sep, $z, $x-1, $y-1),
@@ -53,7 +55,7 @@ sub map_tiles {
];
} else {
my $url = "g=701";
- $url .= "&productSet=mmOS" if $z > 10;
+ $url .= "&productSet=mmOS" if $z > 10 && !$ni;
return [
"//ecn.t0.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y-1, $z) . ".png?$url",
"//ecn.t1.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y-1, $z) . ".png?$url",
@@ -63,4 +65,10 @@ sub map_tiles {
}
}
+sub in_northern_ireland_box {
+ my ($lat, $lon) = @_;
+ return 1 if $lat >= 54.015 && $lat <= 55.315 && $lon >= -8.18 && $lon <= -5.415;
+ return 0;
+}
+
1;