0.0.0-alpha.11 • Published 9 years ago
leaflet-mount v0.0.0-alpha.11
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:
- simplify map interface design
- allow simple reuse and extension
- 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:
Leaflethas factories everywhere! where areL.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
figuretag 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
0.0.0-alpha.11
9 years ago
0.0.0-alpha.10
9 years ago
0.0.0-alpha.9
9 years ago
0.0.0-alpha.8
9 years ago
0.0.0-alpha.7
9 years ago
0.0.0-alpha.6
9 years ago
0.0.0-alpha.5
9 years ago
0.0.0-alpha.4
9 years ago
0.0.0-alpha.3
9 years ago
0.0.0-alpha.2
9 years ago
0.0.0-alpha.1
9 years ago