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

Clarify icon-rotation-alignment values - #500

Merged
jfirebaugh merged 2 commits into
mb-pagesfrom
clarify-icon-rotation-alignment
Sep 21, 2016
Merged

jfirebaugh merged 2 commits into
mb-pagesfrom
clarify-icon-rotation-alignment

Conversation

@jfirebaugh

Copy link
Copy Markdown
Contributor

Wrapped preview:

In combination with symbol-placement, determines the rotation behavior of icons. The value viewport produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of symbol-placement. When symbol-placement is set to point, the value map produces icons whose x-axes are aligned east-west, and the value auto is equivalent to viewport. When symbol-placement is set to line, the value map produces icons whose x-axes are aligned with the line, and the value auto is equivalent to map.

cc @1ec5

@jfirebaugh

Copy link
Copy Markdown
Contributor Author

Similarly for text-rotation-alignment:

In combination with symbol-placement, determines the rotation behavior of the individual glyphs forming the text. The value viewport produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of symbol-placement. When symbol-placement is set to point, the value map produces glyphs whose x-axes are aligned east-west, and the value auto is equivalent to viewport. When symbol-placement is set to line, the value map produces glyphs whose x-axes are aligned with the line at the point where each glyph is placed, and the value auto is equivalent to map.

@jfirebaugh

Copy link
Copy Markdown
Contributor Author

This documentation for text-rotation-alignment is ambiguous about whether, when combined with symbol-placement: line, text-rotation-alignment: viewport produces what it actually does, versus a layout

--l          h--i--s.-
   \        /
    i      t
     \    /
      k--e

@1ec5

1ec5 commented Sep 21, 2016

Copy link
Copy Markdown
Contributor

Thanks, this is definitely an improvement. It’s a bit more technical than I would’ve written, but I think developers can still follow along.

For what it’s worth, in mapbox/mapbox-gl-native#5245, which is for symbol-placed annotation views (but same idea), this is how I described a flag that is unset for icon-rotation-alignment: viewport and set for icon-rotation-alignment: map:

If this option is unset, the annotation view remains unchanged as the map is rotated. If this option is set, the annotation view rotates as the map rotates.

For example, you would set this option if the annotation view should be aligned with a street, regardless of the direction from which the user views the street.

I suppose describing use cases is beyond the scope of the documentation in this repository, so this is a 👍.

@jfirebaugh
jfirebaugh force-pushed the clarify-icon-rotation-alignment branch from fcb8624 to 87f68e2 Compare September 21, 2016 22:38
@jfirebaugh
jfirebaugh merged commit 87f68e2 into mb-pages Sep 21, 2016
@jfirebaugh
jfirebaugh deleted the clarify-icon-rotation-alignment branch September 21, 2016 22:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants