This commit is contained in:
2025-09-12 07:32:32 -07:00
parent 4d5fca6a5e
commit 49208df277
2978 changed files with 421237 additions and 394 deletions

23
node_modules/@react-leaflet/core/lib/context.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
import { createContext, useContext } from 'react';
export const CONTEXT_VERSION = 1;
export function createLeafletContext(map) {
return Object.freeze({
__version: CONTEXT_VERSION,
map
});
}
export function extendContext(source, extra) {
return Object.freeze({
...source,
...extra
});
}
export const LeafletContext = createContext(null);
export const LeafletProvider = LeafletContext.Provider;
export function useLeafletContext() {
const context = useContext(LeafletContext);
if (context == null) {
throw new Error('No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>');
}
return context;
}