render: write a dredged area's depth in the mariner's unit - #41
Merged
Conversation
DredgedArea composes its label as "%gm" — the depth and a literal m — and appends the dredged date when the cell carries one. The value is metres only, so on a chart shown in feet it disagreed with the soundings beside it. Surface gains an optional draw_depth_text. The emitter passes the raw metres and whatever followed the depth, and the surface writes the number, the unit and the trailer. The pixel, vector and GPU surfaces declare it. Feet read as whole feet, truncated down, the rule the soundings and contour labels already follow. The bake keeps the metric string as the feature's text and stores the feet twin as text_ft beside the raw metres, so a tile reads in either unit and a consumer that knows nothing of depth units renders what it always did. The style's text-field reads text_ft in feet and falls back to text. A label is rewritten only when its leading depth token matches the feature's DRVAL1, so a class whose label merely opens with a number keeps its own text.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DredgedArea composes its label as "%gm" — the depth and a literal m — and appends the dredged date when the cell carries one. The value is metres only, so on a chart shown in feet it disagreed with the soundings beside it.
Surface gains an optional draw_depth_text. The emitter passes the raw metres and whatever followed the depth, and the surface writes the number, the unit and the trailer. The pixel, vector and GPU surfaces declare it. Feet read as whole feet, truncated down, the rule the soundings and contour labels already follow.
The bake keeps the metric string as the feature's text and stores the feet twin as text_ft beside the raw metres, so a tile reads in either unit and a consumer that knows nothing of depth units renders what it always did. The style's text-field reads text_ft in feet and falls back to text.
A label is rewritten only when its leading depth token matches the feature's DRVAL1, so a class whose label merely opens with a number keeps its own text.