1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-08 09:36:02 -05:00
sdrangel/plugins/feature/map/Cesium/Workers/WebMercatorProjection-aa53f15d.js
2022-02-04 20:41:22 +00:00

2 lines
1.2 KiB
JavaScript

define(["exports","./Matrix2-46444433","./when-229515d6","./RuntimeError-608565a6","./ComponentDatatype-692a36d3"],(function(t,e,i,o,a){"use strict";function n(t){this._ellipsoid=i.defaultValue(t,e.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(n.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),n.mercatorAngleToGeodeticLatitude=function(t){return a.CesiumMath.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},n.geodeticLatitudeToMercatorAngle=function(t){t>n.MaximumLatitude?t=n.MaximumLatitude:t<-n.MaximumLatitude&&(t=-n.MaximumLatitude);const e=Math.sin(t);return.5*Math.log((1+e)/(1-e))},n.MaximumLatitude=n.mercatorAngleToGeodeticLatitude(Math.PI),n.prototype.project=function(t,o){const a=this._semimajorAxis,r=t.longitude*a,u=n.geodeticLatitudeToMercatorAngle(t.latitude)*a,d=t.height;return i.defined(o)?(o.x=r,o.y=u,o.z=d,o):new e.Cartesian3(r,u,d)},n.prototype.unproject=function(t,o){const a=this._oneOverSemimajorAxis,r=t.x*a,u=n.mercatorAngleToGeodeticLatitude(t.y*a),d=t.z;return i.defined(o)?(o.longitude=r,o.latitude=u,o.height=d,o):new e.Cartographic(r,u,d)},t.WebMercatorProjection=n}));