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  表示高德地图插件


版权声明:本文为qq_32973061原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。