Make the Modify interaction more robust
This prevents a JavaScript error when features are added while the interaction does not have a map.
This commit is contained in:
@@ -156,7 +156,10 @@ ol.interaction.Modify.prototype.addFeature_ = function(evt) {
|
|||||||
if (goog.isDef(this.SEGMENT_WRITERS_[geometry.getType()])) {
|
if (goog.isDef(this.SEGMENT_WRITERS_[geometry.getType()])) {
|
||||||
this.SEGMENT_WRITERS_[geometry.getType()].call(this, feature, geometry);
|
this.SEGMENT_WRITERS_[geometry.getType()].call(this, feature, geometry);
|
||||||
}
|
}
|
||||||
this.handlePointerAtPixel_(this.lastPixel_, this.getMap());
|
var map = this.getMap();
|
||||||
|
if (!goog.isNull(map)) {
|
||||||
|
this.handlePointerAtPixel_(this.lastPixel_, map);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user