openMapAppLocation

版本要求:
MapKit≥2.1.0@ray-js/ray≥1.2.10
支持平台:
iOSAndroid
import { map } from '@ray-js/ray';

const { openMapAppLocation } = map;

// Promise 调用
try {
  const res = await openMapAppLocation({ ...params });
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

方法签名
openMapAppLocation(params: )
SDK 最低版本
iOSThingSmartMapKitBizBundle
≥ 5.2.0
Androidcom.thingclips.smart:thingsmart-bizbundle-mapkit
≥ 5.2.0

描述

使用第三方地图查看位置

参数

属性类型必填说明SDK 最低版本
latitudenumber是纬度,范围 -90~90,负数表示南纬—
longitudenumber是经度,范围 -180~180,负数表示西经—
namestring是位置名称—
addressstring是地址详细描述—
mapTypestring是地图类型,目前支持:BMK: 百度地图, MA: 高德地图, TENCENT: 腾讯地图, Google: 谷歌地图—
complete() => void否接口调用结束的回调函数(调用成功、失败都会执行)—
success() => void否接口调用成功的回调函数—
fail(params: Object) => void否接口调用失败的回调函数—
fail 回调参数
属性类型说明
errorMsgstring错误信息
errorCodestring | number错误码
错误扩展

返回值

无

示例代码

import { map } from '@ray-js/ray'

map.openMapAppLocation({
  latitude: 39.908823,
  longitude: 116.39747,
  name: "xx",
  address: "xx",
  mapType: "MA",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});