-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch from many parameters in constructor to a single Options struct #21
Conversation
👍, especially the abstraction of extent and buffer. |
Looks great. I'd suggest mirroring the JS version API though, with features as the first flat required argument and optional object for all the rest options. BTW what's the reason to keep the API 2-step with first doing |
Sounds good, will change this. 👍
Not sure, I'm not too familiar with either version to be honest. |
@incanus do you know? |
@jfirebaugh Is there an easy fix for initializer lists in GCC?
|
That's designated initializer syntax, and it's a C99 feature. As far as I know there's no portable way to use it in C++. You'll have to write it out manually:
|
Hmm, interesting, and I didn't do it in the intermediary Swift port: I think this was related to something in the original shape annotations implementation (https://github.com/mapbox/mapbox-gl-native/pull/1655/files) like needing to convert first, but not necessarily tile until a later point. |
2c32527
to
80e1230
Compare
@incanus can we ditch the step now so that it mirrors the JS API? |
Fine by me, particularly since this is now a separate project.
|
indexMaxPoints(indexMaxPoints_), | ||
solidChildren(solidChildren_), | ||
tolerance(tolerance_) { | ||
GeoJSONVT::GeoJSONVT(std::vector<ProjectedFeature> features_, Options options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not store an Options
object directly into the GeoJSONVT
object rather than exploding it into its parts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm that seems like it would work well.
@mourner @kkaefer Is it valuable to keep |
@mikemorris doesn't matter much, I think this is good to merge. |
@mikemorris let's make it private; we should add more detailed benchmarking to the internals of geojson-vt-cpp anyway if the need arises to optimize. |
- move convertFeatures from public static to private member function - private Options var on GeoJSONVT class
25ab258
to
d0d81a6
Compare
Rebased and squashed, this should be good to merge (and tag |
Not sure what's the best practice is, but worth noting that we diverged the API anyway even though the version was mirrored, so we probably have to break the version mirroring here, even if it's not wanted. @jfirebaugh what do you think? |
I think it's fine to version js and cpp independently. |
switch from many parameters in constructor to a single Options struct
semver major, fixes #20
/cc @mourner @jfirebaugh @incanus