2***@qq.com
2***@qq.com
  • 发布:2018-04-25 17:09
  • 更新:2018-04-25 17:47
  • 阅读:2040

mui调用地图问题

分类:MUI

mui传地理位置调用mui.openWindow打开一个页面调用百度地图的API,做一个导航的路线展示和路线规划,在真机运行和模拟器运行的时候可以实现,通过云打包过后,点击导航就是白屏,没有显示

下面是代码:

            var self = plus.webview.currentWebview();  
            var toAddress = self.toAddress;  
            var city = toAddress.split('市')[0];  

// console.log(city)
// console.log(toAddress)
/百度定位,并使用百度坐标,精确定位/
var requestUrl;
var manualPositionFn = function(){
plus.geolocation.getCurrentPosition(function(result){
// console.log(JSON.stringify(result))
mui.openWindow("http://api.map.baidu.com/direction?origin=latlng:"+result.coords.latitude+","+result.coords.longitude+"|name:当前位置&destination="+toAddress+"&mode=driving&region="+city+"&output=html");
}, function(e){
},{provider:'baidu',enableHighAccuracy:true,timeout:5000,geocode:true,coordsType:'bd09ll'});
}
if(window.plus){
manualPositionFn();
}else{
document.addEventListener("plusready",manualPositionFn,false);
}

2018-04-25 17:09 负责人:无 分享
已邀请:
太烏

太烏

配置地图sdk了么

  • 2***@qq.com (作者)

    没有,因为上面没有使用地图插件,只是传入地址调用API打开一个新页面

    2018-04-26 11:06

该问题目前已经被锁定, 无法添加新回复