Repository navigation
[core] Variable label placement - #14184
Conversation
19df93a to
c6f2cc7
Compare
c6f2cc7 to
ef803e1
Compare
ef803e1 to
9b1def0
Compare
| namespace { | ||
|
|
||
| } // namespace | ||
|
|
| const float spacing, | ||
| const Point<float>& translate, | ||
| const float verticalHeight, | ||
| //const float verticalHeight, |
|
/cc @fabian-guerra for related |
|
@alexshalamov @kkaefer Thanks for your comments! Fixed now in the latest patch set. Also, an optimization for single-line labels is added. |
|
@pozdnyakov - does the implementation in this PR still leave out runtime styling support? |
This patch contains auto-generated runtime API & tests for Android. |
| // but doesn't actually specify what happens if you use both. We go with the radial offset. | ||
| textOffset = evaluateRadialOffset(textAnchor, radialOffset * util::ONE_EM); | ||
| } else { | ||
| textOffset = { layout.evaluate<TextOffset>(zoom, feature)[0] * util::ONE_EM, |
There was a problem hiding this comment.
const auto evaluatedOffset = layout.evaluate<TextOffset>(zoom, feature);
textOffset = { evaluatedOffset[0] * util::ONE_EM, evaluatedOffset[1] * util::ONE_EM };There was a problem hiding this comment.
@pozdnyakov wdyt? simple fix, avoids extra evaluation of text offset.
| case 'string': | ||
| return '[' + property['default'] + "]"; | ||
| case 'enum': | ||
| if (property['default'] !== undefined) { |
There was a problem hiding this comment.
This change has to be applied to darwin/scripts/generate-style-code.js and please run make darwin-style-code after. That's why the iOS and macOS tests fail in this branch.
Let me know if you have any questions.
There was a problem hiding this comment.
It's a bit more than this, pls see 9bc4994
| auto str = mbgl::Enum<MBGLEnum>::toString(value); | ||
| MGLEnum mglType = *mbgl::Enum<MGLEnum>::toEnum(str); | ||
| return [NSValue value:&mglType withObjCType:@encode(MGLEnum)]; | ||
| static NSString *toMGLRawStyleValue(const MBGLEnum &value) { |
There was a problem hiding this comment.
Why are we changing NSValue to an NSString? Is there any MGLTextAnchor conversion error?
There was a problem hiding this comment.
The previously existing method was never invoked - the currently removed
template <typename MBGLEnum = MBGLType,
class = typename std::enable_if<std::is_enum<MBGLEnum>::value>::type,
typename MGLEnum = ObjCEnum,
class = typename std::enable_if<std::is_enum<MGLEnum>::value>::type>
NSExpression *operator()(const MBGLEnum &value) const {...}
was used instead. It worked fine for a single MGLTextAnchor instance, however std::vector< MGLTextAnchor> could not be handled.
|
|
||
| You can set this property to an expression containing any of the following: | ||
|
|
||
| * Constant array values |
There was a problem hiding this comment.
If this is accepts MGLTextAnchor values, the documentation should be similar to:
mapbox-gl-native/platform/darwin/src/MGLSymbolStyleLayer.h
Lines 1145 to 1159 in 0ec8945
Port of mapbox/mapbox-gl-js#7596