aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2012-05-29 15:57:41 +0100
committerDave Whiteland <dave@mysociety.org>2012-05-29 15:57:41 +0100
commit67da8efc720d2d0bd22bd9fe8655b7e983b35bb4 (patch)
tree38b8570647124df06c637d4b923f6010211ef328 /perllib/FixMyStreet/Map
parent40b3a51d33caefa8f5fb97ce9be18ef936c7e260 (diff)
parent131ff6e9bf3626d6a8fff6ae54669d250148a63a (diff)
Merge remote branch 'origin/master' into fmb-read-only
Conflicts: bin/send-reports perllib/FixMyStreet/Cobrand/Default.pm perllib/FixMyStreet/Cobrand/FixMyStreet.pm templates/web/fixmystreet/alert/index.html templates/web/fixmystreet/around/display_location.html web/cobrands/fixmystreet/_layout.scss web/js/map-OpenLayers.js
Diffstat (limited to 'perllib/FixMyStreet/Map')
-rw-r--r--perllib/FixMyStreet/Map/Bromley.pm22
-rw-r--r--perllib/FixMyStreet/Map/FMS.pm21
-rw-r--r--perllib/FixMyStreet/Map/OSM.pm10
3 files changed, 37 insertions, 16 deletions
diff --git a/perllib/FixMyStreet/Map/Bromley.pm b/perllib/FixMyStreet/Map/Bromley.pm
new file mode 100644
index 000000000..20821236f
--- /dev/null
+++ b/perllib/FixMyStreet/Map/Bromley.pm
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+#
+# FixMyStreet:Map::Bromley
+# Bromley have slightly different tiles, with trees etc.
+#
+# Copyright (c) 2012 UK Citizens Online Democracy. All rights reserved.
+# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
+
+package FixMyStreet::Map::Bromley;
+use base 'FixMyStreet::Map::FMS';
+
+use strict;
+
+sub map_type {
+ return '[ [ "", "a-" ], "https://{S}fix.bromley.gov.uk/tilma" ]';
+}
+
+sub map_tile_base {
+ '-', "https://%sfix.bromley.gov.uk/tilma/%d/%d/%d.png";
+}
+
+1;
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm
index 24842c861..b1dd29002 100644
--- a/perllib/FixMyStreet/Map/FMS.pm
+++ b/perllib/FixMyStreet/Map/FMS.pm
@@ -37,23 +37,28 @@ sub get_quadkey {
return $key;
}
+sub map_tile_base {
+ '.', "http://%stilma.mysociety.org/sv/%d/%d/%d.png";
+}
+
sub map_tiles {
my ($self, $x, $y, $z) = @_;
if ($z >= 16) {
+ my ($tile_sep, $tile_base) = $self->map_tile_base;
return [
- "http://a.tilma.mysociety.org/sv/$z/" . ($x-1) . "/" . ($y-1) . ".png",
- "http://b.tilma.mysociety.org/sv/$z/$x/" . ($y-1) . ".png",
- "http://c.tilma.mysociety.org/sv/$z/" . ($x-1) . "/$y.png",
- "http://tilma.mysociety.org/sv/$z/$x/$y.png",
+ sprintf($tile_base, 'a' . $tile_sep, $z, $x-1, $y-1),
+ sprintf($tile_base, 'b' . $tile_sep, $z, $x, $y-1),
+ sprintf($tile_base, 'c' . $tile_sep, $z, $x-1, $y),
+ sprintf($tile_base, '', $z, $x, $y),
];
} else {
my $url = "g=701";
$url .= "&productSet=mmOS" if $z > 10;
return [
- "http://ecn.t0.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y-1, $z) . ".png?$url",
- "http://ecn.t1.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y-1, $z) . ".png?$url",
- "http://ecn.t2.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y, $z) . ".png?$url",
- "http://ecn.t3.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y, $z) . ".png?$url",
+ "//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",
+ "//ecn.t2.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y, $z) . ".png?$url",
+ "//ecn.t3.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y, $z) . ".png?$url",
];
}
}
diff --git a/perllib/FixMyStreet/Map/OSM.pm b/perllib/FixMyStreet/Map/OSM.pm
index 8ca5949d8..119337e37 100644
--- a/perllib/FixMyStreet/Map/OSM.pm
+++ b/perllib/FixMyStreet/Map/OSM.pm
@@ -109,15 +109,9 @@ sub map_pins {
my @pins = map {
# Here we might have a DB::Problem or a DB::Nearby, we always want the problem.
my $p = (ref $_ eq 'FixMyStreet::App::Model::DB::Nearby') ? $_->problem : $_;
- #{
- # latitude => $p->latitude,
- # longitude => $p->longitude,
- # colour => $p->state eq 'fixed' ? 'green' : 'red',
- # id => $p->id,
- # title => $p->title,
- #}
+ my $colour = $c->cobrand->pin_colour( $p, 'around' );
[ $p->latitude, $p->longitude,
- 'yellow', # $p->is_fixed ? 'green' : 'red',
+ $colour,
$p->id, $p->title
]
} @$around_map, @$nearby;