Skip to content
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

Mapbox-gl and Geojson types update #22544

Merged
merged 4 commits into from
Jan 12, 2018

Conversation

alex3165
Copy link
Contributor

@alex3165 alex3165 commented Dec 28, 2017

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If changing an existing definition:

@typescript-bot
Copy link
Contributor

@alex3165 - It appears Travis did not correctly run on this PR! /cc @RyanCavanaugh to investigate and advise.

Copy link
Contributor

@atd-schubert atd-schubert left a comment

Choose a reason for hiding this comment

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

The GeometryObject interface should not have an optional property coordinates

@@ -68,6 +68,7 @@ export interface GeoJsonObject {
*/
export interface GeometryObject extends GeoJsonObject {
type: GeoJsonGeometryTypes;
coordinates?: Position | Position[] | Position[][] | Position[][][];
Copy link
Contributor

Choose a reason for hiding this comment

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

A GeometryCollection is also a GeometryObject, but is not allowed to have a coordinates property. At a first glance it seems to be incorrect for me.

Why do you use it here? Maybe we will find another, better solution...

Copy link
Contributor Author

@alex3165 alex3165 Dec 28, 2017

Choose a reason for hiding this comment

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

If the geometry type (GeoJsonGeometryTypes) is Point or Polygon it can have coordinates no? That's why I made it optional, in case it is a GeometryCollection and shouldn't have a coordinates

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I got the point. But i would not prefer to make it like this. I take a look at an older change especially on the old line 33. In my opinion the GeometryObject should be a type again, like this:

export type GeometryObject = Point | /* other geometries */ | GeometryCollection
// with Geometries like this:

export interface Point extends GeoJsonObject {
    type: "Point";
    coordinates: Position;
}
// and so on...

In short, I think there is no advantage to extends geometries from the GeometryObject instead of GeoJsonObject directly.

What do @Cobster and @JeffJacobson think about that?

@typescript-bot
Copy link
Contributor

@alex3165 One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Dec 28, 2017
@alex3165
Copy link
Contributor Author

alex3165 commented Jan 8, 2018

Hey @atd-schubert Thanks for your comment, I reverted the changes related to geojson types and created my own type in the end in mapbox-gl instead. could you approve the changes?

@typescript-bot typescript-bot removed Popular package This PR affects a popular package (as counted by NPM download counts). Revision needed This PR needs code changes before it can be merged. labels Jan 8, 2018
@typescript-bot
Copy link
Contributor

🔔 @atd-schubert - Thanks for your review of this PR! Can you please look at the new code and update your review status if appropriate?

@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 8, 2018

@alex3165 Thank you for submitting this PR!

🔔 @dobrud @PatrickR - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot typescript-bot added Other Approved This PR was reviewed and signed-off by a community member. Awaiting reviewer feedback labels Jan 8, 2018
@typescript-bot
Copy link
Contributor

We've gotten sign-off from a reviewer 👏. A maintainer will soon review this PR and merge it if there are no issues. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for contributing to DefinitelyTyped!

@RyanCavanaugh RyanCavanaugh merged commit 4e9fc99 into DefinitelyTyped:master Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Other Approved This PR was reviewed and signed-off by a community member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants