The attribution control no longer shows duplicate attribution text. r=crschmidt (closes #2300)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9731 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -23,12 +23,6 @@ OpenLayers.Control.Attribution =
|
||||
*/
|
||||
separator: ", ",
|
||||
|
||||
/**
|
||||
* APIProperty: eliminateDuplicates
|
||||
* {Boolean} shall already present attribution strings be eliminated when other layers have the same attribution string?
|
||||
*/
|
||||
eliminateDuplicates: false,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.Attribution
|
||||
*
|
||||
@@ -87,9 +81,9 @@ OpenLayers.Control.Attribution =
|
||||
for(var i=0, len=this.map.layers.length; i<len; i++) {
|
||||
var layer = this.map.layers[i];
|
||||
if (layer.attribution && layer.getVisibility()) {
|
||||
// add attribution if duplicates shall be ignored generally
|
||||
// or if the current attribution string is unique
|
||||
if (!this.eliminateDuplicates || OpenLayers.Util.indexOf(attributions, layer.attribution) === -1) {
|
||||
// add attribution only if attribution text is unique
|
||||
if (OpenLayers.Util.indexOf(
|
||||
attributions, layer.attribution) === -1) {
|
||||
attributions.push( layer.attribution );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user