From 9c71dbf7b04bd119a186bba9f8d7ee5a2645149b Mon Sep 17 00:00:00 2001 From: Ratamiez Date: Fri, 18 Aug 2017 14:01:44 +0200 Subject: [PATCH] #26 --- src/Projection/AbstractProjection.js | 5 ++++- src/Projection/AitoffProjection.js | 3 ++- src/Projection/AugustProjection.js | 3 ++- src/Projection/AzimuthProjection.js | 3 ++- src/Projection/MercatorProjection.js | 3 ++- src/Projection/MollweideProjection.js | 3 ++- src/Projection/PlateProjection.js | 6 ++++-- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/Projection/AbstractProjection.js b/src/Projection/AbstractProjection.js index 970a727..479cb02 100644 --- a/src/Projection/AbstractProjection.js +++ b/src/Projection/AbstractProjection.js @@ -80,8 +80,11 @@ define(['../Renderer/GeoBound'], */ AbstractProjection.prototype.project = function (geoPos, dest) { throw "Not implemented"; - }; + }; + AbstractProjection.prototype.getDefaultZ = function () { + return 100000; + }; /**************************************************************************************************************/ diff --git a/src/Projection/AitoffProjection.js b/src/Projection/AitoffProjection.js index 3cb91c4..0017ee2 100755 --- a/src/Projection/AitoffProjection.js +++ b/src/Projection/AitoffProjection.js @@ -170,7 +170,8 @@ define(['./AbstractProjection', '../Utils/Utils', '../Renderer/glMatrix'], dest[0] = 2 * cosPhi * Math.sin(lambda) * sinciAlpha; dest[1] = Math.sin(phi) * sinciAlpha; - dest[2] = geoPos[2]; + dest[2] = this.getDefaultZ(); + //dest[2] = geoPos[2]; // Triple winkel: mode // TODO: inverse diff --git a/src/Projection/AugustProjection.js b/src/Projection/AugustProjection.js index 1fbdada..6410dca 100755 --- a/src/Projection/AugustProjection.js +++ b/src/Projection/AugustProjection.js @@ -74,7 +74,8 @@ define(['./AbstractProjection', '../Utils/Utils', '../Renderer/glMatrix'], dest[0] = 4 / 3 * x * (3 + x2 - 3 * y2); dest[1] = 4 / 3 * y * (3 + 3 * x2 - y2); - dest[2] = geoPos[2]; + dest[2] = this.getDefaultZ(); + //dest[2] = geoPos[2]; return dest; }; diff --git a/src/Projection/AzimuthProjection.js b/src/Projection/AzimuthProjection.js index 5cbece9..0567e47 100644 --- a/src/Projection/AzimuthProjection.js +++ b/src/Projection/AzimuthProjection.js @@ -104,7 +104,8 @@ define(['./AbstractProjection', '../Utils/Utils', '../Renderer/glMatrix'], o *= this.pole === "south" ? -1 : 1; dest[0] = p * Math.sin(o); dest[1] = -p * Math.cos(o); - dest[2] = geoPos[2]; + dest[2] = this.getDefaultZ(); + //dest[2] = geoPos[2]; return dest; }; diff --git a/src/Projection/MercatorProjection.js b/src/Projection/MercatorProjection.js index fd8acc8..125ff96 100755 --- a/src/Projection/MercatorProjection.js +++ b/src/Projection/MercatorProjection.js @@ -108,7 +108,8 @@ define(['./AbstractProjection', '../Utils/Utils', '../Renderer/glMatrix'], dest[0] = x; dest[1] = y; - dest[2] = geoPos[2]; + dest[2] = this.getDefaultZ(); + //dest[2] = geoPos[2]; return dest; }; diff --git a/src/Projection/MollweideProjection.js b/src/Projection/MollweideProjection.js index 015b936..f29c903 100755 --- a/src/Projection/MollweideProjection.js +++ b/src/Projection/MollweideProjection.js @@ -112,7 +112,8 @@ define(['./AbstractProjection', '../Utils/Utils', '../Renderer/glMatrix'], dest[0] = mollX; dest[1] = mollY; - dest[2] = geoPos[2]; + dest[2] = this.getDefaultZ(); + //dest[2] = geoPos[2]; return dest; }; diff --git a/src/Projection/PlateProjection.js b/src/Projection/PlateProjection.js index 17c3aae..5d7a7d7 100755 --- a/src/Projection/PlateProjection.js +++ b/src/Projection/PlateProjection.js @@ -55,13 +55,14 @@ define(['./AbstractProjection', '../Utils/Utils', '../Renderer/glMatrix'], dest[0] = position3d[0] * 180 / Math.PI; dest[1] = position3d[1] * 180 / Math.PI; dest[2] = position3d[2]; + return dest; }; /** * @function project * @memberOf PlateProjection# - */ + */ PlateProjection.prototype.project = function (geoPos, dest) { if (!dest) { @@ -69,7 +70,8 @@ define(['./AbstractProjection', '../Utils/Utils', '../Renderer/glMatrix'], } dest[0] = geoPos[0] * Math.PI / 180; dest[1] = geoPos[1] * Math.PI / 180; - dest[2] = geoPos[2]; + dest[2] = this.getDefaultZ(); + //dest[2] = geoPos[2]; return dest; };