aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-04-04 12:28:34 +0100
committerDave Arter <davea@mysociety.org>2018-04-10 10:42:34 +0100
commitf94eb50f9a33e89364f674da3d0af2fb329947b0 (patch)
treed65abc41ff6fd358c36752dc4d5be637db405883 /web
parent68a5ed303f0c74b4ed784bf98930499857e52017 (diff)
Add layer attribution to attribution control
If a layer has an attribution option then add it to the attribution control when the layer becomes visible.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/assets.js3
-rw-r--r--web/js/map-OpenStreetMap.js1
2 files changed, 4 insertions, 0 deletions
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js
index 6c64bb922..57c82a46b 100644
--- a/web/cobrands/fixmystreet/assets.js
+++ b/web/cobrands/fixmystreet/assets.js
@@ -475,6 +475,9 @@ fixmystreet.assets = {
styleMap: options.stylemap || get_asset_stylemap(),
assets: true
};
+ if (options.attribution !== undefined) {
+ layer_options.attribution = options.attribution;
+ }
if (options.srsName !== undefined) {
layer_options.projection = new OpenLayers.Projection(options.srsName);
} else if (fixmystreet.wmts_config) {
diff --git a/web/js/map-OpenStreetMap.js b/web/js/map-OpenStreetMap.js
index a742e61ba..4165f8ee4 100644
--- a/web/js/map-OpenStreetMap.js
+++ b/web/js/map-OpenStreetMap.js
@@ -5,6 +5,7 @@ fixmystreet.maps.config = function() {
}
fixmystreet.controls = [
new OpenLayers.Control.ArgParser(),
+ new OpenLayers.Control.Attribution(),
//new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PermalinkFMS(permalink_id),