From fe35ddba0fab0ebc413300dff0f1f323aec40e9a Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 25 May 2011 14:28:40 +0100 Subject: Make tile URL a parameter so it can be different, bring OSM's StreetView under the same code. --- perllib/FixMyStreet/Map/OSM/StreetView.pm | 40 +++++++------------------------ 1 file changed, 9 insertions(+), 31 deletions(-) (limited to 'perllib/FixMyStreet/Map/OSM/StreetView.pm') diff --git a/perllib/FixMyStreet/Map/OSM/StreetView.pm b/perllib/FixMyStreet/Map/OSM/StreetView.pm index 9512e2013..ba7134c1e 100644 --- a/perllib/FixMyStreet/Map/OSM/StreetView.pm +++ b/perllib/FixMyStreet/Map/OSM/StreetView.pm @@ -7,9 +7,9 @@ # Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ package FixMyStreet::Map::OSM::StreetView; +use base 'FixMyStreet::Map::OSM'; use strict; -use mySociety::Web qw(ent); sub header_js { return ' @@ -19,38 +19,16 @@ sub header_js { '; } -# display_map C PARAMS -# PARAMS include: -# latitude, longitude for the centre point of the map -# TYPE is 1 if the map is clickable, 0 otherwise. -# PINS is array of pins to show, location and colour -sub display_map { - my ($self, $c, %params) = @_; - $params{pre} ||= ''; - - my @pins; - foreach my $pin (@{$params{pins}}) { - $pin->[3] ||= ''; - push @pins, "[ $pin->[0], $pin->[1], '$pin->[2]', '$pin->[3]' ]"; - } - my $pins_js = join(",\n", @pins); +sub map_type { + return '""'; +} - my $out = ''; - my $copyright = _('Map contains Ordnance Survey data © Crown copyright and database right 2010.'); - $out .= < -var fixmystreet = { - 'latitude': $params{latitude}, - 'longitude': $params{longitude}, - 'pins': [ $pins_js ] +sub base_tile_url { + return 'os.openstreetmap.org/sv'; } - -
- $params{pre} -
- -EOF - return $out; + +sub copyright { + return _('Map contains Ordnance Survey data © Crown copyright and database right 2010.'); } 1; -- cgit v1.2.3