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

leaflet-mount

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-mount

Seamlessly, flexibly insert content into leaflet maps

  • 0.0.0-alpha.11
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Leaflet Mount

img


This is a set of tools for leaflet: base classes and stock components to create custom map interfaces.

intro | code samples | use/install |


concepts

L.Mount has some targets in its design:

  1. simplify map interface design
  2. allow simple reuse and extension
  3. encourage composition over configuration

This means that it's here to let you do what you want with very little work, but work nonetheless. Some things might strike you as odd:

  • **Leaflet has factories everywhere! where are L.Mount's? **
  • Why doesn't this work out of the box?
    • Mount is meant to be a tool: helpful defaults for one map could be nonsensical for another.

intro

With Mount, you'll notice its two changes to L.Map:

  • the new default options render a bare map
  • a figure tag wraps the map (& figcaption)

Now your map's ready for building :rocket:

code

L.Mount.Attribution

Attribution is a simple component: a span with a cite for each visible layer (auto updates).

.leaflet-mount-attribution {
    position: absolute;
    bottom: 0;
    right: 0;
}
    map.mount(new L.Mount.Attribution());

L.Mount.ZoomIn & ZoomOut

ZoomIn and ZoomOut are uncoupled for flexiblility.

    map
      .mount(new L.Mount.ZoomIn());
      .mount(new L.Mount.ZoomOut());

install

unpkg

unpkg

FAQs

Package last updated on 27 Feb 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