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

Gilberto Ramos sdjbm17 at gmail.com
Mon Jul 12 15:52:58 EDT 2010


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){
           
vectorLayer.destroyFeatures([vectorLayer.features[vectorLayer.features.length-1]]);
            return true; // could be false too, does not make any difference
        }
    });

Not the sexiest way to solve the problem but it works for me.

Cheers,

Gilberto Ramos

-----
just another web developer
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Limit-total-Vector-Layer-points-to-be-drawn-tp5282918p5284592.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list