LocationEstimateUtil

最低版本: 1.0.0最后更新: 2019/11/26

组件功能:

一些关于定位和坐标点的方法,都会返回一个 Promise.

 

方法:

方法名参数类型promise 中返回值说明最低版本支持平台
豹小秘豹花瓶豹大屏
getPlaceList  坐标点数组获取地图上所有的坐标点1.0.0
havePlacedestinationstringboolean判断是否有 destination 坐标点1.0.0
isRobotEstimate  boolean判断机器人是否已经定位1.0.0
isInPlacenamestringboolean判断 name 是否在目标点的 criticalDistance 范围内1.0.0
criticalDistancenumber

示例代码:

let locationEstimateUtil = new LocationEstimateUtil();

locationEstimateUtil.getPlaceList().then(

  (list: []): void => {

      for (let index in list) {

          let name = list[index]['name'];

          console.log(name);

      }

  }

);

locationEstimateUtil..isInPlace('接待点')

.then((bInPlace: boolean): void => {

  if (bInPlace) {

      console.log('In Reception point');

   } else {

      console.log('Not in Reception point');

  }

});