- Notifications
You must be signed in to change notification settings - Fork0
A high performance react reconciler for [leafletjs](https://www.leafletjs.com)
License
chickencoding123/leaflet-react-fibers
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
npm i leaflet-react-fibers --save# oryarn add leaflet-react-fibers --saveimport{LeafletMap,L}from"leaflet-react-fibers"constJustAMap=()=>{return(<LeafletMapoptions={{crs:L.CRS.Simple}}><lfRectanglebounds={[[50,50],[150,100]]}options={{fillColor:'black'}}add={()=>{console.log('added a rectangle layer')}}/></LeafletMap>)}
SeeDocs for various examples.
You must provide a JSX renderer when embedding HTML inlfPopup orlfTooltip otherwise their contents are ignored, this is by design:
ℹ️ You do NOT have to use
react-dom, any JSX renderer will suffice.
import{LeafletMap,L}from"leaflet-react-fibers"importReactDOMfrom"react-dom"constPopupInsideARectangle=()=>{return(<LeafletMapoptions={{crs:L.CRS.Simple}}jsxRenderer={ReactDOM.render}><lfRectanglebounds={[[50,50],[150,100]]}options={{fillColor:'black'}}add={()=>{console.log('added a rectangle layer')}}><lfPopuplatlng={[100,100]}add={()=>{console.log('added an popup layer')}}><div>Hello world!</div></lfPopup></lfRectangle></LeafletMap>)}
None of the libraries mentioned below provide mutability control out of the box and state management features.
- react-leaflet-fiber another fiber implementation.
- react-leaflet react wrapper for leaflet which comes with hooks.
[x] Mutability control does not work at the moment. This is a feature of this library that allows a layer to be explicitly mutable or immutable using amutable prop.
Clone this repository and simply runnpm run storybook to get started.
About
A high performance react reconciler for [leafletjs](https://www.leafletjs.com)
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.
