Re: [OpenLayers-Users] DrawFeature with callback?

2008-12-08 Thread Nino Saturnino Martinez Vazquez Wael
Hi Adorian Thanks it worked :) Adorian Ardelean wrote: Hi Nino, This works ok for me: dosomething = function (feature) { //do something with polygon alert(yeeehaaa); }; controls = { polygon: new OpenLayers.Control.DrawFeature(regions,OpenLayers.Handler.Polygon,

Re: [OpenLayers-Users] DrawFeature with callback?

2008-12-08 Thread Nino Saturnino Martinez Vazquez Wael
Hi again What if you want todo the exact same thing with the editing toolbar? map.addControl(new OpenLayers.Control.EditingToolbar(vectors,OpenLayers.Handler.Polygon,{'featureAdded': serialize})); Does not work... Adorian Ardelean wrote: Hi Nino, This works ok for me:

Re: [OpenLayers-Users] DrawFeature with callback?

2008-12-08 Thread Nino Saturnino Martinez Vazquez Wael
. Arnd Wippermann -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Nino Saturnino Martinez Vazquez Wael Gesendet: Freitag, 5. Dezember 2008 14:03 An: Adorian Ardelean Cc: users@openlayers.org Betreff: Re: [OpenLayers-Users] DrawFeature

Re: [OpenLayers-Users] DrawFeature with callback?

2008-12-08 Thread Eric Lemoine
Hi var e = new OpenLayers.Control.EditingToolbar(...); for(var i = 0; ie.controls.length; i++) { var c = e.controls[i]; c.events.on({ featureadded: functio(e) { alert(e.feature); } }); } Untested. Cheers, Eric 2008/12/8, Nino Saturnino Martinez Vazquez

Re: [OpenLayers-Users] DrawFeature with callback?

2008-12-08 Thread Nino Saturnino Martinez Vazquez Wael
Thanks it worked as well :) Eric Lemoine wrote: Hi var e = new OpenLayers.Control.EditingToolbar(...); for(var i = 0; ie.controls.length; i++) { var c = e.controls[i]; c.events.on({ featureadded: functio(e) { alert(e.feature); } }); } Untested.

[OpenLayers-Users] DrawFeature with callback?

2008-12-05 Thread Nino Saturnino Martinez Vazquez Wael
Hi Guys Im doing a integration for the Apache Wicket framework( http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-contrib-openlayers ), and want to add some more features. Im looking into adding the possibility to draw polygons, however I cant find a example where theres a simple

Re: [OpenLayers-Users] DrawFeature with callback?

2008-12-05 Thread Adorian Ardelean
Hi, I presume you have to specify the event name somehow. Try including this: dosomething = function (feature) { } ...callbacks: {'featureAdded': dosomething}... All the best, Adorian On Fri, Dec 5, 2008 at 12:59 PM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Hi Guys

Re: [OpenLayers-Users] DrawFeature with callback?

2008-12-05 Thread Nino Saturnino Martinez Vazquez Wael
Okay so I now have this, still not working though: html xmlns=http://www.w3.org/1999/xhtml; head titleOpenLayers Regular Polygon Example/title script src=http://openlayers.org/api/OpenLayers.js;/script script type=text/javascript var map, polygonControl;

Re: [OpenLayers-Users] DrawFeature with callback?

2008-12-05 Thread Adorian Ardelean
Hi Nino, This works ok for me: dosomething = function (feature) { //do something with polygon alert(yeeehaaa); }; controls = { polygon: new OpenLayers.Control.DrawFeature(regions,OpenLayers.Handler.Polygon, {'featureAdded': dosomething}) } All the best, Adorian On Fri, Dec 5,

Re: [OpenLayers-Users] DrawFeature with callback?

2008-12-05 Thread Arnd Wippermann
PROTECTED] Im Auftrag von Nino Saturnino Martinez Vazquez Wael Gesendet: Freitag, 5. Dezember 2008 14:03 An: Adorian Ardelean Cc: users@openlayers.org Betreff: Re: [OpenLayers-Users] DrawFeature with callback? Okay so I now have this, still not working though: html xmlns=http://www.w3.org