Template for the Attribution control.

This allows to add map specific copyright, or copyright required for tools like geocoders that are used in the context of the map.
This commit is contained in:
ahocevar
2012-02-11 12:34:40 +01:00
parent 68a6c62f0b
commit 6385be7ffe
2 changed files with 13 additions and 2 deletions

View File

@@ -24,6 +24,14 @@ OpenLayers.Control.Attribution =
*/
separator: ", ",
/**
* APIProperty: template
* {String} Template for the attribution. This has to include the substring
* "${layers}", which will be replaced by the layer specific
* attributions, separated by <separator>. The default is "${layers}".
*/
template: "${layers}",
/**
* Constructor: OpenLayers.Control.Attribution
*
@@ -86,7 +94,9 @@ OpenLayers.Control.Attribution =
}
}
}
this.div.innerHTML = attributions.join(this.separator);
this.div.innerHTML = OpenLayers.String.format(this.template, {
layers: attributions.join(this.separator)
});
}
},