Only call addToDrawing if sketchFeature

This commit is contained in:
Bart van den Eijnden
2016-08-23 18:05:06 +02:00
parent 2d65ffb8ab
commit 3118df320b

View File

@@ -346,7 +346,7 @@ ol.interaction.Draw.handleEvent = function(mapBrowserEvent) {
}
var pass = !this.freehand_;
if (this.freehand_ &&
mapBrowserEvent.type === ol.MapBrowserEvent.EventType.POINTERDRAG) {
mapBrowserEvent.type === ol.MapBrowserEvent.EventType.POINTERDRAG && this.sketchFeature_ !== null) {
this.addToDrawing_(mapBrowserEvent);
pass = false;
} else if (mapBrowserEvent.type ===