小程序
小游戏
企业微信
微信支付
扫描小程序码分享
使用地图聚合的例子导入开发工具为何看不到效果?
4 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
参考https://developers.weixin.qq.com/miniprogram/dev/component/map.html#%E7%82%B9%E8%81%9A%E5%90%88
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
<map id="map" latitude="{{location.latitude}}" longitude="{{location.longitude}}" show-location="{{showPosition}}" show-compass="{{true}}" show-scale="{{true}}" markers="{{markers}}" scale="16"> </map> pc模拟器这样写可以渲染出来 this.setData({ markers }) 真机下面两种写法都可以 let map=wx.createMapContext('map') map.addMarkers 或 this.setData({ markers })
真机上才能看到效果 开发者工具暂不支持
聚合这里,不知道谁写的文档,以及示例代码,完全学不会。
已经能正常在地图显示 markers,就想距离近时聚合,点击弹开,看了一两个小时这部分内容,都不知道怎么写代码实现。官方写的示例,不要掺杂 markers 的制作过程,直接给一个markers 数组,然后开始实现聚合行不行
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
参考https://developers.weixin.qq.com/miniprogram/dev/component/map.html#%E7%82%B9%E8%81%9A%E5%90%88
<map id="map" latitude="{{location.latitude}}" longitude="{{location.longitude}}" show-location="{{showPosition}}" show-compass="{{true}}" show-scale="{{true}}" markers="{{markers}}" scale="16"> </map> pc模拟器这样写可以渲染出来 this.setData({ markers }) 真机下面两种写法都可以 let map=wx.createMapContext('map') map.addMarkers 或 this.setData({ markers })
map.addMarkers
这种写法最新版微信开发者工具确实无法渲染数据,
版本:wechat_devtools_1.05.2102010_x64.exe
真机上才能看到效果 开发者工具暂不支持
聚合这里,不知道谁写的文档,以及示例代码,完全学不会。
已经能正常在地图显示 markers,就想距离近时聚合,点击弹开,看了一两个小时这部分内容,都不知道怎么写代码实现。官方写的示例,不要掺杂 markers 的制作过程,直接给一个markers 数组,然后开始实现聚合行不行