Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw interaction does not work as expect when there is a select interaction #4114

Closed
bartvde opened this issue Sep 15, 2015 · 4 comments
Closed

Comments

@bartvde
Copy link
Member

bartvde commented Sep 15, 2015

diff --git a/examples/draw-features.js b/examples/draw-features.js
index b7cb4ce..5f13bae 100644
--- a/examples/draw-features.js
+++ b/examples/draw-features.js
@@ -2,6 +2,7 @@ goog.require('ol.Map');
 goog.require('ol.View');
 goog.require('ol.geom.Polygon');
 goog.require('ol.interaction.Draw');
+goog.require('ol.interaction.Select');
 goog.require('ol.layer.Tile');
 goog.require('ol.layer.Vector');
 goog.require('ol.source.MapQuest');
@@ -46,6 +47,8 @@ var map = new ol.Map({
   })
 });

+map.addInteraction(new ol.interaction.Select());
+
 var typeSelect = document.getElementById('type');

 var draw; // global so we can remove it later

screen shot 2015-09-15 at 19 26 23

Is there an obvious reason why this combination of interactions should be avoided?

@bartvde
Copy link
Member Author

bartvde commented Sep 15, 2015

Also, this does not happen if the layer is unmanaged. If the layer is managed, you can see the above effect.

@bartvde
Copy link
Member Author

bartvde commented Sep 28, 2015

This line is causing the observed behaviour: https://github.com/openlayers/ol3/blob/master/src/ol/interaction/selectinteraction.js#L257

@bartvde
Copy link
Member Author

bartvde commented Nov 7, 2015

In the end I made sure in my application I did not have these two interactions active at the same time. Workaround though.

@ahocevar
Copy link
Member

ahocevar commented Nov 7, 2015

Can you reference the faulty line in selectinteraction.js for the revision in question instead of master? The line on master is a JSDoc comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants