OpenLayers .containsPoint after pan
Posted
by Adrian
on Stack Overflow
See other posts from Stack Overflow
or by Adrian
Published on 2009-04-29T12:49:07Z
Indexed on
2010/04/06
3:53 UTC
Read the original article
Hit count: 374
openlayers
I've seem to have hit a bug or i have overlooked something.
I written some code that enumerates through all the vector features on a OpenLayers Vector layer - to check if the mouse is inside a vector feature - if so then it displays some info based on the feature.
I had to write my own methods to do this because the existing OpenLayers Controls( select etc) stop after finding a feature under the mouse, and i the possibility of several features being stacked on top of one another.
My problem is that the .containsPoint method seems to be using coords from before a 'pan'. After zooming in or out the geometry seems to be in the right place and .containsPoint is works correctly when I wave the mouse over the map.
Do I need to do something after the map has been panned to update something( feature's geometry)
© Stack Overflow or respective owner