Download tmp-demo-frontend/node_modules/react-leaflet/lib/GeoJSON.js from LarryD123/OurData: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/datasets/LarryD123/OurData/resolve/main/tmp-demo-frontend/node_modules/react-leaflet/lib/GeoJSON.js
- Command line
-
hf download hf://datasets/LarryD123/OurData/tmp-demo-frontend/node_modules/react-leaflet/lib/GeoJSON.js
-
curl -L -o GeoJSON.js https://huggingface.co/datasets/LarryD123/OurData/resolve/main/tmp-demo-frontend/node_modules/react-leaflet/lib/GeoJSON.js
643 Bytes
| import { createElementObject, createPathComponent, extendContext } from '@react-leaflet/core'; | |
| import { GeoJSON as LeafletGeoJSON } from 'leaflet'; | |
| export const GeoJSON = createPathComponent(function createGeoJSON({ data, ...options }, ctx) { | |
| const geoJSON = new LeafletGeoJSON(data, options); | |
| return createElementObject(geoJSON, extendContext(ctx, { | |
| overlayContainer: geoJSON | |
| })); | |
| }, function updateGeoJSON(layer, props, prevProps) { | |
| if (props.style !== prevProps.style) { | |
| if (props.style == null) { | |
| layer.resetStyle(); | |
| } else { | |
| layer.setStyle(props.style); | |
| } | |
| } | |
| }); | |