huiyan-fe / react-bmapgl

基于百度地图JavaScript GL版API封装的React组件库
http://huiyan.baidu.com/github/react-bmapgl/
MIT License
114 stars 20 forks source link

加点聚合的功能怎么加,用官网示例的写法会报错 #45

Closed peiyanmei closed 2 years ago

peiyanmei commented 2 years ago
    var MAX = 10;
    var markers = [];
    var pt = null;
    var i = 0;
    for (; i < MAX; i++) {
        pt = new BMap.Point(Math.random() * 40 + 85, Math.random() * 30 + 21);
        markers.push(new BMap.Marker(pt));
    }
    console.log(markers)
    //最简单的用法,生成一个marker数组,然后调用markerClusterer类即可。
    var markerClusterer = new BMapLib.MarkerClusterer(this.map, { markers: markers });

Uncaught TypeError: Cannot read properties of undefined (reading 'style')
at BMapLib.TextIconOverlay.e._updateCss (TextIconOverlay_min.js:1:7224)