Search code examples
openlayers

performance issue when adding vector layers to openLayers map where it's consuming too much memory/GPU usage when upgrading to v.6 and v.7


I was updating Openlayer from version 5 to version 7 since I use it for my web application and it seems I'm experiencing performance issues where it consumes too much memory and GPU power. I tried using vector image layer rather than vector layer, but there was no difference. Additionally, my web application requires over 200 vector layers, all of which were functional in version 5, but in versions 6 and 7, it completely stalls (where it's affecting the zooming and mouse event functionality). any advice on this matter?


Solution

  • Turns out I was using classname property inside my vectorLayer in which it will create a new full canvas for each layer, VectorLayer({className : string , Source : vectorSource }). So I just Removed it and now it works perfectly.