react-leaflet-extendable

1.0.2 • Public • Published

React-Leaflet-Extendable

npm version

This is literally just a fork of react-leaflet that adds the ability to directly extend components. Unless you have an issue specifically about extending components DO NOT raise issues here. Raise them on the react-leaflet repository.

This repository exists because of https://github.com/PaulLeCam/react-leaflet/issues/506

Please read through that issue before deciding if you actually should use this library and not react-leaflet. For most use cases react-leaflet will be fine.

TLDR; react-leaflet v2 makes it impossible to directly extend these components:

  • AttributionControl
  • Circle
  • ExtendableCircle
  • FeatureGroup
  • GeoJSON
  • ImageOverlay
  • LayerGroup
  • LayersControl
  • Marker
  • Pane
  • Polygon
  • Polyline
  • Popup
  • Rectangle
  • ScaleControl
  • TileLayer
  • Tooltip
  • VideoOverlay
  • WMSTileLayer
  • ZoomControl

This fork lets you extend those.

The extendable exports of these components are all formatted like: Extendable<COMPONENT>

e.g. ExtendableAttributionControl, ExtendableCircle, etc...

Usage

import { ExtendableTileLayer, withLeaflet } from 'react-leaflet-extendable'

class MyCustomTileLayer extends ExtendableTileLayer {
    // Go nuts here
}
export default withLeaflet(MyCustomTileLayer)

License

MIT
See LICENSE file.

Package Sidebar

Install

npm i react-leaflet-extendable

Weekly Downloads

169

Version

1.0.2

License

MIT

Unpacked Size

573 kB

Total Files

167

Last publish

Collaborators

  • jbccollins