summaryrefslogtreecommitdiff
path: root/platform/node
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-11-01 16:20:35 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-11-11 18:20:01 +0200
commit8bbc7d9290218a65a86d51748838175cdb7379f9 (patch)
tree668850d96bc38ac7d564ad653417c9d925d10f14 /platform/node
parentc6f3cc8b60e0cff032020a780d4fd3de1cb2a112 (diff)
downloadqtlocation-mapboxgl-8bbc7d9290218a65a86d51748838175cdb7379f9.tar.gz
[node] Add support for Image expression
Diffstat (limited to 'platform/node')
-rw-r--r--platform/node/src/node_expression.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/node/src/node_expression.cpp b/platform/node/src/node_expression.cpp
index 81d5c74767..7e59847da9 100644
--- a/platform/node/src/node_expression.cpp
+++ b/platform/node/src/node_expression.cpp
@@ -42,7 +42,8 @@ type::Type parseType(v8::Local<v8::Object> type) {
{"color", type::Color},
{"value", type::Value},
{"formatted", type::Formatted},
- {"number-format", type::String}};
+ {"number-format", type::String},
+ {"resolvedImage", type::Image}};
v8::Local<v8::Value> v8kind = Nan::Get(type, Nan::New("kind").ToLocalChecked()).ToLocalChecked();
std::string kind(*v8::String::Utf8Value(v8kind));
@@ -220,6 +221,8 @@ struct ToValue {
return scope.Escape(result);
}
+
+ v8::Local<v8::Value> operator()(const Image& image) { return toJS(image.toValue()); }
};
v8::Local<v8::Value> toJS(const Value& value) {