|
var Model = function() {
this.callParent();
this.gpsCityText = justep.Bind.observable();
this.gpsCityCode = justep.Bind.observable();
this.lonText = justep.Bind.observable();
this.latText = justep.Bind.observable();
};
Model.prototype.modelLoad = function(event) {
navigator.baiduMap.base.getCurrentLocation(
function(data){
this.lonText.set(data.lon);
this.latText.set(data.lat);
},
function() {
throw justep.Error.create("获取经纬度失败");
}
);
navigator.baiduMap.base.getNameFromLocation(
{lon:this.lonText.get(),lat:this.latText.get()},
function(mapData){
this.gpsCityCode.set(mapData.result.cityCode);
},
function() {
throw justep.Error.create("获取位置失败");
}
);
};
打包时已经把 com.justep.cordova.pugin.baiduMapBase这个插件打入包内,也把安全码、密钥都输入了,但是却到不到CityCode信息。因为这个是要打包APP到手机才能测试的,因而无法debugger,请技术看看我的代码有没有错误。
|
|