手机真我GT大师探索版[图片]
addMarkers添加聚集点在开发工具上能用,在真机调试上显示不出点?请问是什么回事for (let i in markersData) { const newMarker = { id: 1, iconPath: '../../static/pointDevice.png', width: 50, height: 50, joinCluster: true, // 指定了该参数才会参与聚合 label: { width: 50, height: 30, borderWidth: 1, borderRadius: 5, borderColor:'#138FE3', bgColor: '#ffffff', anchorX: 0, anchorY: -10, content:'' } } newMarker.id = i +1 newMarker.latitude = markersData[i].lat newMarker.longitude = markersData[i].lon newMarker.label.content = markersData[i].species newMarker.clusterId = markersData[i].id this.markerListData.push(newMarker.id) markers.push(newMarker) } // console.log(markers,'asdafdasf') this.mapContext.addMarkers({ markers:markers, clear: true, complete(res) { console.log(res,'complete') }, success(res){ console.log(res,'成功') } })
2022-04-27请问点聚合后如何出现数字
微信小程序聚合点有的坐标不能被聚合的问题?小程序map组件 版本号:2.14.0 两组坐标,有一组能出现聚合点,一组却不能出现聚合点这是什么问题呢? [图片] 上图已实现聚合且坐标点为: var customCallout1 = { id: 43, latitude: 23.169401, longitude: 113.157806, iconPath: '../image/location.png', width:60, height:60, joinCluster: true, customCallout: { anchorY: 0, anchorX: 0, display: 'BYCLICK' }, } var customCallout2 = { id: 345, latitude: 23.096994, longitude: 113.324520, iconPath: '../image/location.png', width:60, height:60, joinCluster: true, customCallout: { anchorY: 0, anchorX: 0, display: 'BYCLICK', }, } var customCallout3 = { id:3434, latitude: 23.095994, longitude: 113.325520, iconPath: '../image/location.png', width:60, height:60, joinCluster: true, customCallout: { anchorY: 0, anchorX: 0, display: 'BYCLICK', }, } [图片] 上图没有聚合效果,坐标点为: var customCallout4 = { id: 43, latitude: 36.071302, longitude: 111.498871, iconPath: '../image/location.png', width:60, height:60, joinCluster: true, customCallout: { anchorY: 0, anchorX: 0, display: 'BYCLICK' }, } var customCallout5 = { id: 345, latitude: 36.143753, longitude: 111.431881, iconPath: '../image/location.png', width:60, height:60, joinCluster: true, customCallout: { anchorY: 10, anchorX: 0, display: 'BYCLICK', }, } 这两份marker其他参数都是一样的,为什么不形成聚合点呢 map组件初始化 //var allMarkers = [customCallout1, customCallout2, customCallout3] var allMarkers = [customCallout4, customCallout5] Page({ data: { // latitude: 23.096994, // longitude: 113.324520, latitude: 36.088228, longitude: 111.518949, }, onLoad: function () { this.mapCtx = wx.createMapContext('myMap'); this.mapCtx.addMarkers({ markers:allMarkers, clear: false, fail(res){ console.log(res); }, complete(res) { console.log('addMarkers', res) } }) }, markertap(e) { console.log('@@@ markertap', e) }, }) wxml文件 <view class="page-body"> <view class="page-section page-section-gap"> <map id="myMap" style="width: 100%; height: 300px;" latitude="{{latitude}}" longitude="{{longitude}}" bindmarkertap="markertap" scale="10" > <!-- <cover-view slot="callout"> <block wx:for="{{markers}}" wx:key="item.id"> <cover-view class="customCallout" marker-id="{{item.id}}" > <cover-image class="icon" src="/image/voice.png"></cover-image> <cover-view class="content"> {{num}}-{{item}}-{{index}} </cover-view> </cover-view> </block> </cover-view> --> </map> </view> </view>
2022-01-06请问你是怎么把数字显示出来的
多个相同坐标的marker组成聚合点后,点击聚合点不能展开,不能实现聚合分散https://developers.weixin.qq.com/miniprogram/dev/component/map.html 多个相同坐标的marker组成聚合点后,点击聚合点不能展开,不能实现聚合分散,无论将地图放大到多么大都一样,真机调试,任何机型都有这个问题 [图片] 只要marker的坐标都一样,就会必现
2022-01-06