Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[node] Implement GeoJSON converter #9961

Merged
merged 1 commit into from
Sep 13, 2017
Merged

Conversation

brunoabinader
Copy link
Member

This is needed in order to let functions like addSource being used via style operators in render tests.

@brunoabinader brunoabinader added feature Node.js node-mapbox-gl-native labels Sep 11, 2017
@brunoabinader brunoabinader self-assigned this Sep 11, 2017
@asheemmamoowala
Copy link
Contributor

@brunoabinader - is this the same as : #5623?

@brunoabinader
Copy link
Member Author

@asheemmamoowala I think so - currently we have a generic GeoJSON converter in a sense that it accepts stringified JSON in std::string form. It is the base for e.g. Qt and Android converters. In this PR I add the same functionality to Node.

Copy link
Member

@kkaefer kkaefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this is definitely a workaround implementation. Ideally, we'd be converting the v8 object to our internal GeoJSON representation directly instead of stringifying. Not sure whether that's actually faster, but I imagine it is.

@brunoabinader
Copy link
Member Author

brunoabinader commented Sep 12, 2017

Ideally, we'd be converting the v8 object to our internal GeoJSON representation directly instead of stringifying

The intent is to reuse the same string-based converter already battle-proven and used by other platforms. I'd prefer to use this instead of implementing a whole new converter from scratch.

Copy link
Contributor

@jfirebaugh jfirebaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good workaround for now. We can leave #5623 open.


Nan::HandleScope scope;

v8::Local<v8::Object> JSON = Nan::To<v8::Object>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call - we can use it here as well.

@@ -41,10 +41,9 @@
"render-tests/regressions/mapbox-gl-js#3548": "skip - needs issue",
"render-tests/regressions/mapbox-gl-js#3682": "https://github.com/mapbox/mapbox-gl-js/issues/3682",
"render-tests/regressions/mapbox-gl-native#7357": "https://github.com/mapbox/mapbox-gl-native/issues/7357",
"render-tests/runtime-styling/image-add-sdf": "skip - https://github.com/mapbox/mapbox-gl-native/issues/9847",
Copy link
Contributor

@jfirebaugh jfirebaugh Sep 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's probably a few other tests that can be enabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - render-tests/regressions/mapbox-gl-js#3548.

@brunoabinader brunoabinader force-pushed the node-convert-geojson branch 2 times, most recently from 9dc55ff to fb2648e Compare September 13, 2017 19:51
@brunoabinader brunoabinader merged commit e9914bf into master Sep 13, 2017
@brunoabinader brunoabinader deleted the node-convert-geojson branch September 13, 2017 20:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Node.js node-mapbox-gl-native
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants