Download tmp-demo-frontend/node_modules/react-leaflet/lib/Rectangle.js from LarryD123/OurData: direct link, hf CLI and curl.
- Browser
- Download file 571 Bytes
-
https://huggingface.co/datasets/LarryD123/OurData/resolve/main/tmp-demo-frontend/node_modules/react-leaflet/lib/Rectangle.js
- Command line
-
hf download hf://datasets/LarryD123/OurData/tmp-demo-frontend/node_modules/react-leaflet/lib/Rectangle.js
-
curl -L -o Rectangle.js https://huggingface.co/datasets/LarryD123/OurData/resolve/main/tmp-demo-frontend/node_modules/react-leaflet/lib/Rectangle.js
571 Bytes
| import { createElementObject, createPathComponent, extendContext } from '@react-leaflet/core'; | |
| import { Rectangle as LeafletRectangle } from 'leaflet'; | |
| export const Rectangle = createPathComponent(function createRectangle({ bounds, ...options }, ctx) { | |
| const rectangle = new LeafletRectangle(bounds, options); | |
| return createElementObject(rectangle, extendContext(ctx, { | |
| overlayContainer: rectangle | |
| })); | |
| }, function updateRectangle(layer, props, prevProps) { | |
| if (props.bounds !== prevProps.bounds) { | |
| layer.setBounds(props.bounds); | |
| } | |
| }); | |