1、效果展示
2、关键代码
.wxml布局文件代码
.js逻辑文件代码
Page({
openMap:function(){
wx.getLocation({
type: 'gcj02', // 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标
success: function(res){
// success
wx.openLocation({
latitude: res.latitude, // 纬度,范围为-90~90,负数表示南纬
longitude: res.longitude, // 经度,范围为-180~180,负数表示西经
scale: 28, // 缩放比例
})
}
})
}
})
3、源代码获取方式
百度云链接:http://pan.b

本文展示了如何在微信小程序中实现打开内置地图的功能,包括.wxml布局和.js逻辑文件的关键代码示例,并提供了完整的源代码百度云下载链接。如在实现过程中遇到问题,作者提供微信咨询支持。
最低0.47元/天 解锁文章
4544

被折叠的 条评论
为什么被折叠?



