diff options
-rw-r--r-- | perllib/FixMyStreet/Map/Bing.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/FMS.pm | 5 | ||||
-rw-r--r-- | templates/web/base/maps/fms.html | 2 | ||||
-rw-r--r-- | templates/web/base/maps/openlayers.html | 3 | ||||
-rw-r--r-- | web/js/map-bing-ol.js | 8 | ||||
-rw-r--r-- | web/js/map-fms.js | 12 |
6 files changed, 19 insertions, 13 deletions
diff --git a/perllib/FixMyStreet/Map/Bing.pm b/perllib/FixMyStreet/Map/Bing.pm index 46b8f68cd..4c1887641 100644 --- a/perllib/FixMyStreet/Map/Bing.pm +++ b/perllib/FixMyStreet/Map/Bing.pm @@ -27,7 +27,7 @@ sub get_quadkey { } sub map_tile_base { - '', "//ecn.%s.tiles.virtualearth.net/tiles/r%s.png?g=3293"; + '', "//ecn.%s.tiles.virtualearth.net/tiles/r%s.png?g=3467"; } sub map_tiles { diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index 7e61f334c..50a21c125 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -28,8 +28,9 @@ sub map_tiles { sprintf($tile_base, '', $z, $x, $y), ]; } else { - my $url = "g=3293"; - $url .= "&productSet=mmOS" if $z > 10 && !$ni; + my $key = FixMyStreet->config('BING_MAPS_API_KEY'); + my $url = "g=3467"; + $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", "//ecn.t1.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x, $y-1, $z) . ".png?$url", diff --git a/templates/web/base/maps/fms.html b/templates/web/base/maps/fms.html index d4302e72e..31e050ba1 100644 --- a/templates/web/base/maps/fms.html +++ b/templates/web/base/maps/fms.html @@ -10,4 +10,4 @@ <![endif]--> [% END %] -[% map_html = INCLUDE maps/openlayers.html %] +[% map_html = INCLUDE maps/openlayers.html include_key = 1 %] diff --git a/templates/web/base/maps/openlayers.html b/templates/web/base/maps/openlayers.html index 48eb896e8..27c71f42f 100644 --- a/templates/web/base/maps/openlayers.html +++ b/templates/web/base/maps/openlayers.html @@ -22,6 +22,9 @@ var fixmystreet = { 'numZoomLevels': [% map.numZoomLevels %], 'zoomOffset': [% map.zoomOffset %], 'map_type': [% map.map_type %], +[% IF include_key -%] + 'key': '[% c.config.BING_MAPS_API_KEY %]', +[%- END %] 'pins': [% INCLUDE maps/pins_js.html %] } </script> diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 9406997f9..9b0a73fb8 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -105,10 +105,10 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { get_urls: function(bounds, z) { return [ - "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=3293", - "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=3293", - "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=3293", - "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=3293" + "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=3467", + "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=3467", + "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=3467", + "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=3467" ]; }, diff --git a/web/js/map-fms.js b/web/js/map-fms.js index 1c08bd251..6ef4265d0 100644 --- a/web/js/map-fms.js +++ b/web/js/map-fms.js @@ -59,12 +59,14 @@ OpenLayers.Layer.BingUK = OpenLayers.Class(OpenLayers.Layer.Bing, { } } else { var type = ''; - if (z > 10 && in_uk) { type = '&productSet=mmOS'; } + if (z > 10 && in_uk) { + type = '&productSet=mmOS&key=' + fixmystreet.key; + } urls = [ - "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=3293" + type, - "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=3293" + type, - "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=3293" + type, - "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=3293" + type + "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=3467" + type, + "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=3467" + type, + "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=3467" + type, + "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=3467" + type ]; } return urls; |