Selección de objetos de mapa usando ol.source.TileWMS en capas abiertas 3
Estoy usando capas abiertas 3, y estoy usando este código para mostrar el 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
});
Estoy usando dragbox para hacer la selección rectangular y cuando hago shift + drag no puedo seleccionar los objetos en el mapa. ¿Puede alguien ayudarme a lograrlo? Este es el código que estoy usando para la selección rectangular.
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(', ');
}
}); `