[OpenLayers-Users] SelectFeature on click problem

Brad Spencer brad at cubewerx.com.au
Wed Aug 26 20:09:24 EDT 2009


List,

 

I have been struggling with a SelectFeature on a vector layer. I create the
layers quite OK but am having trouble getting my popup to work on a mouse
click on feature.

 

My code snippet..

 

// pointFeature is the array of sorted point objects to be added as vector
markers

                userMarkers.addFeatures(filteredPoints);


                map.addLayer(userMarkers);

                

//Create a select feature control and add it to the map.

                 selectControl = new
OpenLayers.Control.SelectFeature(userMarkers, 

                                {              

                                                //hover: true

                                                onSelect: onFeatureSelect 

                                                ,onUnselect:
onFeatureUnselect

                                });

 

                map.addControl(selectControl);

                selectControl.activate();

 

When I run this code it will NOT trigger the onFeatureSelect function but if
I set hover: true it does launch the function. 

 

Can anyone see a problem with this - I am using 2.8

 

Cheers, Brad

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090827/1c27f5cb/attachment.html


More information about the Users mailing list