Skip to main content

Performance

Performance

Leaflet-Geoman offers a set of special options to increase performance when working with very large datasets. The problem with leaflet and very large datasets, are the amount of elements in the DOM. The following options reduce the amount of DOM nodes significantly. Thus, allowing for buttery smooth editing even with super large datasets.

See the available options in the table below.

OptionDefaultDescription
limitMarkersToCount-1Shows only n markers closest to the cursor. Use -1 for no limit.
limitMarkersToZoom-1Shows markers when under the given zoom level. ⭐
limitMarkersToViewportfalseShows only markers in the viewport. ⭐
limitMarkersToClickfalseShows markers only after the layer was clicked. ⭐

All options can be used together. In fact, the performance increases even more when using multiple options together, depending on your desired user experience.

They are part of the options for Edit Mode. See usage and full options table there.

Examples

Performance improvements enabled with limitMarkersToCount: 10

Loading...

Performance improvements enabled with limitMarkersToViewPort: true

Loading...

Performance improvements enabled with limitMarkersToClick: true

Loading...

Performance improvements enabled with limitMarkersToZoom: 15 (zoom starts at lvl 14, zoom in to see the effect)

Loading...

Performance improvements enabled with all features:

{
limitMarkersToClick: true,
limitMarkersToViewPort: true,
limitMarkersToCount: 10,
limitMarkersToZoom: 15
}
Loading...