diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/css/core.scss | 1 | ||||
-rw-r--r-- | web/js/map-bing-ol.js | 30 | ||||
-rw-r--r-- | web/js/map-streetview.js | 2 |
3 files changed, 31 insertions, 2 deletions
diff --git a/web/css/core.scss b/web/css/core.scss index 6186f8965..17bf4e6c2 100644 --- a/web/css/core.scss +++ b/web/css/core.scss @@ -538,6 +538,7 @@ $map_width: 500px; .olControlAttribution { bottom: 3px !important; left: 3px; + color: #222222; } .olControlPermalink { bottom: 3px !important; diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 032ac1e89..391f837c6 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -4,14 +4,40 @@ function set_map_config(perm) { new OpenLayers.Control.ArgParser(), new OpenLayers.Control.Navigation(), perm, + //new OpenLayers.Control.ZoomPanel() new OpenLayers.Control.PanZoomFMS() ]; fixmystreet.map_type = OpenLayers.Layer.Bing; } OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { - attribution: '<a href="http://www.bing.com/maps/">' + - '<img border=0 src="http://dev.virtualearth.net/Branding/logo_powered_by.png"></a>', + attributionTemplate: '${logo}${copyrights}', + + setMap: function() { + OpenLayers.Layer.XYZ.prototype.setMap.apply(this, arguments); + this.updateAttribution(); + this.map.events.register("moveend", this, this.updateAttribution); + }, + + updateAttribution: function() { + var z = this.map.getZoom() + this.zoomOffset; + var copyrights; + var logo = ''; + if (z >= 16) { + copyrights = 'Contains Ordnance Survey data © Crown copyright and database right 2010'; + } else { + logo = '<a href="http://www.bing.com/maps/"><img border=0 src="http://dev.virtualearth.net/Branding/logo_powered_by.png"></a>'; + copyrights = '© 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. © AND, Navteq, Ordnance Survey'; + } + this.attribution = OpenLayers.String.format(this.attributionTemplate, { + logo: logo, + copyrights: copyrights + }); + this.map && this.map.events.triggerEvent("changelayer", { + layer: this, + property: "attribution" + }); + }, initialize: function(name, options) { var url = []; diff --git a/web/js/map-streetview.js b/web/js/map-streetview.js index cfd595b95..99fdca983 100644 --- a/web/js/map-streetview.js +++ b/web/js/map-streetview.js @@ -44,6 +44,8 @@ OpenLayers.Util.onImageLoadError = function() { * - <OpenLayers.Layer.XYZ> */ OpenLayers.Layer.StreetView = OpenLayers.Class(OpenLayers.Layer.XYZ, { + attribution: 'Map contains Ordnance Survey data © Crown copyright and database right 2010.', + /** * Constructor: OpenLayers.Layer.StreetView * |