Hello!

Although the OpenLayers documentation gets a lot of critisicm, I think it is 
quite clear in this aspect: 

http://dev.openlayers.org/releases/OpenLayers-2.11/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.EVENT_TYPES

"moveend: triggered after a drag, pan, or zoom completes"

So, register for the moveend-event only, and you should be good to go. 

(So can others discuss how intuitive the name "moveend" is for the case of both 
zoom,drag and pan)

-Atle Sveen

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Puneet Kishor
Sent: 7. februar 2012 05:43
To: [email protected]
Subject: [OpenLayers-Users] fire an event only once on either zoomend or moveend

I want to have an event fire only once on zoomend or on moveend.

If I do

        "eventListeners": {
                    "zoomend": mapEvent
                }

it fires only when I zoom in or out. On the other hand, if I do

        "eventListeners": {
                    "moveend": mapEvent,
                    "zoomend": mapEvent
                }


then while it fires only once on panning the map, it fires twice on zoom in or 
out. How can I make it so it fires only once whether it is moveend or zoomend?

--
Puneet Kishor _______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to