diff options
author | Chris Loer <chris.loer@gmail.com> | 2018-09-19 15:20:03 -0700 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2018-10-15 13:15:46 -0700 |
commit | d0cd49f516d053620147e9f047252bd88374ac5d (patch) | |
tree | 55681fefb455cc7e3d6305c86d9a1d88e9dced84 /platform/darwin/src/MGLStyleLayer.mm.ejs | |
parent | ce76bde13d0f4381ee861f81daf636defaff0bc5 (diff) | |
download | qtlocation-mapboxgl-d0cd49f516d053620147e9f047252bd88374ac5d.tar.gz |
[ios, macos] Minimal darwin wrappers of 'format' expression
Add support for `MGL_FUNCTION('format', <text>, <options dictionary>)`
Diffstat (limited to 'platform/darwin/src/MGLStyleLayer.mm.ejs')
-rw-r--r-- | platform/darwin/src/MGLStyleLayer.mm.ejs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/darwin/src/MGLStyleLayer.mm.ejs index 49ac04ce05..6d0c4bfdd9 100644 --- a/platform/darwin/src/MGLStyleLayer.mm.ejs +++ b/platform/darwin/src/MGLStyleLayer.mm.ejs @@ -125,8 +125,13 @@ namespace mbgl { if (<%- objCName(property) %> && <%- objCName(property) %>.expressionType == NSConstantValueExpressionType) { std::string string = ((NSString *)<%- objCName(property) %>.constantValue).UTF8String; if (mbgl::style::conversion::hasTokens(string)) { +<% if (property.type === 'formatted') { -%> + self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbgl::style::PropertyValue<mbgl::style::expression::Formatted>( + mbgl::style::conversion::convertTokenStringToFormatExpression(string))); +<% } else { -%> self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbgl::style::PropertyValue<std::string>( mbgl::style::conversion::convertTokenStringToExpression(string))); +<% } -%> return; } } |