-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Labels getting clipped in tile mode (node version) #284
Comments
Thanks for reporting this @acalcutt Is there a way to reproduce this cropping problem with the linux native renderer and the demotiles? |
Is the any information on using the linux native renderer? like at least switches mbgl-render needs? Basically I would want to try an recreate this view, where it trims "United States" |
I tried various zoom levels, like but I wasn't able to see any clipping. I always assumed this was where the label was at the edge of the tile. so I think to test this you would need two tiles that are side by side where the label gets clipped off. also, I'm not sure this mbgl-render can do tile mode, where it overdraws a bit to help with the labels. |
I've made a application to test this issue here Test 1 - With maplibre-gl-native Test 2 - With mapbox-gl-native Compare the maplibre version to the mapbox version. In the maplibre version, the "North" in "North Adams", which is right on the edge, is missing. However in the mapbox version, it is there as expected. |
I also tried with
but always got correctly clipped labels... |
Hm interesting, is the diff between mapbox-gl-native and maplibre-gl-native large? When was their last common commit? |
The diff is pretty large between the mapbox last version. My assumption right now is this is related to the mode switch. If I go remove this line (mode: 'tile',) https://github.com/acalcutt/maplibre-label-clipping-test/blob/main/index.js#L147 , with the mapbox version, it produces the same output as maplibre. The code for tile mode has been refactored a bit, since mapbox 5.0.2...maybe there was some mistake with that |
I've done a few thing to try and track this down...non successful so far. 1.) I tried setting viewportPaddingDefault to 1024, like is supposed to happen in tile mode to see if maybe the tile mode switch was not working. However even at 1024 the label clipping still occurred. 2.) I tried reverting back to the first maplibre node release in cfcbc62 , but the issue seemed to be happening in that release also 3.) I tried going back really far to a mapbox release that mentioned tile mode b84449e , but unfortunately I couldn't get it to build. I used the instruction for that release, but I assume it needs an older GCC since I was getting syntax errors. I've been trying to test this with https://www.npmjs.com/package/@acalcutt/maplibre-gl-native-test since I wasn't sure how to use an unreleased version of maplibre-gl-native with node. does anybody know if that is possible (to use the node package without releasing it?) |
Maybe you can install it from a local folder https://stackoverflow.com/questions/8088795/installing-a-local-module-using-npm |
Have you made any progress @acalcutt ? I'm seeing a fair amount of clipping and overlaps. |
Unfortunately I haven't figured anything else. I haven't had much time to look though since my real job has kept me really busy this month. My last test leads me to believe maybe it isn't tile mode padding like I was originally thinking. |
Thanks for putting in the work. I'll do a bit of digging myself this week. |
I updated @acalcutt/[email protected] to include these render fixes. unfortunately it doesn't look like they fixed the issue here. I was hopeful since the fixes were in the same files... but somewhat expected it since I had tried to revert #270 before and it didn't fix this issue. I also updated the test app in this thread to use the latest node release and confirmed it didn't help this issue. |
I will say I need to look at these render test in #351 (comment) 'render-tests/text-variable-anchor/all-anchors-tile-map-mode' looks like it tests this. |
Maybe also look in the ignored tests. If I run
I get these ignored tests:
|
It worked! So far I have tested in my tileserver-gl and in the label clipping test above and it seems like it is fixed This should be fixed in my npm package This is what the two images from my label test look like now, no longer clipping labels |
Really nice! Do you know if we can run the render test via the node platform? |
Fixed by #415 |
@wipfli unfortunately I am not aware of how to run the render tests for node, or if there are any. |
To do the basic tests the build does in linux, it would be something like ubuntu 20.04
however, looking in the package.json there are some other tests that didn't seem to work for me on my test vm
Edit: the error test-render gets after installing d3 is
seems like it runs the render test from the js version? |
Ah interesting. The render test fixtures are indeed in the maplibre-gl-js submodule. Maybe even the test harness from GL JS is used for node? |
I mentioned this issue in #279 , but did not want to pollute that thread with an unrelated problem.
In my testing of the node version of maplibre-gl-native in my branch of tileserver-gl I have noticed labels getting clipped more than in the mapbox-gl-native version.
For example, in the maplibre-gl-native version it is consistently cutting off labels all over the place like this
Where in the maptiler version using mapbox-gl-native v5.02, does not have this issue
Looking at several similar threads I found these related mapbox issues
mapbox/mapbox-gl-native#15805
mapbox/mapbox-gl-native#14011
mapbox/mapbox-gl-native#15880
The first article in this list mentions this was improved in v5.0.2, which I did find the change they mentioned here mapbox/mapbox-gl-native@d500b67. the padding was increased when in tile mode to help the labels to help with the trimming (a change which still exists, slightly rewritten). Also, in tileserver-gl they added the code to use tile mode here maptiler/tileserver-gl@5048388
Looking though the related code in https://github.com/maplibre/maplibre-gl-native/blob/main/src/mbgl/text/collision_index.cpp#L26-L50 it seems like the changes that added padding in tile mode are still there and looking in my tileserver-gl code the tile mode option is still set ( https://github.com/acalcutt/tileserver-gl/blob/main/src/serve_rendered.js#L574 )
From this, to me, it seems like it should be showing the labels correct like in the second screenshot, but for some reason it is not.
One idea I had is maybe it is ignoring the tile mode switch? I'm guessing that would be this code in the node binding code?
Does anyone have any other idea or tips that could help? I am told there is no issue with labels in the android version, which Is why I was thinking something with the node mode switch.
The text was updated successfully, but these errors were encountered: