I have found this Question for capturing mouse movement on the map, but I'm not using python for this project, I use openlayers3.

I would like someone to explain to me how can I capture mouse movement on the map with openlayers3, basically map will follow users interaction whit the map. Here is a JSFIDDLE example of the map.


Listen for pointermove event on map object:

map.on('pointermove', function(evt) {
    // When user was dragging map, then coordinates didn't change and there's
    // no need to continue
    if (evt.dragging) {
    // You can access coordinates from evt.coordinate now

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.