Jeroen De Dauw has submitted this change and it was merged.

Change subject: allow longitude coordinates up to 360 in JS globe coordinate
......................................................................


allow longitude coordinates up to 360 in JS globe coordinate

- up to 360 is required for Mars coordinates to render

Change-Id: Ifaaa4e3144971278c2faa4adfffbcfed8b935784
---
M DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js
M 
DataValues/resources/globeCoordinate.js/tests/globeCoordinate.GlobeCoordinate.tests.js
2 files changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js
 
b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js
index 73742ee..1f41ba8 100644
--- 
a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js
+++ 
b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js
@@ -41,12 +41,12 @@
 
                // TODO: Capture altitude and globe
 
-               // TODO: The following checks are earth specific. When 
implementing additional globes,
-               // either loosen the restrictions or implement globe specific 
restrictions.
-               if( Math.abs( this._latitude ) > 90 ) {
+               // TODO: Implement globe specific restrictions. The 
restrictions below
+               // allow coordinates for Mars and other globes.
+               if( Math.abs( this._latitude ) > 360 ) {
                        throw new Error( 'Latitude (' + this._latitude + ') is 
out of bounds' );
                }
-               if( Math.abs( this._longitude ) > 180 ) {
+               if( Math.abs( this._longitude ) > 360 ) {
                        throw new Error( 'Longitude (' + this._longitude + ') 
is out of bounds' );
                }
 
diff --git 
a/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.GlobeCoordinate.tests.js
 
b/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.GlobeCoordinate.tests.js
index 542770c..bbc3761 100644
--- 
a/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.GlobeCoordinate.tests.js
+++ 
b/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.GlobeCoordinate.tests.js
@@ -96,6 +96,7 @@
                                { latitude: 0, longitude: 0, precision: 1 },
                                { latitude: -3, longitude: 2, precision: 1 },
                                { latitude: 1.1, longitude: 2, precision: 0.1 },
+                               { latitude: 11.92, longitude: 255.92, 
precision: 0.1 },
                                { latitude: 90, longitude: 30.1, precision: 
0.01 },
                                { latitude: 0.1, longitude: 0.0075, precision: 
1 / 3600 },
                                { latitude: -0.1, longitude: 0, precision: 1 / 
60 },

-- 
To view, visit https://gerrit.wikimedia.org/r/84140
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifaaa4e3144971278c2faa4adfffbcfed8b935784
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/DataValues
Gerrit-Branch: master
Gerrit-Owner: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Daniel Werner <daniel.wer...@wikimedia.de>
Gerrit-Reviewer: Henning Snater <henning.sna...@wikimedia.de>
Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to