//自定义点聚合图标
var sts = [{
url: "https://a.amap.com/jsapi_demos/static/images/blue.png",
size: new AMap.Size(32, 32),
offset: new AMap.Pixel(-16, -16)
}, {
url: "https://a.amap.com/jsapi_demos/static/images/green.png",
size: new AMap.Size(32, 32),
offset: new AMap.Pixel(-16, -16)
}, {
url: "https://a.amap.com/jsapi_demos/static/images/orange.png",
size: new AMap.Size(36, 36),
offset: new AMap.Pixel(-18, -18)
}, {
url: "https://a.amap.com/jsapi_demos/static/images/red.png",
size: new AMap.Size(48, 48),
offset: new AMap.Pixel(-24, -24)
}, {
url: "https://a.amap.com/jsapi_demos/static/images/darkRed.png",
size: new AMap.Size(48, 48),
offset: new AMap.Pixel(-24, -24)
}];
//点聚合
var cluster = [];
//添加点聚合方法
cluster = new AMap.MarkerClusterer(gmap, gpsMarks, {
zoomOnclick:false,
styles: sts,
gridSize: 80
});
//设置点聚合最小显示的限制 当地图上点小于15个时,直接显示全部标记
cluster.setMinClusterSize(15)
gpsMarks.splice(0,gpsMarks.length)
高德地图点聚合最小显示