markers: [
{
clusterId: 6,
height: "32rpx",
iconPath: "https://stpg.01mmc.cn/prod-api/file/statics/icon/logo/weather_logo_5.png",
id: 6,
joinCluster: true,
latitude: 30.183178077712377,
longitude: 120.1595385032642,
name: "心心农场气象站2",
width: "32rpx",
},
{
clusterId: 1664113273962283000,
height: "32rpx",
iconPath: "https://stpg.01mmc.cn/prod-api/file/statics/icon/logo/sensor_logo_5.png",
id: 1664113273962283000,
joinCluster: true,
latitude: 30.18135020060892,
longitude: 120.15633463926073,
name: "心心农场传感器2",
width: "32rpx",
},
{
clusterId: 5,
height: "32rpx",
iconPath: "https://stpg.01mmc.cn/prod-api/file/statics/icon/logo/valvesin0_logo_5.png",
id: 5,
joinCluster: true,
latitude: 30.183262180971205,
longitude: 120.1567566743741,
name: "心心农场控制器2",
width: "32rpx",
}
]
这三个点在模拟器上都显示,在真机上就只显示一个
去掉聚合的相关代码(去掉点上的joinCluster和clusterId属性以及addMarkers方法),真机上三个点就都显示了为什么呀?求大神帮忙
配置的marker有问题,一开始是不需要设置clusterId的,形成聚合之后才有的clusterId,另外他的宽高也设置错了,多rpx,去掉clusterId,宽高设置为数字,即可