Uncaught TypeError: AMap.MarkerClusterer is not a constructor

实验点聚合时报错:

            cluster = new AMap.MarkerClusterer(map, markers, {
                styles: sts,
                gridSize: 80
            }); 

改为: map.plugin(["AMap.MarkerClusterer"],function() {
    cluster = new AMap.MarkerClusterer(
        map,
        markers,
        {
            styles:sts
        }
    );

map.plugin  表示高德地图插件

猜你喜欢

转载自blog.csdn.net/qq_32973061/article/details/84770431
今日推荐