import { Bounds, Size } from '../../types'; import { ControlAnchor, LengthUnit, MapTypeControlType, NavigationControlType } from '../../constants'; import { PlainIcon } from '../Overlay/types'; interface ControlReactProps { /** 控制控件显示/隐藏。undefined 或 true = 显示,false = 隐藏 */ visible?: boolean; } export interface NavigationControlOptions { anchor?: ControlAnchor; offset?: Size; type?: NavigationControlType; showZoomInfo?: boolean; enableGeolocation?: boolean; } export interface NavigationControl3DOptions { anchor?: ControlAnchor; offset?: Size; } export interface ScaleControlOptions { anchor?: ControlAnchor; offset?: Size; /** 比例尺单位制,走 setUnit() */ unit?: LengthUnit; } export interface OverviewMapControlOptions { anchor?: ControlAnchor; offset?: Size; size?: Size; isOpen?: boolean; zoomInterval?: number; padding?: number; } export interface MapTypeControlOptions { anchor?: ControlAnchor; offset?: Size; type?: MapTypeControlType; mapTypes?: unknown[]; enableSwitch?: boolean; /** 是否显示路网层,走 showStreetLayer() */ showStreetLayer?: boolean; } export interface CopyrightItem { id: number; content?: string; bounds?: Bounds; } export interface CopyrightControlOptions { anchor?: ControlAnchor; offset?: Size; /** 自定义版权信息,创建和更新时调用 addCopyright() */ copyrights?: CopyrightItem[]; } export interface GeolocationControlOptions { anchor?: ControlAnchor; offset?: Size; showAddressBar?: boolean; enableAutoLocation?: boolean; locationIcon?: PlainIcon | unknown; watchPosition?: boolean; useCompass?: boolean; autoZoom?: boolean; autoViewport?: boolean; /** @since 4.0 定位前回调;返回 false 可阻止默认定位 */ onLocationStart?: (onSuccess: Function, onFail: Function) => boolean | void; } export interface PanoramaControlOptions { anchor?: ControlAnchor; offset?: Size; } export interface ZoomControlOptions { anchor?: ControlAnchor; offset?: Size; } export interface CityListControlOptions { anchor?: ControlAnchor; offset?: Size; expand?: boolean; /** @since 4.0 自定义触发元素 */ trigger?: HTMLElement; onChangeBefore?: () => void; onChangeAfter?: () => void; onChangeSuccess?: (poi: { city: string; code: string | number; }) => void; /** @since 4.0 */ onOpen?: () => void; /** @since 4.0 */ onClose?: () => void; canCheckSize?: boolean; } export type LocationControlOptions = GeolocationControlOptions; export interface LogoControlOptions { anchor?: ControlAnchor; offset?: Size; } export interface NavigationControlProps extends NavigationControlOptions, ControlReactProps { } export interface NavigationControl3DProps extends NavigationControl3DOptions, ControlReactProps { } export interface ScaleControlProps extends ScaleControlOptions, ControlReactProps { } export interface OverviewMapControlProps extends OverviewMapControlOptions, ControlReactProps { onViewChanged?: (raw: unknown) => void; onViewChanging?: (raw: unknown) => void; onResize?: (raw: unknown) => void; } export interface MapTypeControlProps extends MapTypeControlOptions, ControlReactProps { } export interface CopyrightControlProps extends CopyrightControlOptions, ControlReactProps { } export interface GeolocationControlProps extends GeolocationControlOptions, ControlReactProps { onLocationSuccess?: (raw: unknown) => void; onLocationError?: (raw: unknown) => void; } export interface PanoramaControlProps extends PanoramaControlOptions, ControlReactProps { } export interface ZoomControlProps extends ZoomControlOptions, ControlReactProps { } export interface CityListControlProps extends CityListControlOptions, ControlReactProps { } export type LocationControlProps = GeolocationControlProps; export interface LogoControlProps extends LogoControlOptions, ControlReactProps { } export declare const NavigationControl: import('react').MemoExoticComponent<(props: NavigationControlProps) => any>; export declare const NavigationControl3D: import('react').MemoExoticComponent<(props: NavigationControl3DProps) => any>; export declare const ScaleControl: import('react').MemoExoticComponent<(props: ScaleControlProps) => any>; export declare const OverviewMapControl: import('react').MemoExoticComponent<(props: OverviewMapControlProps) => any>; export declare const MapTypeControl: import('react').MemoExoticComponent<(props: MapTypeControlProps) => any>; export declare const CopyrightControl: import('react').MemoExoticComponent<(props: CopyrightControlProps) => any>; export declare const GeolocationControl: import('react').MemoExoticComponent<(props: GeolocationControlProps) => any>; export declare const PanoramaControl: import('react').MemoExoticComponent<(props: PanoramaControlProps) => any>; export declare const ZoomControl: import('react').MemoExoticComponent<(props: ZoomControlProps) => any>; export declare const CityListControl: import('react').MemoExoticComponent<(props: CityListControlProps) => any>; export declare const LocationControl: import('react').MemoExoticComponent<(props: GeolocationControlProps) => any>; export declare const LogoControl: import('react').MemoExoticComponent<(props: LogoControlProps) => any>; export {};