Nectar of the Programming Masses

    leaflet-map-server-component

    0.2.0 • Public • Published

    leaflet-map-server-component Build Status

    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

    Install

    npm i leaflet-map-server-component

    DownloadsWeekly Downloads

    23

    Version

    0.2.0

    License

    MIT

    Last publish

    Collaborators

    • pimterry