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

Compatability with @americana/maplibre-shield-generator #159

Open
neodescis opened this issue Oct 20, 2023 · 8 comments
Open

Compatability with @americana/maplibre-shield-generator #159

neodescis opened this issue Oct 20, 2023 · 8 comments

Comments

@neodescis
Copy link

Description
It seems that presently only the US interstates have a network of anything besides "other." It would be great if the tile set produced could be compatible with @americana/maplibre-shield-generator. That project has a very extensive mapping of networks to road shields, and it would be great if we could somehow leverage it with these tiles/styles.

@bdon
Copy link
Member

bdon commented Oct 20, 2023

@neodescis is there a well-defined specification of the possible values and how those map to shields?

We would target the shield icons at the bottom of https://www.nextzen.org

A goal of these styles is to work the same across web and native, which would exclude using SVG fallbacks.

@neodescis
Copy link
Author

neodescis commented Oct 20, 2023

The mapping is built dynamically, and as far as I can tell it is not (yet?) published in an npm package. I've inquired about this. However, their current mapping is published here: https://zelonewolf.github.io/openstreetmap-americana/shields.json

The shield generator library is not tightly coupled to that mapping, but leveraging it seems valuable.

Many (most?) of the shields are generated on the fly with draw functions, but some are handled with empty sprite images as well. Those sprites are generated from SVG, but supplied to MapLibre as a .png file at runtime. It's a pretty interesting solution to the shield problem.

@bdon
Copy link
Member

bdon commented Oct 20, 2023

Thanks. We definitely want to address shields and route concurrencies, this will likely happen sometime in 2024 as we enhance the tileset before the styles.

@neodescis
Copy link
Author

Sounds great. Do you have a roadmap published anywhere? I am presently using the tileset to drive part of my own set of map styles, and this is the one place I've found the tile data to be lacking. Depending on the timing, I may even be able to lend a hand.

@nvkelso
Copy link
Collaborator

nvkelso commented Oct 20, 2023

+1 for more complicated shield data values! There's 2500 lines of shield logic over in Tilezen we can port over – looking at network values, ref values, and coarse reverse geocoding the country.

@bdon the blocker here is being able to coarse reverse geocode the country code.

@bdon
Copy link
Member

bdon commented Oct 21, 2023

the blocker here is being able to coarse reverse geocode the country code.

implicit dependency on #44

@bdon
Copy link
Member

bdon commented Oct 26, 2024

@nvkelso it looks like shield_text_length can be eliminated in favor of https://maplibre.org/maplibre-style-spec/expressions/#length ?

Currently thinking of leaving ref straight from OSM and populating shield_text with maximum 5 characters, along with network. then shield_text2 and network2 for concurrencies, up to some fixed number.

@nvkelso
Copy link
Collaborator

nvkelso commented Oct 26, 2024

Works for me!

Tilezen didn't have the length for a very long time until it was needed for backwards compatibility with older versions of the predecessor to MapLibre, would be nice to remove it.

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

No branches or pull requests

3 participants