|
参照了视频,上面引用过了:require("cordova!cordova-plugin-geolocation");
Model.prototype.button7Click = function(event){
var me=this;
function successCallback (position){
alert("地址:"+position.address);
alert("坐标:"+position.coorType);
alert("纬度:"+position.coords.latitude);
alert("经度:"+position.coords.longitude);
me.comp("windowDialog1").open({data:JSON.stringify(position)});
}
function errorCallback (){
alert("失败");
}
navigator.geolocation.getCurrentPosition(successCallback, errorCallback);
};
现在在手机上运行,可以进入successCallback内,但是有两个问题:
1, position.address这个数据出不来.其他的坐标什么的都能出来
2,我把map.html mapActivity.js mapActivity.w全部拷贝到了我的文件夹下.在手机上运行,
出来个新网页,上面是百度地图定们,但是下面是一片空白,没有百度地图出来呀.
|
|