使用范围:UI2
Contents
class Geo ($UI/system/api/native/geo)
地理信息接口。
var geo = require('$UI/system/api/native/geo'); geo.openLocation({ latitude : 23.099994, longitude : 113.324520, name : 'TIT 创意园', address : '广州市海珠区新港中路 397 号', scale : 14, infoUrl : 'http://weixin.qq.com' }); geo.getLocation({ success : function(res) { alert(JSON.stringify(res)); }, cancel : function(res) { alert('用户拒绝授权获取地理位置'); } });
Constructor Top
Geo () |
Static Methods Top
void | getLocation (Object options) | |
void | openLocation (Object options) |
Constructor details
Top
public
Geo
()
地理信息接口。
var geo = require('$UI/system/api/native/geo');
geo.openLocation({
latitude : 23.099994,
longitude : 113.324520,
name : 'TIT 创意园',
address : '广州市海珠区新港中路 397 号',
scale : 14,
infoUrl : 'http://weixin.qq.com'
});
geo.getLocation({
success : function(res) {
alert(JSON.stringify(res));
},
cancel : function(res) {
alert('用户拒绝授权获取地理位置');
}
});
public
Geo
()
地理信息接口。
var geo = require('$UI/system/api/native/geo'); geo.openLocation({ latitude : 23.099994, longitude : 113.324520, name : 'TIT 创意园', address : '广州市海珠区新港中路 397 号', scale : 14, infoUrl : 'http://weixin.qq.com' }); geo.getLocation({ success : function(res) { alert(JSON.stringify(res)); }, cancel : function(res) { alert('用户拒绝授权获取地理位置'); } });
Static Methods Detail Top
static
public
void
getLocation
(Object options)
得到当前的地理位置。
static
public
void
openLocation
(Object options)
打开百度地图。