地图js:Page({ data: { markers: [], //地图参数: latitude: "", //纬度 longitude: "", //经度 }, clicktop(e) { let that = t_taro vue 微信小程序 webview 里 获取当前定位">
赞
踩
<view>
<button type="primary" bindtap="clicktop">地图</button>
</view>
Page({ data: { markers: [], //地图参数: latitude: "", //纬度 longitude: "", //经度 }, clicktop(e) { let that = this; wx.getLocation({ type: 'wgs84', success(res){ wx.openLocation({ latitude: res.latitude, longitude: res.longitude, scale:18, success:function(res){ wx.chooseLocation({ success(res){ console.log(res); } }) } }) }, fail:function(err){ console.log(err); } }) }, })
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。