preact-leaflet-ts
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

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)

Package Sidebar

Install

npm i preact-leaflet-ts

Weekly Downloads

1

Version

0.1.7

License

MIT

Unpacked Size

28.2 kB

Total Files

24

Last publish

Collaborators

  • fayelure