Skip to content Skip to sidebar Skip to footer

Openlayers 3 , Clustering Polygons Or Linestings

i've been searching for a way to cluster polygons using openlayers 3 but no luck. i've read that clustering only works with points so i'm thinking about editing the ol.source.clust

Solution 1:

As of openlayers 3.15.0, it is possible to cluster all geometry types using an optional function, geometryFunction. From http://openlayers.org/en/v3.15.0/apidoc/ol.source.Cluster.html:

Function that takes an ol.Feature as argument and returns an ol.geom.Point as cluster calculation point for the feature. When a feature should not be considered for clustering, the function should return null. See ol.geom.Polygon#getInteriorPoint for a way to get a cluster calculation point for polygons.

Post a Comment for "Openlayers 3 , Clustering Polygons Or Linestings"