aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map/OSM/StreetView.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-05-25 14:28:40 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-05-25 14:28:40 +0100
commitfe35ddba0fab0ebc413300dff0f1f323aec40e9a (patch)
tree00e7253bf8f6fa6e399a857450b31fe4b3d1bf12 /perllib/FixMyStreet/Map/OSM/StreetView.pm
parent34296c409fe2ab9f02e5aeb14100570a8fb68dea (diff)
Make tile URL a parameter so it can be different, bring OSM's StreetView under the same code.
Diffstat (limited to 'perllib/FixMyStreet/Map/OSM/StreetView.pm')
-rw-r--r--perllib/FixMyStreet/Map/OSM/StreetView.pm40
1 files changed, 9 insertions, 31 deletions
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 &copy; Crown copyright and database right 2010.');
- $out .= <<EOF;
-<script type="text/javascript">
-var fixmystreet = {
- 'latitude': $params{latitude},
- 'longitude': $params{longitude},
- 'pins': [ $pins_js ]
+sub base_tile_url {
+ return 'os.openstreetmap.org/sv';
}
-</script>
-<div id="map_box">
- $params{pre}
- <div id="map"></div>
- <p id="copyright">$copyright</p>
-EOF
- return $out;
+
+sub copyright {
+ return _('Map contains Ordnance Survey data &copy; Crown copyright and database right 2010.');
}
1;