[OpenLayers-Users] Intermittent selectfeature "onfeatureselected" Firefox only.

Mike K. poseidon3182 at gmail.com
Wed Sep 28 10:18:38 EDT 2011


Hi,

I am running into a very weird (for me) issue that seems to effect Firefox
(3.6 and 5), but not IE (7,8):

I created a vector layer, enabled layer events (featureselected,
featureunselected), created and activated control with that layer added.  

The way the layer gets populated is an Ajax call (jquery), where the success
function goes through each feature, extracts relevant data, creates geometry
and feature and then adds it to an array.  The last thing the function does
is add the array of features to the vector layer.

The selectfeature function is supposed to create a popup with feature
attributes.

The weird part comes in when I was testing the code.  Almost randomly, if I
click on a feature, some of them will show a popup, and some do not.  I have
narrowed it down (made return only 2 features) to where I can see that 1
feature will consistently not respond to selection (the event doesn't even
go off), while the 2nd one consistently will, but I don't see any difference
between them.  If the data was bad, it shouldn't have appeared on the map in
the first place.  What's more, is that it's a consistently a Firefox issue,
and works perfectly in IE.  When I use firebug to programatically select a
feature using the console, it works just fine as well.

This is definitely an issue when I am loading features "manually" since when
I get similar data as a "proper" GeoJSON and let OpenLayers parse it,
everything is good.

Sorry I couldn't provide actual code examples, they are on a different
system.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Intermittent-selectfeature-onfeatureselected-Firefox-only-tp6840365p6840365.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list