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

When loading many feature footprint vectors onto the map, the openlayers map and web application becomes unresponsive. Is there any way to improve the performance of the openlayers map with many vectors?

We would like to be able to support at least 1000 vectors on the map at once.

We are using openlayers 4.

As I can tell, OpenLayers 3+ uses HTML5 canvas to render images and vectors. I've seen the canvas being used to make video games and other high performance graphic applications. I don't understand why it would cause this unresponsive issue with OpenLayers though.

Edit: When I say "vectors" I mean square polygons. This application will run on a desktop with average computing power.

Answers:

Answer

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
}

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.