2 lines
1.2 KiB
JavaScript
2 lines
1.2 KiB
JavaScript
|
define(["exports","./Cartesian3-e0307675","./Cartesian2-bd414876","./defaultValue-81eec7ed","./Check-741c5f3c","./Math-e73894ab"],(function(e,t,i,o,a,n){"use strict";function r(e){this._ellipsoid=o.defaultValue(e,i.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),r.mercatorAngleToGeodeticLatitude=function(e){return n.CesiumMath.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},r.geodeticLatitudeToMercatorAngle=function(e){e>r.MaximumLatitude?e=r.MaximumLatitude:e<-r.MaximumLatitude&&(e=-r.MaximumLatitude);const t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},r.MaximumLatitude=r.mercatorAngleToGeodeticLatitude(Math.PI),r.prototype.project=function(e,i){const a=this._semimajorAxis,n=e.longitude*a,u=r.geodeticLatitudeToMercatorAngle(e.latitude)*a,d=e.height;return o.defined(i)?(i.x=n,i.y=u,i.z=d,i):new t.Cartesian3(n,u,d)},r.prototype.unproject=function(e,t){const a=this._oneOverSemimajorAxis,n=e.x*a,u=r.mercatorAngleToGeodeticLatitude(e.y*a),d=e.z;return o.defined(t)?(t.longitude=n,t.latitude=u,t.height=d,t):new i.Cartographic(n,u,d)},e.WebMercatorProjection=r}));
|