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
General confusion about rendering vectors with WebGL using openlayers version 3.14 #5054
Comments
see discussion in #3476 |
The webgl renderer supports rendering points. No lines and polygons.
The standard canvas renderer gives you support for rendering lines and polygons with full interactivity. If you want to render 50000+ features, you should consider using |
hi @ahocevar , thank you for your quick and helpful reply. I came across an example that used This was the code:
I gave this example a try but ended up with an empty map and didn't experiment further. |
See http://openlayers.org/en/v3.14.2/examples/image-vector-layer.html, with full interactivity on hover. |
@ahocevar , not wanting to drift off too far from the initial WebGL issue but on that example I seem to be unable to render any point on my local solution. I found that it is best to run sample projects on a test server, so I am doing that. I tried pointing to a local file (../data.js) or pointing to an external (http://...) file but I just can't seem to render anything. Also, the api documentation seems to lack property information on the Also, is it supported to just add an empty source and add the features manually later on using
? Thanks |
What property information are you missing in the var features = formatter.readFeatures(someInMemoryData,
{featureProjection: map.getView().getProjection()}); |
Hello, I've been working with openlayers3 for the past weeks now as I was hired at a company that is on the verge of switching from openlayers2 to openlayers3, because of performance limitations that seem to occur when rendering 50.000 vector features, mostly Points and Lines and a few Polygons. The panning and zooming gets very sluggish.
I'm currently contributing to a POC to see if the issues can be resolved by making the upgrade to openlayers3.
One of the possible points of improvements that I am currently investigating is to also use WebGL as a rendered, to speed up the rendering process. For now, I'm researching what the current implementation is for openlayers but seem to come across many confusing and contradicting sources of information on the web.
The main issue is that I cannot tell for sure that rendering lines and points is not supported by openlayers3. My advice would initially be to not use the WebGL for now and use the canvas rendering, because we need to draw Points, Lines and Polygons. Also, wee need interactivity when hovering these features. However, every google marathon seems to end up at the following article : http://www.camptocamp.com/en/actualite/openlayers-3-towards-drawing-lines-and-polygons-with-webgl/. Which makes it kinda hard to explain that it is not possible to render lines and polygons using WebGl.
One of the things I found very confusing about the openlayers documentation in general is that there are a lot of examples still out there that are using older versions of openlayers (in this particular case, v3.4) that are no longer relevant in newer (currently 3.14.2) versions because they made use of experimental features that haven't made it to later versions.
To come to a conclusion,
Thank you very much for your time reading this. Would really appreciate it if someone could clarify all this and will be happy to help to take away some of the confusion that exists on the web myself.
Greetings,
stvn
The text was updated successfully, but these errors were encountered: