Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leaflet-boundsawarelayergroup

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-boundsawarelayergroup

Leaflet.LayerGroup plugin to render only layers in the current map bounds

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Leaflet.boundsAwareLayerGroup

Leaflet.LayerGroup plugin to render only layers in the current map bounds

Adding lots of layers to a map can kill browser performance, even if the layers are outside the map bounds and not visible to the user. Leaflet.boundsAwareLayerGroup patches Leaflet.LayerGroup to manage only rendering in the map layers in the map bounds. On each map bounds change (zoom, pan, whatever...), layers in the new bounds are added, layers outside are removed.

See the plugin in action when comparing performance with and without Leaflet.boundsAwareLayerGroup for 5,000 markers.

Using the plugin

Create a new Leaflet.LayerGroup with the makeBoundsAware option.

new L.LayerGroup([marker1, marker2], {
	makeBoundsAware: true
}.addTo(map);

or

L.layerGroup([marker1, marker2], {
	makeBoundsAware: true
}).addTo(map);

Leaflet.boundsAwareLayerGroup works with Leaflet.FeatureGroup as well...

L.featureGroup([marker1, marker2], {
	makeBoundsAware: true
}).addTo(map);

Keywords

FAQs

Package last updated on 22 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc