Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A high performance react reconciler for [leafletjs](https://www.leafletjs.com)

License

NotificationsYou must be signed in to change notification settings

chickencoding123/leaflet-react-fibers

leaflet-react-fibers logo

leaflet-react-fibers

A high performance react library forleafletjs

npmlicensedocs

How to use

npm i leaflet-react-fibers --save# oryarn add leaflet-react-fibers --save
import{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.

JSX renderer

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 usereact-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>)}

Similar work

None of the libraries mentioned below provide mutability control out of the box and state management features.

  1. react-leaflet-fiber another fiber implementation.
  2. react-leaflet react wrapper for leaflet which comes with hooks.

Known Issues

[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.

Development

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

Stars

Watchers

Forks

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp