user3714967
user3714967

Reputation: 1645

Openlayers 3 stop event propagation

I joined two examples from openlayers examples popup and drawing features. Now i want to stop on map click listener when i'm drawing features, so that popup doesn't show when i'm drawing.

Upvotes: 2

Views: 2235

Answers (1)

tonio
tonio

Reputation: 2376

Unregister your click event when drawing:

var key = map.on('click', function(evt) { … });

// when drawing
map.unByKey(key);

See http://openlayers.org/en/master/apidoc/ol.Object.html#on

Upvotes: 1

Related Questions