微信小程序 提供了内嵌地图,调取手机中地图app的导航功能,代码如下:
js:
markertap(e) { var latitude = e.currentTarget.dataset.latitude var longitude = e.currentTarget.dataset.longitude console.log("latitude:", latitude) console.log("longitude:", longitude) wx.openLocation({ latitude: Number(latitude), longitude: Number(longitude), }) }但是,将其写入 onload中的时候 是无效的。
有问题请加群:563752274,纯小程序开发交流群,回答问题答案:Tony。