zhizhi/node_modules/dingtalk-jsapi/api/device/geolocation/start.d.ts

72 lines
3.5 KiB
TypeScript
Raw Normal View History

/**
*
* @apiName device.geolocation.start
*/
export interface IDeviceGeolocationStartParams {
/**
* accuracy
* 200m
*/
targetAccuracy: number;
/** iOS端位置变更敏感度单位为m此值会影响iOS端callback回调速率 */
iOSDistanceFilter: number;
/** 是否缓存地理位置信息。默认是true。如果true客户端会对定位的地理位置信息缓存在缓存期内2分钟再次定位会返回旧的定位 */
useCache?: boolean;
/** 是否需要带有逆地理编码信息;该功能需要网络请求,请更具自己的业务场景使用,默认否 */
withReGeocode?: boolean;
/** 数据回传最小时间间隔单位ms */
callBackInterval: number;
/** 定位场景id对于同一id的不可连续start否则会报错。不同scenceId的互不影响 */
sceneId: string;
}
/**
*
* @apiName device.geolocation.start
*/
export interface IDeviceGeolocationStartResult {
/** 经度 */
longitude: number;
/** 纬度 */
latitude: number;
/** 实际的定位精度半径(单位米) */
accuracy: number;
/** 格式化地址,如:北京市朝阳区南磨房镇北京国家广告产业园区 */
address: string;
/** 省份,如:北京市 */
province: string;
/** 城市,直辖市会返回空 */
city: string;
/** 行政区,如:朝阳区 */
district: string;
/** 街道西大望路甲12-2号楼 */
road: string;
/** 当前设备网络类型wifi、3g等 */
netType: string;
/** 当前设备使用移动运营商CMCC等 */
operatorType: string;
/** 对错误码的描述 */
errorMessage?: string;
/** 错误码 */
errorCode?: number;
/** 仅Android支持wifi设置是否开启不保证已连接上 */
isWifiEnabled?: boolean;
/** 仅Android支持gps设置是否开启不保证已经连接上 */
isGpsEnabled?: boolean;
/** 仅Android支持定位返回的经纬度是否是模拟的结果 */
isFromMock?: boolean;
/** 仅Android支持我们使用的是混合定位具体定位提供者有wifi/lbs/gps" 这三种 */
provider?: 'wifi' | 'lbs' | 'gps';
/** 仅Android支持移动网络是设置是否开启不保证已经连接上 */
isMobileEnabled: boolean;
}
/**
* ()
* callback的方式
* JSAPI
* (v3.4.8)(start)(stop)(status)
* @apiName device.geolocation.start
* @supportVersion ios: 3.4.7 android: 3.4.7
*/
export declare function start$(params: IDeviceGeolocationStartParams): Promise<IDeviceGeolocationStartResult>;
export default start$;