diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-11-06 16:11:47 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2018-11-13 17:28:26 +0200 |
commit | bf8b24fa8d30df374ee36be781b6a572036187b9 (patch) | |
tree | bdca15eef94898a879e4f3737eee2dc44efa275f /platform/node | |
parent | 4e15a0c8cd7c906908d97da10f75b35a3bc2ed9e (diff) | |
download | qtlocation-mapboxgl-bf8b24fa8d30df374ee36be781b6a572036187b9.tar.gz |
[build] Update to geometry v1.0.0
Diffstat (limited to 'platform/node')
-rw-r--r-- | platform/node/src/node_feature.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/platform/node/src/node_feature.cpp b/platform/node/src/node_feature.cpp index e5333f1b76..ee1cdab031 100644 --- a/platform/node/src/node_feature.cpp +++ b/platform/node/src/node_feature.cpp @@ -14,6 +14,10 @@ using Properties = mbgl::PropertyMap; template <class T> struct ToType { public: + v8::Local<v8::String> operator()(const empty&) { + return type("Empty"); + } + v8::Local<v8::String> operator()(const point<T>&) { return type("Point"); } @@ -159,8 +163,8 @@ v8::Local<v8::Object> toJS(const Feature& feature) { Nan::Set(result, Nan::New("geometry").ToLocalChecked(), toJS(feature.geometry)); Nan::Set(result, Nan::New("properties").ToLocalChecked(), toJS(feature.properties)); - if (feature.id) { - Nan::Set(result, Nan::New("id").ToLocalChecked(), FeatureIdentifier::visit(*feature.id, ToValue())); + if (!feature.id.is<mbgl::NullValue>()) { + Nan::Set(result, Nan::New("id").ToLocalChecked(), FeatureIdentifier::visit(feature.id, ToValue())); } return scope.Escape(result); |