diff options
Diffstat (limited to 'perllib/FixMyStreet/Map')
-rw-r--r-- | perllib/FixMyStreet/Map/Bromley.pm | 22 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/FMS.pm | 21 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/OSM.pm | 10 |
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; |