的OpenLayers 3,聚类多边形或linestings(openlayers 3 , clus

2019-09-29 16:27发布

我一直在寻找一种方式,以集群中使用的OpenLayers 3,但没有运气的多边形。 我读过集群只点所以我想有关编辑ol.source.cluster工作。 所以没有任何人做过,或有任何其他解决办法?

亲切的问候

Answer 1:

如的OpenLayers 3.15.0的,所以可以使用集群的可选功能,所有几何类型geometryFunction 。 从http://openlayers.org/en/v3.15.0/apidoc/ol.source.Cluster.html :

函数,它接受一个ol.Feature作为参数并返回一个ol.geom.Point为群集计算点为特征。 当功能不应被视为对聚类,函数应该返回null。 见ol.geom.Polygon#getInteriorPoint一种方式来获得多边形集群计算点。



文章来源: openlayers 3 , clustering polygons or linestings