Skip to content

jaysencpp/solidjs-leaflet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solidjs-leaflet

A simple SolidJS wrapper for leaflet to display maps.

Installation

npm install solidjs-leaflet leaflet
yarn add solidjs-leaflet leaflet
pnpm add solidjs-leaflet leaflet

If you are using Typescript, also install:

npm install -D @types/leaflet
yarn add -D @types/leaflet
pnpm add -D @types/leaflet

Usage

To use the SolidJS leaflet wrapper:

import {SolidLeafletMap} from "solidjs-leaflet"

const Example = () => {
  return (
    <SolidLeafletMap
      center={[63.0, 13.0]}
      id="map"
      zoom={17}
      onMapReady={(l, m) => {
        const icon = l.icon({
          iconUrl: '/marker-icon.png',
          shadowUrl: '/marker-shadow.png',
        });
        const marker = l
          .marker([63.0 13.0], {
            icon,
          })
          .addTo(m);
        marker.bindPopup('Hello World!');
      }}
    />
  );
};

About

SolidJS wrapper for leaflet

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published