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:
Tim Schaub
2009-10-08 17:00:40 +00:00
parent ab2b2356f1
commit bff91d251c
3 changed files with 10 additions and 98 deletions

View File

@@ -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 );
}
}