DieselDepot-APP/node_modules/react-leaflet/lib/GeoJSON.js
SJCoetz 34608475cb feat: add depot map integration
Add Leaflet and react-leaflet dependencies for interactive map functionality
Extend DDDepot type with optional latitude/longitude fields for map markers
Update site metadata and admin settings page text
Add client-side DepotMap component to render depot locations
Update PocketBase admin token in environment configuration
2026-07-20 12:31:18 +02:00

16 lines
644 B
JavaScript

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);
}
}
});