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

Omit label from some legend entries #691

Open
1ec5 opened this issue Jan 14, 2023 · 2 comments
Open

Omit label from some legend entries #691

1ec5 opened this issue Jan 14, 2023 · 2 comments
Labels
enhancement New feature or request points of interest

Comments

@1ec5
Copy link
Member

1ec5 commented Jan 14, 2023

Currently, every legend entry depicts both a label and an icon, as long as it’s part of the backing symbol layer. But the label is only necessary for some symbol layers, such as the place layers, that are distinguished from each other by the label’s text size, font style, or color. The label is visually appealing but not as significant to some other symbol layers, such as airports. For POI layers (#387, #689), it’s quite unnecessary and has a much greater potential to look wonky as the name gets long.

A legend entry’s configuration should be able to specify whether to show the label, controlling whether this method gets called:

let labelCell = row.querySelector(".label");
this.populateTextLabelFromSymbol(labelCell, entry.feature);

/ref #689 (comment)

@1ec5 1ec5 added enhancement New feature or request points of interest labels Jan 14, 2023
@1ec5 1ec5 mentioned this issue Jan 14, 2023
@ZeLonewolf
Copy link
Member

Would you want that on a per-entry basis or per-category basis?

@1ec5
Copy link
Member Author

1ec5 commented Jan 15, 2023

Either could work, though there might be reasons to exclude the label from individual entries apart from the other entries in a category. For example, I’ve thought about special-casing the “Capital city” entry to omit the label, to emphasize that the entry is really about the special icon, not the potentially large label.

If we control the label’s visibility at the category level, then getRowForEntry() needs to take that setting (or the whole section) as a second parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request points of interest
Projects
None yet
Development

No branches or pull requests

2 participants