I am developing GIS Portal using OpenLayers, I use WFS
GetFeature
to retrieve some data like bellow:
var layer = map.getLayersByName("pf_trecho_at");
var polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");
var protocol = new OpenLayers.Protocol.WFS.fromWMSLayer(layer[0], {
url: "/geoserver/wfs",
featurePrefix: 'light',
readFormat: new OpenLayers.Format.GeoJSON(),
outputFormat: "JSON",
extractAttributes: true
});
control = new OpenLayers.Control.GetFeature({
protocol: protocol,
box: true,
hover: true,
multipleKey: "shiftKey",
toggleKey: "ctrlKey"
});
control.events.register("featureselected", this, function(e) {
polygonLayer.addFeatures([e.feature]);
this.displayPopup(e, 'pf_trecho_at');
});
control.events.register("featureunselected", this, function(e) {
polygonLayer.removeFeatures([e.feature]);
});
map.addLayer(polygonLayer);
map.addControl(control);
control.activate();
My doubt is, the selection control draw a rectangle to select the features, is it possible to draw a circle to select then?