0.1.7 • Published 3 years ago
preact-leaflet-ts v0.1.7
typescript Preact leaflet
Still in development
A Preaect wrapper made in Javascript and converted to Javascript from Preact-leaflet. Credit goes to kontrollanten.
Supporting following Leaflet components:
Example
import { Map, TileLayer } from 'preact-leaflet';
<Map center={[63.83919, 20.15069]} style={{ height: '100%' }} zoom={10}>
<TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" />
</Map>
For more advanced examples, look into the e2e App and it's published version.
API
This is just a thin wrapper, checkout Leaflet API for usage.
Options
All props, except for on
prefixed, are passed to Leaflet.
Event listeners
Props prefixed with on
are handled as event listeners, e.g. onZoom
will listen for the zoom
event.
Todo:
- Add tests (jasmine, mocha, jest)