Rendering Polygons and Markers "on demand"

9 views
Skip to first unread message

Luca Bertoncello

unread,
Apr 6, 2022, 1:35:03 PMApr 6
to leafl...@googlegroups.com
Hi again!

So, I got to display a map with all airspaces and airports and it looks
quite like the ICAO maps.

The problem is, that there are _many_ elements. Really many elements...
And this means that displaying the maps and later exporting it as PNG is
very very slow.

My idea: just display the airspaces and airports that should be displayed.
It should be a big difference to render 20 elements or to render 2000
elements...

Well, now I don't know how to do that...
I add all airspaces with:

airspacesG = L.geoJSON(airspaces, {
style: function(feature) {
...
}
}).addTo(map);

Maybe there is a better way to do that?
Second problem: to delete airspaces that should not be displayed and
display the new ones as soon as the map will be moved.

Can someone give me a suggestion how to solve my problem?
As I sayd, I'm not really an expert in Javascript... :/

Thanks a lot
Luca
Reply all
Reply to author
Forward
0 new messages