Download demo-frontend/node_modules/react-leaflet/lib/Polygon.js from LarryD123/OurData: direct link, hf CLI and curl.
- Browser
- Download file 569 Bytes
-
https://huggingface.co/datasets/LarryD123/OurData/resolve/main/demo-frontend/node_modules/react-leaflet/lib/Polygon.js
- Command line
-
hf download hf://datasets/LarryD123/OurData/demo-frontend/node_modules/react-leaflet/lib/Polygon.js
-
curl -L -o Polygon.js https://huggingface.co/datasets/LarryD123/OurData/resolve/main/demo-frontend/node_modules/react-leaflet/lib/Polygon.js
569 Bytes
| import { createElementObject, createPathComponent, extendContext } from '@react-leaflet/core'; | |
| import { Polygon as LeafletPolygon } from 'leaflet'; | |
| export const Polygon = createPathComponent(function createPolygon({ positions, ...options }, ctx) { | |
| const polygon = new LeafletPolygon(positions, options); | |
| return createElementObject(polygon, extendContext(ctx, { | |
| overlayContainer: polygon | |
| })); | |
| }, function updatePolygon(layer, props, prevProps) { | |
| if (props.positions !== prevProps.positions) { | |
| layer.setLatLngs(props.positions); | |
| } | |
| }); | |