--
---
You received this message because you are subscribed to the Google Groups "Leaflet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-js+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hello everyone!
Quite related with this large numbers, I'm having a strange issue with about 30k-40k points (in these case, Circles) using Canvas backend.
Not rendering performance but removeLayer perfomance. I've tested this with Leaflet 0.5.1 and the lastest branch master (grabbed yesterday).
It appears to still have some very slow performance ...
I'm using a L.geoJSON layer to load some geoJSON data from a server-side component. On a zoom in or zoom out, i remove the previous layer and load another.
Simply like this:
$.getJSON(url, function(data) {
currentLayer = new L.geoJson(data, {
pointToLayer: function (feature, latlng) {
var circle = new L.Circle(latlng, 1, { ....});
return circle;
}
});
map.addLayer(currentLayer);
});
and removing the layer, simply like this:
function onChangedZoom(e) {
if(currentLayer != undefined) {
map.removeLayer(currentLayer);
}
......
}
I'm having terrible performance on my very old test machine, a 2006 Macbook Pro (CoreDuo 2.66 Ghz, 2GB RAM) and similar results (propotionally, i mean) on a colleague Windows machine (i5 2.27GHz, 4GB Ram) ... both on Chrome.
Some numbers on leaflet 0.6-dev:
MacBook Pro:
Layer Create time: 4817ms (L.geoJSON after already having the geoJSON data on the client)
Layer Render time: 4528ms (map.addLayer)
removing layer...
Removed Layer time: 13857ms (map.removeLayer)
Windows machine:
Layer Create time: 3458ms (L.geoJSON after already having the geoJSON data on the client)
Layer Render time: 4057ms (map.addLayer)
removing layer...
Removed Layer time: 5316ms (map.removeLayer)
Is it me or removeLayer is really slow ... does it make sense being slower than addLayer?
Any input or suggestion?
Thanks in advance …
Regards,
Rui Leal