[build] Update to geometry v1.0.0

This commit is contained in:
Bruno de Oliveira Abinader
2018-11-06 16:11:47 +02:00
parent 4e15a0c8cd
commit bf8b24fa8d
42 changed files with 174 additions and 113 deletions

View File

@@ -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);