I'm having trouble selecting a feature inside a KML, and wondering if this is even supported.
as a pretty basic example i have:
var vectorSource = new ol.source.Vector({
//url: 'https://developers.google.com/kml/documentation/KML_Samples.kml',
url:'https://openlayers.org/en/latest/examples/data/kml/2012-02-10.kml',
format: new ol.format.KML()
});
var vectorLayer = new ol.layer.Vector({
source: vectorSource
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
vectorLayer
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: {
collapsible: false
}
}),
view: new ol.View({
center: [876970.8463461736, 5859807.853963373],
projection: 'EPSG:3857',
zoom: 10
})
});
var selectClick = new ol.interaction.Select({
condition: ol.events.click
});
map.addInteraction(selectClick);
which you can find running here: https://codepen.io/vishnu4/pen/oQzVVz you'll notice the select action does nothing, where i have a similar geojson example that works fine : https://codepen.io/vishnu4/pen/xQEMjy .
Is this as expected? Or is there a workaround to get this to work so i can select the specific features (placemarks?) inside the KML object?
Just as an aside, I know that getting a feature using forEachFeatureAtPixel works ( https://codepen.io/vishnu4/pen/YRGbyR ) , but I'm looking to use the Select method.