This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] Variable label placement #14184
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9616f89
[core] Enable text-variable-anchor property
pozdnyakov 2960381
[core] Enable 'text-radial-offset' property
pozdnyakov 8c95140
[core] auto value for 'text-justify' field
pozdnyakov 8fd6717
[core] Introduce variable text placement for point labels - Layout part
pozdnyakov 9711b9d
Export hideGlyphs and addDynamicAttributes symbols
alexshalamov cefa35b
[core] Introduce variable text placement for point labels - Render part
alexshalamov ab1f820
[core] Introduce variable text placement for point labels - Placement…
pozdnyakov 9b1def0
Enable text-variable-anchor render tests
pozdnyakov 26d0a74
[android] Fix style code generation if array default value is missing
pozdnyakov cc6cc89
[core] Single line optimization for variable label placement
pozdnyakov 9bc4994
[darwin] Support for variable text placement API
pozdnyakov 4cad71a
[Darwin] Improve documentation for enum array properties
pozdnyakov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -222,6 +222,10 @@ typedef NS_ENUM(NSUInteger, MGLTextAnchor) { | |||||||||||||||||||||||||||||||
property. | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
typedef NS_ENUM(NSUInteger, MGLTextJustification) { | ||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
The text is aligned towards the anchor position. | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
MGLTextJustificationAuto, | ||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
The text is aligned to the left. | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
|
@@ -1279,6 +1283,7 @@ MGL_EXPORT | |||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
* Constant `MGLTextJustification` values | ||||||||||||||||||||||||||||||||
* Any of the following constant string values: | ||||||||||||||||||||||||||||||||
* `auto`: The text is aligned towards the anchor position. | ||||||||||||||||||||||||||||||||
* `left`: The text is aligned to the left. | ||||||||||||||||||||||||||||||||
* `center`: The text is centered. | ||||||||||||||||||||||||||||||||
* `right`: The text is aligned to the right. | ||||||||||||||||||||||||||||||||
|
@@ -1349,8 +1354,8 @@ MGL_EXPORT | |||||||||||||||||||||||||||||||
`NSValue` object containing a `CGVector` struct set to 0 ems rightward and 0 | ||||||||||||||||||||||||||||||||
ems downward. Set this property to `nil` to reset it to the default value. | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
This property is only applied to the style if `text` is non-`nil`. Otherwise, | ||||||||||||||||||||||||||||||||
it is ignored. | ||||||||||||||||||||||||||||||||
This property is only applied to the style if `text` is non-`nil`, and | ||||||||||||||||||||||||||||||||
`textRadialOffset` is set to `nil`. Otherwise, it is ignored. | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
You can set this property to an expression containing any of the following: | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
@@ -1372,8 +1377,8 @@ MGL_EXPORT | |||||||||||||||||||||||||||||||
`NSValue` object containing a `CGVector` struct set to 0 ems rightward and 0 | ||||||||||||||||||||||||||||||||
ems upward. Set this property to `nil` to reset it to the default value. | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
This property is only applied to the style if `text` is non-`nil`. Otherwise, | ||||||||||||||||||||||||||||||||
it is ignored. | ||||||||||||||||||||||||||||||||
This property is only applied to the style if `text` is non-`nil`, and | ||||||||||||||||||||||||||||||||
`textRadialOffset` is set to `nil`. Otherwise, it is ignored. | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
You can set this property to an expression containing any of the following: | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
@@ -1463,6 +1468,27 @@ MGL_EXPORT | |||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
@property (nonatomic, null_resettable) NSExpression *textPitchAlignment; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
Radial offset of text, in the direction of the symbol's anchor. Useful in | ||||||||||||||||||||||||||||||||
combination with `textVariableAnchor`, which doesn't support the | ||||||||||||||||||||||||||||||||
two-dimensional `textOffset`. | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
This property is measured in ems. | ||||||||||||||||||||||||||||||||
pozdnyakov marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
This property is only applied to the style if `textOffset` is set to `nil`. | ||||||||||||||||||||||||||||||||
Otherwise, it is ignored. | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
You can set this property to an expression containing any of the following: | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
* Constant numeric values | ||||||||||||||||||||||||||||||||
* Predefined functions, including mathematical and string operators | ||||||||||||||||||||||||||||||||
* Conditional expressions | ||||||||||||||||||||||||||||||||
* Variable assignments and references to assigned variables | ||||||||||||||||||||||||||||||||
* Interpolation and step functions applied to the `$zoomLevel` variable and/or | ||||||||||||||||||||||||||||||||
feature attributes | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
@property (nonatomic, null_resettable) NSExpression *textRadialOffset; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
Rotates the text clockwise. | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
@@ -1549,6 +1575,32 @@ MGL_EXPORT | |||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
@property (nonatomic, null_resettable) NSExpression *textTransform; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||||||
To increase the chance of placing high-priority labels on the map, you can | ||||||||||||||||||||||||||||||||
provide an array of `textAnchor` locations: the render will attempt to place | ||||||||||||||||||||||||||||||||
the label at each location, in order, before moving onto the next label. Use | ||||||||||||||||||||||||||||||||
`textJustify: auto` to choose justification based on anchor position. To apply | ||||||||||||||||||||||||||||||||
an offset, use the `textRadialOffset` instead of the two-dimensional | ||||||||||||||||||||||||||||||||
`textOffset`. | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
This property is only applied to the style if `textAnchor` is set to `nil`, and | ||||||||||||||||||||||||||||||||
`textOffset` is set to `nil`, and `symbolPlacement` is set to an expression | ||||||||||||||||||||||||||||||||
that evaluates to or `MGLSymbolPlacementPoint`. Otherwise, it is ignored. | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
You can set this property to an expression containing any of the following: | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
* Constant array values | ||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is accepts mapbox-gl-native/platform/darwin/src/MGLSymbolStyleLayer.h Lines 1145 to 1159 in 0ec8945
|
||||||||||||||||||||||||||||||||
* Predefined functions, including mathematical and string operators | ||||||||||||||||||||||||||||||||
* Conditional expressions | ||||||||||||||||||||||||||||||||
* Variable assignments and references to assigned variables | ||||||||||||||||||||||||||||||||
* Step functions applied to the `$zoomLevel` variable | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
This property does not support applying interpolation functions to the | ||||||||||||||||||||||||||||||||
`$zoomLevel` variable or applying interpolation or step functions to feature | ||||||||||||||||||||||||||||||||
attributes. | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
@property (nonatomic, null_resettable) NSExpression *textVariableAnchor; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
#pragma mark - Accessing the Paint Attributes | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
#if TARGET_OS_IPHONE | ||||||||||||||||||||||||||||||||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we changing
NSValue
to anNSString
? Is there anyMGLTextAnchor
conversion error?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previously existing method was never invoked - the currently removed
was used instead. It worked fine for a single
MGLTextAnchor
instance, howeverstd::vector< MGLTextAnchor>
could not be handled.