@actinc/dls
Version:
Design Language System (DLS) for ACT & Encoura front-end projects.
56 lines • 2.43 kB
TypeScript
/**
* Copyright (c) ACT, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { GeoJSONFeature, ProjectionSpecification } from 'mapbox-gl';
import React from 'react';
import { AttributionControlProps, ControlPosition, FogSpecification, LayerProps, LngLatBoundsLike, MapMouseEvent, MapRef, NavigationControlProps, MapProps as ReactMapGLProps, SourceProps as SourceGLProps, TerrainSpecification } from 'react-map-gl/mapbox';
import type GeoJSON from 'geojson';
type MapGLProps = ReactMapGLProps & {
logoPosition?: ControlPosition;
fog?: FogSpecification;
terrain?: TerrainSpecification;
};
type SourceProps = SourceGLProps & {
data?: GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry> | string | undefined;
};
export interface InitialBoundsPositionProps {
id?: string | number;
position: LngLatBoundsLike;
}
export interface FeatureHoverProps {
feature: GeoJSONFeature;
lat: number;
lng: number;
}
export type MapProps = MapGLProps & {
attributionControlProps?: AttributionControlProps;
children?: React.ReactElement;
color?: string;
data?: GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry> | string | undefined;
height: number | string;
initialBoundsPosition?: InitialBoundsPositionProps;
layers?: Array<React.ReactElement<LayerProps>>;
layerProps?: LayerProps;
mapboxAccessToken: string;
navigationControlProps?: NavigationControlProps;
onMapClick?: (event: MapMouseEvent, mapRef: MapRef | null) => void;
preserveDrawingBuffer?: boolean;
projection?: ProjectionSpecification;
setHoverInfo?: (value: FeatureHoverProps | undefined) => void;
sourceId?: string;
sourceProps?: SourceProps;
width: number | string;
};
/**
* Map component which under the hood uses mapbox and react-map-gl. For this to work it's necessary
* to add the link bellow in the head of your page: <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.css' rel='stylesheet' />
* For more information: https://visgl.github.io/react-map-gl/docs/get-started/get-started#styling
*
* @note If sending the `data` prop it's also necessary to send the `sourceId` prop.
*/
export declare const Map: React.FC<MapProps>;
export default Map;
//# sourceMappingURL=index.d.ts.map