diff options
Diffstat (limited to 'platform/darwin/src/MGLSymbolStyleLayer.mm')
-rw-r--r-- | platform/darwin/src/MGLSymbolStyleLayer.mm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/darwin/src/MGLSymbolStyleLayer.mm index 6d91bbe87f..e54a0b9a15 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.mm +++ b/platform/darwin/src/MGLSymbolStyleLayer.mm @@ -54,6 +54,7 @@ namespace mbgl { }); MBGL_DEFINE_ENUM(MGLSymbolZOrder, { + { MGLSymbolZOrderAuto, "auto" }, { MGLSymbolZOrderViewportY, "viewport-y" }, { MGLSymbolZOrderSource, "source" }, }); @@ -587,6 +588,24 @@ namespace mbgl { return MGLStyleValueTransformer<mbgl::style::SymbolPlacementType, NSValue *, mbgl::style::SymbolPlacementType, MGLSymbolPlacement>().toExpression(propertyValue); } +- (void)setSymbolSortKey:(NSExpression *)symbolSortKey { + MGLAssertStyleLayerIsValid(); + MGLLogDebug(@"Setting symbolSortKey: %@", symbolSortKey); + + auto mbglValue = MGLStyleValueTransformer<float, NSNumber *>().toPropertyValue<mbgl::style::PropertyValue<float>>(symbolSortKey, true); + self.rawLayer->setSymbolSortKey(mbglValue); +} + +- (NSExpression *)symbolSortKey { + MGLAssertStyleLayerIsValid(); + + auto propertyValue = self.rawLayer->getSymbolSortKey(); + if (propertyValue.isUndefined()) { + propertyValue = self.rawLayer->getDefaultSymbolSortKey(); + } + return MGLStyleValueTransformer<float, NSNumber *>().toExpression(propertyValue); +} + - (void)setSymbolSpacing:(NSExpression *)symbolSpacing { MGLAssertStyleLayerIsValid(); MGLLogDebug(@"Setting symbolSpacing: %@", symbolSpacing); |