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

GlobeCoordinate: support other globes #94

Merged
merged 1 commit into from
Apr 7, 2016
Merged

GlobeCoordinate: support other globes #94

merged 1 commit into from
Apr 7, 2016

Conversation

ricordisamoa
Copy link
Contributor

Prefer the injected value instead of the hard-coded 'http://www.wikidata.org/entity/Q2'.

Add tests.

Bug: T105321

@thiemowmde
Copy link
Contributor

@@ -40,7 +40,7 @@
throw new Error( 'Longitude (' + this._longitude + ') is out of bounds' );
}

this._globe = 'http://www.wikidata.org/entity/Q2'; // TODO: Support other globes
this._globe = gcDef.globe;

Choose a reason for hiding this comment

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

maybe gcDef.globe || 'http://www.wikidata.org/entity/Q2' just in case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@thiemowmde
Copy link
Contributor

Thanks a lot for changes. I just wanted to merge this but found that Fomafix is right: equals must compare the globe. Don't forget to add tests for this.

Notes:

  • getDecimal is fine. Don't add the globe there.
  • Don't add type checks. The existing properties do not have type checks too. I think this is fine. I think performance is more important than absolute type safety here.

@ricordisamoa
Copy link
Contributor Author

Right. Thank you.

{ latitude: 5, longitude: -0.00292, precision: 1 / 36000 }
{ latitude: 5, longitude: -0.00292, precision: 1 / 36000 },
{ latitude: 5, longitude: 2, globe: 'http://www.wikidata.org/entity/Q2' },
{ latitude: 5, longitude: 2, globe: 'http://www.wikidata.org/entity/Q313' }
Copy link
Contributor

Choose a reason for hiding this comment

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

The test error is caused by a bug in equals. I will fix it in an other patch. To make your patch pass please add precision: 1 to these lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thx, it puzzled me.

Prefer the injected value instead of the
hard-coded 'http://www.wikidata.org/entity/Q2'.

Add tests.

Bug: T105321
@thiemowmde thiemowmde merged commit b711aab into wmde:master Apr 7, 2016
@ricordisamoa ricordisamoa deleted the bug/T131665 branch April 7, 2016 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants