Changeset 3329
- Timestamp:
- 06/14/07 15:18:57 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (1 diff)
- trunk/openlayers/tests/test_Map.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Map.js
r3323 r3329 622 622 * viewPort (assuming the control was not added outsideViewport) 623 623 * 624 * @param { String} id ID of thecontrol to remove624 * @param {OpenLayers.Control} control control to remove 625 625 */ 626 removeControl: function ( id) {627 var control = this.getControl(id);628 if ( control) {626 removeControl: function (control) { 627 //make sure control is non-null and actually part of our map 628 if ( (control) && (control == this.getControl(control.id)) ) { 629 629 if (!control.outsideViewport) { 630 630 this.viewPortDiv.removeChild(control.div) trunk/openlayers/tests/test_Map.html
r3282 r3329 432 432 433 433 //remove control 434 map1.removeControl(control .id)434 map1.removeControl(control) 435 435 newNumControls = map1.controls.length; 436 436 t.ok( newNumControls == oldNumControls, "removing the control decreases control count") … … 449 449 450 450 //remove bogus 451 map1.removeControl("bogus id"); 451 control = { id: "bogus id" }; 452 map1.removeControl(control); 452 453 newNumControls = map1.controls.length; 453 454 t.ok( newNumControls == oldNumControls, "removing bad controlid doesnt crash or decrease control count")
