如何在openlayers 6中暂停图层/地图渲染?在地图上滚动或拖动时,性能很差。我只想在'moveend‘之后渲染我的地图。
发布于 2020-07-20 20:40:41
updateWhileAnimating和updateWhileInteracting是否已设置为true。如果它们是false (默认值),您将获得更好的性能。请参阅https://openlayers.org/en/latest/apidoc/module-ol_layer_Vector-VectorLayer.html发布于 2020-07-29 02:11:42
在交互和动画过程中使用ol/layer/VectorImage进行更快的渲染,但代价是渲染的精确度较低。请参阅https://openlayers.org/en/latest/examples/image-vector-layer.html
发布于 2020-07-21 00:19:50
我找到了一个解决方案:
map.on('movestart', () => {
layers.forEach(layer => {
layer.setExtent(map.getView().calculateExtent());
});
});
map.on('moveend', () => {
layers.forEach(layer => {
layer.setExtent(undefined);
});
});https://stackoverflow.com/questions/62992446
复制相似问题