Changeset 4237
- Timestamp:
- 09/12/07 09:40:28 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Control/Attribution.js
r4231 r4237 17 17 * {String} String used to seperate layers. 18 18 */ 19 sep erator: ", ",19 separator: ", ", 20 20 21 21 /** … … 37 37 this.map.events.unregister("addlayer", this, this.updateAttribution); 38 38 this.map.events.unregister("changelayer", this, this.updateAttribution); 39 this.map.events.unregister("changebaselayer", this, this.updateAttribution); 39 40 40 41 OpenLayers.Control.prototype.destroy.apply(this, arguments); … … 51 52 OpenLayers.Control.prototype.draw.apply(this, arguments); 52 53 54 this.map.events.register('changebaselayer', this, this.updateAttribution); 53 55 this.map.events.register('changelayer', this, this.updateAttribution); 54 56 this.map.events.register('addlayer', this, this.updateAttribution); … … 71 73 } 72 74 } 73 this.div.innerHTML = attributions.join(this.sep erator);75 this.div.innerHTML = attributions.join(this.separator); 74 76 }, 75 77 trunk/openlayers/tests/Control/test_Attribution.html
r4231 r4237 11 11 t.eq( control.displayClass, "olControlAttribution", "displayClass is correct" ); 12 12 } 13 function test_Control_Attribution_setBaseLayer (t) { 14 t.plan(1); 15 map = new OpenLayers.Map("map"); 16 map.addControl(control); 17 map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer!', isBaseLayer: true})); 18 map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer 2!', isBaseLayer: true})); 19 map.setBaseLayer(map.layers[1]); 20 t.eq(control.div.innerHTML, 'My layer 2!', "Attribution correct with changed base layer"); 21 22 } 13 23 function test_Control_Attribution_draw (t) { 14 24 t.plan(3); … … 20 30 map.addLayer(new OpenLayers.Layer("name", {'attribution':'My layer 2!'})); 21 31 t.eq(control.div.innerHTML, 'My layer!, My layer 2!', "Attribution correct with two layers."); 22 control.sep erator = '|';32 control.separator = '|'; 23 33 map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer 3!'})); 24 34 t.eq(control.div.innerHTML, 'My layer!|My layer 2!|My layer 3!', "Attribution correct with three layers and diff seperator."); 35 36 25 37 } 26 38 // -->
