public class ChatLocationManager
extends com.tuisongbao.engine.common.BaseManager
获取当前位置,以经纬度标记。
Modifier and Type | Method and Description |
---|---|
Location |
getCurrentLocation(com.tuisongbao.engine.common.callback.EngineCallback<Location> callback,
int timeoutInSeconds)
获取当前的位置
|
static ChatLocationManager |
getInstance() |
bind, bindOnce, trigger, unbind, unbind
public static ChatLocationManager getInstance()
public Location getCurrentLocation(com.tuisongbao.engine.common.callback.EngineCallback<Location> callback, int timeoutInSeconds)
处理方法的回调参数不保证一定会返回当前位置。在没有开启位置服务并且没有网络连接的情况下,是无法实时获取到当前位置的,此时会返回上一次记录的位置。
此外,超过给定时间限制后会触发 onSuccess
的回调,并将上一次记录的位置返回。
callback
- 处理方法timeoutInSeconds
- 超时时间,单位是 “秒”,默认为 5 秒。null