反应中的集群-mapbox-gl出现错误。
我可以在不使用集群的情况下绘制标记,但是对于集群,它会给出以下错误:
supercluster_1.default不是一个函数
为此,响应代码:
<Map
style={style}
containerStyle={mapStyle}
center={{ lng: -71.07636094093323, lat: 42.35034583215539 }}
bearing={[20]}
pitch={[40]}
zoom={[1]}
>
<Cluster ClusterMarkerFactory={(coordinates) => {
return (<Marker coordinates={coordinates} style={clusterMarkerStyle}>
<div>1</div>
</Marker>)
}}>
{
places.features.map((feature, key) =>
<Marker
key={key}
coordinates={feature.geometry.coordinates}
>
<Mark/>
</Marker>
)
}
</Cluster>
</Map>发布于 2018-10-23 06:16:50
重新安装node_modules解决了问题。
https://stackoverflow.com/questions/50637577
复制相似问题