Hi,
it's onUnselect and not onUnSelect.
and the argument is the event
function onFeatureSelect(event) {
var feature = event.feature;
function onFeatureUnselect(event) {
var feature = event.feature;
and if you want use
function onPopupClose(evt) {
selectControl.unselect(selectedFeature);
//onFeatureUnselect(selectedFeature);
}
then you must declare selectControl as global variable.
Arnd
_____
Von: Tom Chance [mailto:[email protected]]
Gesendet: Sonntag, 19. September 2010 15:51
An: Arnd Wippermann
Cc: [email protected]
Betreff: Re: [OpenLayers-Users] Re: KML layer popups not working as expected
On 18 September 2010 14:56, Tom Chance <[email protected]> wrote:
On 18 September 2010 13:41, Arnd Wippermann <[email protected]> wrote:
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.
That did the trick, thank you very much for the pointer.
Unfortunately I now have an additional problem. If you click on a marker,
you can close its popup by clicking on the close button. If you click on one
marker and then click on another, the first popup doesn't close, and both
the close buttons affect only the second marker popup.
http://tomchance.dev.openstreetmap.org/london.html
Any help is much appreciated.
Tom
--
http://tom.acrewoods.net http://twitter.com/tom_chance
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users