-
Notifications
You must be signed in to change notification settings - Fork 89
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
Overlapping transparent polylines produce darker regions #1082
Comments
Also "spikes" appear with thick lines at small zooms. |
@eddiemuc playing with the OpenGL calls, but it needs more work and tests: |
Very impressive! How did you do it? Two comments:
|
A good article to this problem could be found here. Interesting are the diagrams where you could see, that your double drawing take place, when two of the segments are drawn on top of each other. |
@charlenni thanks, this is a very interesting document. The lines certainly need more work at the corners. |
@eddiemuc I tested this code in LineBucket.java#L643. if (!Color.isOpaque(line.color)) {
gl.depthMask(true);
gl.clear(GL.DEPTH_BUFFER_BIT);
GLState.test(true, false);
} |
IMHO this is not necessary. Just because Google does it, it doesn't have to be good. If it's easier to never create the darker pattern we should go that way. But no strong preference, both is fine for me... BTW, thanks @devemux86 for looking into this issue! |
It isn't because of Google having it this way (btw. Mapbox too), it is, because it is a bug. There shouldn't any of this dark parts at the edges. And the spike is also a problem, because it isn't the same edge form as the rest. |
That's correct. What I rather meant to say is: if it is for any reason much easier implementation-wise to just fix the dark pattern in turns (and not in crossings) then that would also be acceptable for us (because we accept it in GMaps as well). I wanted to lift the "implementation burden" a bit, that's all. Sorry for the confusion. |
If anyone knows OpenGL and wants to help, I am happy to review pull requests. For now I can push something like the above solution, probably via an option. To avoid the spikes at zoom, use the Corners to be round instead of miter or bevel, needs work in |
Looks MUCH better with the fix applied: But the "spike" remains, even when I set Also zooming out leaves the polyline visible: |
The layers are always visible unless we hide them. The You can try without setting it, which is the default and see if it works better in your case.
Do you mean the line joins at the corners, this is different and needs new implementation.
|
Try without using the point reduction call, that is leave it on (as default). Otherwise you can hide the layer at the required zoom level. |
I looked into the underlying code of pointReduction and found that the flag just sets a default constant drop distance to the line bucket. Experimenting with this I found that the zooming problem could be solved in a great way if the drop distance could be set directly (as a float) on the Style object. I prepared PR #1085 for this and would be glad if you would consider adding such a feature. |
Sorry, PR #1085 (I updated the previous comment) |
With PRs #1084 and #1085 merged I would consider this issue solved. Thanks a lot! @devemux86 : we would like to include these fixes into c:geo (but don't want to use the snapshots for official c:geo builds). There was no release since the two PRs were merged, so we considered using jitpack.io. However, we noticed that since 0.19.0 both mapsforge and vtm seem not to build on jitpack.io any more (see https://jitpack.io/#mapsforge/mapsforge for mapsforge and https://jitpack.io/#mapsforge/vtm for vtm). Do you know the reason for this? Is there any other way to link to a stable build of e.g. 8d43af4 (current master's head) |
@eddiemuc thanks for your contributions! Does JitPack require special rules? You can use the snapshots, the latest or a fixed version. |
Apparently jitpack requires a project to explicitely specify the Java version used for compile if it is not Java 8. See https://jitpack.io/docs/BUILDING/#java-version. This is why the build currently fails (see https://jitpack.io/com/github/mapsforge/vtm/0.20.0/build.log). However, sorry for that, I somehow thought that mapsforge and vtm support jitpack (because we used it in the past :-)).
I found just one snapshot release here: https://oss.sonatype.org/#nexus-search;quick~vtm |
@eddiemuc the snapshot builds and versions are here: |
@eddiemuc probably instead of: implementation 'org.mapsforge:vtm:master-SNAPSHOT' could use for example: implementation 'org.mapsforge:vtm:master-20231227.121602-914' |
This only happens when using: implementation 'org.mapsforge:vtm:master-SNAPSHOT' |
There seems to be no consistency across the different sub-libs of VTM with regards to such snapshot version numbers, or I am doing something wrong here again? E.g. using above version Using one earlier version |
@eddiemuc indeed Maven publishes independently the modules, so need to use a fixed version for each one. |
Ok, thanks! Using different versions it worked out. It's a bit tricky though. |
I added @eddiemuc can you test if they work in c:geo? https://jitpack.io/#mapsforge/mapsforge/jitpack-SNAPSHOT |
Works fine! |
@eddiemuc thanks for the confirmation! I merged the JitPack support in both Mapsforge and VTM repositories. |
Thanks a lot! I will now link this version to our master build (until VTM release 0.21.0 comes out :-)) |
It seems that drawing polylines (e.g. Routes) with VTM with a certain thickness and a semi-transparent color leads to "darker edges" when those line segments are overlapping on polyline points. This effect is also visible when zooming out.
Update: Also "spikes" appear with thick lines at small zooms.
Some screenshots:
Screenshot zoomed a bit above the polyline:
Screenshot close to polyline:
More details and code to reproduce issue can be found on this PR: #1081
The text was updated successfully, but these errors were encountered: