diff --git a/v2/api.js b/v2/api.js index bc4dd58..100a56c 100755 --- a/v2/api.js +++ b/v2/api.js @@ -1,4 +1,4 @@ -/** +/** * WebGL Earth 2.0 * =============== * Copyright (C) 2014 - Klokan Technologies GmbH @@ -6,7 +6,7 @@ * Powered by Cesium ( http://www.webglearth.org/cesium ). Apache 2.0 license. */ -CESIUM_BASE_URL = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//www.webglearth.com/v2/'; +CESIUM_BASE_URL = ('https:' == document.location.protocol ? 'https:' : 'http:') + 'v2/'; !function(){var e,t,r;!function(i){function n(e,t){return w.call(e,t)}function o(e,t){var r,i,n,o,a,s,l,u,c,h,d=t&&t.split("/"),m=_.map,f=m&&m["*"]||{};if(e&&"."===e.charAt(0))if(t){for(d=d.slice(0,d.length-1),e=d.concat(e.split("/")),u=0;u0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||f)&&m){for(r=e.split("/"),u=r.length;u>0;u-=1){if(i=r.slice(0,u).join("/"),d)for(c=d.length;c>0;c-=1)if(n=m[d.slice(0,c).join("/")],n&&(n=n[i])){o=n,a=u;break}if(o)break;!s&&f&&f[i]&&(s=f[i],l=u)}!o&&s&&(o=s,a=l),o&&(r.splice(0,a,o),e=r.join("/"))}return e}function a(e,t){return function(){return m.apply(i,C.call(arguments,0).concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){v[e]=t}}function u(e){if(n(g,e)){var t=g[e];delete g[e],y[e]=!0,d.apply(i,t)}if(!n(v,e)&&!n(y,e))throw new Error("No "+e);return v[e]}function c(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function h(e){return function(){return _&&_.config&&_.config[e]||{}}}var d,m,f,p,v={},g={},_={},y={},w=Object.prototype.hasOwnProperty,C=[].slice;f=function(e,t){var r,i=c(e),n=i[0];return e=i[1],n&&(n=o(n,t),r=u(n)),n?e=r&&r.normalize?r.normalize(e,s(t)):o(e,t):(e=o(e,t),i=c(e),n=i[0],e=i[1],n&&(r=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:r}},p={require:function(e){return a(e)},exports:function(e){var t=v[e];return"undefined"!=typeof t?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:h(e)}}},d=function(e,t,r,o){var s,c,h,d,m,_,w=[];if(o=o||e,"function"==typeof r){for(t=!t.length&&r.length?["require","exports","module"]:t,m=0;m>>0,u=Math.max(0,Math.min(r,_)),h=[],c=_-u+1,d=[],m=a(),u)for(v=m.progress,p=function(e){d.push(e),--c||(f=p=g,m.reject(d))},f=function(e){h.push(e),--u||(f=p=g,m.resolve(h))},y=0;_>y;++y)y in t&&e(t[y],l,s,v);else m.resolve(h);return m.then(i,n,o)})}function u(e,t,r,i){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,r,i)}function c(e,t,r,i){return v(1,arguments),d(e,_).then(t,r,i)}function h(){return d(arguments,_)}function d(t,r){return e(t,function(t){var i,n,o,s,l,u;if(o=n=t.length>>>0,i=[],u=a(),o)for(s=function(t,n){e(t,r).then(function(e){i[n]=e,--o||u.resolve(i)},u.reject)},l=0;n>l;l++)l in t?s(t[l],l):--o;else u.resolve(i);return u.promise})}function m(t,r){var i=w.call(arguments,1);return e(t,function(t){var n;return n=t.length,i[0]=function(t,i,o){return e(t,function(t){return e(i,function(e){return r(t,e,o,n)})})},y.apply(t,i)})}function f(t,r,i){var n=arguments.length>2;return e(t,function(e){return e=n?i:e,r.resolve(e),e},function(e){return r.reject(e),o(e)},r.progress)}function p(e,t){for(var r,i=0;r=e[i++];)r(t)}function v(e,t){for(var r,i=t.length;i>e;)if(r=t[--i],null!=r&&"function"!=typeof r)throw new Error("arg "+i+" must be a function")}function g(){}function _(e){return e}var y,w,C;return e.defer=a,e.resolve=t,e.reject=r,e.join=h,e.all=c,e.map=d,e.reduce=m,e.any=u,e.some=l,e.chain=f,e.isPromise=s,i.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(C,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(C,t)})})}},w=[].slice,y=[].reduce||function(e){var t,r,i,n,o;if(o=0,t=Object(this),n=t.length>>>0,r=arguments,r.length<=1)for(;;){if(o in t){i=t[o++];break}if(++o>=n)throw new TypeError}else i=r[1];for(;n>o;++o)o in t&&(i=e(i,t[o],o,t));return i},e})}("function"==typeof r&&r.amd?r:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),r("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),r("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),r("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),r("Core/Credit",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";var i=function(t,i,n){var o=e(n),a=e(i),s=e(t);if(!s&&!a&&!o)throw new r("text, imageUrl or link is required");s||a||(t=n),this._text=t,this._imageUrl=i,this._link=n,this._hasLink=o,this._hasImage=a};return t(i.prototype,{text:{get:function(){return this._text}},imageUrl:{get:function(){return this._imageUrl}},link:{get:function(){return this._link}}}),i.prototype.hasImage=function(){return this._hasImage},i.prototype.hasLink=function(){return this._hasLink},i.equals=function(t,r){var i=!e(t),n=!e(r);return t===r||(i&&n||!i&&!n)&&t._text===r._text&&t._imageUrl===r._imageUrl&&t._link===r._link},i.prototype.equals=function(e){return i.equals(this,e)},i}),r("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),r("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),r("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r>>1^t[1&e];for(;r>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),r("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},n.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},n.lerp=function(e,t,r){return(1-r)*e+r*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){if(!r(e))throw new i("degrees is required.");return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){if(!r(e))throw new i("radians is required.");return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){if(!r(e))throw new i("angle is required.");var t=n.TWO_PI,o=e-Math.floor(e/t)*t;return o<-Math.PI?o+t:o>=Math.PI?o-t:o},n.negativePiToPi=function(e){if(!r(e))throw new i("x is required.");for(var t=n.EPSILON10,o=n.PI,a=n.TWO_PI;-(o+t)>e;)e+=a;if(-o>e)return-o;for(;e>o+t;)e-=a;return e>o?o:e},n.zeroToTwoPi=function(e){if(!r(e))throw new i("x is required.");var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(e,n,o){if(!r(e))throw new i("left is required.");if(!r(n))throw new i("right is required.");return o=t(o,0),Math.abs(e-n)<=o};var o=[1];n.factorial=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");var t=o.length;if(e>=t)for(var r=o[t-1],n=t;e>=n;n++)o.push(r*n);return o[e]},n.incrementWrap=function(e,n,o){if(o=t(o,0),!r(e))throw new i("n is required.");if(o>=n)throw new i("maximumValue must be greater than minimumValue.");return++e,e>n&&(e=o),e},n.isPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new i("A number greater than or equal to 0 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,n){if(!r(e))throw new i("value is required");if(!r(t))throw new i("min is required.");if(!r(n))throw new i("max is required.");return t>e?t:e>n?n:e};var a=new e;return n.setRandomNumberSeed=function(t){if(!r(t))throw new i("seed is required.");a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n}),r("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r,i){this.x=e(t,0),this.y=e(r,0),this.z=e(i,0)};o.fromSpherical=function(i,n){if(!t(i))throw new r("spherical is required");t(n)||(n=new o);var a=i.clock,s=i.cone,l=e(i.magnitude,1),u=l*Math.sin(s);return n.x=u*Math.cos(a),n.y=u*Math.sin(a),n.z=l*Math.cos(s),n},o.fromElements=function(e,r,i,n){return t(n)?(n.x=e,n.y=r,n.z=i,n):new o(e,r,i)},o.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new o(e.x,e.y,e.z):void 0},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(i,n,o){if(!t(i))throw new r("value is required");if(!t(n))throw new r("array is required");o=e(o,0),n[o++]=i.x,n[o++]=i.y,n[o]=i.z},o.unpack=function(i,n,a){if(!t(i))throw new r("array is required");return n=e(n,0),t(a)||(a=new o),a.x=i[n++],a.y=i[n++],a.z=i[n],a},o.fromArray=o.unpack,o.getMaximumComponent=function(e){if(!t(e))throw new r("cartesian is required");return Math.max(e.x,e.y,e.z)},o.getMinimumComponent=function(e){if(!t(e))throw new r("cartesian is required");return Math.min(e.x,e.y,e.z)},o.getMinimumByComponent=function(e,i,n){if(!t(e))throw new r("first is required.");if(!t(i))throw new r("second is required.");if(!t(n))throw new r("result is required.");return n.x=Math.min(e.x,i.x),n.y=Math.min(e.y,i.y),n.z=Math.min(e.z,i.z),n},o.getMaximumByComponent=function(e,i,n){if(!t(e))throw new r("first is required.");if(!t(i))throw new r("second is required.");if(!t(n))throw new r("result is required.");return n.x=Math.max(e.x,i.x),n.y=Math.max(e.y,i.y),n.z=Math.max(e.z,i.z),n},o.magnitudeSquared=function(e){if(!t(e))throw new r("cartesian is required");return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,i){if(!t(e)||!t(i))throw new r("left and right are required.");return o.subtract(e,i,a),o.magnitude(a)},o.normalize=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");var n=o.magnitude(e);return i.x=e.x/n,i.y=e.y/n,i.z=e.z/n,i},o.dot=function(e,i){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");return e.x*i.x+e.y*i.y+e.z*i.z},o.multiplyComponents=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x*i.x,n.y=e.y*i.y,n.z=e.z*i.z,n},o.add=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x+i.x,n.y=e.y+i.y,n.z=e.z+i.z,n},o.subtract=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x-i.x,n.y=e.y-i.y,n.z=e.z-i.z,n},o.multiplyByScalar=function(e,i,n){if(!t(e))throw new r("cartesian is required");if("number"!=typeof i)throw new r("scalar is required and must be a number.");if(!t(n))throw new r("result is required");return n.x=e.x*i,n.y=e.y*i,n.z=e.z*i,n},o.divideByScalar=function(e,i,n){if(!t(e))throw new r("cartesian is required");if("number"!=typeof i)throw new r("scalar is required and must be a number.");if(!t(n))throw new r("result is required");return n.x=e.x/i,n.y=e.y/i,n.z=e.z/i,n},o.negate=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");return i.x=-e.x,i.y=-e.y,i.z=-e.z,i},o.abs=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");return i.x=Math.abs(e.x),i.y=Math.abs(e.y),i.z=Math.abs(e.z),i};var s=new o;o.lerp=function(e,i,n,a){if(!t(e))throw new r("start is required.");if(!t(i))throw new r("end is required.");if("number"!=typeof n)throw new r("t is required and must be a number.");if(!t(a))throw new r("result is required.");return o.multiplyByScalar(i,n,s),a=o.multiplyByScalar(e,1-n,a),o.add(s,a,a)};var l=new o,u=new o;o.angleBetween=function(e,i){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");o.normalize(e,l),o.normalize(i,u);var n=o.dot(l,u),a=o.magnitude(o.cross(l,u,l));return Math.atan2(a,n)};var c=new o;o.mostOrthogonalAxis=function(e,i){if(!t(e))throw new r("cartesian is required.");if(!t(i))throw new r("result is required.");var n=o.normalize(e,c);return o.abs(n,n),i=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,i):o.clone(o.UNIT_Z,i):n.y<=n.z?o.clone(o.UNIT_Y,i):o.clone(o.UNIT_Z,i)},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},o.equalsEpsilon=function(e,i,n){if("number"!=typeof n)throw new r("epsilon is required and must be a number.");return e===i||t(e)&&t(i)&&Math.abs(e.x-i.x)<=n&&Math.abs(e.y-i.y)<=n&&Math.abs(e.z-i.z)<=n},o.cross=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");var o=e.x,a=e.y,s=e.z,l=i.x,u=i.y,c=i.z,h=a*c-s*u,d=s*l-o*c,m=o*u-a*l;return n.x=h,n.y=d,n.z=m,n},o.fromDegrees=function(e,i,a,s,l){if(!t(e))throw new r("longitude is required");if(!t(i))throw new r("latitude is required");var u=n.toRadians(e),c=n.toRadians(i);return o.fromRadians(u,c,a,s,l)};var h=new o,d=new o,m=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(i,n,a,s,l){if(!t(i))throw new r("longitude is required");if(!t(n))throw new r("latitude is required");a=e(a,0);var u=t(s)?s.radiiSquared:m,c=Math.cos(n);h.x=c*Math.cos(i),h.y=c*Math.sin(i),h.z=Math.sin(n),h=o.normalize(h,h),o.multiplyComponents(u,h,d);var f=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,f,d),h=o.multiplyByScalar(h,a,h),t(l)||(l=new o),o.add(d,h,l)},o.fromDegreesArray=function(e,i,a){if(!t(e))throw new r("positions is required.");for(var s=new Array(e.length),l=0;ls;s+=2){var l=e[s],u=e[s+1];n[s/2]=o.fromRadians(l,u,0,i,n[s/2])}return n},o.fromDegreesArrayHeights=function(e,i,a){if(!t(e))throw new r("positions is required.");if(e.length<3)throw new r("positions length cannot be less than 3.");if(0!==e.length%3)throw new r("positions length must be a multiple of 3.");for(var s=new Array(e.length),l=0;ls;s+=3){var l=e[s],u=e[s+1],c=e[s+2];n[s/3]=o.fromRadians(l,u,c,i,n[s/3])}return n},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),r("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r,i){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(i,0)};return o.fromRadians=function(i,n,a,s){if(!t(i))throw new r("longitude is required.");if(!t(n))throw new r("latitude is required.");return a=e(a,0),t(s)?(s.longitude=i,s.latitude=n,s.height=a,s):new o(i,n,a)},o.fromDegrees=function(e,i,a,s){if(!t(e))throw new r("longitude is required.");if(!t(i))throw new r("latitude is required.");return e=n.toRadians(e),i=n.toRadians(i),o.fromRadians(e,i,a,s)},o.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new o(e.longitude,e.latitude,e.height):void 0},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},o.equalsEpsilon=function(e,i,n){if("number"!=typeof n)throw new r("epsilon is required and must be a number.");return e===i||t(e)&&t(i)&&Math.abs(e.longitude-i.longitude)<=n&&Math.abs(e.latitude-i.latitude)<=n&&Math.abs(e.height-i.height)<=n},o.toString=function(e){if(!t(e))throw new r("cartographic is required");return"("+e.longitude+", "+e.latitude+", "+e.height+")"},o.ZERO=i(new o(0,0,0)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return o.toString(this)},o}),r("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";var l=function(t,i,n){if(t=r(t,0),i=r(i,0),n=r(n,0),0>t||0>i||0>n)throw new o("All radii components must be greater than or equal to zero.");this._radii=new e(t,i,n),this._radiiSquared=new e(t*t,i*i,n*n),this._radiiToTheFourth=new e(t*t*t*t,i*i*i*i,n*n*n*n),this._oneOverRadii=new e(0===t?0:1/t,0===i?0:1/i,0===n?0:1/n),this._oneOverRadiiSquared=new e(0===t?0:1/(t*t),0===i?0:1/(i*i),0===n?0:1/(n*n)),this._minimumRadius=Math.min(t,i,n),this._maximumRadius=Math.max(t,i,n),this._centerToleranceSquared=s.EPSILON1};n(l.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),l.clone=function(t,r){if(!i(t))return void 0;var n=t._radii;return i(r)?(e.clone(n,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(n.x,n.y,n.z)},l.fromCartesian3=function(e){return i(e)?new l(e.x,e.y,e.z):new l},l.WGS84=a(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=a(new l(1,1,1)),l.MOON=a(new l(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){if(!i(t))throw new o("cartographic is required.");var n=t.longitude,a=t.latitude,s=Math.cos(a),l=s*Math.cos(n),u=s*Math.sin(n),c=Math.sin(a);return i(r)||(r=new e),r.x=l,r.y=u,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return i(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var u=new e,c=new e;l.prototype.cartographicToCartesian=function(t,r){var n=u,o=c;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,t.height,n),i(r)||(r=new e),e.add(o,n,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){if(!i(e))throw new o("cartographics is required.");var r=e.length;i(t)?t.length=r:t=new Array(r);for(var n=0;r>n;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var h=new e,d=new e,m=new e;l.prototype.cartesianToCartographic=function(r,n){var o=this.scaleToGeodeticSurface(r,d);if(!i(o))return void 0;var a=this.geodeticSurfaceNormal(o,h),l=e.subtract(r,o,m),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),f=s.sign(e.dot(l,r))*e.magnitude(l);return i(n)?(n.longitude=u,n.latitude=c,n.height=f,n):new t(u,c,f)},l.prototype.cartesianArrayToCartographicArray=function(e,t){if(!i(e))throw new o("cartesians is required.");var r=e.length;i(t)?t.length=r:t=new Array(r);for(var n=0;r>n;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t};var f=new e,p=new e;return l.prototype.scaleToGeodeticSurface=function(t,r){if(!i(t))throw new o("cartesian is required.");var n=t.x,a=t.y,l=t.z,u=this._oneOverRadii,c=u.x,h=u.y,d=u.z,m=n*n*c*c,v=a*a*h*h,g=l*l*d*d,_=m+v+g,y=Math.sqrt(1/_),w=e.multiplyByScalar(t,y,f);if(_s.EPSILON12);return i(r)?(r.x=n*A,r.y=a*M,r.z=l*D,r):new e(n*A,a*M,l*D)},l.prototype.scaleToGeocentricSurface=function(t,r){if(!i(t))throw new o("cartesian is required.");i(r)||(r=new e);var n=t.x,a=t.y,s=t.z,l=this._oneOverRadiiSquared,u=1/Math.sqrt(n*n*l.x+a*a*l.y+s*s*l.z);return e.multiplyByScalar(t,u,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return i(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return i(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||i(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l}),r("Core/Event",["./defineProperties","./DeveloperError"],function(e,t){"use strict";var r=function(){this._listeners=[],this._scopes=[]};return e(r.prototype,{numberOfListeners:{get:function(){return this._listeners.length}}}),r.prototype.addEventListener=function(e,r){if("function"!=typeof e)throw new t("listener is required and must be a function.");this._listeners.push(e),this._scopes.push(r);var i=this;return function(){i.removeEventListener(e,r)}},r.prototype.removeEventListener=function(e,r){if("function"!=typeof e)throw new t("listener is required and must be a function.");for(var i=this._listeners,n=this._scopes,o=-1,a=0;ai;i++)e[i].apply(t[i],arguments)},r}),r("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n){"use strict";var o=function(t,r){this.x=e(t,0),this.y=e(r,0)};o.fromElements=function(e,r,i){return t(i)?(i.x=e,i.y=r,i):new o(e,r)},o.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new o(e.x,e.y):void 0},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(i,n,o){if(!t(i))throw new r("value is required");if(!t(n))throw new r("array is required");o=e(o,0),n[o++]=i.x,n[o]=i.y},o.unpack=function(i,n,a){if(!t(i))throw new r("array is required");return n=e(n,0),t(a)||(a=new o),a.x=i[n++],a.y=i[n],a},o.fromArray=o.unpack,o.getMaximumComponent=function(e){if(!t(e))throw new r("cartesian is required");return Math.max(e.x,e.y)},o.getMinimumComponent=function(e){if(!t(e))throw new r("cartesian is required");return Math.min(e.x,e.y)},o.getMinimumByComponent=function(e,i,n){if(!t(e))throw new r("first is required.");if(!t(i))throw new r("second is required.");if(!t(n))throw new r("result is required.");return n.x=Math.min(e.x,i.x),n.y=Math.min(e.y,i.y),n},o.getMaximumByComponent=function(e,i,n){if(!t(e))throw new r("first is required.");if(!t(i))throw new r("second is required.");if(!t(n))throw new r("result is required.");return n.x=Math.max(e.x,i.x),n.y=Math.max(e.y,i.y),n},o.magnitudeSquared=function(e){if(!t(e))throw new r("cartesian is required");return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,i){if(!t(e)||!t(i))throw new r("left and right are required.");return o.subtract(e,i,a),o.magnitude(a)},o.normalize=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");var n=o.magnitude(e);return i.x=e.x/n,i.y=e.y/n,i},o.dot=function(e,i){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");return e.x*i.x+e.y*i.y},o.multiplyComponents=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x*i.x,n.y=e.y*i.y,n},o.add=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x+i.x,n.y=e.y+i.y,n},o.subtract=function(e,i,n){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");if(!t(n))throw new r("result is required");return n.x=e.x-i.x,n.y=e.y-i.y,n},o.multiplyByScalar=function(e,i,n){if(!t(e))throw new r("cartesian is required");if("number"!=typeof i)throw new r("scalar is required and must be a number.");if(!t(n))throw new r("result is required");return n.x=e.x*i,n.y=e.y*i,n},o.divideByScalar=function(e,i,n){if(!t(e))throw new r("cartesian is required");if("number"!=typeof i)throw new r("scalar is required and must be a number.");if(!t(n))throw new r("result is required");return n.x=e.x/i,n.y=e.y/i,n},o.negate=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");return i.x=-e.x,i.y=-e.y,i},o.abs=function(e,i){if(!t(e))throw new r("cartesian is required");if(!t(i))throw new r("result is required");return i.x=Math.abs(e.x),i.y=Math.abs(e.y),i};var s=new o;o.lerp=function(e,i,n,a){if(!t(e))throw new r("start is required.");if(!t(i))throw new r("end is required.");if("number"!=typeof n)throw new r("t is required and must be a number.");if(!t(a))throw new r("result is required.");return o.multiplyByScalar(i,n,s),a=o.multiplyByScalar(e,1-n,a),o.add(s,a,a)};var l=new o,u=new o;o.angleBetween=function(e,i){if(!t(e))throw new r("left is required");if(!t(i))throw new r("right is required");return o.normalize(e,l),o.normalize(i,u),n.acosClamped(o.dot(l,u))};var c=new o;return o.mostOrthogonalAxis=function(e,i){if(!t(e))throw new r("cartesian is required.");if(!t(i))throw new r("result is required.");var n=o.normalize(e,c);return o.abs(n,n),i=n.x<=n.y?o.clone(o.UNIT_X,i):o.clone(o.UNIT_Y,i)},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},o.equalsEpsilon=function(e,i,n){if("number"!=typeof n)throw new r("epsilon is required and must be a number.");return e===i||t(e)&&t(i)&&Math.abs(e.x-i.x)<=n&&Math.abs(e.y-i.y)<=n},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),r("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,i,n,o,a){"use strict";var s=function(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,r){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},s.prototype.unproject=function(e,r){if(!i(e))throw new o("cartesian is required");var n=this._oneOverSemimajorAxis,a=e.x*n,s=e.y*n,l=e.z;return i(r)?(r.longitude=a,r.latitude=s,r.height=l,r):new t(a,s,l)},s}),r("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,i,n,o,a){"use strict";var s=function(e,r,i,n){this.west=t(e,0),this.south=t(r,0),this.east=t(i,0),this.north=t(n,0)