Is there a On Map Move event in OpenLayers?
In OpenLayers 2 you can do with the same method:
map.events.register(type, obj, listener);
movestart triggered after the start of a drag, pan, or zoom
move triggered after each drag, pan, or zoom
moveend triggered after a drag, pan, or zoom completes
zoomend triggered after a zoom completes
example code:
map.events.register("move", map, function() {
console.log("panning");
});
i hope it helps you...
In OpenLayers 3 you have moveend
, an ol.MapEvent
triggered by the map itselft. Use it this way:
map.on("moveend", function(e){
// event actions
});
This event is triggered in many ways, after click
or dblclick
ol.MapBrowserEvent
events.
Hope it helps.