mmr-gl-react
Version:
React components for MMR GL JS-compatible libraries
134 lines (133 loc) • 7.62 kB
TypeScript
import * as React from 'react';
import type { Map as MmrMap, MapOptions, Marker as MmrMarker, MarkerOptions, Popup as MmrPopup, PopupOptions, AttributionControl as MmrAttributionControl, FullscreenControl as MmrFullscreenControl, GeolocateControl as MmrGeolocateControl, NavigationControl as MmrNavigationControl, ScaleControl as MmrScaleControl } from 'mmr-gl';
import { MapStyle, AnyLayer, AnySource } from './types/style-spec-mmr';
import { MapProps as _MapProps } from './components/map';
import { MarkerProps as _MarkerProps } from './components/marker';
import { PopupProps as _PopupProps } from './components/popup';
import { AttributionControlProps as _AttributionControlProps } from './components/attribution-control';
import { FullscreenControlProps as _FullscreenControlProps } from './components/fullscreen-control';
import { GeolocateControlProps as _GeolocateControlProps } from './components/geolocate-control';
import { NavigationControlProps as _NavigationControlProps } from './components/navigation-control';
import { ScaleControlProps as _ScaleControlProps } from './components/scale-control';
import { LayerProps as _LayerProps } from './components/layer';
import { SourceProps as _SourceProps } from './components/source';
import type { MapRef as _MapRef } from './mmr/create-ref';
import type * as events from './types/events';
import type { MapCallbacks } from './types/events-mmr';
export declare function useMap(): import("./components/use-map").MapCollection<MmrMap>;
export type MapProps = _MapProps<MapOptions, MapStyle, MapCallbacks, MmrMap>;
export type MapRef = _MapRef<MmrMap>;
export declare const Map: React.ForwardRefExoticComponent<{
zoom?: number;
pitch?: number;
bearing?: number;
maxZoom?: number;
minZoom?: number;
interactive?: boolean;
minPitch?: number;
maxPitch?: number;
maxBounds?: import("mmr-gl").LngLatBoundsLike;
renderWorldCopies?: boolean;
scrollZoom?: boolean | import("mmr-gl").AroundCenterOptions;
boxZoom?: boolean;
dragRotate?: boolean;
dragPan?: boolean | import("mmr-gl").DragPanOptions;
keyboard?: boolean;
doubleClickZoom?: boolean;
touchZoomRotate?: boolean | import("mmr-gl").AroundCenterOptions;
touchPitch?: boolean | import("mmr-gl").AroundCenterOptions;
accessToken?: string;
localIdeographFontFamily?: string;
pixelRatio?: number;
antialias?: boolean;
attributionControl?: boolean;
bearingSnap?: number;
clickTolerance?: number;
collectResourceTiming?: boolean;
crossSourceCollisions?: boolean;
cooperativeGestures?: boolean | import("mmr-gl").GestureOptions;
customAttribution?: string | string[];
hash?: string | boolean;
fadeDuration?: number;
failIfMajorPerformanceCaveat?: boolean;
locale?: any;
logoPosition?: import("mmr-gl").ControlPosition;
preserveDrawingBuffer?: boolean;
pitchWithRotate?: boolean;
refreshExpiredTiles?: boolean;
trackResize?: boolean;
transformRequest?: import("mmr-gl").RequestTransformFunction;
maxTileCacheSize?: number;
maxTileCacheZoomLevels?: number;
transformCameraUpdate?: import("mmr-gl").CameraUpdateTransformFunction;
validateStyle?: boolean;
maxCanvasSize?: [number, number];
mmrglLogo?: boolean;
} & Partial<import("./types/common").ViewState> & MapCallbacks & {
vkAccessToken?: string;
vkBaseApiUrl?: string;
initialViewState?: Partial<import("./types/common").ViewState> & {
bounds?: import("./types").LngLatBoundsLike;
fitBoundsOptions?: {
offset?: import("./types").PointLike;
minZoom?: number;
maxZoom?: number;
padding?: number | import("./types").PaddingOptions;
};
};
gl?: WebGLRenderingContext;
viewState?: import("./types/common").ViewState & {
width: number;
height: number;
};
mapStyle?: string | MapStyle | import("./types").ImmutableLike<MapStyle>;
styleDiffing?: boolean;
fog?: unknown;
light?: import("mmr-gl-style-spec").LightSpecification;
terrain?: import("mmr-gl-style-spec").TerrainSpecification;
interactiveLayerIds?: string[];
cursor?: string;
} & import("./utils/set-globals").GlobalSettings & {
mapLib?: import("./types/lib").MapLib<MmrMap> | Promise<import("./types/lib").MapLib<MmrMap>>;
reuseMaps?: boolean;
id?: string;
style?: React.CSSProperties;
children?: any;
} & React.RefAttributes<MapRef>>;
export type MarkerProps = _MarkerProps<MarkerOptions, MmrMarker>;
export declare const Marker: (props: MarkerProps & React.RefAttributes<MmrMarker>) => React.ReactElement | null;
export type PopupProps = _PopupProps<PopupOptions, MmrPopup>;
export declare const Popup: (props: PopupProps & React.RefAttributes<MmrPopup>) => React.ReactElement | null;
type AttributionControlOptions = ConstructorParameters<typeof MmrAttributionControl>[0];
export type AttributionControlProps = _AttributionControlProps<AttributionControlOptions>;
export declare const AttributionControl: (props: AttributionControlProps) => React.ReactElement | null;
type FullscreenControlOptions = ConstructorParameters<typeof MmrFullscreenControl>[0];
export type FullscreenControlProps = _FullscreenControlProps<FullscreenControlOptions>;
export declare const FullscreenControl: (props: FullscreenControlProps) => React.ReactElement | null;
type NavigationControlOptions = ConstructorParameters<typeof MmrNavigationControl>[0];
export type NavigationControlProps = _NavigationControlProps<NavigationControlOptions>;
export declare const NavigationControl: (props: NavigationControlProps) => React.ReactElement | null;
type GeolocateControlOptions = ConstructorParameters<typeof MmrGeolocateControl>[0];
export type GeolocateControlProps = _GeolocateControlProps<GeolocateControlOptions, MmrGeolocateControl>;
export declare const GeolocateControl: (props: GeolocateControlProps & React.RefAttributes<MmrGeolocateControl>) => React.ReactElement | null;
type ScaleControlOptions = ConstructorParameters<typeof MmrScaleControl>[0];
export type ScaleControlProps = _ScaleControlProps<ScaleControlOptions>;
export declare const ScaleControl: (props: ScaleControlProps) => React.ReactElement | null;
export type LayerProps = _LayerProps<AnyLayer>;
export declare const Layer: (props: LayerProps) => React.ReactElement | null;
export type SourceProps = _SourceProps<AnySource>;
export declare const Source: (props: SourceProps) => React.ReactElement | null;
export { default as useControl } from './components/use-control';
export { MapProvider } from './components/use-map';
export default Map;
export * from './types/public';
export type { default as Point } from '@mapbox/point-geometry';
export type { PointLike, LngLat, LngLatLike, LngLatBounds, LngLatBoundsLike, PaddingOptions, MapGeoJSONFeature, GeoJSONSource, VideoSource, ImageSource, CanvasSource, VectorTileSource } from 'mmr-gl';
export * from './types/style-spec-mmr';
export type { MapEvent, MapMouseEvent, MapLayerMouseEvent, MapTouchEvent, MapLayerTouchEvent, MapStyleDataEvent, MapSourceDataEvent, MapWheelEvent, MapBoxZoomEvent, ErrorEvent, ViewStateChangeEvent } from './types/events-mmr';
export type PopupEvent = events.PopupEvent<MmrPopup>;
export type MarkerEvent = events.MarkerEvent<MmrMarker>;
export type MarkerDragEvent = events.MarkerDragEvent<MmrMarker>;
export type GeolocateEvent = events.GeolocateEvent<MmrGeolocateControl>;
export type GeolocateResultEvent = events.GeolocateResultEvent<MmrGeolocateControl>;
export type GeolocateErrorEvent = events.GeolocateErrorEvent<MmrGeolocateControl>;