aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Map')
-rw-r--r--perllib/FixMyStreet/Map/Angus.pm18
-rw-r--r--perllib/FixMyStreet/Map/Bing.pm8
-rw-r--r--perllib/FixMyStreet/Map/Bristol.pm17
-rw-r--r--perllib/FixMyStreet/Map/Bromley.pm8
-rw-r--r--perllib/FixMyStreet/Map/FMS.pm9
-rw-r--r--perllib/FixMyStreet/Map/Google.pm5
-rw-r--r--perllib/FixMyStreet/Map/GoogleOL.pm12
-rw-r--r--perllib/FixMyStreet/Map/OSM.pm6
-rw-r--r--perllib/FixMyStreet/Map/OSM/MapQuest.pm2
-rw-r--r--perllib/FixMyStreet/Map/OSM/StreetView.pm6
-rw-r--r--perllib/FixMyStreet/Map/OSM/TonerLite.pm7
-rw-r--r--perllib/FixMyStreet/Map/Zurich.pm15
12 files changed, 93 insertions, 20 deletions
diff --git a/perllib/FixMyStreet/Map/Angus.pm b/perllib/FixMyStreet/Map/Angus.pm
new file mode 100644
index 000000000..98f5373c1
--- /dev/null
+++ b/perllib/FixMyStreet/Map/Angus.pm
@@ -0,0 +1,18 @@
+# FixMyStreet:Map::Angus
+# More JavaScript, for street assets
+
+package FixMyStreet::Map::Angus;
+use base 'FixMyStreet::Map::FMS';
+
+use strict;
+
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.angus.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-bing-ol.js',
+ '/js/map-fms.js',
+ '/cobrands/fixmystreet/assets.js',
+ '/cobrands/angus/js.js',
+] }
+
+1;
diff --git a/perllib/FixMyStreet/Map/Bing.pm b/perllib/FixMyStreet/Map/Bing.pm
index 617823b45..68c9fea32 100644
--- a/perllib/FixMyStreet/Map/Bing.pm
+++ b/perllib/FixMyStreet/Map/Bing.pm
@@ -8,7 +8,11 @@ use strict;
sub map_type { '' }
-sub map_template { 'bing' }
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.fixmystreet.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-bing-ol.js',
+] }
sub copyright { '' }
@@ -26,7 +30,7 @@ sub get_quadkey {
}
sub map_tile_base {
- '', "//ecn.%s.tiles.virtualearth.net/tiles/r%s.png?g=3467";
+ '', "//ecn.%s.tiles.virtualearth.net/tiles/r%s.png?g=5941";
}
sub map_tiles {
diff --git a/perllib/FixMyStreet/Map/Bristol.pm b/perllib/FixMyStreet/Map/Bristol.pm
index c2925ff8d..5d05fbd34 100644
--- a/perllib/FixMyStreet/Map/Bristol.pm
+++ b/perllib/FixMyStreet/Map/Bristol.pm
@@ -30,12 +30,8 @@ sub tile_parameters {
dpi => 96,
inches_per_unit => 39.3701, # BNG uses metres
projection => 'EPSG:27700',
- # The original tile origin values from the getCapabilities call are
- # -5220400.0/4470200.0, but this results in the map tile being offset
- # slightly. These corrected values were figured out manually by
- # trial and error...
- origin_x => -5220385.5,
- origin_y => 4470189.0,
+ origin_x => -5220400.0,
+ origin_y => 4470200.0,
};
return $params;
}
@@ -62,6 +58,15 @@ sub copyright {
sub map_template { 'bristol' }
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.bristol.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-wmts-base.js',
+ '/js/map-wmts-bristol.js',
+ '/cobrands/fixmystreet/assets.js',
+ '/cobrands/bristol/js.js',
+] }
+
# Reproject a WGS84 lat/lon into BNG easting/northing
sub reproject_from_latlon($$$) {
my ($self, $lat, $lon) = @_;
diff --git a/perllib/FixMyStreet/Map/Bromley.pm b/perllib/FixMyStreet/Map/Bromley.pm
index 0cd36a2ac..1310c2a5a 100644
--- a/perllib/FixMyStreet/Map/Bromley.pm
+++ b/perllib/FixMyStreet/Map/Bromley.pm
@@ -9,7 +9,13 @@ use base 'FixMyStreet::Map::FMS';
use strict;
-sub map_template { 'bromley' }
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.fixmystreet.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-bing-ol.js',
+ '/js/map-fms.js',
+ '/cobrands/bromley/map.js',
+] }
sub map_tile_base {
'-', "https://%sfix.bromley.gov.uk/tilma/%d/%d/%d.png";
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm
index 50a21c125..13c7f9d87 100644
--- a/perllib/FixMyStreet/Map/FMS.pm
+++ b/perllib/FixMyStreet/Map/FMS.pm
@@ -11,6 +11,13 @@ use strict;
sub map_template { 'fms' }
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.fixmystreet.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-bing-ol.js',
+ '/js/map-fms.js',
+] }
+
sub map_tile_base {
'-', "//%stilma.mysociety.org/sv/%d/%d/%d.png";
}
@@ -29,7 +36,7 @@ sub map_tiles {
];
} else {
my $key = FixMyStreet->config('BING_MAPS_API_KEY');
- my $url = "g=3467";
+ my $url = "g=5941";
$url .= "&productSet=mmOS&key=$key" if $z > 10 && !$ni;
return [
"//ecn.t0.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x-1, $y-1, $z) . ".png?$url",
diff --git a/perllib/FixMyStreet/Map/Google.pm b/perllib/FixMyStreet/Map/Google.pm
index 8ddf4f4e9..f40eff167 100644
--- a/perllib/FixMyStreet/Map/Google.pm
+++ b/perllib/FixMyStreet/Map/Google.pm
@@ -13,6 +13,11 @@ use Utils;
use constant ZOOM_LEVELS => 6;
use constant MIN_ZOOM_LEVEL => 13;
+sub map_javascript { [
+ "http://maps.googleapis.com/maps/api/js?sensor=false",
+ '/js/map-google.js',
+] }
+
# display_map C PARAMS
# PARAMS include:
# latitude, longitude for the centre point of the map
diff --git a/perllib/FixMyStreet/Map/GoogleOL.pm b/perllib/FixMyStreet/Map/GoogleOL.pm
index 55032d707..44d0e77e7 100644
--- a/perllib/FixMyStreet/Map/GoogleOL.pm
+++ b/perllib/FixMyStreet/Map/GoogleOL.pm
@@ -13,4 +13,16 @@ sub map_type { '' }
sub map_template { 'google-ol' }
+sub map_javascript {
+ my $google_maps_url = "https://maps.googleapis.com/maps/api/js?v=3";
+ my $key = FixMyStreet->config('GOOGLE_MAPS_API_KEY');
+ $google_maps_url .= "&key=$key" if $key;
+ [
+ $google_maps_url,
+ '/vendor/OpenLayers/OpenLayers.google.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-google-ol.js',
+ ]
+}
+
1;
diff --git a/perllib/FixMyStreet/Map/OSM.pm b/perllib/FixMyStreet/Map/OSM.pm
index 76af99d36..47d6eeee7 100644
--- a/perllib/FixMyStreet/Map/OSM.pm
+++ b/perllib/FixMyStreet/Map/OSM.pm
@@ -18,6 +18,12 @@ sub map_type { 'OpenLayers.Layer.OSM.Mapnik' }
sub map_template { 'osm' }
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.fixmystreet.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-OpenStreetMap.js',
+] }
+
sub map_tiles {
my ( $self, %params ) = @_;
my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} );
diff --git a/perllib/FixMyStreet/Map/OSM/MapQuest.pm b/perllib/FixMyStreet/Map/OSM/MapQuest.pm
index ac80e61b5..8b24e1ba2 100644
--- a/perllib/FixMyStreet/Map/OSM/MapQuest.pm
+++ b/perllib/FixMyStreet/Map/OSM/MapQuest.pm
@@ -11,8 +11,6 @@ use strict;
sub map_type { 'OpenLayers.Layer.OSM.MapQuestOpen' }
-sub map_template { 'mapquest-attribution' }
-
sub map_tiles {
my ( $self, %params ) = @_;
my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} );
diff --git a/perllib/FixMyStreet/Map/OSM/StreetView.pm b/perllib/FixMyStreet/Map/OSM/StreetView.pm
index 12fbdb19d..3281faa35 100644
--- a/perllib/FixMyStreet/Map/OSM/StreetView.pm
+++ b/perllib/FixMyStreet/Map/OSM/StreetView.pm
@@ -11,7 +11,11 @@ use strict;
sub map_type { '' }
-sub map_template { 'osm-streetview' }
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.fixmystreet.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-streetview.js',
+] }
sub base_tile_url {
return 'os.openstreetmap.org/sv';
diff --git a/perllib/FixMyStreet/Map/OSM/TonerLite.pm b/perllib/FixMyStreet/Map/OSM/TonerLite.pm
index b0d12c453..b50611f3d 100644
--- a/perllib/FixMyStreet/Map/OSM/TonerLite.pm
+++ b/perllib/FixMyStreet/Map/OSM/TonerLite.pm
@@ -16,7 +16,12 @@ use strict;
sub map_type { 'OpenLayers.Layer.Stamen' }
-sub map_template { 'osm-toner-lite' }
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.fixmystreet.js',
+ "https://stamen-maps.a.ssl.fastly.net/js/tile.stamen.js?v1.3.0",
+ '/js/map-OpenLayers.js',
+ '/js/map-toner-lite.js',
+] }
sub copyright {
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.'
diff --git a/perllib/FixMyStreet/Map/Zurich.pm b/perllib/FixMyStreet/Map/Zurich.pm
index ed68daeee..8b4a3d931 100644
--- a/perllib/FixMyStreet/Map/Zurich.pm
+++ b/perllib/FixMyStreet/Map/Zurich.pm
@@ -34,12 +34,8 @@ sub tile_parameters {
dpi => 96,
inches_per_unit => 39.3701, # BNG uses metres
projection => 'EPSG:2056',
- # The original tile origin values from the getCapabilities call are
- # -27386400.0/31814500.0, but this results in the map tile being offset
- # slightly. These corrected values were figured out manually by
- # trial and error...
- origin_x => -27386322.5,
- origin_y => 31814423.0,
+ origin_x => -27386400.0,
+ origin_y => 31814500.0,
};
return $params;
}
@@ -69,6 +65,13 @@ sub copyright {
sub map_template { 'zurich' }
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.zurich.js',
+ '/js/OpenLayers.Projection.CH1903Plus.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-wmts-base.js',
+ '/js/map-wmts-zurich.js',
+] }
# Reproject a WGS84 lat/lon into Swiss easting/northing
sub reproject_from_latlon($$$) {