Make modify interaction more robust

When the map has not been rendered yet, adding a feature should not
trigger coordinate related functions as they make use of the framestate.
This commit is contained in:
Guillaume Beraudo
2016-12-07 11:15:23 +01:00
parent 59e802737e
commit 109e6a8324

View File

@@ -198,7 +198,7 @@ ol.interaction.Modify.prototype.addFeature_ = function(feature) {
this.SEGMENT_WRITERS_[geometry.getType()].call(this, feature, geometry);
}
var map = this.getMap();
if (map) {
if (map && map.isRendered()) {
this.handlePointerAtPixel_(this.lastPixel_, map);
}
ol.events.listen(feature, ol.events.EventType.CHANGE,