Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Highway shields #36

Closed
nickidlugash opened this issue Jun 13, 2014 · 6 comments
Closed

Highway shields #36

nickidlugash opened this issue Jun 13, 2014 · 6 comments

Comments

@nickidlugash
Copy link
Contributor

We should have a way of creating highway shields. I'm not sure if it makes more sense for this to be a separate feature from creating markers, or essentially the same. If we can implement each marker + label as a grouped element so that there isn't the issue of markers being visible while labels are not, and vice versa, then highway shields could just be markers + labels with zero offset.


@ajashton's comment on previous ticket about this:

highway shields could just be markers + labels with zero offset

Yes, there are very old discussions about removing the separate "shield" concept from Mapnik as well and just making the marker handling flexible enough to do the same thing.

There are two main cases I'd want to have covered (for highway shields and many other styling situations):

Text on top of a rectangle that is fitted to the width/height of the text, with border/corner-radius/padding options similar to divs in CSS.
Text on top of a image, to handle more complex things like US Interstate shields.

@kkaefer
Copy link
Contributor

kkaefer commented Jun 14, 2014

I was thinking about treating highway shields as generated icons: rather than specifying an icon-image, you specify other parameters that tell the renderer how to create the icon (in CPU code), and from there on, just treat it as a regular icon.

@kkaefer
Copy link
Contributor

kkaefer commented Jun 14, 2014

Specifically, we could implement something akin to http://www.w3.org/TR/css3-background/#border-images: You provide a templated image that can expand in various directions, and add then fit it to the generated text for the shield.

@1ec5
Copy link
Contributor

1ec5 commented Nov 26, 2016

You provide a templated image that can expand in various directions, and add then fit it to the generated text for the shield.

Nine-part images are important for more than just highway shields, so I’ve opened a separate issue to discuss them: #581.

In addition to nine-part images, having a dedicated way to define how label text is styled and superimposed on a nine-part image would make it possible to define a syntax for styling concurrent route shields without requiring a separate layer for each combination of shield types.

@jfirebaugh
Copy link
Contributor

@nickidlugash Are there additional style spec features needed for highway shields beyond icon-text-fit, icon-text-fit-padding, and nine-part resizable images, or can we close this issue?

@nickidlugash
Copy link
Contributor Author

@jfirebaugh hmm so the original intent behind this ticket was addressed a while back:

If we can implement each marker + label as a grouped element so that there isn't the issue of markers being visible while labels are not, and vice versa, then highway shields could just be markers + labels with zero offset.

In terms of actual highway shield generation in the renderer, even nine-part resizeable images would not enable us to generate our more complex highway shields, but we can discuss this on other tickets. I can close here.

@1ec5
Copy link
Contributor

1ec5 commented Dec 8, 2016

In terms of actual highway shield generation in the renderer, even nine-part resizeable images would not enable us to generate our more complex highway shields

Nine-part images would help with the most common shield shapes (rounded rectangles), but indeed the fancier shapes would require other solutions, such as choosing a different shield based on the reflen. #597 would make that more scalable.

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

No branches or pull requests

4 participants