Download demo-frontend/node_modules/react-leaflet/lib/ImageOverlay.js from LarryD123/OurData: direct link, hf CLI and curl.
- Browser
- Download file 867 Bytes
-
https://huggingface.co/datasets/LarryD123/OurData/resolve/main/demo-frontend/node_modules/react-leaflet/lib/ImageOverlay.js
- Command line
-
hf download hf://datasets/LarryD123/OurData/demo-frontend/node_modules/react-leaflet/lib/ImageOverlay.js
-
curl -L -o ImageOverlay.js https://huggingface.co/datasets/LarryD123/OurData/resolve/main/demo-frontend/node_modules/react-leaflet/lib/ImageOverlay.js
867 Bytes
| import { createElementObject, createLayerComponent, extendContext, updateMediaOverlay } from '@react-leaflet/core'; | |
| import { LatLngBounds, ImageOverlay as LeafletImageOverlay } from 'leaflet'; | |
| export const ImageOverlay = createLayerComponent(function createImageOverlay({ bounds, url, ...options }, ctx) { | |
| const overlay = new LeafletImageOverlay(url, bounds, options); | |
| return createElementObject(overlay, extendContext(ctx, { | |
| overlayContainer: overlay | |
| })); | |
| }, function updateImageOverlay(overlay, props, prevProps) { | |
| updateMediaOverlay(overlay, props, prevProps); | |
| if (props.bounds !== prevProps.bounds) { | |
| const bounds = props.bounds instanceof LatLngBounds ? props.bounds : new LatLngBounds(props.bounds); | |
| overlay.setBounds(bounds); | |
| } | |
| if (props.url !== prevProps.url) { | |
| overlay.setUrl(props.url); | |
| } | |
| }); | |