【函数】 | boolean isReady() |
【说明】 | GPS是否就绪。 |
【返回】 | true或false。 |
【参数】 | 无 |
【示例】 |
alert(rexseeGps.isReady());
运行示例
|
【函数】 | void openSettings() |
【说明】 | 打开GPS配置页面,成功打开GPS会触发事件onGpsSettingSuccessed,否则会触发事件onGpsSettingFailed。 |
【返回】 | 无 |
【参数】 | 无 |
【示例】 |
rexseeGps.openSettings();
运行示例
|
【函数】 | void start() |
【说明】 | 启动GPS,如果GPS尚未打开会报错。 |
【返回】 | 无 |
【参数】 | 无 |
【示例】 |
rexseeGps.start();
运行示例
rexseeDialog.toast('开始定位......'); |
【函数】 | void stop() |
【说明】 | 关闭GPS。 |
【返回】 | 无 |
【参数】 | 无 |
【示例】 |
rexseeGps.stop();
运行示例
rexseeDialog.toast('停止定位。'); |
【函数】 | JsonObject getLastKnownLocation() |
【说明】 | 获取最近知道的位置。 |
【返回】 |
返回值是一个JSON格式的字符串,使用eval('('+json+')')可以将JSON字符串转换为JavaScript对象。
{
|
【参数】 | 无 |
【示例】 |
var rtn=rexseeGps.getLastKnownLocation();
运行示例
if ( rtn=='' ) alert('No LastknownLocation.'); else alert(rtn); |
【函数】 | float getDistanceBetween(String startLongitude, String startLatitude, String endLongitude, String endLatitude) |
【说明】 | 计算两个地点之间的直线距离。 |
【返回】 | 距离,单位是米。 |
【参数】 |
startLongitude:起点经度。
startLatitude:起点纬度。 endLongitude:终点经度。 endLatitude:终点纬度。 |
【示例】 |
alert(rexseeGps.getDistanceBetween('116.45508','39.84229','116.55508','39.84229'));
运行示例
|