-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openlayers performance #15850
Comments
Performance might be improved by setting |
Another option is to use an ImageVector layer instead of a Vector layer. |
Thanks for your reply, do you mean the class ol.layer.VectorImage? I am using this class and it does perform better than ol.layer.Vector. But still not as good as geojs performance. |
@ahocevar Thanks for ur reply, i tried increasing the renderBuffer to 90,000, as same as number of my features, but I doesn't feel like the effect is improving. |
@nipeone I don't think the |
@nipeone If you want to use the WebGL renderer (which might improve performance), you need to write different code. See e.g. https://openlayers.org/en/latest/examples/webgl-vector-layer.html. Looks like what you have now comes from an OpenLayers v3 example. |
@ahocevar Thanks again, performance improves dramatically with the above example, but if increase the number of features to 360000, an error will be reported like this: |
When using WebGLLayer to render massive vector features, zooming or moving the map causes the memory to increase sharply until the web page crashes. In which version can this problem be solved? |
@jia-mx you can try my example code, i did not test max limitation, when len(features)=90000, everything is ok.if len(features)=360000 will report error |
@nipeone Your example has the same problem. Continuously zooming or moving the map will cause memory to increase dramatically until the page crashes. @ahocevar In which version can this problem be solved? |
This is something for @jahow to answer. |
@ahocevar is there an interface to free memory after panning and zooming? I'm not sure about the memory management rules of openlayers, from the phenomenon, it should be caused by not releasing the memory in time after each pan and zoom. |
When uploading shp of a file of about 12 MB to the webgl layer using the WebGLVectorLayerRenderer (the feature is about 5000 multipolygons), a rangeerror invalid array length occurs. |
oh my... I solved it simply with VectorImageLayer. thank you |
For WebGL, @jahow should be able to help. |
老哥不会是长沙腾讯的吧 |
Unfortunately there are still unsolved issues regarding memory consumption with the WebGL vector renderer, I'm sorry for not having a better answer to that :/ Also 360k features sounds like it might be too much for the renderer at that time to be honest. You might want to look into using vector tiles to achieve btter results. |
Using openlayers and geojs to display 90,000 features, when zooming or panning, the openlayers will lag for 1~2 seconds, but geojs works smoothly. Is the usage of openlayers not correct?
Here is my reference code:https://github.com/nipeone/geojs_vs_openlayers
The text was updated successfully, but these errors were encountered: