react-ol-choropleth
Version:
A React plugin for creating choropleth maps using OpenLayers
28 lines (27 loc) • 1.39 kB
TypeScript
import { Style } from 'ol/style.js';
import { StyleLike } from 'ol/style/Style.js';
import { FeatureLike } from 'ol/Feature.js';
import { ColorScale, GeoJSONFeatureCollection, OverlayOptions, LegendPosition } from '../types/map';
type BaseChoroplethMapProps = {
data: FeatureLike[] | GeoJSONFeatureCollection;
valueProperty: string;
colorScale: ColorScale;
style?: Style | StyleLike;
zoom?: number;
baseMap?: "osm" | "satellite" | "none";
showLegend?: boolean;
legendPosition?: LegendPosition;
onFeatureClick?: (feature: FeatureLike | null, coordinate?: [number, number]) => void;
onFeatureHover?: (feature: FeatureLike | null) => void;
overlayOptions?: OverlayOptions | false;
zoomToFeature?: boolean;
selectedFeatureBorderColor?: string;
canZoomOutBoundaries?: boolean;
};
interface ExtendedChoroplethMapProps extends BaseChoroplethMapProps {
className?: string;
mapClassName?: string;
legendClassName?: string;
}
declare const _default: import('react').MemoExoticComponent<({ data, valueProperty, colorScale, style, zoom, baseMap, showLegend, legendPosition, onFeatureClick, onFeatureHover, overlayOptions, zoomToFeature, selectedFeatureBorderColor, canZoomOutBoundaries, className, mapClassName, legendClassName, }: ExtendedChoroplethMapProps) => import("react/jsx-runtime").JSX.Element>;
export default _default;