2015-12-04 30 views
0

在openlayers 2.8中,根据票据https://trac.osgeo.org/openlayers/ticket/1815,存在与集群策略相关的阈值。openlayers 3中集群策略的阈值在哪里?

在openlayers 3中没有提及它的任何地方(而战略范例似乎也没有提及)。 http://openlayers.org/en/master/apidoc/ol.source.Cluster.html

有谁知道这个功能是否有票?

+0

这在ol3中不受支持。随意打开[问题](https://github.com/openlayers/ol3/issues),甚至更好地打开[拉取请求](https://github.com/openlayers/ol3/blob/master/CONTRIBUTING .MD#贡献码)。 – tsauerwein

回答

0

范例发生了很大变化。在OpenLayers 3中,您使用集群样式创建一个新图层,并将“阈值”设置为图层选项中的maxResolution或minResolution。 类似:

var clusterLayer = new ol.layer.Vector({ 
       visible: true, 
       zIndex: insightMap.totalServcies - element.SortOrder, 
       id: Id,           
       serviceId: element.Id, 
       minResolution: clusteringThreshold, 
       cluster: true, 
      }); 

您也可以根据载文使用MINZOOM和MAXZOOM,但我已经遇到了与他们一贯执行的问题。