mirror of
https://github.com/sstent/aicyclingcoach-go.git
synced 2026-01-28 01:52:41 +00:00
sync
This commit is contained in:
4
node_modules/react-leaflet/lib/AttributionControl.d.ts
generated
vendored
Normal file
4
node_modules/react-leaflet/lib/AttributionControl.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/// <reference types="react" />
|
||||
import { Control } from 'leaflet';
|
||||
export type AttributionControlProps = Control.AttributionOptions;
|
||||
export declare const AttributionControl: import("react").ForwardRefExoticComponent<Control.AttributionOptions & import("react").RefAttributes<Control.Attribution>>;
|
||||
5
node_modules/react-leaflet/lib/AttributionControl.js
generated
vendored
Normal file
5
node_modules/react-leaflet/lib/AttributionControl.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { createControlComponent } from '@react-leaflet/core';
|
||||
import { Control } from 'leaflet';
|
||||
export const AttributionControl = createControlComponent(function createAttributionControl(props) {
|
||||
return new Control.Attribution(props);
|
||||
});
|
||||
5
node_modules/react-leaflet/lib/Circle.d.ts
generated
vendored
Normal file
5
node_modules/react-leaflet/lib/Circle.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference types="react" />
|
||||
import { type CircleProps } from '@react-leaflet/core';
|
||||
import { Circle as LeafletCircle } from 'leaflet';
|
||||
export type { CircleProps } from '@react-leaflet/core';
|
||||
export declare const Circle: import("react").ForwardRefExoticComponent<CircleProps & import("react").RefAttributes<LeafletCircle<any>>>;
|
||||
8
node_modules/react-leaflet/lib/Circle.js
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/Circle.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { createElementObject, createPathComponent, extendContext, updateCircle } from '@react-leaflet/core';
|
||||
import { Circle as LeafletCircle } from 'leaflet';
|
||||
export const Circle = createPathComponent(function createCircle({ center , children: _c , ...options }, ctx) {
|
||||
const circle = new LeafletCircle(center, options);
|
||||
return createElementObject(circle, extendContext(ctx, {
|
||||
overlayContainer: circle
|
||||
}));
|
||||
}, updateCircle);
|
||||
5
node_modules/react-leaflet/lib/CircleMarker.d.ts
generated
vendored
Normal file
5
node_modules/react-leaflet/lib/CircleMarker.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference types="react" />
|
||||
import { type CircleMarkerProps } from '@react-leaflet/core';
|
||||
import { CircleMarker as LeafletCircleMarker } from 'leaflet';
|
||||
export type { CircleMarkerProps } from '@react-leaflet/core';
|
||||
export declare const CircleMarker: import("react").ForwardRefExoticComponent<CircleMarkerProps & import("react").RefAttributes<LeafletCircleMarker<any>>>;
|
||||
8
node_modules/react-leaflet/lib/CircleMarker.js
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/CircleMarker.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { createElementObject, createPathComponent, extendContext, updateCircle } from '@react-leaflet/core';
|
||||
import { CircleMarker as LeafletCircleMarker } from 'leaflet';
|
||||
export const CircleMarker = createPathComponent(function createCircleMarker({ center , children: _c , ...options }, ctx) {
|
||||
const marker = new LeafletCircleMarker(center, options);
|
||||
return createElementObject(marker, extendContext(ctx, {
|
||||
overlayContainer: marker
|
||||
}));
|
||||
}, updateCircle);
|
||||
7
node_modules/react-leaflet/lib/FeatureGroup.d.ts
generated
vendored
Normal file
7
node_modules/react-leaflet/lib/FeatureGroup.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference types="react" />
|
||||
import { type PathProps } from '@react-leaflet/core';
|
||||
import { FeatureGroup as LeafletFeatureGroup } from 'leaflet';
|
||||
import type { LayerGroupProps } from './LayerGroup.js';
|
||||
export interface FeatureGroupProps extends LayerGroupProps, PathProps {
|
||||
}
|
||||
export declare const FeatureGroup: import("react").ForwardRefExoticComponent<FeatureGroupProps & import("react").RefAttributes<LeafletFeatureGroup<any>>>;
|
||||
9
node_modules/react-leaflet/lib/FeatureGroup.js
generated
vendored
Normal file
9
node_modules/react-leaflet/lib/FeatureGroup.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { createElementObject, createPathComponent, extendContext } from '@react-leaflet/core';
|
||||
import { FeatureGroup as LeafletFeatureGroup } from 'leaflet';
|
||||
export const FeatureGroup = createPathComponent(function createFeatureGroup({ children: _c , ...options }, ctx) {
|
||||
const group = new LeafletFeatureGroup([], options);
|
||||
return createElementObject(group, extendContext(ctx, {
|
||||
layerContainer: group,
|
||||
overlayContainer: group
|
||||
}));
|
||||
});
|
||||
9
node_modules/react-leaflet/lib/GeoJSON.d.ts
generated
vendored
Normal file
9
node_modules/react-leaflet/lib/GeoJSON.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference types="react" />
|
||||
import { type PathProps } from '@react-leaflet/core';
|
||||
import type { GeoJsonObject } from 'geojson';
|
||||
import { GeoJSON as LeafletGeoJSON, type GeoJSONOptions } from 'leaflet';
|
||||
import type { LayerGroupProps } from './LayerGroup.js';
|
||||
export interface GeoJSONProps extends GeoJSONOptions, LayerGroupProps, PathProps {
|
||||
data: GeoJsonObject;
|
||||
}
|
||||
export declare const GeoJSON: import("react").ForwardRefExoticComponent<GeoJSONProps & import("react").RefAttributes<LeafletGeoJSON<any, import("geojson").Geometry>>>;
|
||||
16
node_modules/react-leaflet/lib/GeoJSON.js
generated
vendored
Normal file
16
node_modules/react-leaflet/lib/GeoJSON.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
8
node_modules/react-leaflet/lib/ImageOverlay.d.ts
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/ImageOverlay.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { type MediaOverlayProps } from '@react-leaflet/core';
|
||||
import { ImageOverlay as LeafletImageOverlay } from 'leaflet';
|
||||
import type { ReactNode } from 'react';
|
||||
export interface ImageOverlayProps extends MediaOverlayProps {
|
||||
children?: ReactNode;
|
||||
url: string;
|
||||
}
|
||||
export declare const ImageOverlay: import("react").ForwardRefExoticComponent<ImageOverlayProps & import("react").RefAttributes<LeafletImageOverlay>>;
|
||||
17
node_modules/react-leaflet/lib/ImageOverlay.js
generated
vendored
Normal file
17
node_modules/react-leaflet/lib/ImageOverlay.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { createElementObject, createLayerComponent, extendContext, updateMediaOverlay } from '@react-leaflet/core';
|
||||
import { LatLngBounds, ImageOverlay as LeafletImageOverlay } from 'leaflet';
|
||||
export const ImageOverlay = createLayerComponent(function createImageOveraly({ 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);
|
||||
}
|
||||
});
|
||||
7
node_modules/react-leaflet/lib/LayerGroup.d.ts
generated
vendored
Normal file
7
node_modules/react-leaflet/lib/LayerGroup.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { type EventedProps } from '@react-leaflet/core';
|
||||
import { LayerGroup as LeafletLayerGroup, type LayerOptions } from 'leaflet';
|
||||
import type { ReactNode } from 'react';
|
||||
export interface LayerGroupProps extends LayerOptions, EventedProps {
|
||||
children?: ReactNode;
|
||||
}
|
||||
export declare const LayerGroup: import("react").ForwardRefExoticComponent<LayerGroupProps & import("react").RefAttributes<LeafletLayerGroup<any>>>;
|
||||
8
node_modules/react-leaflet/lib/LayerGroup.js
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/LayerGroup.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { createElementObject, createLayerComponent, extendContext } from '@react-leaflet/core';
|
||||
import { LayerGroup as LeafletLayerGroup } from 'leaflet';
|
||||
export const LayerGroup = createLayerComponent(function createLayerGroup({ children: _c , ...options }, ctx) {
|
||||
const group = new LeafletLayerGroup([], options);
|
||||
return createElementObject(group, extendContext(ctx, {
|
||||
layerContainer: group
|
||||
}));
|
||||
});
|
||||
48
node_modules/react-leaflet/lib/LayersControl.d.ts
generated
vendored
Normal file
48
node_modules/react-leaflet/lib/LayersControl.d.ts
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import { Control, type Layer } from 'leaflet';
|
||||
import React, { type ForwardRefExoticComponent, type FunctionComponent, type ReactNode, type RefAttributes } from 'react';
|
||||
export interface LayersControlProps extends Control.LayersOptions {
|
||||
children?: ReactNode;
|
||||
}
|
||||
export declare const useLayersControlElement: (props: LayersControlProps, context: Readonly<{
|
||||
__version: number;
|
||||
map: import("leaflet").Map;
|
||||
layerContainer?: import("leaflet").LayerGroup<any> | import("@react-leaflet/core/lib/context").ControlledLayer | undefined;
|
||||
layersControl?: Control.Layers | undefined;
|
||||
overlayContainer?: Layer | undefined;
|
||||
pane?: string | undefined;
|
||||
}>) => React.MutableRefObject<Readonly<{
|
||||
instance: Control.Layers;
|
||||
context: Readonly<{
|
||||
__version: number;
|
||||
map: import("leaflet").Map;
|
||||
layerContainer?: import("leaflet").LayerGroup<any> | import("@react-leaflet/core/lib/context").ControlledLayer | undefined;
|
||||
layersControl?: Control.Layers | undefined;
|
||||
overlayContainer?: Layer | undefined;
|
||||
pane?: string | undefined;
|
||||
}>;
|
||||
container?: any;
|
||||
}>>;
|
||||
export declare const useLayersControl: (props: LayersControlProps) => React.MutableRefObject<Readonly<{
|
||||
instance: Control.Layers;
|
||||
context: Readonly<{
|
||||
__version: number;
|
||||
map: import("leaflet").Map;
|
||||
layerContainer?: import("leaflet").LayerGroup<any> | import("@react-leaflet/core/lib/context").ControlledLayer | undefined;
|
||||
layersControl?: Control.Layers | undefined;
|
||||
overlayContainer?: Layer | undefined;
|
||||
pane?: string | undefined;
|
||||
}>;
|
||||
container?: any;
|
||||
}>>;
|
||||
export interface ControlledLayerProps {
|
||||
checked?: boolean;
|
||||
children: ReactNode;
|
||||
name: string;
|
||||
}
|
||||
export declare const LayersControl: ForwardRefExoticComponent<LayersControlProps & RefAttributes<Control.Layers>> & {
|
||||
BaseLayer: FunctionComponent<ControlledLayerProps>;
|
||||
Overlay: FunctionComponent<ControlledLayerProps>;
|
||||
};
|
||||
type AddLayerFunc = (layersControl: Control.Layers, layer: Layer, name: string) => void;
|
||||
export declare function createControlledLayer(addLayerToControl: AddLayerFunc): (props: ControlledLayerProps) => JSX.Element | null;
|
||||
export {};
|
||||
77
node_modules/react-leaflet/lib/LayersControl.js
generated
vendored
Normal file
77
node_modules/react-leaflet/lib/LayersControl.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
import { LeafletProvider, createContainerComponent, createControlHook, createElementHook, createElementObject, extendContext, useLeafletContext } from '@react-leaflet/core';
|
||||
import { Control } from 'leaflet';
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
export const useLayersControlElement = createElementHook(function createLayersControl({ children: _c , ...options }, ctx) {
|
||||
const control = new Control.Layers(undefined, undefined, options);
|
||||
return createElementObject(control, extendContext(ctx, {
|
||||
layersControl: control
|
||||
}));
|
||||
}, function updateLayersControl(control, props, prevProps) {
|
||||
if (props.collapsed !== prevProps.collapsed) {
|
||||
if (props.collapsed === true) {
|
||||
control.collapse();
|
||||
} else {
|
||||
control.expand();
|
||||
}
|
||||
}
|
||||
});
|
||||
export const useLayersControl = createControlHook(useLayersControlElement);
|
||||
// @ts-ignore
|
||||
export const LayersControl = createContainerComponent(useLayersControl);
|
||||
export function createControlledLayer(addLayerToControl) {
|
||||
return function ControlledLayer(props) {
|
||||
const parentContext = useLeafletContext();
|
||||
const propsRef = useRef(props);
|
||||
const [layer, setLayer] = useState(null);
|
||||
const { layersControl , map } = parentContext;
|
||||
const addLayer = useCallback((layerToAdd)=>{
|
||||
if (layersControl != null) {
|
||||
if (propsRef.current.checked) {
|
||||
map.addLayer(layerToAdd);
|
||||
}
|
||||
addLayerToControl(layersControl, layerToAdd, propsRef.current.name);
|
||||
setLayer(layerToAdd);
|
||||
}
|
||||
}, [
|
||||
layersControl,
|
||||
map
|
||||
]);
|
||||
const removeLayer = useCallback((layerToRemove)=>{
|
||||
layersControl?.removeLayer(layerToRemove);
|
||||
setLayer(null);
|
||||
}, [
|
||||
layersControl
|
||||
]);
|
||||
const context = useMemo(()=>{
|
||||
return extendContext(parentContext, {
|
||||
layerContainer: {
|
||||
addLayer,
|
||||
removeLayer
|
||||
}
|
||||
});
|
||||
}, [
|
||||
parentContext,
|
||||
addLayer,
|
||||
removeLayer
|
||||
]);
|
||||
useEffect(()=>{
|
||||
if (layer !== null && propsRef.current !== props) {
|
||||
if (props.checked === true && (propsRef.current.checked == null || propsRef.current.checked === false)) {
|
||||
map.addLayer(layer);
|
||||
} else if (propsRef.current.checked === true && (props.checked == null || props.checked === false)) {
|
||||
map.removeLayer(layer);
|
||||
}
|
||||
propsRef.current = props;
|
||||
}
|
||||
});
|
||||
return props.children ? /*#__PURE__*/ React.createElement(LeafletProvider, {
|
||||
value: context
|
||||
}, props.children) : null;
|
||||
};
|
||||
}
|
||||
LayersControl.BaseLayer = createControlledLayer(function addBaseLayer(layersControl, layer, name) {
|
||||
layersControl.addBaseLayer(layer, name);
|
||||
});
|
||||
LayersControl.Overlay = createControlledLayer(function addOverlay(layersControl, layer, name) {
|
||||
layersControl.addOverlay(layer, name);
|
||||
});
|
||||
13
node_modules/react-leaflet/lib/MapContainer.d.ts
generated
vendored
Normal file
13
node_modules/react-leaflet/lib/MapContainer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { type FitBoundsOptions, type LatLngBoundsExpression, Map as LeafletMap, type MapOptions } from 'leaflet';
|
||||
import React, { type CSSProperties, type ReactNode } from 'react';
|
||||
export interface MapContainerProps extends MapOptions {
|
||||
bounds?: LatLngBoundsExpression;
|
||||
boundsOptions?: FitBoundsOptions;
|
||||
children?: ReactNode;
|
||||
className?: string;
|
||||
id?: string;
|
||||
placeholder?: ReactNode;
|
||||
style?: CSSProperties;
|
||||
whenReady?: () => void;
|
||||
}
|
||||
export declare const MapContainer: React.ForwardRefExoticComponent<MapContainerProps & React.RefAttributes<LeafletMap>>;
|
||||
57
node_modules/react-leaflet/lib/MapContainer.js
generated
vendored
Normal file
57
node_modules/react-leaflet/lib/MapContainer.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
function _extends() {
|
||||
_extends = Object.assign || function(target) {
|
||||
for(var i = 1; i < arguments.length; i++){
|
||||
var source = arguments[i];
|
||||
for(var key in source){
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
};
|
||||
return _extends.apply(this, arguments);
|
||||
}
|
||||
import { LeafletProvider, createLeafletContext } from '@react-leaflet/core';
|
||||
import { Map as LeafletMap } from 'leaflet';
|
||||
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from 'react';
|
||||
function MapContainerComponent({ bounds , boundsOptions , center , children , className , id , placeholder , style , whenReady , zoom , ...options }, forwardedRef) {
|
||||
const [props] = useState({
|
||||
className,
|
||||
id,
|
||||
style
|
||||
});
|
||||
const [context, setContext] = useState(null);
|
||||
useImperativeHandle(forwardedRef, ()=>context?.map ?? null, [
|
||||
context
|
||||
]);
|
||||
const mapRef = useCallback((node)=>{
|
||||
if (node !== null && context === null) {
|
||||
const map = new LeafletMap(node, options);
|
||||
if (center != null && zoom != null) {
|
||||
map.setView(center, zoom);
|
||||
} else if (bounds != null) {
|
||||
map.fitBounds(bounds, boundsOptions);
|
||||
}
|
||||
if (whenReady != null) {
|
||||
map.whenReady(whenReady);
|
||||
}
|
||||
setContext(createLeafletContext(map));
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
useEffect(()=>{
|
||||
return ()=>{
|
||||
context?.map.remove();
|
||||
};
|
||||
}, [
|
||||
context
|
||||
]);
|
||||
const contents = context ? /*#__PURE__*/ React.createElement(LeafletProvider, {
|
||||
value: context
|
||||
}, children) : placeholder ?? null;
|
||||
return /*#__PURE__*/ React.createElement("div", _extends({}, props, {
|
||||
ref: mapRef
|
||||
}), contents);
|
||||
}
|
||||
export const MapContainer = /*#__PURE__*/ forwardRef(MapContainerComponent);
|
||||
8
node_modules/react-leaflet/lib/Marker.d.ts
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/Marker.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { type EventedProps } from '@react-leaflet/core';
|
||||
import { type LatLngExpression, Marker as LeafletMarker, type MarkerOptions } from 'leaflet';
|
||||
import type { ReactNode } from 'react';
|
||||
export interface MarkerProps extends MarkerOptions, EventedProps {
|
||||
children?: ReactNode;
|
||||
position: LatLngExpression;
|
||||
}
|
||||
export declare const Marker: import("react").ForwardRefExoticComponent<MarkerProps & import("react").RefAttributes<LeafletMarker<any>>>;
|
||||
28
node_modules/react-leaflet/lib/Marker.js
generated
vendored
Normal file
28
node_modules/react-leaflet/lib/Marker.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import { createElementObject, createLayerComponent, extendContext } from '@react-leaflet/core';
|
||||
import { Marker as LeafletMarker } from 'leaflet';
|
||||
export const Marker = createLayerComponent(function createMarker({ position , ...options }, ctx) {
|
||||
const marker = new LeafletMarker(position, options);
|
||||
return createElementObject(marker, extendContext(ctx, {
|
||||
overlayContainer: marker
|
||||
}));
|
||||
}, function updateMarker(marker, props, prevProps) {
|
||||
if (props.position !== prevProps.position) {
|
||||
marker.setLatLng(props.position);
|
||||
}
|
||||
if (props.icon != null && props.icon !== prevProps.icon) {
|
||||
marker.setIcon(props.icon);
|
||||
}
|
||||
if (props.zIndexOffset != null && props.zIndexOffset !== prevProps.zIndexOffset) {
|
||||
marker.setZIndexOffset(props.zIndexOffset);
|
||||
}
|
||||
if (props.opacity != null && props.opacity !== prevProps.opacity) {
|
||||
marker.setOpacity(props.opacity);
|
||||
}
|
||||
if (marker.dragging != null && props.draggable !== prevProps.draggable) {
|
||||
if (props.draggable === true) {
|
||||
marker.dragging.enable();
|
||||
} else {
|
||||
marker.dragging.disable();
|
||||
}
|
||||
}
|
||||
});
|
||||
9
node_modules/react-leaflet/lib/Pane.d.ts
generated
vendored
Normal file
9
node_modules/react-leaflet/lib/Pane.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import React, { type CSSProperties, type ReactNode } from 'react';
|
||||
export interface PaneProps {
|
||||
children?: ReactNode;
|
||||
className?: string;
|
||||
name: string;
|
||||
pane?: string;
|
||||
style?: CSSProperties;
|
||||
}
|
||||
export declare const Pane: React.ForwardRefExoticComponent<PaneProps & React.RefAttributes<HTMLElement>>;
|
||||
72
node_modules/react-leaflet/lib/Pane.js
generated
vendored
Normal file
72
node_modules/react-leaflet/lib/Pane.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
import { LeafletProvider, addClassName, useLeafletContext } from '@react-leaflet/core';
|
||||
import React, { forwardRef, useState, useEffect, useImperativeHandle, useMemo } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
const DEFAULT_PANES = [
|
||||
'mapPane',
|
||||
'markerPane',
|
||||
'overlayPane',
|
||||
'popupPane',
|
||||
'shadowPane',
|
||||
'tilePane',
|
||||
'tooltipPane'
|
||||
];
|
||||
function omitPane(obj, pane) {
|
||||
const { [pane]: _p , ...others } = obj;
|
||||
return others;
|
||||
}
|
||||
function createPane(name, props, context) {
|
||||
if (DEFAULT_PANES.indexOf(name) !== -1) {
|
||||
throw new Error(`You must use a unique name for a pane that is not a default Leaflet pane: ${name}`);
|
||||
}
|
||||
if (context.map.getPane(name) != null) {
|
||||
throw new Error(`A pane with this name already exists: ${name}`);
|
||||
}
|
||||
const parentPaneName = props.pane ?? context.pane;
|
||||
const parentPane = parentPaneName ? context.map.getPane(parentPaneName) : undefined;
|
||||
const element = context.map.createPane(name, parentPane);
|
||||
if (props.className != null) {
|
||||
addClassName(element, props.className);
|
||||
}
|
||||
if (props.style != null) {
|
||||
Object.keys(props.style).forEach((key)=>{
|
||||
// @ts-ignore
|
||||
element.style[key] = props.style[key];
|
||||
});
|
||||
}
|
||||
return element;
|
||||
}
|
||||
function PaneComponent(props, forwardedRef) {
|
||||
const [paneName] = useState(props.name);
|
||||
const [paneElement, setPaneElement] = useState(null);
|
||||
useImperativeHandle(forwardedRef, ()=>paneElement, [
|
||||
paneElement
|
||||
]);
|
||||
const context = useLeafletContext();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const newContext = useMemo(()=>({
|
||||
...context,
|
||||
pane: paneName
|
||||
}), [
|
||||
context
|
||||
]);
|
||||
useEffect(()=>{
|
||||
setPaneElement(createPane(paneName, props, context));
|
||||
return function removeCreatedPane() {
|
||||
const pane = context.map.getPane(paneName);
|
||||
pane?.remove?.();
|
||||
// @ts-ignore map internals
|
||||
if (context.map._panes != null) {
|
||||
// @ts-ignore map internals
|
||||
context.map._panes = omitPane(context.map._panes, paneName);
|
||||
// @ts-ignore map internals
|
||||
context.map._paneRenderers = omitPane(// @ts-ignore map internals
|
||||
context.map._paneRenderers, paneName);
|
||||
}
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
return props.children != null && paneElement != null ? /*#__PURE__*/ createPortal(/*#__PURE__*/ React.createElement(LeafletProvider, {
|
||||
value: newContext
|
||||
}, props.children), paneElement) : null;
|
||||
}
|
||||
export const Pane = /*#__PURE__*/ forwardRef(PaneComponent);
|
||||
8
node_modules/react-leaflet/lib/Polygon.d.ts
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/Polygon.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { type PathProps } from '@react-leaflet/core';
|
||||
import { type LatLngExpression, type PolylineOptions, Polygon as LeafletPolygon } from 'leaflet';
|
||||
import type { ReactNode } from 'react';
|
||||
export interface PolygonProps extends PolylineOptions, PathProps {
|
||||
children?: ReactNode;
|
||||
positions: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][];
|
||||
}
|
||||
export declare const Polygon: import("react").ForwardRefExoticComponent<PolygonProps & import("react").RefAttributes<LeafletPolygon<any>>>;
|
||||
12
node_modules/react-leaflet/lib/Polygon.js
generated
vendored
Normal file
12
node_modules/react-leaflet/lib/Polygon.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { createElementObject, createPathComponent, extendContext } from '@react-leaflet/core';
|
||||
import { Polygon as LeafletPolygon } from 'leaflet';
|
||||
export const Polygon = createPathComponent(function createPolygon({ positions , ...options }, ctx) {
|
||||
const polygon = new LeafletPolygon(positions, options);
|
||||
return createElementObject(polygon, extendContext(ctx, {
|
||||
overlayContainer: polygon
|
||||
}));
|
||||
}, function updatePolygon(layer, props, prevProps) {
|
||||
if (props.positions !== prevProps.positions) {
|
||||
layer.setLatLngs(props.positions);
|
||||
}
|
||||
});
|
||||
8
node_modules/react-leaflet/lib/Polyline.d.ts
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/Polyline.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { type PathProps } from '@react-leaflet/core';
|
||||
import { type LatLngExpression, Polyline as LeafletPolyline, type PolylineOptions } from 'leaflet';
|
||||
import type { ReactNode } from 'react';
|
||||
export interface PolylineProps extends PolylineOptions, PathProps {
|
||||
children?: ReactNode;
|
||||
positions: LatLngExpression[] | LatLngExpression[][];
|
||||
}
|
||||
export declare const Polyline: import("react").ForwardRefExoticComponent<PolylineProps & import("react").RefAttributes<LeafletPolyline<import("geojson").LineString | import("geojson").MultiLineString, any>>>;
|
||||
12
node_modules/react-leaflet/lib/Polyline.js
generated
vendored
Normal file
12
node_modules/react-leaflet/lib/Polyline.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { createElementObject, createPathComponent, extendContext } from '@react-leaflet/core';
|
||||
import { Polyline as LeafletPolyline } from 'leaflet';
|
||||
export const Polyline = createPathComponent(function createPolyline({ positions , ...options }, ctx) {
|
||||
const polyline = new LeafletPolyline(positions, options);
|
||||
return createElementObject(polyline, extendContext(ctx, {
|
||||
overlayContainer: polyline
|
||||
}));
|
||||
}, function updatePolyline(layer, props, prevProps) {
|
||||
if (props.positions !== prevProps.positions) {
|
||||
layer.setLatLngs(props.positions);
|
||||
}
|
||||
});
|
||||
8
node_modules/react-leaflet/lib/Popup.d.ts
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/Popup.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { type EventedProps } from '@react-leaflet/core';
|
||||
import { type LatLngExpression, Popup as LeafletPopup, type PopupOptions } from 'leaflet';
|
||||
import { type ReactNode } from 'react';
|
||||
export interface PopupProps extends PopupOptions, EventedProps {
|
||||
children?: ReactNode;
|
||||
position?: LatLngExpression;
|
||||
}
|
||||
export declare const Popup: import("react").ForwardRefExoticComponent<PopupProps & import("react").RefAttributes<LeafletPopup>>;
|
||||
49
node_modules/react-leaflet/lib/Popup.js
generated
vendored
Normal file
49
node_modules/react-leaflet/lib/Popup.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import { createElementObject, createOverlayComponent } from '@react-leaflet/core';
|
||||
import { Popup as LeafletPopup } from 'leaflet';
|
||||
import { useEffect } from 'react';
|
||||
export const Popup = createOverlayComponent(function createPopup(props, context) {
|
||||
const popup = new LeafletPopup(props, context.overlayContainer);
|
||||
return createElementObject(popup, context);
|
||||
}, function usePopupLifecycle(element, context, { position }, setOpen) {
|
||||
useEffect(function addPopup() {
|
||||
const { instance } = element;
|
||||
function onPopupOpen(event) {
|
||||
if (event.popup === instance) {
|
||||
instance.update();
|
||||
setOpen(true);
|
||||
}
|
||||
}
|
||||
function onPopupClose(event) {
|
||||
if (event.popup === instance) {
|
||||
setOpen(false);
|
||||
}
|
||||
}
|
||||
context.map.on({
|
||||
popupopen: onPopupOpen,
|
||||
popupclose: onPopupClose
|
||||
});
|
||||
if (context.overlayContainer == null) {
|
||||
// Attach to a Map
|
||||
if (position != null) {
|
||||
instance.setLatLng(position);
|
||||
}
|
||||
instance.openOn(context.map);
|
||||
} else {
|
||||
// Attach to container component
|
||||
context.overlayContainer.bindPopup(instance);
|
||||
}
|
||||
return function removePopup() {
|
||||
context.map.off({
|
||||
popupopen: onPopupOpen,
|
||||
popupclose: onPopupClose
|
||||
});
|
||||
context.overlayContainer?.unbindPopup();
|
||||
context.map.removeLayer(instance);
|
||||
};
|
||||
}, [
|
||||
element,
|
||||
context,
|
||||
setOpen,
|
||||
position
|
||||
]);
|
||||
});
|
||||
8
node_modules/react-leaflet/lib/Rectangle.d.ts
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/Rectangle.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { type PathProps } from '@react-leaflet/core';
|
||||
import { type LatLngBoundsExpression, Rectangle as LeafletRectangle, type PathOptions } from 'leaflet';
|
||||
import type { ReactNode } from 'react';
|
||||
export interface RectangleProps extends PathOptions, PathProps {
|
||||
bounds: LatLngBoundsExpression;
|
||||
children?: ReactNode;
|
||||
}
|
||||
export declare const Rectangle: import("react").ForwardRefExoticComponent<RectangleProps & import("react").RefAttributes<LeafletRectangle<any>>>;
|
||||
12
node_modules/react-leaflet/lib/Rectangle.js
generated
vendored
Normal file
12
node_modules/react-leaflet/lib/Rectangle.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
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);
|
||||
}
|
||||
});
|
||||
39
node_modules/react-leaflet/lib/SVGOverlay.d.ts
generated
vendored
Normal file
39
node_modules/react-leaflet/lib/SVGOverlay.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
import { type MediaOverlayProps } from '@react-leaflet/core';
|
||||
import { SVGOverlay as LeafletSVGOverlay } from 'leaflet';
|
||||
import { type ReactNode } from 'react';
|
||||
export interface SVGOverlayProps extends MediaOverlayProps {
|
||||
attributes?: Record<string, string>;
|
||||
children?: ReactNode;
|
||||
}
|
||||
export declare const useSVGOverlayElement: (props: SVGOverlayProps, context: Readonly<{
|
||||
__version: number;
|
||||
map: import("leaflet").Map;
|
||||
layerContainer?: import("leaflet").LayerGroup<any> | import("@react-leaflet/core/lib/context").ControlledLayer | undefined;
|
||||
layersControl?: import("leaflet").Control.Layers | undefined;
|
||||
overlayContainer?: import("leaflet").Layer | undefined;
|
||||
pane?: string | undefined;
|
||||
}>) => import("react").MutableRefObject<Readonly<{
|
||||
instance: LeafletSVGOverlay;
|
||||
context: Readonly<{
|
||||
__version: number;
|
||||
map: import("leaflet").Map;
|
||||
layerContainer?: import("leaflet").LayerGroup<any> | import("@react-leaflet/core/lib/context").ControlledLayer | undefined;
|
||||
layersControl?: import("leaflet").Control.Layers | undefined;
|
||||
overlayContainer?: import("leaflet").Layer | undefined;
|
||||
pane?: string | undefined;
|
||||
}>;
|
||||
container?: any;
|
||||
}>>;
|
||||
export declare const useSVGOverlay: (props: SVGOverlayProps) => import("react").MutableRefObject<Readonly<{
|
||||
instance: LeafletSVGOverlay;
|
||||
context: Readonly<{
|
||||
__version: number;
|
||||
map: import("leaflet").Map;
|
||||
layerContainer?: import("leaflet").LayerGroup<any> | import("@react-leaflet/core/lib/context").ControlledLayer | undefined;
|
||||
layersControl?: import("leaflet").Control.Layers | undefined;
|
||||
overlayContainer?: import("leaflet").Layer | undefined;
|
||||
pane?: string | undefined;
|
||||
}>;
|
||||
container?: any;
|
||||
}>>;
|
||||
export declare const SVGOverlay: import("react").ForwardRefExoticComponent<SVGOverlayProps & import("react").RefAttributes<LeafletSVGOverlay>>;
|
||||
23
node_modules/react-leaflet/lib/SVGOverlay.js
generated
vendored
Normal file
23
node_modules/react-leaflet/lib/SVGOverlay.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { createElementHook, createElementObject, createLayerHook, updateMediaOverlay } from '@react-leaflet/core';
|
||||
import { SVGOverlay as LeafletSVGOverlay } from 'leaflet';
|
||||
import { forwardRef, useImperativeHandle } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
export const useSVGOverlayElement = createElementHook(function createSVGOverlay(props, context) {
|
||||
const { attributes , bounds , ...options } = props;
|
||||
const container = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||
container.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
|
||||
if (attributes != null) {
|
||||
Object.keys(attributes).forEach((name)=>{
|
||||
container.setAttribute(name, attributes[name]);
|
||||
});
|
||||
}
|
||||
const overlay = new LeafletSVGOverlay(container, bounds, options);
|
||||
return createElementObject(overlay, context, container);
|
||||
}, updateMediaOverlay);
|
||||
export const useSVGOverlay = createLayerHook(useSVGOverlayElement);
|
||||
function SVGOverlayComponent({ children , ...options }, forwardedRef) {
|
||||
const { instance , container } = useSVGOverlay(options).current;
|
||||
useImperativeHandle(forwardedRef, ()=>instance);
|
||||
return container == null || children == null ? null : /*#__PURE__*/ createPortal(children, container);
|
||||
}
|
||||
export const SVGOverlay = /*#__PURE__*/ forwardRef(SVGOverlayComponent);
|
||||
4
node_modules/react-leaflet/lib/ScaleControl.d.ts
generated
vendored
Normal file
4
node_modules/react-leaflet/lib/ScaleControl.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/// <reference types="react" />
|
||||
import { Control } from 'leaflet';
|
||||
export type ScaleControlProps = Control.ScaleOptions;
|
||||
export declare const ScaleControl: import("react").ForwardRefExoticComponent<Control.ScaleOptions & import("react").RefAttributes<Control.Scale>>;
|
||||
5
node_modules/react-leaflet/lib/ScaleControl.js
generated
vendored
Normal file
5
node_modules/react-leaflet/lib/ScaleControl.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { createControlComponent } from '@react-leaflet/core';
|
||||
import { Control } from 'leaflet';
|
||||
export const ScaleControl = createControlComponent(function createScaleControl(props) {
|
||||
return new Control.Scale(props);
|
||||
});
|
||||
7
node_modules/react-leaflet/lib/TileLayer.d.ts
generated
vendored
Normal file
7
node_modules/react-leaflet/lib/TileLayer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference types="react" />
|
||||
import { type LayerProps } from '@react-leaflet/core';
|
||||
import { TileLayer as LeafletTileLayer, type TileLayerOptions } from 'leaflet';
|
||||
export interface TileLayerProps extends TileLayerOptions, LayerProps {
|
||||
url: string;
|
||||
}
|
||||
export declare const TileLayer: import("react").ForwardRefExoticComponent<TileLayerProps & import("react").RefAttributes<LeafletTileLayer>>;
|
||||
12
node_modules/react-leaflet/lib/TileLayer.js
generated
vendored
Normal file
12
node_modules/react-leaflet/lib/TileLayer.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { createElementObject, createTileLayerComponent, updateGridLayer, withPane } from '@react-leaflet/core';
|
||||
import { TileLayer as LeafletTileLayer } from 'leaflet';
|
||||
export const TileLayer = createTileLayerComponent(function createTileLayer({ url , ...options }, context) {
|
||||
const layer = new LeafletTileLayer(url, withPane(options, context));
|
||||
return createElementObject(layer, context);
|
||||
}, function updateTileLayer(layer, props, prevProps) {
|
||||
updateGridLayer(layer, props, prevProps);
|
||||
const { url } = props;
|
||||
if (url != null && url !== prevProps.url) {
|
||||
layer.setUrl(url);
|
||||
}
|
||||
});
|
||||
8
node_modules/react-leaflet/lib/Tooltip.d.ts
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/Tooltip.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { type EventedProps } from '@react-leaflet/core';
|
||||
import { type LatLngExpression, Tooltip as LeafletTooltip, type TooltipOptions } from 'leaflet';
|
||||
import { type ReactNode } from 'react';
|
||||
export interface TooltipProps extends TooltipOptions, EventedProps {
|
||||
children?: ReactNode;
|
||||
position?: LatLngExpression;
|
||||
}
|
||||
export declare const Tooltip: import("react").ForwardRefExoticComponent<TooltipProps & import("react").RefAttributes<LeafletTooltip>>;
|
||||
49
node_modules/react-leaflet/lib/Tooltip.js
generated
vendored
Normal file
49
node_modules/react-leaflet/lib/Tooltip.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import { createElementObject, createOverlayComponent } from '@react-leaflet/core';
|
||||
import { Tooltip as LeafletTooltip } from 'leaflet';
|
||||
import { useEffect } from 'react';
|
||||
export const Tooltip = createOverlayComponent(function createTooltip(props, context) {
|
||||
const tooltip = new LeafletTooltip(props, context.overlayContainer);
|
||||
return createElementObject(tooltip, context);
|
||||
}, function useTooltipLifecycle(element, context, { position }, setOpen) {
|
||||
useEffect(function addTooltip() {
|
||||
const container = context.overlayContainer;
|
||||
if (container == null) {
|
||||
return;
|
||||
}
|
||||
const { instance } = element;
|
||||
const onTooltipOpen = (event)=>{
|
||||
if (event.tooltip === instance) {
|
||||
if (position != null) {
|
||||
instance.setLatLng(position);
|
||||
}
|
||||
instance.update();
|
||||
setOpen(true);
|
||||
}
|
||||
};
|
||||
const onTooltipClose = (event)=>{
|
||||
if (event.tooltip === instance) {
|
||||
setOpen(false);
|
||||
}
|
||||
};
|
||||
container.on({
|
||||
tooltipopen: onTooltipOpen,
|
||||
tooltipclose: onTooltipClose
|
||||
});
|
||||
container.bindTooltip(instance);
|
||||
return function removeTooltip() {
|
||||
container.off({
|
||||
tooltipopen: onTooltipOpen,
|
||||
tooltipclose: onTooltipClose
|
||||
});
|
||||
// @ts-ignore protected property
|
||||
if (container._map != null) {
|
||||
container.unbindTooltip();
|
||||
}
|
||||
};
|
||||
}, [
|
||||
element,
|
||||
context,
|
||||
setOpen,
|
||||
position
|
||||
]);
|
||||
});
|
||||
9
node_modules/react-leaflet/lib/VideoOverlay.d.ts
generated
vendored
Normal file
9
node_modules/react-leaflet/lib/VideoOverlay.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { type MediaOverlayProps } from '@react-leaflet/core';
|
||||
import { VideoOverlay as LeafletVideoOverlay, type VideoOverlayOptions } from 'leaflet';
|
||||
import type { ReactNode } from 'react';
|
||||
export interface VideoOverlayProps extends MediaOverlayProps, VideoOverlayOptions {
|
||||
children?: ReactNode;
|
||||
play?: boolean;
|
||||
url: string | string[] | HTMLVideoElement;
|
||||
}
|
||||
export declare const VideoOverlay: import("react").ForwardRefExoticComponent<VideoOverlayProps & import("react").RefAttributes<LeafletVideoOverlay>>;
|
||||
24
node_modules/react-leaflet/lib/VideoOverlay.js
generated
vendored
Normal file
24
node_modules/react-leaflet/lib/VideoOverlay.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { createElementObject, createLayerComponent, extendContext, updateMediaOverlay } from '@react-leaflet/core';
|
||||
import { VideoOverlay as LeafletVideoOverlay } from 'leaflet';
|
||||
export const VideoOverlay = createLayerComponent(function createVideoOverlay({ bounds , url , ...options }, ctx) {
|
||||
const overlay = new LeafletVideoOverlay(url, bounds, options);
|
||||
if (options.play === true) {
|
||||
overlay.getElement()?.play();
|
||||
}
|
||||
return createElementObject(overlay, extendContext(ctx, {
|
||||
overlayContainer: overlay
|
||||
}));
|
||||
}, function updateVideoOverlay(overlay, props, prevProps) {
|
||||
updateMediaOverlay(overlay, props, prevProps);
|
||||
if (typeof props.url === 'string' && props.url !== prevProps.url) {
|
||||
overlay.setUrl(props.url);
|
||||
}
|
||||
const video = overlay.getElement();
|
||||
if (video != null) {
|
||||
if (props.play === true && !prevProps.play) {
|
||||
video.play();
|
||||
} else if (!props.play && prevProps.play === true) {
|
||||
video.pause();
|
||||
}
|
||||
}
|
||||
});
|
||||
8
node_modules/react-leaflet/lib/WMSTileLayer.d.ts
generated
vendored
Normal file
8
node_modules/react-leaflet/lib/WMSTileLayer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference types="react" />
|
||||
import { type LayerProps } from '@react-leaflet/core';
|
||||
import { TileLayer, type WMSOptions, type WMSParams } from 'leaflet';
|
||||
export interface WMSTileLayerProps extends WMSOptions, LayerProps {
|
||||
params?: WMSParams;
|
||||
url: string;
|
||||
}
|
||||
export declare const WMSTileLayer: import("react").ForwardRefExoticComponent<WMSTileLayerProps & import("react").RefAttributes<TileLayer.WMS>>;
|
||||
14
node_modules/react-leaflet/lib/WMSTileLayer.js
generated
vendored
Normal file
14
node_modules/react-leaflet/lib/WMSTileLayer.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { createElementObject, createTileLayerComponent, updateGridLayer, withPane } from '@react-leaflet/core';
|
||||
import { TileLayer } from 'leaflet';
|
||||
export const WMSTileLayer = createTileLayerComponent(function createWMSTileLayer({ eventHandlers: _eh , params ={} , url , ...options }, context) {
|
||||
const layer = new TileLayer.WMS(url, {
|
||||
...params,
|
||||
...withPane(options, context)
|
||||
});
|
||||
return createElementObject(layer, context);
|
||||
}, function updateWMSTileLayer(layer, props, prevProps) {
|
||||
updateGridLayer(layer, props, prevProps);
|
||||
if (props.params != null && props.params !== prevProps.params) {
|
||||
layer.setParams(props.params);
|
||||
}
|
||||
});
|
||||
4
node_modules/react-leaflet/lib/ZoomControl.d.ts
generated
vendored
Normal file
4
node_modules/react-leaflet/lib/ZoomControl.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/// <reference types="react" />
|
||||
import { Control } from 'leaflet';
|
||||
export type ZoomControlProps = Control.ZoomOptions;
|
||||
export declare const ZoomControl: import("react").ForwardRefExoticComponent<Control.ZoomOptions & import("react").RefAttributes<Control.Zoom>>;
|
||||
5
node_modules/react-leaflet/lib/ZoomControl.js
generated
vendored
Normal file
5
node_modules/react-leaflet/lib/ZoomControl.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { createControlComponent } from '@react-leaflet/core';
|
||||
import { Control } from 'leaflet';
|
||||
export const ZoomControl = createControlComponent(function createZoomControl(props) {
|
||||
return new Control.Zoom(props);
|
||||
});
|
||||
4
node_modules/react-leaflet/lib/hooks.d.ts
generated
vendored
Normal file
4
node_modules/react-leaflet/lib/hooks.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { LeafletEventHandlerFnMap, Map } from 'leaflet';
|
||||
export declare function useMap(): Map;
|
||||
export declare function useMapEvent<T extends keyof LeafletEventHandlerFnMap>(type: T, handler: LeafletEventHandlerFnMap[T]): Map;
|
||||
export declare function useMapEvents(handlers: LeafletEventHandlerFnMap): Map;
|
||||
34
node_modules/react-leaflet/lib/hooks.js
generated
vendored
Normal file
34
node_modules/react-leaflet/lib/hooks.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { useLeafletContext } from '@react-leaflet/core';
|
||||
import { useEffect } from 'react';
|
||||
export function useMap() {
|
||||
return useLeafletContext().map;
|
||||
}
|
||||
export function useMapEvent(type, handler) {
|
||||
const map = useMap();
|
||||
useEffect(function addMapEventHandler() {
|
||||
// @ts-ignore event type
|
||||
map.on(type, handler);
|
||||
return function removeMapEventHandler() {
|
||||
// @ts-ignore event type
|
||||
map.off(type, handler);
|
||||
};
|
||||
}, [
|
||||
map,
|
||||
type,
|
||||
handler
|
||||
]);
|
||||
return map;
|
||||
}
|
||||
export function useMapEvents(handlers) {
|
||||
const map = useMap();
|
||||
useEffect(function addMapEventHandlers() {
|
||||
map.on(handlers);
|
||||
return function removeMapEventHandlers() {
|
||||
map.off(handlers);
|
||||
};
|
||||
}, [
|
||||
map,
|
||||
handlers
|
||||
]);
|
||||
return map;
|
||||
}
|
||||
23
node_modules/react-leaflet/lib/index.d.ts
generated
vendored
Normal file
23
node_modules/react-leaflet/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export { useMap, useMapEvent, useMapEvents } from './hooks.js';
|
||||
export { AttributionControl, type AttributionControlProps, } from './AttributionControl.js';
|
||||
export { Circle, type CircleProps } from './Circle.js';
|
||||
export { CircleMarker, type CircleMarkerProps } from './CircleMarker.js';
|
||||
export { FeatureGroup, type FeatureGroupProps } from './FeatureGroup.js';
|
||||
export { GeoJSON, type GeoJSONProps } from './GeoJSON.js';
|
||||
export { ImageOverlay, type ImageOverlayProps } from './ImageOverlay.js';
|
||||
export { LayerGroup, type LayerGroupProps } from './LayerGroup.js';
|
||||
export { LayersControl, type LayersControlProps, type ControlledLayerProps, } from './LayersControl.js';
|
||||
export { MapContainer, type MapContainerProps } from './MapContainer.js';
|
||||
export { Marker, type MarkerProps } from './Marker.js';
|
||||
export { Pane, type PaneProps } from './Pane.js';
|
||||
export { Polygon, type PolygonProps } from './Polygon.js';
|
||||
export { Polyline, type PolylineProps } from './Polyline.js';
|
||||
export { Popup, type PopupProps } from './Popup.js';
|
||||
export { Rectangle, type RectangleProps } from './Rectangle.js';
|
||||
export { ScaleControl, type ScaleControlProps } from './ScaleControl.js';
|
||||
export { SVGOverlay, type SVGOverlayProps } from './SVGOverlay.js';
|
||||
export { TileLayer, type TileLayerProps } from './TileLayer.js';
|
||||
export { Tooltip, type TooltipProps } from './Tooltip.js';
|
||||
export { VideoOverlay, type VideoOverlayProps } from './VideoOverlay.js';
|
||||
export { WMSTileLayer, type WMSTileLayerProps } from './WMSTileLayer.js';
|
||||
export { ZoomControl, type ZoomControlProps } from './ZoomControl.js';
|
||||
23
node_modules/react-leaflet/lib/index.js
generated
vendored
Normal file
23
node_modules/react-leaflet/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
export { useMap, useMapEvent, useMapEvents } from './hooks.js';
|
||||
export { AttributionControl } from './AttributionControl.js';
|
||||
export { Circle } from './Circle.js';
|
||||
export { CircleMarker } from './CircleMarker.js';
|
||||
export { FeatureGroup } from './FeatureGroup.js';
|
||||
export { GeoJSON } from './GeoJSON.js';
|
||||
export { ImageOverlay } from './ImageOverlay.js';
|
||||
export { LayerGroup } from './LayerGroup.js';
|
||||
export { LayersControl } from './LayersControl.js';
|
||||
export { MapContainer } from './MapContainer.js';
|
||||
export { Marker } from './Marker.js';
|
||||
export { Pane } from './Pane.js';
|
||||
export { Polygon } from './Polygon.js';
|
||||
export { Polyline } from './Polyline.js';
|
||||
export { Popup } from './Popup.js';
|
||||
export { Rectangle } from './Rectangle.js';
|
||||
export { ScaleControl } from './ScaleControl.js';
|
||||
export { SVGOverlay } from './SVGOverlay.js';
|
||||
export { TileLayer } from './TileLayer.js';
|
||||
export { Tooltip } from './Tooltip.js';
|
||||
export { VideoOverlay } from './VideoOverlay.js';
|
||||
export { WMSTileLayer } from './WMSTileLayer.js';
|
||||
export { ZoomControl } from './ZoomControl.js';
|
||||
Reference in New Issue
Block a user