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

leaflet-layerscontrol-buttons

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-layerscontrol-buttons

Leaflet layers control using a set of buttons.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Leaflet layerscontrol buttons

Simple and compact Leaflet layers control composed of a button for each layer, similar to the Google maps API used to use.

screenshot

  • Tested with Leaflet 1.2.0
  • Available on npm: leaflet-layerscontrol-buttons

Usage

After including leaflet, include these two leaflet-layerscontrol-buttons files.

<link rel="stylesheet" href="leaflet-layerscontrol-buttons.css" />
<script src="leaflet-layerscontrol-buttons.js"></script>

And use it like you would use L.Control.Layers, omitting the overlays argument:

var layersControl = L.control.layers.buttons({
    'OSM': L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'),
    'Toner': L.tileLayer('http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png'),
    'Watercolor': L.tileLayer('http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg')
}).addTo(map);

// attribution omitted for the example, remember to attribute!

FAQs

Package last updated on 22 Aug 2017

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