[OpenLayers-Dev] Re: when moving/dragging a feature the moveend event has zoomChanged set to true.

Eric Lemoine eric.lemoine at camptocamp.com
Thu Sep 2 15:42:55 EDT 2010


On Thu, Sep 2, 2010 at 7:27 PM, MostlyBaldEagle <MostlyBaldEagle at shaw.ca> wrote:
>
> Yes, see attached html file.
>
> 3 actions
>
> move map -> zoomChanged not set
> zoom in -> zoomChanged is set (correct behavior)
> drag marker -> zoomChanged is set (bug ?)
>
> http://osgeo-org.1803224.n2.nabble.com/file/n5492049/ZoomEventBug.htm
> ZoomEventBug.htm

Your dragComplete listener does vectorLayer.redraw, which triggers
moveend with zoomChanged set to true. My interpretation of the code is
that Layer.redraw is very close to a reset of the layer, so
Layer.redraw set zoomChanged to true just like when the layer is drawn
the first time. To work around the problem you can set/unset a flag
before/after calling vectorLayer.redraw, and check this flag in the
"moveend" listener.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Dev mailing list