handlers have to check if layer exists before destroying it. Thanks pgiraud. (closes #1107)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@5085 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -114,8 +114,14 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
||||
if(this.drawing) {
|
||||
this.cancel();
|
||||
}
|
||||
this.map.removeLayer(this.layer, false);
|
||||
this.layer.destroy();
|
||||
// If a layer's map property is set to null, it means that that layer
|
||||
// isn't added to the map. Since we ourself added the layer to the map
|
||||
// in activate(), we can assume that if this.layer.map is null it means
|
||||
// that the layer has been destroyed (as a result of map.destroy() for
|
||||
// example.
|
||||
if (this.layer.map != null) {
|
||||
this.layer.destroy(false);
|
||||
}
|
||||
this.layer = null;
|
||||
return true;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user