ZeLonewolf / openstreetmap-americana

A quintessentially American map style
https://zelonewolf.github.io/openstreetmap-americana
Creative Commons Zero v1.0 Universal
175 stars 56 forks source link

General capability to set halos on POI icons #324

Open ZeLonewolf opened 2 years ago

ZeLonewolf commented 2 years ago

Currently, we are not able to set halos for SVG-originated icons. We need halos for cases when POI icons are obscured when they overlap similarly-colored features: image

The mapLibre documentation indicates that this can be done with SDF icons, which can be both recolored and halo'd.

Work is needed to figure out how to add recolorable SDFs to the style and add halos. When properly implemented, all original icon artwork can be done in monochrome.

The workaround for this is to build a border into the icon, like we do for the capital / city icons.

claysmalley commented 2 years ago

This may also be relevant to highway shields with simple shapes but a variety of color schemes, like the flowerpot shields of county roads in Ontario, or the various places that use a home-plate-shaped shield.

ZeLonewolf commented 2 years ago

I'm not sure whether or not we could make that work for shields, since we generate them in code. That's something we can revisit once somebody understands how SDF icons work :)

zekefarwell commented 2 years ago

For the the city dots and capital city stars, I included halos in the graphics, probably because I couldn't find a Maplibre propery that would do it. Recolorable icons via SDF seems like a nice feature. Looks like they are limited to one color only though, so not an option for any multicolor icons.

ZeLonewolf commented 2 years ago

Good point on the coloring. Also, if there's a legitimate use case for multicolored icons, the built-in halo in the SVG remains an option for that.