Replies: 3 comments 20 replies
-
I'm not sure I'm following. Can you give an example of something that you currently can't do? Something very specific. |
Beta Was this translation helpful? Give feedback.
-
Example using Example using It seems like you can then use |
Beta Was this translation helpful? Give feedback.
-
PointA point is a two-element array of numbers, representing an [x, y] coordinate pair. Units and other interpretation of the x/y values depend on where and how the point type is used. text-offsetLayout property. Optional point or array of points. Units in ems. Defaults to [0,0]. Requires text-field. Disabled by text-radial-offset. Supports interpolate expressions. Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, a single point used for text-offset will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position. If an array of points is provided for text-offset, the number of points should match the number of entries provided via text-variable-anchor. Each point in the array is used as the offset distance of text from its anchor, when the corresponding anchor is used by the renderer. If more entries are provided for text-variable-anchor than text-offset, the last value in text-offset will be used. Example
When the renderer chooses the top anchor, [0, 4] will be used for text-offset; the text will be shifted down by 4 ems. When the renderer chooses the left anchor, [3, 0] will be used for text-offset; the text will be shifted right by 3 ems. |
Beta Was this translation helpful? Give feedback.
-
text-offset and text-radial-offset both seem tailored to placement of labels around a center-anchored icon. For pushpins, teardrops, or other asymmetrical icons, I don't see style syntax to distribute labels evenly around the icon's perimeter.
e.g., if the desired label placements for all eight variable-anchor positions are as follows, what's the best way to indicate this through the symbol layer style? The stop sign icon is anchored at the bottom, so the desired text-offset for 'left' vs 'bottom-left' would have a different y value.
Assuming I'm correct the current style schema doesn't support this, what would a new or modified style property look like? We could be completely explicit and have something like an offset per text anchor, but maybe there's a more elegant solution?
Beta Was this translation helpful? Give feedback.
All reactions