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

Accept feature projection in GeoJSON constructor #5917

Merged
merged 1 commit into from Sep 27, 2016
Merged

Accept feature projection in GeoJSON constructor #5917

merged 1 commit into from Sep 27, 2016

Conversation

tschaub
Copy link
Member

@tschaub tschaub commented Sep 27, 2016

This adds support for a featureProjection option to the GeoJSON constructor.

See #5687.

Copy link
Member

@marcjansen marcjansen left a comment

Choose a reason for hiding this comment

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

Nice work, thnaks Tim. I have added one question, which you'll answer with ease, I guess.

Good to be merged otherwise.

return ol.obj.assign({
dataProjection: this.defaultDataProjection,
featureProjection: this.defaultFeatureProjection
}, options);
Copy link
Member

Choose a reason for hiding this comment

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

Where did rightHanded and decimals go?

Copy link
Member Author

Choose a reason for hiding this comment

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

If rightHanded or decimals are provided in option, these will be applied to the return.

Copy link
Member

Choose a reason for hiding this comment

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

Ahh yes, I somehow didn't see the options being passed in. Thanks for the clarification, @tschaub.

* Projection for features read or written by the format. Options passed to
* read or write methods will take precedence.
* @type {ol.ProjectionLike}
* @api stable
Copy link
Member

Choose a reason for hiding this comment

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

do we want to mark this option stable?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it makes sense to call this stable. I'll merge as is, and if there is disagreement, we can change it before the release.

@tschaub tschaub merged commit 5973644 into openlayers:master Sep 27, 2016
@tschaub tschaub deleted the format-options branch September 27, 2016 12:11
@tschaub
Copy link
Member Author

tschaub commented Sep 27, 2016

Thanks for the review @marcjansen and @fredj.

@bartvde
Copy link
Member

bartvde commented Oct 12, 2016

@tschaub locally tests fail with make check for me:

  1) ol.format.GeoJSON #writeGeometry accepts featureProjection:

      expected [ 10, 19.999999999999986 ] to sort of equal [ 10, 20 ]
      + expected - actual

       [
         10
      -  19.999999999999986
      +  20
       ]

  2) ol.format.GeoJSON #writeGeometry respects featureProjection passed to constructor:

      expected [ 10, 19.999999999999986 ] to sort of equal [ 10, 20 ]
      + expected - actual

       [
         10
      -  19.999999999999986
      +  20
       ]

@thhomas
Copy link
Contributor

thhomas commented Oct 25, 2016

I get the same error in make test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants