Socket
Socket
Sign inDemoInstall

leaflet-ui

Package Overview
Dependencies
23
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    leaflet-ui

Leaflet presets for common user interface customizations


Version published
Weekly downloads
6K
decreased by-3.2%
Maintainers
1
Install size
17.5 MB
Created
Weekly downloads
 

Readme

Source

leaflet-ui

NPM version License

Leaflet presets for common user interface customizations

For a working example see demo

Leaflet default UI


How to use

  1. include CSS & JavaScript
    <head>
    ...
    <style> html, body, #map { height: 100%; width: 100%; padding: 0; margin: 0; } </style>
    <!-- Leaflet -->
    <script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"></script>
    <!-- Leaflet-UI -->
    <script src="https://unpkg.com/leaflet-ui@latest/dist/leaflet-ui.js"></script>
    ...
    </head>
    
  2. choose a div container used for the slippy map
    <body>
    ...
      <div id="map"></div>
    ...
    </body>
    
  3. create your first simple “leaflet-ui” slippy map
    <script>
      var map = L.map('map', {
        center: [41.4583, 12.7059],
        zoom: 5,
    
        // Optional customizations
        mapTypeId: 'topo',
        mapTypeIds: ['streets', 'terrain', 'satellite', 'topo'],
        gestureHandling: true,
        zoomControl: true,
        pegmanControl: true,
        locateControl: true,
        fullscreenControl: true,
        layersControl: true,
        minimapControl: true,
        editInOSMControl: true,
        loadingControl: true,
        searchControl: true,
        disableDefaultUI: false,
    
        // Experimental feature
        rotate: true,
      });
      map.once('idle',function(){ /* Waiting for map init */});
    </script>
    

Compatibile with: leaflet@1.6.0


Contributors: Raruto

Keywords

FAQs

Last updated on 20 Jan 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc