declare enum FabricAnnotationType { /** * 点标注 */ image = "image", /** * 大头针标注, 地图内置. */ pin = "pin", /** * 动画标注 */ animation = "animation" } declare enum FabricAnnotationAnimationType { /** * 无动画 */ none = "none", /** * 移动动画,主要用于司机卡车移动, 只有更新已有标注才有效 */ move = "move" } declare enum CalloutRichTextDockDirection { top = "top", right = "right", bottom = "bottom", left = "left" } declare enum MapDistanceSearchType { /** * 直线距离 */ DistanceSearchTypeStraight = 0, /** * 驾车导航距离 */ DistanceSearchTypeDrive = 1, /** * 步行导航距离 */ DistanceSearchTypeWalk = 3 } declare enum FabricMapErrorCode { /** * 非法URL */ invalidURL = "invalidURL", /** * 非法参数 */ invalidParam = "invalidParam", /** * 地图未找到 */ mapNotFound = "mapNotFound", /** * 地图加载失败 */ mapDidFailLoading = "mapDidFailLoading", /** * 地图定位用户失败 */ mapDidFailToLocateUser = "mapDidFailToLocateUser", /** * 地图搜索类初始化失败 */ mapSearchAPIFailToInit = "searchAPIFailToInit", /** * 地图搜索方法不存在 */ mapSearchMethodNotFound = "mapSearchMethodNotFound", /** * 地图搜索参数不存在 */ mapSearchParamNotFound = "mapSearchParamNotFound", /** * 地图搜索参数序列化出错 */ mapSearchParamSerializeError = "mapSearchParamSerializeError" } declare enum MAPinAnnotationColor { /** * 红色大头针 */ ColorRed = 0, /** * 绿色大头针 */ ColorGreen = 1, /** * 紫色大头针 */ ColorPurple = 2 } declare enum MapSupplierType { /** * AMap */ MapSupplierTypeAMap = -1, /** * Baidu */ MapSupplierTypeBaidu = 0, /** * MapBar */ MapSupplierTypeMapBar = 1, /** * MapABC */ MapSupplierTypeMapABC = 2, /** * SoSoMap */ MapSupplierTypeSoSoMap = 3, /** * AliYun */ MapSupplierTypeAliYun = 4, /** * Google */ MapSupplierTypeGoogle = 5, /** * GPS */ MapSupplierTypeGPS = 6 } declare enum FabricMapNaviType { /** * 自驾 */ drive = 0, /** * 步行 */ walking = 1, /** * 公共交通 */ bus = 2, /** * 火车 */ railway = 3, /** * 骑行 */ riding = 4 } declare enum FabricMapPathType { /** * 单路径 */ singleLine = 0, /** * 多路径 */ multiLine = 1 } declare enum FabricMALineJoinType { /** * 斜面连接点 */ kMALineJoinBevel = 0, /** * 斜接连接点 */ kMALineJoinMiter = 1, /** * 圆角连接点 */ kMALineJoinRound = 2 } declare enum FabricMALineCapType { /** * 普通头 */ kMALineCapButt = 0, /** * 扩展头 */ kMALineCapSquare = 1, /** * 箭头 */ kMALineCapArrow = 2, /** * 圆形头 */ kMALineCapRound = 3 } declare enum FabricMALineDashType { /** * 不画虚线 */ kMALineDashTypeNone = 0, /** * 方块样式 */ kMALineDashTypeSquare = 1, /** * 圆点样式 */ kMALineDashTypeDot = 2 } /** * Indicates the Json types, incldue `undefind` cause of * Sometimes we allow some typing property is optional. */ export type Json = undefined | null | boolean | number | string | Json[] | { [prop: string]: Json; }; export type MapSize = { /** * 矩形x->宽度 * 网页的绝对PX, 和div高度定义的高度一致, Native自动根据屏幕分辨率做转换 iphone 12可能是390宽度 */ width: number; /** * 矩形y->高度 * 网页的绝对PX, 和div高度定义的高度一致, Native自动根据屏幕分辨率做转换 iphone 12可能是390宽度 */ height: number; }; export type MapPoint = { /** * 网页的绝对PX, 和div高度定义的高度一致, Native自动根据屏幕分辨率做转换 iphone 12可能是390宽度 */ x: number; /** * 网页的绝对PX, 和div高度定义的高度一致, Native自动根据屏幕分辨率做转换 iphone 12可能是390宽度 */ y: number; }; /** * 屏幕矩形区域; 矩形起点: {x,y }, width, height 决定一个热曲(矩形) */ export type MapRectangleArea = MapSize & MapPoint; /** * 经纬度, description中格式为 <经度,纬度> */ export type MapGeoPoint = { /** * 经度(水平方向) */ longitude: number; /** * 纬度(垂直方向) */ latitude: number; }; /** * 行政区划 */ export type MapDistrict = { /** * 区域编码 */ adcode: string; /** * 城市编码 */ citycode: string; /** * 行政区名称 */ name: string; /** * 级别 */ level: string; /** * 城市中心点 */ center: MapGeoPoint; /** * 下级行政区域数组 */ districts: MapDistrict[]; /** * 行政区边界坐标点, NSString 数组 */ polylines: string[]; }; /** * 城市 */ export type MapCity = { /** * 城市名称 */ city: string; /** * 城市编码 */ citycode: string; /** * 城市区域编码 */ adcode: string; /** * 此区域的建议结果数目, AMapSuggestion 中使用 */ num: number; /** * 途径区域 AMapDistrict 数组,AMepStep中使用,只有name和adcode。 */ districts: MapDistrict[]; }; /** * 建议信息 */ export type MapSuggestion = { /** * NSString 数组 */ keywords: string[]; /** * AMapCity 数组 */ cities: MapCity[]; }; export type MapIndoorData = { /** * 楼层,为0时为POI本身 */ floor: number; /** * 楼层名称 */ floorName: string; /** * 建筑物ID */ pid: string; }; /** * 兴趣区域 */ export type MapAOI = { /** * AOI全局唯一ID */ uid: string; /** * 名称 */ name: string; /** * 所在区域编码 */ adcode: string; /** * 中心点经纬度 */ location: MapGeoPoint; /** * 面积,单位平方米 */ area: number; }; export type MapPOI = { /** * POI全局唯一ID */ uid: string; /** * 名称 */ name: string; /** * 兴趣点类型 */ type: string; /** * 类型编码 */ typecode: string; /** * 经纬度 */ location: MapGeoPoint; /** * 地址 */ address: string; /** * 电话 */ tel: string; /** * 距中心点的距离,单位米。在周边搜索时有效 */ distance: number; /** * 停车场类型,地上、地下、路边 */ parkingType: string; /** * 商铺id */ shopID: string; /** * 邮编 */ postcode: string; /** * 网址 */ website: string; /** * 电子邮件 */ email: string; /** * 省 */ province: string; /** * 省编码 */ pcode: string; /** * 城市名称 */ city: string; /** * 城市编码 */ citycode: string; /** * 区域名称 */ district: string; /** * 区域编码 */ adcode: string; /** * 地理格ID */ gridcode: string; /** * 入口经纬度 */ enterLocation: MapGeoPoint; /** * 出口经纬度 */ exitLocation: MapGeoPoint; /** * 方向 */ direction: string; /** * 是否有室内地图 */ hasIndoorMap: boolean; /** * 所在商圈 */ businessArea: string; /** * 室内信息 */ indoorData: MapIndoorData; /** * 子POI列表 */ subPOIs: MapSubPOT[]; /** * 图片列表 */ images: MapImage[]; }; /** * POI图片信息 */ export type MapImage = { /** * 标题 */ title: string; /** * url */ url: string; }; export type MapSubPOT = { /** * POI全局唯一ID */ uid: string; /** * 名称 */ name: string; /** * 名称简写 */ sname: string; /** * 经纬度 */ location: MapGeoPoint; /** * 地址 */ address: string; /** * 距中心点距离 */ distance: number; /** * 子POI类型 */ subtype: string; }; /** * POI搜索参数基础数据结构 */ export type PoiSearchParam = { /** * 当前页数, 范围1-100, [default = 1] * @default 1 */ page?: number; /** * 每页记录数, 范围1-25, [default = 20] * @default 20 */ offset?: number; /** * 类型,多个类型用“|”分割 可选值:文本分类、分类代码 */ types?: string; /** * 排序规则, 0-距离排序;1-综合排序, 默认0 */ sortrule?: number; /** * 建筑物POI编号,传入建筑物POI之后,则只在该建筑物之内进行搜索(since 4.5.0) */ building?: string; /** * 是否返回子POI,默认为 NO。 */ requireSubPOIs?: boolean; } & T; /** * POI搜索参数返回结基础数据结构 */ export type PoiSearchResult = { /** * POI结果,AMapPOI 数组 */ pois: MapPOI[]; } & T; /** * 地址组成要素 */ export type MapAddressComponent = { /** * 国家(since 5.7.0) */ country: string; /** * 国家简码(since 7.4.0)仅海外生效 */ countryCode: string; /** * 省/直辖市 */ province: string; /** * 市 */ city: string; /** * 城市编码 */ citycode: string; /** * 区 */ district: string; /** * 区域编码 */ adcode: string; /** * 乡镇街道 */ township: string; /** * 乡镇街道编码 */ towncode: string; /** * 社区 */ neighborhood: string; /** * 建筑 */ building: string; }; /** * 道路 */ export type MapRoad = { /** * 道路ID */ uid: string; /** * 道路名称 */ name: string; /** * 距离(单位:米) */ distance: number; /** * 方向 */ direction: string; /** * 坐标点 */ location: MapGeoPoint; }; /** * 道路交叉口 */ export type MapRoadInter = { /** * 距离(单位:米) */ distance: number; /** * 方向 */ direction: string; /** * 经纬度 */ location: MapGeoPoint; /** * 第一条道路ID */ firstId: string; /** * 第一条道路名称 */ firstName: string; /** * 第二条道路ID */ secondId: string; /** * 第二条道路名称 */ secondName: string; }; /** * 逆地理编码 */ export type MapReGeocode = { /** * 格式化地址 */ formattedAddress: string; /** * 地址组成要素 */ addressComponent: MapAddressComponent; /** * 道路信息 AMapRoad 数组 */ roads: MapRoad[]; /** * 道路路口信息 AMapRoadInter 数组 */ roadinters: MapRoadInter[]; /** * 兴趣点信息 AMapPOI 数组 */ pois: MapPOI[]; /** * 兴趣区域信息 AMapAOI 数组 */ aois: MapAOI[]; }; /** * 路段基本信息 */ export type MapStep = { /** * 唯一ID, 暂时不考虑多路径; 如果多条, 每条都包含 */ id: string; /** * 行走指示 */ instruction: string; /** * 方向 */ orientation: string; /** * 道路名称 */ road: string; /** * 此路段长度(单位:米) */ distance: number; /** * 此路段预计耗时(单位:秒) */ duration: number; /** * 此路段坐标点串 */ polyline: string; /** * 导航主要动作 */ action: string; /** * 导航辅助动作 */ assistantAction: string; /** * 此段收费(单位:元) */ tolls: number; /** * 收费路段长度(单位:米) */ tollDistance: number; /** * 主要收费路段 */ tollRoad: string; /** * 途径城市 AMapCity 数组,只有驾车路径规划时有效 */ cities: Array; /** * 路况信息数组,只有驾车路径规划时有效 */ tmcs: Array; }; /** * 实时路况信息 */ export type MapTMC = { /** * 长度(单位:米) */ distance: number; /** * 路况状态描述:0 未知,1 畅通,2 缓行,3 拥堵,4 严重拥堵 */ status: string; /** * 此路段坐标点串 */ polyline: string; }; /** * 步行、骑行、驾车方案 */ export type MapPath = { /** * 唯一ID, 暂时不考虑多路径; 如果多条, 每条都包含 */ id: string; /** * 起点和终点的距离 */ distance: number; /** * 预计耗时(单位:秒) */ duration: number; /** * 导航策略 */ strategy: string; /** * 导航路段 AMapStep 数组 */ steps: Array; /** * 此方案费用(单位:元) */ tolls: number; /** * 此方案收费路段长度(单位:米) */ tollDistance: number; /** * 此方案交通信号灯个数 */ totalTrafficLights: number; /** * 限行信息,仅在驾车和货车路径规划时有效。(since 6.0.0) * 驾车路径规划时: * 0 代表限行已规避或未限行; 1 代表限行无法规避。 * 货车路径规划时: * 0,未知(未输入完整/正确车牌号信息时候显示) * 1,已规避限行 * 2,起点限行 * 3,途径点在限行区域内(设置途径点才出现此报错) * 4,途径限行区域 * 5,终点限行 */ restriction: number; /** * 规划路径完整坐标点串集合 */ polyline: string; /** * 经纬度数组 */ coordinates: MapPoint[]; }; /** * 公交方案 */ export type MapTransit = { /** * 此公交方案价格(单位:元) */ cost: number; /** * 此换乘方案预期时间(单位:秒) */ duration: number; /** * 是否是夜班车 */ nightflag: boolean; /** * 此方案总步行距离(单位:米) */ walkingDistance: number; /** * 换乘路段 MapSegment 数组 */ segments: Array; /** * 当前方案的总距离 */ distance: number; }; /** * 公交换乘路段,如果walking和buslines同时有值,则是先walking后buslines */ export type MapSegment = { /** * 此路段步行导航信息 */ walking: MapWalking; /** * 此路段可供选择的不同公交线路 AMapBusLine 数组 */ buslines: Array; /** * 出租车信息,跨城时有效 */ taxi: MapTaxi; /** * 火车信息,跨城时有效 */ railway: MapRailway; /** * 入口名称 */ enterName: string; /** * 入口经纬度 */ enterLocation: MapGeoPoint; /** * 出口名称 */ exitName: string; /** * 出口经纬度 */ exitLocation: MapGeoPoint; }; /** * 出租车信息 */ export type MapTaxi = { /** * 起点坐标 */ origin: MapGeoPoint; /** * 终点坐标 */ destination: MapGeoPoint; /** * 距离,单位米 */ distance: number; /** * 耗时,单位秒 */ duration: number; /** * 起点名称 */ sname: string; /** * 终点名称 */ tname: string; }; /** * 公交线路 */ export type MapBusLine = { /** * 公交线路ID */ uid: string; /** * 公交类型 */ type: string; /** * 公交线路名称 */ name: string; /** * 坐标集合 */ polyline: string; /** * 城市编码 */ citycode: string; /** * 首发站 */ startStop: string; /** * 终点站 */ endStop: string; /** * 当查询公交站点时,返回的 AMapBusLine 中含有该字段 */ location: MapGeoPoint; /** * 首班车时间 */ startTime: string; /** * 末班车时间 */ endTime: string; /** * 所属公交公司 */ company: string; /** * 距离。在公交线路查询时,该值为此线路的全程距离,单位为千米; 在公交路径规划时,该值为乘坐此路公交车的行驶距离,单位为米 */ distance: number; /** * 起步价 */ basicPrice: number; /** * 全程票价 */ totalPrice: number; /** * 本线路公交站 AMapBusStop 数组 */ busStops: Array; /** * 起程站 */ departureStop: MapBusStop; /** * 下车站 */ arrivalStop: MapBusStop; /** * 途径公交站 AMapBusStop 数组 */ viaBusStops: Array; /** * 预计行驶时间(单位:秒) */ duration: number; }; /** * 公交站 */ export type MapBusStop = { /** * 公交站点ID */ uid: string; /** * 区域编码 */ adcode: string; /** * 公交站名 */ name: string; /** * 城市编码 */ citycode: string; /** * 经纬度坐标 */ location: MapGeoPoint; /** * 途径此站的公交路线 AMapBusLine 数组 */ buslines: Array; /** * 查询公交线路时的第几站 */ sequence: string; }; /** * TODO: 暂时未定义, 以后根据使用情况再决定. */ export type MapRailway = { [index: string]: any; }; /** * 步行换乘信息 */ export type MapWalking = { /** * 起点坐标 */ origin: MapGeoPoint; /** * 终点坐标 */ destination: MapGeoPoint; /** * 起点和终点的步行距离 */ distance: number; /** * 步行预计时间 */ duration: number; /** * 步行路段 AMapStep 数组 */ steps: Array; }; /** * 路径规划 */ export type MapRoute = { /** * 起点坐标 */ origin: MapGeoPoint; /** * 终点坐标 */ destination: MapGeoPoint; /** * 出租车费用(单位:元) */ taxiCost: number; /** * 步行、骑行、驾车方案列表 MapPath 数组 */ paths: Array; /** * 公交换乘方案列表 AMapTransit 数组 */ transits: Array; }; /** * 多边形, 当传入两个点的时候,当做矩形处理:左下-右上两个顶点;其他情况视为多边形,几个点即为几边型。 */ export type MapGeoPolygon = { /** * 坐标集, AMapGeoPoint 数组 */ points: Array; }; export type CalloutRichTextContentItemBase = { /** * 文本内容 */ data: string; /** * 上右下左 * @default [0,0,0,0] */ padding?: [ number, number, number, number ]; /** * 是否单行 * true 单行展示 * false 多行展示 * @default false */ singleLine?: boolean; } & T; export type CalloutRichTextContentItemImage = CalloutRichTextContentItemBase<{ /** * 内容类型 */ type: "image"; /** * 如果type:'image', 则提供图片大小 */ imageSize?: MapSize; }>; export type CalloutRichTextContentItemText = CalloutRichTextContentItemBase<{ /** * 内容类型 */ type: "text"; /** * 是否加粗 * @default false */ bold?: boolean; /** * 最大宽度, 如果超过直接换行. 如果是多行, 每行超过则自动换行. */ maxWidth?: number; /** * 字体颜色, 常用透明度对应16进制关系 * 颜色, 常用透明度对应16进制关系 * ``` * .0(00) .1(19) .05(0C) .15(26) * .2(33) .3(4C) .25(3F) .35(59) * .4(66) .5(7F) .45(72) .55(8C) * .6(99) .7(B2) .65(A5) .75(BF) * .8(CC) .9(E5) .85(D8) .95(F2) * ``` * @example `#11010010` */ color?: string; /** * 内容是Label阴影半径 */ textShadowColor?: string; /** * 内容是Label阴影半径 */ textShadowBlurRadius?: number; /** * 内容是Label的描边宽度,正值会导致空心,负值导致 * textStrokeWidth这个属性在 andriod 和 ios 上值的含义不一样 * ios是字体宽度的百分比、andriod 是像素 */ textStrokeWidth?: number; /** * 内容是Label的阴影偏移 */ textStrokeColor?: string; /** * 内容是Label的阴影偏移 */ textShadowOffset?: MapPoint; /** * 字体大小 PX */ fontSize?: number; }>; export type AnnotationItem = { /** * 唯一标识 */ id: string; /** * 是否被选中 * @default false */ isSelected: boolean; /** * 原生标题, 如果存在了`calloutHTML`则优先级以`calloutHTML`高 */ title?: string; /** * 原生副标题, 如果存在了`calloutHTML`则优先级以`calloutHTML`高 */ subtitle?: string; /** * 网页富文本, 点击标注弹起的浮窗WebView html内容 */ calloutHTML?: string; /** * 网页富文本, 点击标注弹起的浮窗 WebView 的 大小 */ calloutHTMLSize?: { /** * 网页的绝对PX, 和div高度定义的高度一致, Native自动根据屏幕分辨率做转换 iphone 12可能是390宽度 */ width: number; /** * 网页的绝对PX, 和div高度定义的高度一致, Native自动根据屏幕分辨率做转换 iphone 12可能是390宽度 */ height: number; }; /** * 弹出框默认位于view正中上方,可以设置calloutOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是屏幕坐标 */ calloutOffset?: MapPoint; /** * Native 富文本 */ calloutRichText?: { /** * 最大宽度, 如果超过直接显示.... */ maxWidth?: number; /** * 全局背景色 * 颜色, 常用透明度对应16进制关系 * ``` * .0(00) .1(19) .05(0C) .15(26) * .2(33) .3(4C) .25(3F) .35(59) * .4(66) .5(7F) .45(72) .55(8C) * .6(99) .7(B2) .65(A5) .75(BF) * .8(CC) .9(E5) .85(D8) .95(F2) * ``` * @example `#11010010` */ bgColor?: string; /** * 最外层圆角 */ boxRadius?: number; /** * 上右下左 * @default [0,0,0,0] */ boxPadding?: [ number, number, number, number ]; /** * 合子阴影 * https://cssgenerator.org/box-shadow-css-generator.html */ boxShadow?: { offsetX: number; offsetY: number; spreadRadius: number; /** * 颜色, 常用透明度对应16进制关系 * ``` * .0(00) .1(19) .05(0C) .15(26) * .2(33) .3(4C) .25(3F) .35(59) * .4(66) .5(7F) .45(72) .55(8C) * .6(99) .7(B2) .65(A5) .75(BF) * .8(CC) .9(E5) .85(D8) .95(F2) * ``` * @example `#11010010` */ color: string; }; /** * 内容组装, 3维数组: * @example * ```ts * contents: [ * // 第一维数组: 左右结构 * [ * // 第二维数组: 上下结构 * [ * // 第三维数组: 左右结构 * {type:'text', data:''},{type:'text'},{type:'image'} * ], * [ * // 第三维数组: 左右结构 * {type:'text'},{type:'text'},{type:'image'} * ], * ], * // 第一维数组: 左右结构 * [ * [],[] * ] * ] * ``` */ contents: Array>[]; /** * 气泡停靠在标记点的方位. * - top - 停靠在标记点上方 * - right - 停靠在标记点右边 * - bottom - 停靠在标记点底边 * - left - 停靠在标记点左边 * - 默认值: top */ dockDirection?: CalloutRichTextDockDirection; }; /** * 默认为YES,当为NO时view忽略触摸事件 */ enabled?: boolean; /** * 是否可以拖动 * @default false */ draggable?: boolean; /** * annotationView是否突出显示(一般不需要手动设置) */ highlighted?: boolean; /** * 设置是否可以显示callout,默认为 Yes * @default true */ canShowCallout?: boolean; /** * 设置是否允许点击地图关闭callout,默认为 Yes * @default true */ canHideCallout?: boolean; /** * Note: FabricAnnotationType.pin (地图内置, 需要传递 `pinColor`) */ type: FabricAnnotationType; /** * @default FabricAnnotationAnimationType.none */ animationType: FabricAnnotationAnimationType; /** * `animationType`如果是FabricAnnotationAnimationType.move * 注意android最小支持的值为: 1s * @default 0.25s */ moveAnimationTime?: number; /** * type === FabricAnnotationType.pin 生效, 需要传递此值 */ pinColor?: MAPinAnnotationColor; /** * Base64 Image String Or Image */ image: string; /** * 图片大小 */ imageSize?: MapSize; /** * Base64 Image String Or Image */ animatedImages?: string[]; /** * 经纬度 */ coordinate: MapGeoPoint; /** * annotationView的中心默认位于annotation的坐标位置,可以设置centerOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是屏幕坐标 */ centerOffset?: MapPoint; /** * z值,大值在上,默认为0。 * @default 0 */ zIndex?: number; /** * 是否固定在屏幕一点, 注意,拖动或者手动改变经纬度,都会导致设置失效, * NOTE: 地图中间那个大头针通常是一个annotation锁屏之后, 并给予一个lockedScreenPoint位置来实现. * @default false */ isLockedToScreen?: boolean; /** * 固定屏幕点的坐标 */ lockedScreenPoint?: MapPoint; /** * 移动方向. 正北为0度,顺时针方向。即正东90,正南180,正西270, * 如果FabricAnnotationAnimationType.Move 的时候Native会尝试计算2个点经纬度的方向, 产生一个动画. 比如2个点之间的路径规划, 小车🚗的行驶方向. * 如果headerDirection存在自定义值, 则native 首先使用自定义的为准, 其次才是自动计算. * 如果不传递Android接收默认值为null, 可以自动计算前后点的角度. */ headerDirection?: string; }; /** * 更新标注的时候会返回当前标注的信息以及屏幕中点的位置. */ export type AnnotationResultBase = AnnotationItem & { /** * 当前点在屏幕中的pixel位置, H5可以考虑实现类似tooltip的模型来代替native 的显示浮窗 * 通常情况下,需求可能存在各种高亮, 颜色, 字体形态的变化, H5可以比较容易自定义UI */ screenPoint: MapPoint; } & T; /** * 删除 标注(大头针等) * @type `removeAnnotations` */ export type RemoveAnnotationsParam = { /** * 删除标点集合 */ annotations: Array>; }; /** * 删除 标注(大头针等)返回结果 */ export type RemoveAnnotationsResult = Array>; /** * 添加、更新标注(大头针等, 注意如果需要将2个点规划的路径限定到特定的区域范围, 可以调用`setMapInView`来实现. * @type `updateAnnotations` */ export type UpdateAnnotationsParam = { /** * 更新标点集合 */ annotations: Array & Required>>; }; /** * 添加、更新标注返回结果 */ export type UpdateAnnotationsResult = { annotations: Array>; }; /** * 获取 标注(大头针等,自身定位除外) * @type `getAllAnnotations` */ export type GetAllAnnotationsParam = {}; /** * 获取 标注(大头针等,自身定位除外),返回结果 */ export type GetAllAnnotationsResult = { annotations: Array>; }; /** * 选中标注(显示浮窗) * @type `selectAnntations` */ export type SelectAnntationsParam = { /** * 选中标注选择, 只需要传递一个值 */ annotations: Array>; }; /** * 选中标注(显示浮窗),返回结果 */ export type SelectAnntationsResult = { annotations: Array>; }; /** * 取消选定标注 (隐藏浮窗) * @type `deselectAnntations` */ export type DeselectAnntationsParam = { /** * 取消标注选择, 只需要传递一个值 */ annotations: Array>; }; /** * 取消选定标注 (隐藏浮窗),返回结果 */ export type DeselectAnntationsResult = { annotations: Array>; }; /** * 更新大头针旗杆, 如需要删除直接使用`removeAnnotations` * @type `updateFlagstick` */ export type UpdateFlagstickParam = Partial> & Required>; /** * 更新大头针旗杆, 返回结果 */ export type UpdateFlagstickResult = { annotations: Array>; }; /** * 移动指定经纬度(点)到地图可视区域中心点, 如果屏幕设置有“大头针小黑柱子”, Native统一会统一执行吸附动画, 移动coordinate到大头针下面. * @type `setMapCenterCoordinate` */ export type SetMapCenterCoordinateParam = { /** * 移动指定经纬度(点)到地图可视区域中心点, 如果屏幕设置有“大头针小黑柱子”, Native统一会统一执行吸附动画, 移动coordinate到大头针下面. * 如果不传递, 默认为当前用户的实时位置, 可以传递指定的经纬度的点. */ coordinate?: MapGeoPoint; /** * 缩放级别(默认3-19,有室内地图时为3-20), Native 初始化默认值 16 * +/-/0, 传递0 不做缩放动作, 但是可以通过返回值回去当下是否可以放大/缩小 */ zoomLevel?: number; }; /** * 根据两个经纬度计算方向角 * @type `coordinateDirection` */ export type GetCoordinateDirectionParam = { /** * 起点坐标 */ origin: MapGeoPoint; /** * 终点坐标 */ destination: MapGeoPoint; }; export type GetCoordinateDirectionResult = { /** * 方向的角度. */ direction: number; }; /** * 根据两个经纬度计算屏幕像素距离 * @type `coordinateScreenDistance` */ export type GetCoordinateScreenDistanceParam = { /** * 起点坐标 */ origin: MapGeoPoint; /** * 终点坐标 */ destination: MapGeoPoint; }; export type GetCoordinateScreenDistanceResult = { /** * 对应点在屏幕中2个点之间的pixel距离. */ distance: number; }; /** * 计算给予的经纬度在屏幕中绝对的pixel位置{x,y} * @type `coordinateScreenPosition` */ export type GetCoordinateScreenPositionParam = { /** * 点的经纬度列表 */ coordinates: MapGeoPoint[]; }; export type GetCoordinateScreenPositionResult = { /** * 对应点在屏幕中的绝对像素位置. */ screenPositions: MapPoint[]; }; export type SetMapPathOperatorItem = { /** * 唯一ID */ id: string; /** * 用于生成笔触纹理id的图片, 优先级高于 strokeColor(支持非PowerOfTwo图片如果您需要减轻绘制产生的锯齿,您可以参考AMap.bundle中的traffic_texture_blue.png的方式,在image两边增加部分透明像素.)。(since 5.3.0) */ strokeImage?: string; /** * 笔触颜色,默认是kMAOverlayRendererDefaultStrokeColor * 需要转换成Native约定的ARGB格式, 透明度放前2位 * 公式如: background: rgba(125, 0, 0, .3); 表示的是30%不透明度的红色背景。把30%的不透明度转换成十六制呢的方法如下:先计算#AA的的十进制x,x/255 = 3/10,解得x=3*255/10,然后再把x换算成十六进制,约等于4C。 * 常用透明度对应16进制关系 * ``` * .0(00) .1(19) .05(0C) .15(26) * .2(33) .3(4C) .25(3F) .35(59) * .4(66) .5(7F) .45(72) .55(8C) * .6(99) .7(B2) .65(A5) .75(BF) * .8(CC) .9(E5) .85(D8) .95(F2) * ``` */ strokeColor?: string; /** * 笔触宽度, 单位屏幕点坐标,默认是10 */ lineWidth?: number; /** * LineJoin,默认是kMALineJoinBevel */ lineJoinType?: FabricMALineJoinType; /** * LineCap,默认是kMALineCapButt */ lineCapType?: FabricMALineCapType; /** * 虚线类型, since 5.5.0, 只有设置strokeColor 才有效 */ lineDashType?: FabricMALineDashType; /** * 路径经纬度数组 */ coordinates: MapGeoPoint[]; /** * 是否启用显示范围,YES启用,不启用时展示全路径 since 7.5.0 * Note:启用之后, showRange必须存在. */ showRangeEnabled?: boolean; /** * 显示范围 since 7.5.0 */ showRange?: { /** * <起点位置,整数部分表示起点索引,小数部分表示在线段上的位置 */ begin: number; /** * <终点位置,整数部分表示起点索引,小数部分表示在线段上的位置 */ end: number; }; }; /** * 添加路径 * @type `addPaths` */ export type SetMapAddPathsParam = { paths: [ SetMapPathOperatorItem ]; }; /** * 删除路径 * @type `removePaths` */ export type SetMapRemovePathsParam = { paths: Array>; }; /** * 获取路径 * @type `getAllPaths` */ export type SetMapGetAllPathsParam = {}; /** * 获取路径返回信息 */ export type SetMapGetAllPathsResult = { paths: [ SetMapPathOperatorItem ]; }; /** * 更新路径 * @type `updatePaths` */ export type SetMapUpdatePathsParam = { paths: Array & Pick>; }; /** * 交换路径 * @type `exchangePath` */ export type SetMapExchangePathParam = { path1: Pick; path2: Pick; }; /** * 根据起点/终点智能规划路径, 路径效果暂时native应编码一个版本即可. * 注意如果需要将2个点规划的路径限定到特定的区域范围, 可以调用`setMapInView`来实现. * @type `setMapPathPlanning` */ export type SetMapPathPlanningParam = { /** * 步行/驾车/打车 */ naviType?: FabricMapNaviType; /** * 路径类型; 单路径/多路径 */ pathType?: FabricMapPathType; /** * 驾车导航策略,默认策略为0。 * 0,速度优先(时间);1,费用优先(不走收费路段的最快道路);2,距离优先;3,不走快速路;4,躲避拥堵; * 5,多策略(同时使用速度优先、费用优先、距离优先三个策略计算路径),其中必须说明,就算使用三个策略算路,会根据路况不固定的返回一至三条路径规划信息; * 6,不走高速;7,不走高速且避免收费;8,躲避收费和拥堵;9,不走高速且躲避收费和拥堵; * 10,多备选,时间最短,距离最短,躲避拥堵(考虑路况); * 11,多备选,时间最短,距离最短; * 12,多备选,躲避拥堵(考虑路况); * 13,多备选,不走高速; * 14,多备选,费用优先; * 15,多备选,躲避拥堵,不走高速(考虑路况); * 16,多备选,费用有限,不走高速; * 17,多备选,躲避拥堵,费用优先(考虑路况); * 18,多备选,躲避拥堵,不走高速,费用优先(考虑路况); * 19,多备选,高速优先; * 20,多备选,高速优先,躲避拥堵(考虑路况) * @default 0 */ strategy?: number; /** * 起始点 */ origin: MapGeoPoint; /** * 终点 */ destination: MapGeoPoint; /** * 路径是否自动移动到可视区域内(`setMapScreenViewportArea`) * @default true */ moveToViewportArea?: boolean; /** * 途经点 AMapGeoPoint 数组,目前最多支持6个途经点 */ waypoints?: Array; /** * Base64 Image String, 绘制路径的笔触图片, 路径平铺背景图. 如果不传Native 可能显示一个默认的颜色. */ strokeImage?: string; }; /** * 根据起点/终点智能规划路径, 路径规划成功后返回的信息 */ export type SetMapPathPlanningResult = MapRoute; /** * 设置Native地图中划线起点/终点落在的区域,Native 需要根据这个区域做适当的缩放计算. * @type `setMapScreenViewportArea` */ export type SetMapScreenViewportAreaParam = { /** * 可视区域 */ area: MapRectangleArea; /** * 可视点; 可选, 如果配置当前希望实时聚焦移动到area的中心. */ coordinates?: Array; }; /** * 设置地图居中展示区域的中心点位置的API输入参数, 其他地图移动都会依据这个显示位置的缩放, 移动, 聚拢. * 同时默认情况下, Native会自动更新用户位置, 自动移动到中心点位置; 注意此处如果native获取定位更早, 他可能会移动到native * 默认的中心点, 而不是我们自定义的中心点, 此时可以通过调用`setMapCenterCoordinate`来主动移动. * @type `setMapScreenViewportCenter` */ export type SetMapScreenViewportCenterParam = { /** * 屏幕地图展示区域的中心点显示位置. */ point: MapPoint; }; /** * 转换地图厂商的经纬度, 百度坐标系转换为腾讯等地图的经纬度坐标转换为高德坐标系 * @type `mapSupplierCoordinateExchange` */ export type MapSupplierCoordinateExchangeParam = { /** * 地图厂商类型 * 百度, 腾讯,... */ type: MapSupplierType; /** * 对应厂商经纬度, type:百度 对应coordinate为百度的坐标, 目标转化为高度的坐标系 */ coordinate: MapGeoPoint; }; /** * 转换地图厂商的经纬度, 百度坐标系转换为腾讯等地图的经纬度坐标转换为高德坐标系 * @type `mapSupplierCoordinateExchange` */ export type MapSupplierCoordinateExchangeResult = { /** * 转换后的高德地图坐标系的经纬度. */ coordinate: MapGeoPoint; }; declare enum UserTrackMode { /** * 不追踪用户的location更新 */ none = 0, /** * 追踪用户的location更新 */ follow = 1, /** * 追踪用户的location与heading更新 */ followWithHeading = 2 } /** * 更新用户定位标注 * @type `setUserLocationRepresentation` */ export type SetUserLocationRepresentationParam = { /** * 用户信息位置是否显示, 默认true * @default true */ showsUserLocation?: boolean; /** * 用户跟踪模式 * @default `UserTrackMode.followWithHeading` */ userTrackMode?: UserTrackMode; /** * 精度圈是否显示,默认YES * @default true */ showsAccuracyRing?: boolean; /** * 是否显示方向指示(followWithHeading模式开启)。默认为YES * @default true */ showsHeadingIndicator?: boolean; /** * 精度圈 填充颜色, 默认 [UIColor colorWithRed:136/255.0 green:166/255.0 blue:227/255.0 alpha:.3] * 常用透明度对应16进制关系 * ``` * .0(00) .1(19) .05(0C) .15(26) * .2(33) .3(4C) .25(3F) .35(59) * .4(66) .5(7F) .45(72) .55(8C) * .6(99) .7(B2) .65(A5) .75(BF) * .8(CC) .9(E5) .85(D8) .95(F2) * ``` * @default `#11010010` */ fillColor?: string; /** * 精度圈 边线颜色, 默认 [UIColor colorWithRed:136/255.0 green:166/255.0 blue:227/255.0 alpha:.3] * 需要转换成Native约定的ARGB格式, 透明度放前2位 * 公式如: background: rgba(125, 0, 0, .3); 表示的是30%不透明度的红色背景。把30%的不透明度转换成十六制呢的方法如下:先计算#AA的的十进制x,x/255 = 3/10,解得x=3*255/10,然后再把x换算成十六进制,约等于4C。 * 常用透明度对应16进制关系 * ``` * .0(00) .1(19) .05(0C) .15(26) * .2(33) .3(4C) .25(3F) .35(59) * .4(66) .5(7F) .45(72) .55(8C) * .6(99) .7(B2) .65(A5) .75(BF) * .8(CC) .9(E5) .85(D8) .95(F2) * ``` */ strokeColor?: string; /** * 精度圈 边线宽度,默认0 * @default 0 */ lineWidth?: string; /** * 定位点背景色,不设置默认白色 * 常用透明度对应16进制关系 * ``` * .0(00) .1(19) .05(0C) .15(26) * .2(33) .3(4C) .25(3F) .35(59) * .4(66) .5(7F) .45(72) .55(8C) * .6(99) .7(B2) .65(A5) .75(BF) * .8(CC) .9(E5) .85(D8) .95(F2) * ``` */ locationDotBgColor?: string; /** * 定位点蓝色圆点颜色,不设置默认蓝色 * 常用透明度对应16进制关系 * ``` * .0(00) .1(19) .05(0C) .15(26) * .2(33) .3(4C) .25(3F) .35(59) * .4(66) .5(7F) .45(72) .55(8C) * .6(99) .7(B2) .65(A5) .75(BF) * .8(CC) .9(E5) .85(D8) .95(F2) * ``` */ locationDotFillColor?: string; /** * 内部蓝色圆点是否使用律动效果, 默认YES * @default true */ enablePulseAnnimation?: boolean; /** * 定位图标, 与蓝色原点互斥base * @example `base64,iV.....` 不包含`data:image/png;前缀` */ image?: string; /** * 定位图标大小 */ imageSize?: MapSize; /** * 定位图标中心点偏移 */ centerOffset?: MapPoint; }; /** * 缩放地图的API输入参数 * @type `setMapZoom` */ export type SetMapZoomParam = { /** * 缩放级别(默认3-19,有室内地图时为3-20, Native 初始化默认值 16 * +/-/0, 传递0 不做缩放动作, 但是可以通过返回值回去当下是否可以放大/缩小 */ zoomLevel?: number; }; /** * 缩放地图返回的数据结构. * @type `setMapZoom` */ export type SetMapZoomParamResult = { /** * 最大的缩放等级 */ maxZoomLevel: number; /** * 当前的缩放等级 */ zoomLevel: number; /** * 最小的缩放等级 */ minZoomLevel: number; }; export type FabricMapOperationEventType = "setMapScreenViewportCenter" | "setMapScreenViewportArea" | "setMapPathPlanning" | "addPaths" | "removePaths" | "getAllPaths" | "updatePaths" | "exchangePath" | "setMapZoom" | "setUserLocationRepresentation" | "setMapCenterCoordinate" | "removeAnnotations" | "updateAnnotations" | "getAllAnnotations" | "selectAnntations" | "deselectAnntations" | "updateFlagstick" | "mapSupplierCoordinateExchange" | "coordinateDirection" | "coordinateScreenPosition" | "coordinateScreenDistance"; /** * 更新路径规划中的小车🚗配置比如行驶方向. */ export type FabricSetMapCarOptions = Pick; export type FabricSetMapCarApi = (options: FabricSetMapCarOptions) => Promise; declare class FabricError extends Error { code: string; message: string; data: any; protected constructor(code: string, message: string, data: any); toJSON: () => { name: any; code: any; data: any; message: any; description: any; number: any; fileName: any; lineNumber: any; columnNumber: any; stack: any; }; } /** * subscribe点击地图上标注浮窗上的事件. * @type `mapAnnotationViewCalloutClicked` */ export type MapAnnotationViewCalloutClickedEventData = { /** * 被点击地图上标注浮窗的信息内容 */ annotation: AnnotationItem; }; /** * subscribe点击地图上任何位置, 返回这个点击位置的经纬度 * @type `mapDidClickAtCoordinate` */ export type MapDidClickAtCoordinateEventData = { /** * 点击地图上点的经纬度, 如果需要额外的地址信息, 我们需要单独调用 */ coordinate: MapGeoPoint; }; /** * subscribe初始化监听用户定位失败 * @type `mapDidFailToLocateUser` */ export type MapDidFailToLocateUserEventData = {}; /** * subscribe初始化监听整个地图加载失败 * @type `mapDidFailLoading` */ export type MapDidFailLoadingEventData = {}; /** * subscribe初始化监听地图中地形加载失败 * @type `mapDidFailLoadTerrain` */ export type MapDidFailLoadTerrainEventData = {}; /** * subscribe初始化监听地图更新好的用户最新的实时位置(经纬度) * @type `mapDidUpdateUserLocation` */ export type MapDidUpdateUserLocationEventData = { /** * 当前用户所在经纬度, 如果需要额外的地址信息, 我们需要单独调用 */ coordinate: MapGeoPoint; }; /** * subscribe 地图准备移动事件 * @type `mapWillMove` */ export type MapWillMoveEventData = { /** * 用户操作,true, 表示用户滑动, 其他属于地图自身的移动. */ wasUserAction: boolean; /** * 中心点经纬度 */ coordinate: MapGeoPoint; /** * 标识当前地图中心位置是否在中国范围外。此属性不是精确判断,不能用于边界区域 */ isAbroad: boolean; /** * 缩放等级 */ zoomLevel: number; }; /** * subscribe 地图移动之后的事件 * @type `mapDidMove` */ export type MapDidMoveEventData = { /** * 用户操作,true, 表示用户滑动, 其他属于地图自身的移动. */ wasUserAction: boolean; /** * 中心点经纬度 */ coordinate: MapGeoPoint; /** * 标识当前地图中心位置是否在中国范围外。此属性不是精确判断,不能用于边界区域 */ isAbroad: boolean; }; /** * subscribe 地图准备移动事件 * @type `mapWillZoom` */ export type MapWillZoomEventData = { /** * 用户操作,true, 表示用户滑动, 其他属于地图自身的移动. */ wasUserAction: boolean; /** * 中心点经纬度 */ coordinate: MapGeoPoint; /** * 标识当前地图中心位置是否在中国范围外。此属性不是精确判断,不能用于边界区域 */ isAbroad: boolean; /** * 缩放等级 */ zoomLevel: number; }; /** * subscribe 地图移动之后的事件 * @type `mapDidZoom` */ export type MapDidZoomEventData = { /** * 用户操作,true, 表示用户滑动, 其他属于地图自身的移动. */ wasUserAction: boolean; /** * 中心点经纬度 */ coordinate: MapGeoPoint; /** * 标识当前地图中心位置是否在中国范围外。此属性不是精确判断,不能用于边界区域 */ isAbroad: boolean; }; export type FabricMapEventListenerType = "mapDidUpdateUserLocation" | "mapWillMove" | "mapDidMove" | "mapDidClickAtCoordinate" | "mapAnnotationViewCalloutClicked" | "mapDidFailToLocateUser" | "mapDidFailLoading" | "mapDidFailLoadTerrain" | "mapWillZoom" | "mapDidZoom"; export type MapSubscribeEventData = T extends "mapDidUpdateUserLocation" ? MapDidUpdateUserLocationEventData : T extends "mapWillMove" ? MapWillMoveEventData : T extends "mapDidMove" ? MapDidMoveEventData : T extends "mapDidZoom" ? MapDidZoomEventData : T extends "mapWillZoom" ? MapWillZoomEventData : T extends "mapDidClickAtCoordinate" ? MapDidClickAtCoordinateEventData : T extends "mapAnnotationViewCalloutClicked" ? MapAnnotationViewCalloutClickedEventData : T extends "mapDidFailToLocateUser" ? MapDidFailToLocateUserEventData : T extends "mapDidFailLoading" ? MapDidFailLoadingEventData : T extends "mapDidFailLoadTerrain" ? MapDidFailLoadTerrainEventData : never; /** * 注注册回调事件接受Native主动通知H5的各种事件. * 1. 如地图拖动Move, 缩放, 初始化成功, 打标等各种事件. */ export type FabricMapSubscribeEventOptions = { [eventName in T]?: (error: null | FabricError, data: MapSubscribeEventData) => void | Promise; }; export type FabricMapSubscribeEventApi = (options: FabricMapSubscribeEventOptions) => void; /** * 传输时间热区位置点, 到Native, 当前热区只支持矩形, 坐标原点为左上角定点. */ export type FabricMapSetHotRegionOptions = { /** * 一次可以传递多个热区点矩形 */ regions: Array; }; export type FabricMapSetHotRegionApi = (options: FabricMapSetHotRegionOptions) => Promise; /** * 获取当前的地理位置、速度。开启高精度定位,接口耗时会增加,可指定 highAccuracyExpireTime 作为超时时间。 * 地图相关使用的坐标格式应为 gcj02, 注意此处iOS/android均使用(高德)地图引擎 */ export type MapLocationOptions = { /** * 是否返回高度信息,需要较高精确度,会减慢接口返回速度 */ altitude?: boolean; /** * 开启高精度定位 * @default false */ isHighAccuracy?: boolean; /** * 定位超时时间(ms), 不提供则无限等待定位结果. * @default 30000 */ expireTime?: number; /** * 是否在无权限时,显示系统设置弹框 * @default false */ isShowOpenSettingWhenDisallowed?: boolean; }; /** * 打开调试模式, 结果返回 */ export type MapLocationCallbackResult = { /** * 纬度,范围为 -90~90,负数表示南纬 */ latitude: string; /** * 经度,范围为 -180~180,负数表示西经 */ longitude: string; /** * 速度,单位 m/s */ speed: string; /** * 位置的精确度 */ accuracy: string; /** * 高度,单位 m */ altitude: string; /** * 逆地理编码结果 */ regeocode: { /** * 格式化地址 */ formattedAddress: string; /** * 国家 */ country: string; /** * 省/直辖市 */ province: string; /** * 市 */ city: string; /** * 区 */ district: string; /** * 城市编码 */ citycode: string; /** * 区域编码 */ adcode: string; /** * 街道名称 */ street: string; /** * 门牌号 */ number: string; /** * 兴趣点名称 */ POIName: string; /** * 所属兴趣点名称 */ AOIName: string; }; }; export type MapLocationGetLocationApi = (options: MapLocationOptions) => Promise; /** * 启动打车插件配置选项 */ export type FabricMapStartOptions = { /** * 全屏webview还是半屏webview * Note: 半屏webview不支持自定义, 大小有native 写死. */ screen: "full" | "half"; /** * 动画方向从下往上top, 动画方向从右往左left, 从左往右只支持全屏, 半屏幕支持上往下, 左往右 */ direction?: "top" | "left"; /** * 启动打车插件配置 */ config: { /** * 启动页H5地址 https:// */ entryPage: string; /** * 缩放级别(默认3-19,有室内地图时为3-20) * +/-/0, 传递0 不做缩放动作, 但是可以通过返回值回去当下是否可以放大/缩小 * 也可以单独调用`setMap`.`setMapZoom` API * @default 16 */ zoomLevel?: SetMapZoomParam["zoomLevel"]; /** * 设置地图居中展示区域的中心点位置的API输入参数, 其他地图移动都会依据这个显示位置的缩放, 移动, 聚拢. * 也可以单独调用`setMap`.`setMapScreenViewportCenter` API */ mapScreenViewportCenter?: SetMapScreenViewportCenterParam; /** * 设置Native地图中划线起点/终点落在的区域,Native 需要根据这个区域做适当的缩放计算. * 也可以单独调用`setMap`.`setMapScreenViewportArea` API */ mapScreenViewportArea?: SetMapScreenViewportAreaParam; }; }; export type FabricMapStartApi = (options: FabricMapStartOptions) => Promise; /** * 打车路径规划并附带小车配置. */ export type FabricSetMapPlanningPathOptions = SetMapPathPlanningParam & { /** * Native是否自动计算移动方向, 如果设置为true, 同时当前存在路径规划的的行车路径, native会自动计算当前annotation的点的方向. * 目前用来处理小车🚗的行驶方向. * @default false */ carAnnotation?: Pick; }; export type FabricSetMapPathPlanningApi = (options: FabricSetMapPlanningPathOptions) => Promise; /** * 搜索启点到终点之间的驾车路径规划 * @method drivingRouteSearch */ export type DrivingRouteSearchParam = { /** * 出发点 */ origin: MapGeoPoint; /** * 目的地 */ destination: MapGeoPoint; /** * 驾车导航策略,默认策略为0。 * 0,速度优先(时间);1,费用优先(不走收费路段的最快道路);2,距离优先;3,不走快速路;4,躲避拥堵; * 5,多策略(同时使用速度优先、费用优先、距离优先三个策略计算路径),其中必须说明,就算使用三个策略算路,会根据路况不固定的返回一至三条路径规划信息; * 6,不走高速;7,不走高速且避免收费;8,躲避收费和拥堵;9,不走高速且躲避收费和拥堵; * 10,多备选,时间最短,距离最短,躲避拥堵(考虑路况); * 11,多备选,时间最短,距离最短; * 12,多备选,躲避拥堵(考虑路况); * 13,多备选,不走高速; * 14,多备选,费用优先; * 15,多备选,躲避拥堵,不走高速(考虑路况); * 16,多备选,费用有限,不走高速; * 17,多备选,躲避拥堵,费用优先(考虑路况); * 18,多备选,躲避拥堵,不走高速,费用优先(考虑路况); * 19,多备选,高速优先; * 20,多备选,高速优先,躲避拥堵(考虑路况) * @default 0 */ strategy?: number; /** * 途经点 AMapGeoPoint 数组,目前最多支持6个途经点 */ waypoints?: Array; /** * 避让区域 AMapGeoPolygon 数组,目前最多支持100个避让区域,每个区域16个点 */ avoidpolygons?: Array; /** * 避让道路名 */ avoidroad?: string; /** * 出发点 POI ID */ originId?: string; /** * 目的地 POI ID */ destinationId?: string; /** * 出发点POI类型编码,此值可以辅助更精准的起点算路,0:普通道路、1:高架上、2:高架下、3:主路、4:辅路、5:隧道、7:环岛、9:停车场内部 */ origintype?: string; /** * 目的地POI类型编码 */ destinationtype?: string; /** * 车牌信息,如京AHA322,支持6位传统车牌和7位新能源车牌,用于判断是否限行 */ plate: string; /** * 是否返回扩展信息,默认为 NO */ requireExtension?: string; /** * 车牌省份,用汉字填入车牌省份缩写。用于判断是否限行 */ plateProvince?: string; /** * 车牌详情,填入除省份及标点之外的字母和数字(需大写)。用于判断是否限行。 */ plateNumber?: string; /** * 使用轮渡,0使用1不使用,默认为0使用 */ ferry?: number; /** * 驾车路径规划车辆类型,默认策略为0。 * 0:普通汽车(默认值); * 1:纯电动车; * 2:插电混动车 */ cartype?: number; }; /** * 搜索启点到终点之间的驾车路径路径规划返回结果 */ export type DrivingRouteSearchResult = { /** * 路径规划信息数目 */ count: number; /** * 路径规划信息 */ route: MapRoute; }; declare enum FabricMapSearchMethod { /** * 地图POI ID 搜索 */ poiIDSearch = "poiIDSearch", /** * POI 关键字查询接口 */ poiKeywordsSearch = "poiKeywordsSearch", /** * POI 周边查询接口 */ poiAroundSearch = "poiAroundSearch", /** * POI 多边形查询接口 */ poiPolygonSearch = "poiPolygonSearch", /** * 沿途查询接口 */ routePOISearch = "routePOISearch", /** * 地址编码查询接口 */ geocodeSearch = "geocodeSearch", /** * 逆地址编码查询接口 */ reGeocodeSearch = "reGeocodeSearch", /** * 输入提示查询接口 */ inputTipsSearch = "inputTipsSearch", /** * 公交站点查询接口 */ busStopSearch = "busStopSearch", /** * 公交线路ID查询 */ busLineIDSearch = "busLineIDSearch", /** * 公交线路关键字查询 */ busLineNameSearch = "busLineNameSearch", /** * 行政区域查询接口 */ districtSearch = "districtSearch", /** * 驾车路径规划查询接口 */ drivingRouteSearch = "drivingRouteSearch", /** * 步行路径规划查询接口 */ walkingRouteSearch = "walkingRouteSearch", /** * 公交路径规划查询接口 */ transitRouteSearch = "transitRouteSearch", /** * 骑行路径规划查询接口 */ ridingRouteSearch = "ridingRouteSearch", /** * 货车路径规划查询接口 */ truckRouteSearch = "truckRouteSearch", /** * 未来路线规划查询接口 */ futureRouteSearch = "futureRouteSearch", /** * 天气查询接口 */ weatherRouteSearch = "weatherRouteSearch", /** * 距离查询 */ distanceSearch = "distanceSearch", /** * 企业地图周边查询接口 */ cloudPOIAroundSearch = "cloudPOIAroundSearch", /** * 企业地图polygon区域查询接口 */ cloudPOIPolygonSearch = "cloudPOIPolygonSearch", /** * 企业地图ID查询接口 */ cloudPOIIDSearch = "cloudPOIIDSearch", /** * 企业地图本地查询接口 */ cloudPOILocalSearch = "cloudPOILocalSearch", /** * 位置短串分享接口 */ locationShareSearch = "locationShareSearch", /** * 兴趣点短串分享接口 */ poiShareSearch = "poiShareSearch", /** * 路线规划短串分享接口 */ routeShareSearch = "routeShareSearch", /** * 导航短串分享接口 */ navigationShareSearch = "navigationShareSearch" } /** * 距离查询请求 * @method distanceSearch */ export type DistanceSearchParam = { /** * 起点坐标数组,最多支持100个点。 */ origins: Array; /** * 终点坐标 */ destination: MapGeoPoint; /** * 路径计算的类型,当type为导航距离时,会考虑路况,故在不同时间请求返回结果可能不同; */ type: MapDistanceSearchType; /** * 驾车距离测量策略,参考驾车路径规划。仅当type为`DistanceSearchTypeDrive`时有效,默认4 */ strategy?: number; /** * 是否返回扩展信息,默认为 NO (since 7.6.0) */ requireExtension?: boolean; }; export type MapDistanceResult = { /** * 起点坐标,起点坐标序列号(从1开始) */ originID: number; /** * 终点坐标,终点坐标序列号(从1开始) */ destID: number; /** * 路径距离,单位:米 */ distance: number; /** * 预计行驶时间,单位:秒 */ duration: number; /** * 错误信息,建议用此字段判断请求是否成功 */ info: string; /** * 在驾车模式下有效。默认为0;1:指定地点之间没有可以行车的道路;2:起点/终点 距离所有道路均距离过远(例如在海洋/矿业);3;起点/终点不在中国境内; */ code: number; }; /** * 距离查询结果 */ export type DistanceSearchResult = { /** * 距离查询结果 AMapDistanceResult 数组。 */ results: Array; }; /** * POI 关键字查询接口入参数 * @method poiKeywordsSearch */ export type PoiKeywordsSearchParam = PoiSearchParam<{ /** * 查询关键字,多个关键字用“|”分割 */ keywords: string; /** * 查询城市,可选值:cityname(中文或中文全拼)、citycode、adcode.(注:台湾省的城市一律设置为【台湾】,不具体到市。) */ city?: string; /** * 强制城市限制功能 默认NO,例如:在上海搜索天安门,如果citylimit为true,将不返回北京的天安门相关的POI * @default false */ cityLimit?: boolean; /** * 设置后,如果sortrule==0,则返回结果会按照距离此点的远近来排序,since 5.2.1 */ location?: MapGeoPoint; }>; export type PoiKeywordsSearchResult = PoiSearchResult<{ /** * 返回的POI数目 */ count: number; /** * 关键字建议列表和城市建议列表 */ suggestion: MapSuggestion; }>; /** * 逆地址编码查询接口, 根据经纬度查询用户的地址信息. * @method `reGeocodeSearch` */ export type ReGeocodeSearchParam = PoiSearchParam<{ /** * 是否返回扩展信息,默认NO。 */ requireExtension?: boolean; /** * 中心点坐标。 */ location: MapGeoPoint; /** * 查询半径,单位米,范围0~3000,默认1000。 */ radius?: number; /** * 指定返回结果poi数组中的POI类型,在requireExtension=YES时生效。输入为typecode, 支持传入多个typecode, 多值时用“|”分割 */ poitype?: number; /** * distance 按距离返回,score 按权重返回,仅海外生效(since 7.4.0) */ mode?: string; }>; export type ReGeocodeSearchResult = { /** * 逆地理编码结果 */ regeocode: MapReGeocode; }; export type FabricSearchMapMethodType = keyof Pick; /** * POI 周边查询接口 * @method poiAroundSearch */ export type PoiAroundSearchParam = PoiSearchParam<{ /** * 查询关键字,多个关键字用“|”分割 */ keywords?: string; /** * 中心点坐标 */ location?: MapGeoPoint; /** * 查询半径,范围:0-50000,单位:米 [default = 1500] * @default 1500 */ radius?: number; /** * 查询城市,可选值:cityname(中文或中文全拼)、citycode、adcode。注:当用户指定的经纬度和city出现冲突,若范围内有用户指定city的数据,则返回相关数据,否则返回为空。(since 5.7.0) */ city?: string; /** * 是否对结果进行人工干预,如火车站,原因为poi较为特殊,结果存在人工干预,干预结果优先,所以距离优先的排序未生效,默认为YES (since 7.4.0) */ special?: boolean; }>; export type PoiAroundSearchResult = PoiSearchResult; export type FabricSearchMapOptions = { /** * 搜索方法 */ method: T; /** * 搜索参数 */ param: T extends "poiKeywordsSearch" ? PoiKeywordsSearchParam : T extends "poiAroundSearch" ? PoiAroundSearchParam : T extends "reGeocodeSearch" ? ReGeocodeSearchParam : T extends "distanceSearch" ? DistanceSearchParam : T extends "drivingRouteSearch" ? DrivingRouteSearchParam : never; }; export type FabricSearchMapResult = T extends "poiKeywordsSearch" ? PoiKeywordsSearchResult : T extends "poiAroundSearch" ? PoiAroundSearchResult : T extends "reGeocodeSearch" ? ReGeocodeSearchResult : T extends "distanceSearch" ? DistanceSearchResult : T extends "drivingRouteSearch" ? DrivingRouteSearchResult : never; export type FabricSearchMapApi = (options: FabricSearchMapOptions) => Promise>; /** * 设置地图事件. */ export type FabricMapOptions = { type: T; param: T extends "setMapScreenViewportCenter" ? SetMapScreenViewportCenterParam : T extends "setMapScreenViewportArea" ? SetMapScreenViewportAreaParam : T extends "setMapZoom" ? SetMapZoomParam : T extends "setUserLocationRepresentation" ? SetUserLocationRepresentationParam : T extends "setMapCenterCoordinate" ? SetMapCenterCoordinateParam : T extends "removeAnnotations" ? RemoveAnnotationsParam : T extends "updateAnnotations" ? UpdateAnnotationsParam : T extends "getAllAnnotations" ? GetAllAnnotationsParam : T extends "selectAnntations" ? SelectAnntationsParam : T extends "deselectAnntations" ? DeselectAnntationsParam : T extends "updateFlagstick" ? UpdateFlagstickParam : T extends "mapSupplierCoordinateExchange" ? MapSupplierCoordinateExchangeParam : T extends "coordinateDirection" ? GetCoordinateDirectionParam : T extends "coordinateScreenPosition" ? GetCoordinateScreenPositionParam : T extends "coordinateScreenDistance" ? GetCoordinateScreenDistanceParam : T extends "setMapPathPlanning" ? SetMapPathPlanningParam : T extends "addPaths" ? SetMapAddPathsParam : T extends "removePaths" ? SetMapRemovePathsParam : T extends "getAllPaths" ? SetMapGetAllPathsParam : T extends "updatePaths" ? SetMapUpdatePathsParam : T extends "exchangePath" ? SetMapExchangePathParam : undefined; }; export type FabricMapResult = T extends "setMapZoom" ? SetMapZoomParamResult : T extends "getAllAnnotations" ? GetAllAnnotationsResult : T extends "mapSupplierCoordinateExchange" ? MapSupplierCoordinateExchangeResult : T extends "updateAnnotations" ? UpdateAnnotationsResult : T extends "updateFlagstick" ? UpdateFlagstickResult : T extends "selectAnntations" ? SelectAnntationsResult : T extends "removeAnnotations" ? RemoveAnnotationsResult : T extends "deselectAnntations" ? DeselectAnntationsResult : T extends "coordinateDirection" ? GetCoordinateDirectionResult : T extends "coordinateScreenDistance" ? GetCoordinateScreenDistanceResult : T extends "coordinateScreenPosition" ? GetCoordinateScreenPositionResult : T extends "setMapPathPlanning" ? SetMapPathPlanningResult : T extends "getAllPaths" ? SetMapGetAllPathsResult : undefined; export type FabricMapApi = (options: FabricMapOptions) => Promise>; export type ConstantsType = { /** * 标柱的动画效果配置 */ annotationAnimationType: typeof FabricAnnotationAnimationType; /** * (地图内置, 需要传递 `pinColor`),点标注 \大头针标注、 地图内置 \ 动画标注 */ annotationType: typeof FabricAnnotationType; /** * 地图操作常用错误状态码定义 */ mapErrorCode: typeof FabricMapErrorCode; /** * 步行/驾车/打车 */ mapNaviType: typeof FabricMapNaviType; /** * 路径规划, 单路径, 还是多路径 */ mapPathType: typeof FabricMapPathType; /** * 地图厂商坐标类型枚举, 百度, 高德, 腾讯, google.... */ mapSupplierType: typeof MapSupplierType; /** * 距离测量类型 */ distanceSearchType: typeof MapDistanceSearchType; /** * 高德地图 pinColor 内置大头针的枚举 */ mapInAnnotationColor: typeof MAPinAnnotationColor; }; export type FabricMapExportApi = { /** * 启动打车插件. */ startMap: FabricMapStartApi; /** * 传输时间热区位置点, 到Native, 当前热区只支持矩形, 坐标原点为左上角定点. */ setHotRegion: FabricMapSetHotRegionApi; /** * 设置地图各种API */ setMap: FabricMapApi; /** * 打车路径规划中的小车配置 */ setMapCar: FabricSetMapCarApi; /** * 设置地图行车路径规划 */ setMapPathPlanning: FabricSetMapPathPlanningApi; /** * 通过地址搜索位置. */ searchMap: FabricSearchMapApi; /** * 注注册回调事件接受Native主动通知H5的各种事件. */ subscribe: FabricMapSubscribeEventApi; /** * 获取当前的地理位置、速度。开启高精度定位,接口耗时会增加,可指定 expireTime 作为超时时间 * 1. 如果定位被用户强制关闭, 或者用户点了拒绝, 或者在设置里面禁用了, 返回错误code:`location_permission_disallow` * 2. 如果定位超时了, 则返回错误code: `location_service_timeout` * 3. 如果定位未决定, 则返回错误code: `location_service_not_determined`(iOS可能弹出来用户很久未点, 会自动抛出系统BUG) */ getLocation: MapLocationGetLocationApi; /** * 常用的枚举常量 */ constants: ConstantsType; }; /** * Fabric打车插件. */ export declare const fabricMap: FabricMapExportApi; export {};