[OpenLayers-Users] Limit total Vector Layer points to be drawn

2010-07-12 Thread giraam
Hi people, I'm trying to limit the total Vector Layer's point to be drawn.. For example, after one point has been drawn prevent new points to be added.. I tried registering beforefeatureadded event as the definition for this event says: Triggered before a feature is added. Listeners will

Re: [OpenLayers-Users] Limit total Vector Layer points to be drawn

2010-07-12 Thread Andreas Hocevar
Hi, looks like your OpenLayers version is too old. This was fixed after the 2.9.1 release (http://trac.openlayers.org/changeset/10362), so you have to use a current development version. Regards, Andreas. On Jul 12, 2010, at 15:40 , giraam wrote: Hi people, I'm trying to limit the total

Re: [OpenLayers-Users] Limit total Vector Layer points to be drawn

2010-07-12 Thread giraam
Hi Andreas, I change my OL include (it was local) and I'm including OL from http://www.openlayers.org/api/OpenLayers.js http://www.openlayers.org/api/OpenLayers.js and still the same problem. I modified my code to something like this: vectorLayer.events.register('beforefeatureadded', this,

Re: [OpenLayers-Users] Limit total Vector Layer points to be drawn

2010-07-12 Thread Gilberto Ramos
Well, I think this is still a bug.. I'm using the OL 2.9.1 and the solution I found for this is: vectorLayer.events.register('beforefeatureadded', this, function(evt){ if(vectorLayer.features.length 1){