所以,我在OpenLayers中聚集了许多项目.
我正在使用一种策略,根据属性对项目进行聚类.
我更改了一个项目的属性.
如何获取群集策略以重新计算群集?
我正在尝试使用openlayers 3加载geojson数据.这是很多日期,所以我想只传输所需的数据.我通过将当前视图的结果和范围传递给Web服务来存档.到目前为止这是我的代码:
var vectorSource = new ol.source.ServerVector({
format: new ol.format.GeoJSON(),
loader: function(extent, resolution, projection) {
var url = 'data.json?e=' + extent.join(',') + '&r=' + resolution;
$.ajax({
url: url,
success: function(data) {
vectorSource.addFeatures(vectorSource.readFeatures(data));
}
});
},
projection: 'EPSG:3857',
strategy: ol.loadingstrategy.bbox
});
var vector = new ol.layer.Vector({
source: vectorSource
});
var map = new ol.Map({
layers: [vector],
target: 'map',
view: new ol.View({
center: [0, 0],
zoom: 0
})
});
Run Code Online (Sandbox Code Playgroud)
但我的代码只调用一次web服务.每当范围(和/或结果)发生变化时,我必须使用哪种加载策略来调用Web服务?