Description
maptalks's version and what browser you use?
0.42.4 / Chrome 71.0.3578.98
Issue description
I've been drawing a very large amount of objects, around 150K+ (mix of polygons / markers / rectangles) and have been noticing that Chrome just crashes as soon as it passes 1.7-1.8 GB memory on the JS instance (Firefox doesn't appear to cap at). I ran a memory profile on a smaller data set and I wonder if it's worthwhile to take a look to see if some structure can be refactored/optimized to result in a smaller footprint.
I did some comparison with Leaflet and I definitely consume a lot less (same place, zoomlevel and dataset is only 700 MB in Leaflet and 1800 MB in MapTalks)
I can also see that memory increases constantly when panning to different parts but rarely decreases at the same rate (over time it appears to increase slightly eventually leading to a tab crash on bigger data sets).
In addition to that is there a way to "unload" drawn / loaded geometries at a certain zoom level defined by user (other than disabling the layer on certain zoom levels)? Right now at zoom level 1 I can see a black dot that is in actuality 100k+ geometries being rendered. I wonder if it's possible to cluster close geometries (depending on the zoom level), having 100 geometries next to each at level 15 might not be obvious, better served as as many as needed to give the same impression, though that would probably require calculation of each closeby collection to figure out the center.
Thanks for the awesome library in any case!
Please provide a reproduction URL (on any jsfiddle like site)
Memory Heapfile (Chrome) on smaller data set: https://drive.google.com/file/d/1r7Lw1WGwW36vko5NDSOslKNq4pU6Dk7X/view?usp=sharing