leaflet-map-server-component
v0.2.0
Published
A leaflet map server component
Downloads
137
Maintainers
Readme
leaflet-map-server-component
A server component for server-rendering leaflet maps
How to use this component
This component statically renders a map. It uses the client-side Leaflet library, running entirely inside a Domino-based server-side DOM, serving up the rendered HTML output.
To use it, install it from NPM with npm install leaflet-map-server-component
and just render:
<leaflet-map lat="41.3851" long="2.1734" zoom="12">
<leaflet-marker lat="41.4036" long="2.1744"></leaflet-marker>
<leaflet-marker lat="41.4225" long="2.1186"></leaflet-marker>
<leaflet-marker lat="41.3640" long="2.1675"></leaflet-marker>
</leaflet-map>
Don't have server components set up yet? Take a look in demo.js for a working example of the whole setup.
Want to see it in action right now? Clone this repo and run npm install && npm run dev
to start the server and see the result.
Coming soon:
- [ ] Map shape overlays
- [ ] Magically autoresize the map when rendering