Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

In my OpenLayers web app I have registered an onmousemove event which performs certain functions. What I am really after though is a way to register and handle the user panning or zooming the map.

Any ideas?

Thanks in advance

AM.

share|improve this question

1 Answer

up vote 7 down vote accepted

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...

share|improve this answer
Brilliant! Thanks for your help. – ASPMapper Jun 1 '12 at 10:10
you're welcome. – Aragon Jun 1 '12 at 10:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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