-
Notifications
You must be signed in to change notification settings - Fork 38
[editable-layers] Update to turf 7 and use geojson types #221
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
base: master
Are you sure you want to change the base?
Conversation
|
||
export type Polygonal = Polygon | MultiPolygon; | ||
|
||
// Feature types | ||
|
||
export type BoundingBoxArray = [number, number, number, number]; | ||
import { Feature, FeatureCollection } from 'geojson'; | ||
export { Feature, FeatureCollection } from 'geojson'; |
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.
Probably want to drop this export, and have all files import directly from geojson
instead - this was a quick way to make the switch.
@timnyborg id like to see this land before integrating the editable-layers into my repo. What additional work is required here? |
@charlieforward9 as far as I'm concerned, none, as this is passing the test suite for me. It's really a question for the repo owners, though. Note that you can use this library with turf@7, which is almost entirely backwards-compatible with v6, just with the odd type assertion around |
That's fantastic to hear. In this case, let's see if @ibgreen can review and land it! I'm eager to get editable layers as up to date and functional as possible as I have 2 projects depending on it |
This is an attempt at updating editable-layers to rely on turf.js@7 to remove the type carnage that came from competing geojson, turf.js, and nebula.gl type definitions.
Feature
andFeatureCollection
types withgeojson
's, narrowing to excludeGeometryCollection
(which is unsupported)FeatureCollection
inputs (intersect, difference, etc.) or return aFeature
(centroid)@turf/area
ts-expect-error
s. Leaves a few type assertions in place to avoid additional functional changes, but the type safety is much improvedlib
folder, and an unusedcurve-utils
file, rather than trying to update turf usages there.Assuming the PR is otherwise acceptable, I'm unsure what other work might need to be done. Other modules in the repo specify turf 6.5, so we might want to update them as well (examples, examples-wip, react, website)
Addresses #202