rc-leaflet
Version:
React Map Components of Leaflet
225 lines (224 loc) • 11.8 kB
TypeScript
import PropTypes from 'prop-types';
import L from 'leaflet';
import { Point as GeoPoint, Geometry, Feature, FeatureCollection } from 'geojson';
import { ContextType } from '../RCMap/Context';
import { Props as LayerGroupProps } from '../LayerGroup';
import FeatureGroup from '../FeatureGroup';
export declare type JSONData = Geometry | Geometry[] | Feature | Feature[] | FeatureCollection;
interface PartialProps {
data: JSONData;
}
declare type Props = Readonly<Partial<PartialProps>>;
export default class GeoJSON<P extends L.GeoJSONOptions = L.GeoJSONOptions> extends FeatureGroup<L.GeoJSON, Props & P> {
static propTypes: {
data: PropTypes.Requireable<PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<(PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][][]>;
}>)[]>;
}> | PropTypes.InferProps<{
id: PropTypes.Requireable<string | number>;
type: PropTypes.Validator<string>;
geometry: PropTypes.Validator<PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<(PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][][]>;
}>)[]>;
}>>;
properties: PropTypes.Requireable<object>;
}> | PropTypes.InferProps<{
id: PropTypes.Requireable<string | number>;
type: PropTypes.Validator<string>;
geometry: PropTypes.Validator<PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<(PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][][]>;
}>)[]>;
}>>;
properties: PropTypes.Requireable<object>;
}>[] | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
features: PropTypes.Validator<PropTypes.InferProps<{
id: PropTypes.Requireable<string | number>;
type: PropTypes.Validator<string>;
geometry: PropTypes.Validator<PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<(PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][][]>;
}>)[]>;
}>>;
properties: PropTypes.Requireable<object>;
}>[]>;
}> | (PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<(PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][]>;
}> | PropTypes.InferProps<{
type: PropTypes.Validator<string>;
coordinates: PropTypes.Validator<number[][][][]>;
}>)[]>;
}>)[]>;
pointToLayer: PropTypes.Requireable<(...args: any[]) => any>;
style: PropTypes.Requireable<((...args: any[]) => any) | PropTypes.InferProps<{
stroke: PropTypes.Requireable<boolean>;
color: PropTypes.Requireable<string>;
weight: PropTypes.Requireable<number>;
opacity: PropTypes.Requireable<number>;
lineCap: PropTypes.Requireable<L.LineCapShape>;
lineJoin: PropTypes.Requireable<L.LineJoinShape>;
dashArray: PropTypes.Requireable<string | number[]>;
dashOffset: PropTypes.Requireable<string>;
fill: PropTypes.Requireable<boolean>;
fillColor: PropTypes.Requireable<string>;
fillOpacity: PropTypes.Requireable<number>;
fillRule: PropTypes.Requireable<L.FillRule>;
renderer: PropTypes.Requireable<L.Renderer>;
className: PropTypes.Requireable<string>;
interactive: PropTypes.Requireable<boolean>;
bubblingMouseEvents: PropTypes.Requireable<boolean>;
group: PropTypes.Requireable<L.LayerGroup<unknown>>;
pane: PropTypes.Requireable<string>;
attribution: PropTypes.Requireable<string>;
onCreate: PropTypes.Requireable<(...args: any[]) => any>;
onAdd: PropTypes.Requireable<(...args: any[]) => any>;
onUpdate: PropTypes.Requireable<(...args: any[]) => any>;
onBeforeRemove: PropTypes.Requireable<(...args: any[]) => any>;
onRemove: PropTypes.Requireable<(...args: any[]) => any>;
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
onClick: PropTypes.Requireable<(...args: any[]) => any>;
onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
onMouseOut: PropTypes.Requireable<(...args: any[]) => any>;
}>>;
onEachFeature: PropTypes.Requireable<(...args: any[]) => any>;
filter: PropTypes.Requireable<(...args: any[]) => any>;
coordsToLatLng: PropTypes.Requireable<(...args: any[]) => any>;
zIndex: PropTypes.Requireable<number>;
group: PropTypes.Requireable<L.LayerGroup<unknown>>;
pane: PropTypes.Requireable<string>;
attribution: PropTypes.Requireable<string>;
onCreate: PropTypes.Requireable<(...args: any[]) => any>;
onAdd: PropTypes.Requireable<(...args: any[]) => any>;
onUpdate: PropTypes.Requireable<(...args: any[]) => any>;
onBeforeRemove: PropTypes.Requireable<(...args: any[]) => any>;
onRemove: PropTypes.Requireable<(...args: any[]) => any>;
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
onClick: PropTypes.Requireable<(...args: any[]) => any>;
onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
onMouseOut: PropTypes.Requireable<(...args: any[]) => any>;
};
static defaultProps: {
pointToLayer(feature: Feature<GeoPoint, any>, position: L.LatLng): L.Marker<any>;
};
constructor(props: LayerGroupProps & Props & P, context: ContextType);
componentDidUpdate(prevProps: LayerGroupProps & Props & P): void;
protected readonly style: L.PathOptions;
protected createInstance(props: Props & P): L.GeoJSON;
}
export {};