Selecionando objetos de mapa usando ol.source.TileWMS em camadas abertas 3
Estou usando as camadas abertas 3 e estou usando este código para exibir o mapa:
wmsSource = new ol.source.TileWMS({
url: 'http://demo.boundlessgeo.com/geoserver/wms',
params: { 'LAYERS': 'ne:ne' },
serverType: 'geoserver',
crossOrigin: ''
});
var wmsLayer = new ol.layer.Tile({
source: wmsSource
});
Estou usando o dragbox para fazer a seleção retangular e, quando faço o shift + arrastar, não consigo selecionar os objetos no mapa. Alguém por favor pode me ajudar em como conseguir isso? Este é o código que estou usando para a seleção retangular.
dragBox.on('boxend', function(e) {
// features that intersect the box are added to the collection of
// selected features, and their names are displayed in the "info"
// div
var info = [];
var extent = dragBox.getGeometry().getExtent();
wmsSource .forEachFeatureIntersectingExtent(extent, function(feature) {
selectedFeatures.push(feature);
info.push(feature.get('name'));
});
if (info.length > 0) {
infoBox.innerHTML = info.join(', ');
}
}); `