Is Displaying 1000+ Feature Footprint Vectors on OpenLayers Map with Good Performance Possible? [closed]

我与影子孤独终老i 提交于 2019-12-04 22:10:44

TL/DR: Yes.

If not, it's likely your own fault. But there are a few easy fixes for when an OL application becomes slow/unresponsive.

  1. Use the image render mode(previously known as ImageVector) for large vector layers. ol.layer.Vector({ renderMode: 'image', ... })

Great performance, but point symbols and texts are always rotated with the view and pixels are scaled during zoom animations.

  1. When you have many features, do not create new styles for each of them with a styleFunction. Instantiating objects is expensive in JavaScript. Try to switch to static styles.

  2. If you are only displaying points, use an cluster layer . Showing one quadrupillion points isn't very helpful anyway

  3. Try the webgl renderer. It is probably faster, but might also look a bit different

.

if (ol.has.WEBGL) {
  var map2 = new ol.Map({
    renderer: (['webgl', 'canvas']),
    ....
  });
} else { 
  // fallback
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!