关于uni-app 原生微信小程序的调起导航功能

uni-app是没有调起导航功能的api 只可以使用微信小程序原生api  wx.openLocation(Object) 使用微信内置地图查看位置  调起导航功能   wx.openLocation(Object object) | 微信开放文档

// 微信小程序调起地址导航、
/**
 * 	@param {Number} lat 地址纬度
 * 	@param {Number} lng 地址经度
 *  @param {string} addressName 地址名称
 *  @param {string} fullAddress 详细地址
 * **/
callUpAddressNavigation(lat,lng,addressName,fullAddress){
	//  微信小程序  
	// #ifdef MP-WEIXIN
	wx.openLocation({
		latitude: lat,         // 纬度
		longitude: lng,        // 经度
		name:addressName,      // 地址名称
		address:fullAddress,   // 详细地址
		success:function(res){
			console.log('拉起成功了啦',res)
		},
		fail: function (err) {
			console.log('拉起失败啦', err)
		}
	})
// #endif
}

当时找了很多方案 ----- 直到一个一个去尝试地图相关的api     

猜你喜欢

转载自blog.csdn.net/weixin_65478269/article/details/128366080