Skip to content
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

Add the ability to not draw text that is illegible #9569

Open
jwoodwardtfx opened this issue Apr 15, 2020 · 7 comments
Open

Add the ability to not draw text that is illegible #9569

jwoodwardtfx opened this issue Apr 15, 2020 · 7 comments

Comments

@jwoodwardtfx
Copy link

jwoodwardtfx commented Apr 15, 2020

We have an application where we have fairly detailed maps and the camera displays in 3D (with a pitch of 60 degrees).

Some text becomes illegible when drawn far from the camera, especially road names in built-up dense residential areas that are styled with a "symbol-placement" of "line" .

A few examples are shown in the red ellipses in the screenshot below:

example

Is it possible to have a flag that would allow text that would be rendered illegibly (or below a certain size) to not actually be drawn (this would improve render performance and declutter the map for areas further from the camera)?

The root problem is that at the given zoom level we only want the text rendered when close to the camera.

Thanks

@ansis
Copy link
Contributor

ansis commented Apr 15, 2020

@jwoodwardtfx have you considered setting "text-pitch-alignment": "viewport" for the road label layers? This would make the labels more legible and maybe avoid the need to hide them.

@jwoodwardtfx
Copy link
Author

While I agree that would slightly improves legibility, it still doesn't fix the problem as labels far from the camera as still so small as to be unreadable.

Also, I don't really want to loose the labels being aligned to the road (as for roads near the camera this looks sensible).

The problem is to do with the distance from the camera, and having no way to make a styling decision based on this.

Not rendering text based on it's size would be a (fairly?) simple hack to workaround my need, but there may be a more general case here...?

@arindam1993
Copy link
Contributor

#9219 should fix it

@jwoodwardtfx
Copy link
Author

Thanks, #9219 certainly looks interesting but I don't think it will fix the issue.

It looks like it'll improve the placement of the labels (especially at higher pitches), but the problem I have is not the placement of the labels but that the labels are drawn at all when the text is so small as to not be legible.

It's more about adjusting the level of detail on the map, and reducing it further from the camera. It something a typically SatNav would do (i.e. more detail closer to the camera where it is useful, but less detail further away).

It's probably more like #8975, but a little less crude than applying to just "distant tiles", i.e. to set the style within a tile according to distance from the camera.

This would probably be achievable by a filter on the style that takes a distance to camera as an input?

@karimnaaji
Copy link
Contributor

@jwoodwardtfx , do you mind trying out the beta https://www.npmjs.com/package/mapbox-gl/v/1.10.0-beta.1 and see whether the combination of what @ansis proposed with the new work introduced by #9219 increases the readability?

@jwoodwardtfx
Copy link
Author

I've given it a go, and not a huge difference. The problem isn't the placement of the label or the level of detail in tiles far-away when the camera has a really low pitch. The problem is the drawing of labels for nearby tiles that are far from the camera.

The following screenshot is from v1.10.0-beta.1:

image

The labels for the roads around the "Withington Bowling Club" are not readable and clutter the map (and take up unnecessary performance). It's labels like these that I'd like to be able to not have drawn. Those "near" the camera are fine (and I'd like to keep these aligned to the roads they are on).

I think something like a filter based on "distance to the camera" in the style for each layer would work?

Thanks.

@jwoodwardtfx
Copy link
Author

How do I get the "needs information" tag off this? I think plenty has been provided, including a description of the issue and screenshots.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants