Hi,
if you take a SelectFeatureControl for each layer, then you are only able to
select features from the upmost layer. If you uncheck the last layer in the
layerswitcher you are able to select features from your first kmllayer.
/**
* Constructor: OpenLayers.Control.SelectFeature
* Create a new control for selecting features.
*
* Parameters:
* layers - {<OpenLayers.Layer.Vector>}, or an array of vector layers.
The
* layer(s) this control will select features from.
* options - {Object}
*/
But you can initialize the SelectFeatureControl with an array of layers
instead of an single layer.
Arnd
_____
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Tom Chance
Gesendet: Samstag, 18. September 2010 13:16
An: [email protected]
Betreff: Re: [OpenLayers-Users] Re: KML layer popups not working as expected
On 18 September 2010 12:11, ChiefDan <[email protected]> wrote:
Well dang, hoped that would be it.
Have you tried flipping the order you add the layers to see if the issue
will then occur in the food layer? If it doesn't perhaps that points to
something going on with the kml file. Although the fact that the icons
appear on the map seems to rule that out.
You're right, if I switch them around so the food layer is added first then
that layer suffers the problem and the power layer functions fine.
I did try breaking the selectControl code out of the function, applying it
manually to each layer and using different variable names for the
selectControl var for each layer. But that didn't help either.
I'm quite surprised that there isn't some standard, easier code to have
popups for a KML layer.
Best,
Tom
I put a break point on the selectfeature callback in firefox and for the
power layer it is not getting called, which is no suprise however I thought
maybe it would point out the function did get called but was crapping out.
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/KML-layer-popups-not-working-as-expec
ted-tp5545420p5545535.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
--
http://tom.acrewoods.net http://twitter.com/tom_chance
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users