2

I want to navigate the map using mouse drag. we did it in openlayers2 using navigator control. Does Openlayers 3 have navigation control? should I add it to map like Openlayers 2?

  • Have you looked at the OpenLayers 3 examples? In particular, openlayers.org/en/master/examples/drag-rotate-and-zoom.html – BradHards Nov 11 '14 at 10:19
  • Yes I did, I use the same structure but I cannot drag the map. Maybe i forget to set anything, for that I need to know what control is responsible for map navigatition – Mariam Malak Nov 11 '14 at 10:25
  • It works in the example, and you have the source code for that example linked off the example page at openlayers.org/en/master/examples/drag-rotate-and-zoom.js. Perhaps you need to post a small, self-contained example showing what you are doing? – BradHards Nov 11 '14 at 10:28
  • 1
    I found the problem, I added ol.interaction.Select({condition:ol.events.condition.mouseMove}) which prevents map dragging – Mariam Malak Nov 11 '14 at 10:33
  • 1
    Some people tend to avoid reading comments when searching for solutions so could you post your comments as an answer please (and accept it after 2 days)? – Joseph Nov 11 '14 at 12:06
1

I found the problem, I added ol.interaction.Select({condition:ol.events.condition.mouseMove}) which prevents map dragging.

The vector-layer.html example solves navigation issue with mouseover interaction

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.