[OpenLayers-Users] Re: Box from GetFeature control,
can this be polygon?
MTrottier
marcandre_trottier at hotmail.com
Wed Nov 23 10:13:08 EST 2011
i'm moving foward !
i'm doing my polygon, the request is sent, i got a response and i can define
my callback
with the help of naresh n, i'm doing something like this :
Hello MTrottier,
To get polygon intersetced area, defind polygon handler in
OpenLayers.control.GetFeature as follows.
The follwoing is rough code which you can add in
OpenLayers.Control.GetFeature
if (this.poly) {
this.handlers.poly = new OpenLayers.Handler.Polygon(this, {
done: this.selectPoly
}, OpenLayers.Util.extend(this.handlerOptions.poly, {
polyDivClassName: "olHandlerPolygonSelectFeature"
}))
}
selectPoly: function (a) {
var b;
this.modifiers = {
multiple: this.multiple,
toggle: this.toggle
};
this.polygon = a;
b = a.getBounds();
this.setModifiers(this.handlers.poly.evt);
this.request(b, {
poly: this.poly
})
},
you need to add select feature function in existing request function i.e.
you need to use geometry intersect function.
Thanks&Regards,
unfortunately, the prototype on initialize (getfeature.js) not working :
OpenLayers.Control.GetFeature.prototype.initialize = function(options) {
....
is it possible ?
i need to modify "GetFeature.js" directly to take effects
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Box-from-GetFeature-control-can-this-be-polygon-tp6265591p7024678.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list