Search code examples
javascriptperformanceleafletgisshapefile

Map on Leaflet freezes if load shape file data with large size


I am currently using Leaflet ShapeFile as a source of my data.

When the shape file [30MB] contains 1 big layer (Feature is big with many coordinates | A whole big polygon), the UI still working but loads very long.

When the shape file [20MB] contains multiple layers (Many Polylines, Polygons markers | Multiple Features), the UI already freezes upon load.

Is there any work around on this like load only what is visible on the map view port so performance issue will be addressed? Is this possible?

Map with ShapeFile:


Solution

  • [SOLVED]

    Thanks to @ghybs! I used canvas as renderer and it greatly improved performance on rendering Large Number of Features.

    Leaflet Canvas