import { LatLng, Coordinates, ReGeocode, LocationListener, LatLngPoint, CoordinateType } from './types'; import type { ExpoGaodeMapModule as NativeExpoGaodeMapModule } from './types/native-module.types'; import { PrivacyConfig, PrivacyStatus, SDKConfig, PermissionStatus } from './types/common.types'; declare const helperMethods: { /** * 初始化 SDK,并缓存配置(包含 webKey) * 注意:允许不提供任何 API Key,因为原生端可能已通过 Config Plugin 配置 */ initSDK(config: SDKConfig): void; isSDKInitialized(): boolean; /** * 设置当前隐私协议版本 * 当版本号变化时,之前的同意状态会失效 */ setPrivacyVersion(version: string): void; /** * 清空已持久化的隐私同意状态 */ resetPrivacyConsent(): void; /** * 一次性同步完整的隐私状态 * 推荐业务层只调用这个方法 */ setPrivacyConfig(config: PrivacyConfig): void; getPrivacyStatus(): PrivacyStatus; setLoadWorldVectorMap(enabled: boolean): void; getVersion(): string; start(): void; stop(): void; isStarted(): Promise; getCurrentLocation(): Promise; coordinateConvert(coordinate: LatLngPoint, type: CoordinateType): Promise; setLocatingWithReGeocode(isReGeocode: boolean): void; readonly isBackgroundLocationEnabled: boolean; /** * 检查位置权限状态 */ checkLocationPermission(): Promise; /** * 请求前台位置权限(增强版) */ requestLocationPermission(): Promise; /** * 请求后台位置权限 * 注意:必须在前台权限已授予后才能请求 */ requestBackgroundLocationPermission(): Promise; /** * 打开应用设置页面 * 引导用户手动授予权限 */ openAppSettings(): void; setAllowsBackgroundLocationUpdates(allows: boolean): void; /** * 添加定位监听器(便捷方法) * 自动订阅 onLocationUpdate 事件,提供容错处理 * @param listener 定位回调函数 * @returns 订阅对象,调用 remove() 取消监听 * 注意:如果使用 Config Plugin 配置了 API Key,无需调用 initSDK() */ addLocationListener(listener: LocationListener): { remove: () => void; }; /** * 计算两个坐标点之间的距离 * @param coordinate1 第一个坐标点 * @param coordinate2 第二个坐标点 * @returns 两点之间的距离(单位:米) */ distanceBetweenCoordinates(coordinate1: LatLngPoint, coordinate2: LatLngPoint): number; /** * 根据多个坐标点计算可同时可见的推荐缩放级别 * @param points 坐标点集合(至少 1 个) * @param options 视口与缩放边界选项 * @returns 推荐 zoom */ calculateFitZoom(points: LatLngPoint[], options?: { viewportWidthPx?: number; viewportHeightPx?: number; paddingPx?: number; minZoom?: number; maxZoom?: number; }): number; /** * 判断点是否在圆内 * @param point 要判断的点 * @param center 圆心坐标 * @param radius 圆半径(单位:米) * @returns 是否在圆内 */ isPointInCircle(point: LatLngPoint, center: LatLngPoint, radius: number): boolean; /** * 判断点是否在多边形内 * @param point 要判断的点 * @param polygon 多边形的顶点坐标数组,支持嵌套数组(多边形空洞) * @returns 是否在多边形内 */ isPointInPolygon(point: LatLngPoint, polygon: LatLngPoint[] | LatLngPoint[][]): boolean; /** * 计算多边形面积 * @param polygon 多边形的顶点坐标数组,支持嵌套数组(多边形空洞) * @returns 面积(单位:平方米) */ calculatePolygonArea(polygon: LatLngPoint[] | LatLngPoint[][]): number; /** * 计算矩形面积 * @param southWest 西南角坐标 * @param northEast 东北角坐标 * @returns 面积(单位:平方米) */ calculateRectangleArea(southWest: LatLngPoint, northEast: LatLngPoint): number; /** * 获取路径上距离目标点最近的点 * @param path 路径点集合 * @param target 目标点 * @returns 最近点信息,包含坐标、索引和距离 */ getNearestPointOnPath(path: LatLngPoint[], target: LatLngPoint): { latitude: number; longitude: number; index: number; distanceMeters: number; } | null; /** * 计算多边形质心 * @param polygon 多边形顶点坐标数组 * @returns 质心坐标 */ calculateCentroid(polygon: LatLngPoint[]): LatLng | null; /** * 计算路径边界和中心点 * @param points 路径点集合 * @returns 边界信息,包含 north, south, east, west 和 center */ calculatePathBounds(points: LatLngPoint[]): { north: number; south: number; east: number; west: number; center: LatLngPoint; } | null; /** * GeoHash 编码 * @param coordinate 坐标点 * @param precision 精度 (1-12) * @returns GeoHash 字符串 */ encodeGeoHash(coordinate: LatLngPoint, precision: number): string; /** * 轨迹抽稀 (RDP 算法) * @param points 原始轨迹点 * @param tolerance 允许误差(米) * @returns 简化后的轨迹点 */ simplifyPolyline(points: LatLngPoint[], tolerance: number): LatLng[]; /** * 计算路径总长度 * @param points 路径点 * @returns 长度(米) */ calculatePathLength(points: LatLngPoint[]): number; /** * 解析高德地图 API 返回的 Polyline 字符串 * 格式: "lng,lat;lng,lat;..." * @param polylineStr 高德原始 polyline 字符串,或包含 polyline 属性的对象 * @returns 解析后的点集 */ parsePolyline(polylineStr: string | { polyline: string; }): LatLng[]; /** * 获取路径上指定距离的点 * @param points 路径点 * @param distance 距离起点的米数 * @returns 点信息(坐标+角度) */ getPointAtDistance(points: LatLngPoint[], distance: number): { latitude: number; longitude: number; angle: number; } | null; /** * 经纬度转换为地图瓦片坐标 * @param coordinate 经纬度点 * @param zoom 缩放级别 * @returns 瓦片坐标(x, y, z) */ latLngToTile(coordinate: LatLngPoint, zoom: number): { x: number; y: number; z: number; } | null; /** * 地图瓦片坐标转换为经纬度 * @param tile 瓦片坐标(x, y, z) * @returns 经纬度点 */ tileToLatLng(tile: { x: number; y: number; z: number; }): LatLng | null; /** * 经纬度转换为地图像素坐标 * @param coordinate 经纬度点 * @param zoom 缩放级别 * @returns 像素坐标(x, y) */ latLngToPixel(coordinate: LatLngPoint, zoom: number): { x: number; y: number; } | null; /** * 地图像素坐标转换为经纬度 * @param pixel 像素坐标(x, y) * @param zoom 缩放级别 * @returns 经纬度点 */ pixelToLatLng(pixel: { x: number; y: number; }, zoom: number): LatLng | null; /** * 批量地理围栏检测 * @param point 待检查的点 * @param polygons 多边形数组,格式为 LatLngPoint[][] 或 LatLngPoint[][][] * @returns 包含点索引的数组(-1 表示不在任何多边形内) */ findPointInPolygons(point: LatLngPoint, polygons: LatLngPoint[][] | LatLngPoint[][][]): number; /** * 生成网格聚合数据 (常用于展示网格聚合图或大规模点数据处理) * @param points 包含经纬度和权重的点数组 * @param gridSizeMeters 网格大小(米) * @returns 包含经纬度和强度的网格点数组 */ generateHeatmapGrid(points: Array, gridSizeMeters: number): Array<{ latitude: number; longitude: number; intensity: number; }>; }; /** * 获取最近一次 initSDK 的配置 */ export declare function getSDKConfig(): SDKConfig | null; type HiddenNativeMethodName = 'setPrivacyShow' | 'setPrivacyAgree'; export type ExpoGaodeMapModule = Omit & typeof helperMethods; declare const ExpoGaodeMapModuleWithHelpers: ExpoGaodeMapModule; /** * 获取用于 Web API 的 webKey(若未初始化或未提供则返回 undefined) */ export declare function getWebKey(): string | undefined; export default ExpoGaodeMapModuleWithHelpers; //# sourceMappingURL=ExpoGaodeMapModule.d.ts.map