高德默认聚合(相邻的可能聚合到一块)
绘制企业聚合点 async drawQiye(markerList) { let that = this; let markersss = []; // 登记、简单、重点 let iconList = [ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAABvVJREFUSEutV39s1GcZ/3zeu+tdf11/KHOLwFjcooKJ0SsQmMIxcUBRhNVujo5NEiLJnAZ/zRlidvMfw7JJFucvps6NGJpipmnXdpdB1xZZsFCJiUamJopOEbTX32t7vXs/5vneHbQEWP/wbe7S+z7v9/08z/s+n8/zvMTcIRGkEo9nlnpyWT6UD9NL8+bc4IeTu3j78vo3jt7LPIprXW86A0NxUnObQn9+Y/gJQg8AiAEwexFYzv4pvFB4SNC8EgEWbTkSJ7PMfeH3+9918UbgwToGaF4mvp15WNKzAC4CyAsIA4hQ8CBmAqwigj0TUWZzAjsCu41bBLWe3f/OlrcFLk1IHBjqpLAWxLiEKgD/JfAfABUAlgrI8vIOICbgooCME6pELL4MLszA+7WD+xdduB445xoans6k4dUQ7KFnVzimh8szY9leLMs2VGZ2A3wSwCSAOIDDkdDko9GxnIBluYnK4S8B+AaAaREzHkye/WrdeaTkkKLtyLwxD3jl05lXSDQAiHrlW858ZVF7MqVwb4q5ROpfFS4eO0ng3QBCctxxel9df8n+oaeGbw079RKoFDDhs0gOPlb/9wUBrz6YSYNKAIwSbDm1r649+fxfY73nl2UTt1yIhadixwHdYbnkwaYA2Oy7b5te++zwrfmcegRfTbiJHJAc3LdA4DXfzaQBJCxikY+ceqTuhcSPFBncy9mV37t0c9iH+iFWAygn0PL6F+s7L9u/M7QiHGEaUgTgW85j/cmFAq/9fgC8EmIW1L8BPAVgmA6Wty0CtoCYhALgcx56JkROWU54jz0APlJMsBmGsP7k3gVGfOcPA+DVtKz2iJKoECEq4OksiLcgg4EgRItct8RxALIFO8OAzJmFA3/0kJ0xVhGcFAJtKAOcLWTg0wKNTaYXhh3wGGAIkKcwY3YBIQJTXlo48LqfBBGvA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qOt+eyIlFN5eRtLYCbZNqW70xPNjXGDqnUbjPwLjGlhQemVxVix6AzAVuYByjJtZcVq15Wx5WUBhRINcuyR9jIrr3lXVWxnXfeSrseNFQufAfBjWiqmkstKQjqrrdxYYKkshwMOBT2JSz2nMHN/EM8CnNEGaCOm3Uz4AxBdAJoK4JG0GLYSqIoVNENQHiBetsppprVOEsv85iYQbSfgnEfkfUPG6rcrwLyog6Roz8vOeJqi2+3ncNvtCirIWPtODCDpPrnpSRthJZCsOu6SnM7kdaY8/W4HrLLiLt+T1ptkrHuv2ZmZ3Ubf0aW7tSfBpfLNZJYvm8LAFwC6dRCfuwWYijWjhQhz7b8w5e8/YJL6OHmgslCy+pN2pxqRIogTMFU2z1PZmub/ABYjBgOoakNQAAAAAElFTkSuQmCC", ]; if (!markerList.length) return; for (const [keys, values] of markerList.entries()) { let marker = new AMap.Marker({ position: new AMap.LngLat(values.longitude, values.latitude), icon: new AMap.Icon({ size: new AMap.Size(30, 30), // 图标尺寸 image: iconList[ values.managementLevel == "REGISTER" ? 0 : values.managementLevel == "SIMPLE" ? 1 : 2 ], imageSize: new AMap.Size(30, 30), // 根据所设置的大小拉伸或压缩图片 }), title: values.name, }); marker.on("click", async function(e) { if (!that.qiyeHtml) return; const html = that.qiyeHtml(values); that.addInfoWindow(html, [e.lnglat.lng, e.lnglat.lat]); }); markersss.push(marker); } //实现聚合点功能 this.cluster = new AMap.MarkerClusterer(that.map, markersss, { maxZoom: 17, gridSize: 60, }); },