231 lines
207 KiB
JavaScript
231 lines
207 KiB
JavaScript
|
/**
|
||
|
* Cesium - https://github.com/AnalyticalGraphicsInc/cesium
|
||
|
*
|
||
|
* Copyright 2011-2017 Cesium Contributors
|
||
|
*
|
||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*
|
||
|
* Columbus View (Pat. Pend.)
|
||
|
*
|
||
|
* Portions licensed separately.
|
||
|
* See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
|
||
|
*/
|
||
|
/**
|
||
|
@license
|
||
|
mersenne-twister.js - https://gist.github.com/banksean/300494
|
||
|
|
||
|
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
|
||
|
All rights reserved.
|
||
|
|
||
|
Redistribution and use in source and binary forms, with or without
|
||
|
modification, are permitted provided that the following conditions
|
||
|
are met:
|
||
|
|
||
|
1. Redistributions of source code must retain the above copyright
|
||
|
notice, this list of conditions and the following disclaimer.
|
||
|
|
||
|
2. Redistributions in binary form must reproduce the above copyright
|
||
|
notice, this list of conditions and the following disclaimer in the
|
||
|
documentation and/or other materials provided with the distribution.
|
||
|
|
||
|
3. The names of its contributors may not be used to endorse or promote
|
||
|
products derived from this software without specific prior written
|
||
|
permission.
|
||
|
|
||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
@license
|
||
|
when.js - https://github.com/cujojs/when
|
||
|
|
||
|
MIT License (c) copyright B Cavalier & J Hann
|
||
|
|
||
|
* A lightweight CommonJS Promises/A and when() implementation
|
||
|
* when is part of the cujo.js family of libraries (http://cujojs.com/)
|
||
|
*
|
||
|
* Licensed under the MIT License at:
|
||
|
* http://www.opensource.org/licenses/mit-license.php
|
||
|
*
|
||
|
* @version 1.7.1
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
@license
|
||
|
sprintf.js from the php.js project - https://github.com/kvz/phpjs
|
||
|
Directly from https://github.com/kvz/phpjs/blob/master/functions/strings/sprintf.js
|
||
|
|
||
|
php.js is copyright 2012 Kevin van Zonneveld.
|
||
|
|
||
|
Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
|
||
|
(http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
|
||
|
(http://getsprink.com), Waldo Malqui Silva, Paulo Freitas, Jack, Jonas
|
||
|
Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Legaev
|
||
|
Andrey, Ates Goral (http://magnetiq.com), Alex, Ratheous, Martijn Wieringa,
|
||
|
Rafa? Kukawski (http://blog.kukawski.pl), lmeyrick
|
||
|
(https://sourceforge.net/projects/bcmath-js/), Nate, Philippe Baumann,
|
||
|
Enrique Gonzalez, Webtoolkit.info (http://www.webtoolkit.info/), Carlos R.
|
||
|
L. Rodrigues (http://www.jsfromhell.com), Ash Searle
|
||
|
(http://hexmen.com/blog/), Jani Hartikainen, travc, Ole Vrijenhoek,
|
||
|
Erkekjetter, Michael Grier, Rafa? Kukawski (http://kukawski.pl), Johnny
|
||
|
Mast (http://www.phpvrouwen.nl), T.Wild, d3x,
|
||
|
http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript,
|
||
|
Rafa? Kukawski (http://blog.kukawski.pl/), stag019, pilus, WebDevHobo
|
||
|
(http://webdevhobo.blogspot.com/), marrtins, GeekFG
|
||
|
(http://geekfg.blogspot.com), Andrea Giammarchi
|
||
|
(http://webreflection.blogspot.com), Arpad Ray (mailto:arpad@php.net),
|
||
|
gorthaur, Paul Smith, Tim de Koning (http://www.kingsquare.nl), Joris, Oleg
|
||
|
Eremeev, Steve Hilder, majak, gettimeofday, KELAN, Josh Fraser
|
||
|
(http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/),
|
||
|
Marc Palau, Martin
|
||
|
(http://www.erlenwiese.de/), Breaking Par Consulting Inc
|
||
|
(http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7),
|
||
|
Chris, Mirek Slugen, saulius, Alfonso Jimenez
|
||
|
(http://www.alfonsojimenez.com), Diplom@t (http://difane.com/), felix,
|
||
|
Mailfaker (http://www.weedem.fr/), Tyler Akins (http://rumkin.com), Caio
|
||
|
Ariede (http://caioariede.com), Robin, Kankrelune
|
||
|
(http://www.webfaktory.info/), Karol Kowalski, Imgen Tata
|
||
|
(http://www.myipdf.com/), mdsjack (http://www.mdsjack.bo.it), Dreamer,
|
||
|
Felix Geisendoerfer (http://www.debuggable.com/felix), Lars Fischer, AJ,
|
||
|
David, Aman Gupta, Michael White, Public Domain
|
||
|
(http://www.json.org/json2.js), Steven Levithan
|
||
|
(http://blog.stevenlevithan.com), Sakimori, Pellentesque Malesuada,
|
||
|
Thunder.m, Dj (http://phpjs.org/functions/htmlentities:425#comment_134018),
|
||
|
Steve Clay, David James, Francois, class_exists, nobbler, T. Wild, Itsacon
|
||
|
(http://www.itsacon.net/), date, Ole Vrijenhoek (http://www.nervous.nl/),
|
||
|
Fox, Raphael (Ao RUDLER), Marco, noname, Mateusz "loonquawl" Zalega, Frank
|
||
|
Forte, Arno, ger, mktime, john (http://www.jd-tech.net), Nick Kolosov
|
||
|
(http://sammy.ru), marc andreu, Scott Cariss, Douglas Crockford
|
||
|
(http://javascript.crockford.com), madipta, Slawomir Kaniecki,
|
||
|
ReverseSyntax, Nathan, Alex Wilson, kenneth, Bayron Guevara, Adam Wallner
|
||
|
(http://web2.bitbaro.hu/), paulo kuong, jmweb, Lincoln Ramsay, djmix,
|
||
|
Pyerre, Jon Hohle, Thiago Mata (http://thiagomata.blog.com), lmeyrick
|
||
|
(https://sourceforge.net/projects/bcmath-js/this.), Linuxworld, duncan,
|
||
|
Gilbert, Sanjoy Roy, Shingo, sankai, Oskar Larsson H?gfeldt
|
||
|
(http://oskar-lh.name/), Denny Wardhana, 0m3r, Everlasto, Subhasis Deb,
|
||
|
josh, jd, Pier Paolo Ramon (http://www.mastersoup.com/), P, merabi, Soren
|
||
|
Hansen, Eugene Bulkin (http://doubleaw.com/), Der Simon
|
||
|
(http://innerdom.sourceforge.net/), echo is bad, Ozh, XoraX
|
||
|
(http://www.xorax.info), EdorFaus, JB, J A R, Marc Jansen, Francesco, LH,
|
||
|
Stoyan Kyosev (http://www.svest.org/), nord_ua, omid
|
||
|
(http://phpjs.org/functions/380:380#comment_137122), Brad Touesnard, MeEtc
|
||
|
(http://yass.meetcweb.com), Peter-Paul Koch
|
||
|
(http://www.quirksmode.org/js/beat.html), Olivier Louvignes
|
||
|
(http://mg-crea.com/), T0bsn, Tim Wiel, Bryan Elliott, Jalal Berrami,
|
||
|
Martin, JT, David Randall, Thomas Beaucourt (http://www.webapp.fr), taith,
|
||
|
vlado houba, Pierre-Luc Paour, Kristof Coomans (SCK-CEN Belgian Nucleair
|
||
|
Research Centre), Martin Pool, Kirk Strobeck, Rick Waldron, Brant Messenger
|
||
|
(http://www.brantmessenger.com/), Devan Penner-Woelk, Saulo Vallory, Wagner
|
||
|
B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong
|
||
|
(http://carrot.org/), Christoph, Daniel Esteban, strftime, Mick@el, rezna,
|
||
|
Simon Willison (http://simonwillison.net), Anton Ongson, Gabriel Paderni,
|
||
|
Marco van Oort, penutbutterjelly, Philipp Lenssen, Bjorn Roesbeke
|
||
|
(http://www.bjornroesbeke.be/), Bug?, Eric Nagel, Tomasz Wesolowski,
|
||
|
Evertjan Garretsen, Bobby Drake, Blues (http://tech.bluesmoon.info/), Luke
|
||
|
Godfrey, Pul, uestla, Alan C, Ulrich, Rafal Kukawski, Yves Sucaet,
|
||
|
sowberry, Norman "zEh" Fuchs, hitwork, Zahlii, johnrembo, Nick Callen,
|
||
|
Steven Levithan (stevenlevithan.com), ejsanders, Scott Baker, Brian Tafoya
|
||
|
(http://www.premasolutions.com/), Philippe Jausions
|
||
|
(http://pear.php.net/user/jausions), Aidan Lister
|
||
|
(http://aidanlister.com/), Rob, e-mike, HKM, ChaosNo1, metjay, strcasecmp,
|
||
|
strcmp, Taras Bogach, jpfle, Alexander Ermolaev
|
||
|
(http://snippets.dzone.com/user/AlexanderErmolaev), DxGx, kilops, Orlando,
|
||
|
dptr1988, Le Torbi, James (http://www.james-bell.co.uk/), Pedro Tainha
|
||
|
(http://www.pedrotainha.com), James, Arnout Kazemier
|
||
|
(http://www.3rd-Eden.com), Chris McMacken, gabriel paderni, Yannoo,
|
||
|
FGFEmperor, baris ozdil, Tod Gentille, Greg Frazier, jakes, 3D-GRAF, Allan
|
||
|
Jensen (http://www.winternet.no), Howard Yeend, Benjamin Lupton, davook,
|
||
|
daniel airton wermann (http://wermann.com.br), Atli T¨®r, Maximusya, Ryan
|
||
|
W Tenney (http://ryan.10e.us), Alexander M Beedie, fearphage
|
||
|
(http://http/my.opera.com/fearphage/), Nathan Sepulveda, Victor, Matteo,
|
||
|
Billy, stensi, Cord, Manish, T.J. Leahy, Riddler
|
||
|
(http://www.frontierwebdev.com/), Rafa? Kukawski, FremyCompany, Matt
|
||
|
Bradley, Tim de Koning, Luis Salazar (http://www.freaky-media.com/), Diogo
|
||
|
Resende, Rival, Andrej Pavlovic, Garagoth, Le Torbi
|
||
|
(http://www.letorbi.de/), Dino, Josep Sanz (http://www.ws3.es/), rem,
|
||
|
Russell Walker (http://www.nbill.co.uk/), Jamie Beck
|
||
|
(http://www.terabit.ca/), setcookie, Michael, YUI Library:
|
||
|
http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at
|
||
|
http://hacks.bluesmoon.info/strftime/strftime.js, Ben
|
||
|
(http://benblume.co.uk/), DtTvB
|
||
|
(http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, William,
|
||
|
meo, incidence, Cagri Ekin, Amirouche, Amir Habibi
|
||
|
(http://www.residence-mixte.com/), Luke Smith (http://lucassmith.name),
|
||
|
Kheang Hok Chin (http://www.distantia.ca/), Jay Klehr, Lorenzo Pisani,
|
||
|
Tony, Yen-Wei Liu, Greenseed, mk.keck, Leslie Hoare, dude, booeyOH, Ben
|
||
|
Bryan
|
||
|
|
||
|
Licensed under the MIT (MIT-LICENSE.txt) license.
|
||
|
|
||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||
|
copy of this software and associated documentation files (the
|
||
|
"Software"), to deal in the Software without restriction, including
|
||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||
|
permit persons to whom the Software is furnished to do so, subject to
|
||
|
the following conditions:
|
||
|
|
||
|
The above copyright notice and this permission notice shall be included
|
||
|
in all copies or substantial portions of the Software.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||
|
IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES
|
||
|
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* @license
|
||
|
*
|
||
|
* Grauw URI utilities
|
||
|
*
|
||
|
* See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js
|
||
|
*
|
||
|
* @author Laurens Holst (http://www.grauw.nl/)
|
||
|
*
|
||
|
* Copyright 2012 Laurens Holst
|
||
|
*
|
||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(n,i){if(!e(i))throw new t(r(n))},i.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},i.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},i.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},i.typeOf.number.lessThan=function(e,r,n){if(i.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},i.typeOf.number.lessThanOrEquals=function(e,r,n){if(i.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},i.typeOf.number.greaterThan=function(e,r,n){if(i.typeOf.number(e,r),n>=r)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},i.typeOf.number.greaterThanOrEquals=function(e,r,n){if(i.typeOf.number(e,r),n>r)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},i.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},i.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},i.typeOf.number.equals=function(e,r,n,a){if(i.typeOf.number(e,n),i.typeOf.number(r,a),n!==a)throw new t(e+" must be equal to "+r+", the actual values are "+n+" and "+a)},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e&&null!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("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<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>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<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var i={};i.Radious=6378137,i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14
|
||
|
return n.x=i,n.y=a,n.z=o,n},s.setRow=function(e,r,n,i){return t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,2),t.typeOf.object("cartesian",n),t.typeOf.object("result",i),i=s.clone(e,i),i[r]=n.x,i[r+3]=n.y,i[r+6]=n.z,i};var d=new e;s.getScale=function(r,n){return t.typeOf.object("matrix",r),t.typeOf.object("result",n),n.x=e.magnitude(e.fromElements(r[0],r[1],r[2],d)),n.y=e.magnitude(e.fromElements(r[3],r[4],r[5],d)),n.z=e.magnitude(e.fromElements(r[6],r[7],r[8],d)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,r,n){t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n);var i=e[0]*r[0]+e[3]*r[1]+e[6]*r[2],a=e[1]*r[0]+e[4]*r[1]+e[7]*r[2],o=e[2]*r[0]+e[5]*r[1]+e[8]*r[2],u=e[0]*r[3]+e[3]*r[4]+e[6]*r[5],s=e[1]*r[3]+e[4]*r[4]+e[7]*r[5],c=e[2]*r[3]+e[5]*r[4]+e[8]*r[5],l=e[0]*r[6]+e[3]*r[7]+e[6]*r[8],f=e[1]*r[6]+e[4]*r[7]+e[7]*r[8],d=e[2]*r[6]+e[5]*r[7]+e[8]*r[8];return n[0]=i,n[1]=a,n[2]=o,n[3]=u,n[4]=s,n[5]=c,n[6]=l,n[7]=f,n[8]=d,n},s.add=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n[0]=e[0]+r[0],n[1]=e[1]+r[1],n[2]=e[2]+r[2],n[3]=e[3]+r[3],n[4]=e[4]+r[4],n[5]=e[5]+r[5],n[6]=e[6]+r[6],n[7]=e[7]+r[7],n[8]=e[8]+r[8],n},s.subtract=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],n[3]=e[3]-r[3],n[4]=e[4]-r[4],n[5]=e[5]-r[5],n[6]=e[6]-r[6],n[7]=e[7]-r[7],n[8]=e[8]-r[8],n},s.multiplyByVector=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.object("cartesian",r),t.typeOf.object("result",n);var i=r.x,a=r.y,o=r.z,u=e[0]*i+e[3]*a+e[6]*o,s=e[1]*i+e[4]*a+e[7]*o,c=e[2]*i+e[5]*a+e[8]*o;return n.x=u,n.y=s,n.z=c,n},s.multiplyByScalar=function(e,r,n){return t.typeOf.object("matrix",e),t.typeOf.number("scalar",r),t.typeOf.object("result",n),n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n},s.multiplyByScale=function(e,r,n){return t.typeOf.object("matrix",e),t.typeOf.object("scale",r),t.typeOf.object("result",n),n[0]=e[0]*r.x,n[1]=e[1]*r.x,n[2]=e[2]*r.x,n[3]=e[3]*r.y,n[4]=e[4]*r.y,n[5]=e[5]*r.y,n[6]=e[6]*r.z,n[7]=e[7]*r.z,n[8]=e[8]*r.z,n},s.negate=function(e,r){return t.typeOf.object("matrix",e),t.typeOf.object("result",r),r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r[4]=-e[4],r[5]=-e[5],r[6]=-e[6],r[7]=-e[7],r[8]=-e[8],r},s.transpose=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],i=e[3],a=e[6],o=e[1],u=e[4],s=e[7],c=e[2],l=e[5],f=e[8];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r};var p=[1,0,0],m=[2,2,1],y=new s,E=new s;return s.computeEigenDecomposition=function(e,r){t.typeOf.object("matrix",e);var i=u.EPSILON20,a=10,o=0,d=0;n(r)||(r={});for(var h=r.unitary=s.clone(s.IDENTITY,r.unitary),p=r.diagonal=s.clone(e,r.diagonal),m=i*c(p);a>d&&l(p)>m;)f(p,y),s.transpose(y,E),s.multiply(p,y,p),s.multiply(E,p,p),s.multiply(h,y,h),++o>2&&(++d,o=0);return r},s.abs=function(e,r){return t.typeOf.object("matrix",e),t.typeOf.object("result",r),r[0]=Math.abs(e[0]),r[1]=Math.abs(e[1]),r[2]=Math.abs(e[2]),r[3]=Math.abs(e[3]),r[4]=Math.abs(e[4]),r[5]=Math.abs(e[5]),r[6]=Math.abs(e[6]),r[7]=Math.abs(e[7]),r[8]=Math.abs(e[8]),r},s.determinant=function(e){t.typeOf.object("matrix",e);var r=e[0],n=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return r*(o*l-c*u)+a*(c*i-n*l)+s*(n*u-o*i)},s.inverse=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],i=e[1],o=e[2],c=e[3],l=e[4],f=e[5],d=e[6],h=e[7],p=e[8],m=s.determinant(e);if(Math.abs(m)<=u.EPSILON15)throw new a("matrix is not invertible");r[0]=l*p-h*f,r[1]=h*o-i*p,r[2]=i*f-l*o,r[3]=d*f-c*p,r[4]=n*p-d*o,r[5]=c*o-n*f,r[6]=c*h-d*l,r[7]=d*i-n*h,r[8]=n*l-c*i;var y=1/m;return s.multiplyByScalar(r,y,r)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===
|
||
|
return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,r){return t.typeOf.number("epsilon",r),n(e)&&Math.abs(this.west-e.west)<=r&&Math.abs(this.south-e.south)<=r&&Math.abs(this.east-e.east)<=r&&Math.abs(this.north-e.north)<=r},s.validate=function(e){t.typeOf.object("rectangle",e);var r=e.north;t.typeOf.number.greaterThanOrEquals("north",r,-u.PI_OVER_TWO),t.typeOf.number.lessThanOrEquals("north",r,u.PI_OVER_TWO);var n=e.south;t.typeOf.number.greaterThanOrEquals("south",n,-u.PI_OVER_TWO),t.typeOf.number.lessThanOrEquals("south",n,u.PI_OVER_TWO);var i=e.west;t.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),t.typeOf.number.lessThanOrEquals("west",i,Math.PI);var a=e.east;t.typeOf.number.greaterThanOrEquals("east",a,-Math.PI),t.typeOf.number.lessThanOrEquals("east",a,Math.PI)},s.southwest=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.west,i.latitude=r.south,i.height=0,i):new e(r.west,r.south)},s.northwest=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.west,i.latitude=r.north,i.height=0,i):new e(r.west,r.north)},s.northeast=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.east,i.latitude=r.north,i.height=0,i):new e(r.east,r.north)},s.southeast=function(r,i){return t.typeOf.object("rectangle",r),n(i)?(i.longitude=r.east,i.latitude=r.south,i.height=0,i):new e(r.east,r.south)},s.center=function(r,i){t.typeOf.object("rectangle",r);var a=r.east,o=r.west;o>a&&(a+=u.TWO_PI);var s=u.negativePiToPi(.5*(o+a)),c=.5*(r.south+r.north);return n(i)?(i.longitude=s,i.latitude=c,i.height=0,i):new e(s,c)},s.intersection=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var a=e.east,o=e.west,c=r.east,l=r.west;o>a&&c>0?a+=u.TWO_PI:l>c&&a>0&&(c+=u.TWO_PI),o>a&&0>l?l+=u.TWO_PI:l>c&&0>o&&(o+=u.TWO_PI);var f=u.negativePiToPi(Math.max(o,l)),d=u.negativePiToPi(Math.min(a,c));if(!((e.west<e.east||r.west<r.east)&&f>=d)){var h=Math.max(e.south,r.south),p=Math.min(e.north,r.north);if(!(h>=p))return n(i)?(i.west=f,i.south=h,i.east=d,i.north=p,i):new s(f,h,d,p)}},s.simpleIntersection=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var a=Math.max(e.west,r.west),o=Math.max(e.south,r.south),u=Math.min(e.east,r.east),c=Math.min(e.north,r.north);return o>=c||a>=u?void 0:n(i)?(i.west=a,i.south=o,i.east=u,i.north=c,i):new s(a,o,u,c)},s.union=function(e,r,i){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r),n(i)||(i=new s);var a=e.east,o=e.west,c=r.east,l=r.west;o>a&&c>0?a+=u.TWO_PI:l>c&&a>0&&(c+=u.TWO_PI),o>a&&0>l?l+=u.TWO_PI:l>c&&0>o&&(o+=u.TWO_PI);var f=u.convertLongitudeRange(Math.min(o,l)),d=u.convertLongitudeRange(Math.max(a,c));return i.west=f,i.south=Math.min(e.south,r.south),i.east=d,i.north=Math.max(e.north,r.north),i},s.expand=function(e,r,i){return t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",r),n(i)||(i=new s),i.west=Math.min(e.west,r.longitude),i.south=Math.min(e.south,r.latitude),i.east=Math.max(e.east,r.longitude),i.north=Math.max(e.north,r.latitude),i},s.contains=function(e,r){t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",r);var n=r.longitude,i=r.latitude,a=e.west,o=e.east;return a>o&&(o+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(o>n||u.equalsEpsilon(n,o,u.EPSILON14))&&i>=e.south&&i<=e.north};var c=new e;return s.subsample=function(e,i,o,l){t.typeOf.object("rectangle",e),i=r(i,a.WGS84),o=r(o,0),n(l)||(l=[]);var f=0,d=e.north,h=e.south,p=e.east,m=e.west,y=c;y.height=o,y.longitude=m,y.latitude=d,l[f]=i.cartographicToCartesian(y,l[f]),f++,y.longitude=p,l[f]=i.cartographicToCartesian(y,l[f]),f++,y.latitude=h,l[f]=i.cartographicToCartesian(y,l[f]),f++,y.longitude=m,l[f]=i.cartographicToCartesian(y,l[f]),f++,0>d?y.latitude=d:h>0?y.latitude=h:y.latitude=0;for(var E=1;8>E;++E)y.longitude=-Math.PI+E*u.PI_OVER_TWO,s.contains(e,y)&&(l[f]=i.cartographicToCartesian(y,l[f]),f++);return 0===y.latitude&&(y.longitude=
|
||
|
var o,u,s,c,l,f=r.oneOverRadii,d=e.multiplyComponents(f,t.origin,S),h=e.multiplyComponents(f,t.direction,A),p=e.magnitudeSquared(d),m=e.dot(d,h);if(p>1){if(m>=0)return;var y=m*m;if(o=p-1,u=e.magnitudeSquared(h),s=u*o,s>y)return;if(y>s){c=m*m-s,l=-m+Math.sqrt(c);var E=l/u,O=o/l;return O>E?new a(E,O):{start:O,stop:E}}var _=Math.sqrt(o/u);return new a(_,_)}return 1>p?(o=p-1,u=e.magnitudeSquared(h),s=u*o,c=m*m-s,l=-m+Math.sqrt(c),new a(0,l/u)):0>m?(u=e.magnitudeSquared(h),new a(0,-m/u)):void 0};var v=new e,b=new e,N=new e,M=new e,I=new e,x=new u,C=new u,P=new u,U=new u,D=new u,q=new u,L=new u,F=new e,B=new e,j=new t;m.grazingAltitudeLocation=function(t,r){if(!n(t))throw new i("ray is required.");if(!n(r))throw new i("ellipsoid is required.");var a=t.origin,s=t.direction;if(!e.equals(a,e.ZERO)){var c=r.geodeticSurfaceNormal(a,v);if(e.dot(s,c)>=0)return a}var l=n(this.rayEllipsoid(t,r)),f=r.transformPositionToScaledSpace(s,v),d=e.normalize(f,f),h=e.mostOrthogonalAxis(f,M),m=e.normalize(e.cross(h,d,b),b),y=e.normalize(e.cross(d,m,N),N),E=x;E[0]=d.x,E[1]=d.y,E[2]=d.z,E[3]=m.x,E[4]=m.y,E[5]=m.z,E[6]=y.x,E[7]=y.y,E[8]=y.z;var O=u.transpose(E,C),_=u.fromScale(r.radii,P),T=u.fromScale(r.oneOverRadii,U),w=D;w[0]=0,w[1]=-s.z,w[2]=s.y,w[3]=s.z,w[4]=0,w[5]=-s.x,w[6]=-s.y,w[7]=s.x,w[8]=0;var R,g,S=u.multiply(u.multiply(O,T,q),w,q),A=u.multiply(u.multiply(S,_,L),E,L),z=u.multiplyByVector(S,a,I),G=p(A,e.negate(z,v),0,0,1),W=G.length;if(W>0){for(var V=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,H=0;W>H;++H){R=u.multiplyByVector(_,u.multiplyByVector(E,G[H],F),F);var Y=e.normalize(e.subtract(R,a,M),M),k=e.dot(Y,s);k>X&&(X=k,V=e.clone(R,V))}var Z=r.cartesianToCartographic(V,j);return X=o.clamp(X,0,1),g=e.magnitude(e.subtract(V,a,M))*Math.sqrt(1-X*X),g=l?-g:g,Z.height=g,r.cartographicToCartesian(Z,new e)}};var z=new e;return m.lineSegmentPlane=function(t,r,a,u){if(!n(t))throw new i("endPoint0 is required.");if(!n(r))throw new i("endPoint1 is required.");if(!n(a))throw new i("plane is required.");n(u)||(u=new e);var s=e.subtract(r,t,z),c=a.normal,l=e.dot(c,s);if(!(Math.abs(l)<o.EPSILON6)){var f=e.dot(c,t),d=-(a.distance+f)/l;if(!(0>d||d>1))return e.multiplyByScalar(s,d,u),e.add(t,u,u),u}},m.trianglePlaneIntersection=function(t,r,a,o){if(!(n(t)&&n(r)&&n(a)&&n(o)))throw new i("p0, p1, p2, and plane are required.");var u=o.normal,s=o.distance,c=e.dot(u,t)+s<0,l=e.dot(u,r)+s<0,f=e.dot(u,a)+s<0,d=0;d+=c?1:0,d+=l?1:0,d+=f?1:0;var h,p;if((1===d||2===d)&&(h=new e,p=new e),1===d){if(c)return m.lineSegmentPlane(t,r,o,h),m.lineSegmentPlane(t,a,o,p),{positions:[t,r,a,h,p],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(r,a,o,h),m.lineSegmentPlane(r,t,o,p),{positions:[t,r,a,h,p],indices:[1,3,4,2,0,4,2,4,3]};if(f)return m.lineSegmentPlane(a,t,o,h),m.lineSegmentPlane(a,r,o,p),{positions:[t,r,a,h,p],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===d){if(!c)return m.lineSegmentPlane(r,t,o,h),m.lineSegmentPlane(a,t,o,p),{positions:[t,r,a,h,p],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(a,r,o,h),m.lineSegmentPlane(t,r,o,p),{positions:[t,r,a,h,p],indices:[2,0,4,2,4,3,1,3,4]};if(!f)return m.lineSegmentPlane(t,a,o,h),m.lineSegmentPlane(r,a,o,p),{positions:[t,r,a,h,p],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i){"use strict";function a(n,a){if(!t(n))throw new r("normal is required.");if(!i.equalsEpsilon(e.magnitude(n),1,i.EPSILON6))throw new r("normal must be normalized.");if(!t(a))throw new r("distance is required.");this.normal=e.clone(n),this.distance=a}a.fromPointNormal=function(n,o,u){if(!t(n))throw new r("point is required.");if(!t(o))throw new r("normal is required.");if(!i.equalsEpsilon(e.magnitude(o),1,i.EPSILON6))throw new r("normal must be normalized.");var s=-e.dot(o,n);return t(u)?(e.clone(o,u.normal),u.distance=s,u):new a(o,s)};var o=new e;return a.fromCartesian4=function(n,u){if(!t(n))throw new r("coefficients is required.");var s=e.fromCartesian4(n,o),c=n.w;if(!i.equalsEpsilon(e.magnitude(s),1,i.EPSILON6))throw new r("normal mu
|
||
|
}function d(e,t){for(var r=f(e,t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a<r.length;a++)i[a]=r.charCodeAt(a);return n}function h(e,t){t=r(t,"");var n=e[1],a=!!e[2],o=e[3];switch(t){case"":case"text":return f(a,o);case"arraybuffer":return d(a,o);case"blob":var u=d(a,o);return new Blob([u],{type:n});case"document":var s=new DOMParser;return s.parseFromString(f(a,o),n);case"json":return JSON.parse(f(a,o));default:throw new i("Unhandled responseType: "+t)}}var p=/^data:(.*?)(;base64)?,(.*)$/;return l.load=function(e,t,r,i,a,u,l){var f=p.exec(e);if(null!==f)return void u.resolve(h(f,t));var d=new XMLHttpRequest;if(c.contains(e)&&(d.withCredentials=!0),n(l)&&n(d.overrideMimeType)&&d.overrideMimeType(l),d.open(r,e,!0),n(a))for(var m in a)a.hasOwnProperty(m)&&d.setRequestHeader(m,a[m]);n(t)&&(d.responseType=t);var y=!1;return"string"==typeof e&&(y=0===e.indexOf("file://")),d.onload=function(){if((d.status<200||d.status>=300)&&(!y||0!==d.status))return void u.reject(new o(d.status,d.response,d.getAllResponseHeaders()));var e=d.response,r=d.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{u.resolve(JSON.parse(e))}catch(i){u.reject(i)}else(""===r||"document"===r)&&n(d.responseXML)&&d.responseXML.hasChildNodes()?u.resolve(d.responseXML):""!==r&&"text"!==r||!n(d.responseText)?u.reject(new s("Invalid XMLHttpRequest response type.")):u.resolve(d.responseText);else u.resolve(e)},d.onerror=function(e){u.reject(new o)},d.send(i),d},l.defaultLoad=l.load,l}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r,n){return e({url:t,headers:r,request:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function i(i,o,u){if(!t(i))throw new r("url is required.");t(o)?t(o.Accept)||(o=e(o),o.Accept=a.Accept):o=a;var s=n(i,o,u);if(t(s))return s.then(function(e){return JSON.parse(e)})}var a={Accept:"application/json,*/*;q=0.01"};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,i,a,o,u,s,c,l,f){"use strict";function d(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))p(this,t.data);else if(n(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){p(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function p(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var i=r.columnNames.indexOf("modifiedJulianDateUtc"),a=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),d=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(0>i||0>a||0>s||0>c||0>d||0>p||0>m)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffse
|
||
|
"use strict";function p(e,t){if(!a(e))throw new u("origin is required.");if(t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e),!a(e))throw new u("origin must not be at the center of the ellipsoid.");var n=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(l.getColumn(n,0,m)),this._yAxis=r.fromCartesian4(l.getColumn(n,1,m));var o=r.fromCartesian4(l.getColumn(n,2,m));this._plane=f.fromPointNormal(e,o)}var m=new n;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var y=new e;p.fromPoints=function(t,r){if(!a(t))throw new u("cartesians is required.");var n=e.fromPoints(t,y);return new p(n.center,r)};var E=new d,O=new r;p.prototype.projectPointOntoPlane=function(e,n){if(!a(e))throw new u("cartesian is required.");var i=E;i.origin=e,r.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,O);if(a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,O)),a(o)){var s=r.subtract(o,this._origin,o),l=r.dot(this._xAxis,s),f=r.dot(this._yAxis,s);return a(n)?(n.x=l,n.y=f,n):new t(l,f)}},p.prototype.projectPointsOntoPlane=function(e,t){if(!a(e))throw new u("cartesians is required.");a(t)||(t=[]);for(var r=0,n=e.length,i=0;n>i;i++){var o=this.projectPointOntoPlane(e[i],t[r]);a(o)&&(t[r]=o,r++)}return t.length=r,t},p.prototype.projectPointToNearestOnPlane=function(e,n){if(!a(e))throw new u("cartesian is required.");a(n)||(n=new t);var i=E;i.origin=e,r.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,O);a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,O));var s=r.subtract(o,this._origin,o),l=r.dot(this._xAxis,s),f=r.dot(this._yAxis,s);return n.x=l,n.y=f,n},p.prototype.projectPointsToNearestOnPlane=function(e,t){if(!a(e))throw new u("cartesians is required.");a(t)||(t=[]);var r=e.length;t.length=r;for(var n=0;r>n;n++)t[n]=this.projectPointToNearestOnPlane(e[n],t[n]);return t};var _=new r;return p.prototype.projectPointsOntoEllipsoid=function(e,t){if(!a(e))throw new u("cartesians is required.");var n=e.length;a(t)?t.length=n:t=new Array(n);for(var i=this._ellipsoid,o=this._origin,s=this._xAxis,c=this._yAxis,l=_,f=0;n>f;++f){var d=e[f];r.multiplyByScalar(s,d.x,l),a(t[f])||(t[f]=new r);var h=r.add(o,l,t[f]);r.multiplyByScalar(c,d.y,l),r.add(h,l,h),i.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,r,n,i,a,o,u,s,c,l,f,d,h,p){"use strict";function m(e,t){this.center=r.clone(i(e,r.ZERO)),this.halfAxes=d.clone(i(t,d.ZERO))}function y(e,t,n,i,u,s,c,l){if(!(a(t)&&a(n)&&a(i)&&a(u)&&a(s)&&a(c)))throw new o("all extents (minimum/maximum X/Y/Z) are required.");a(l)||(l=new m);var f=l.halfAxes;d.setColumn(f,0,e.xAxis,f),d.setColumn(f,1,e.yAxis,f),d.setColumn(f,2,e.zAxis,f);var h=A;h.x=(t+n)/2,h.y=(i+u)/2,h.z=(s+c)/2;var p=v;p.x=(n-t)/2,p.y=(u-i)/2,p.z=(c-s)/2;var y=l.center;return h=d.multiplyByVector(f,h,h),r.add(e.origin,h,y),d.multiplyByScale(f,p,f),l}var E=new r,O=new r,_=new r,T=new r,w=new r,R=new r,g=new d,S={unitary:new d,diagonal:new d};m.fromPoints=function(e,t){if(a(t)||(t=new m),!a(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=r.ZERO,t;var n,i=e.length,o=r.clone(e[0],E);for(n=1;i>n;n++)r.add(o,e[n],o);var u=1/i;r.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,h=0,p=0,y=0;for(n=0;i>n;n++)s=r.subtract(e[n],o,O),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,h+=s.y*s.y,p+=s.y*s.z,y+=s.z*s.z;c*=u,l*=u,f*=u,h*=u,p*=u,y*=u;var A=g;A[0]=c,A[1]=l,A[2]=f,A[3]=l,A[4]=h,A[5]=p,A[6]=f,A[7]=p,A[8]=y;var v=d.computeEigenDecomposition(A,S),b=d.clone(v.unitary,t.halfAxes),N=d.getColumn(b,0,T),M=d.getColumn(b,1,w),I=d.getColumn(b,2,R),x=-Number.MAX_VALUE,C=-Number.MAX_VALUE,P=-Number
|
||
|
componentDatatype:r,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?y:E},c.clone=function(e,t){return a(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=r.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,i,a,o,u){"use strict";function s(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,r){var i=this._semimajorAxis,a=t.longitude*i,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*i,u=t.height;return n(r)?(r.x=a,r.y=o,r.z=u,r):new e(a,o,u)},s.prototype.unproject=function(e,r){if(!n(e))throw new a("cartesian is required");var i=this._oneOverSemimajorAxis,o=e.x*i,u=s.mercatorAngleToGeodeticLatitude(e.y*i),c=e.z;return n(r)?(r.longitude=o,r.latitude=u,r.height=c,r):new t(o,u,c)},s}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,i=t.message;r=e(n)&&e(i)?n+": "+i:t.toString();var a=t.stack;return e(a)&&(r+="\n"+a),r}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function n(n){var i,a=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;a.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=n(s.parameters,a)}catch(c){c instanceof Error?o.error={name:c.name,message:c.message,stack:c.stack}:o.error=c}t(i)||(i=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(a.length=0);try{i(o,a)}catch(c){o.result=void 0,o.error="postMessage failed with error: "+r(c)+"\n with responseMessage: "+JSON.stringify(o),i(o)}}}return n}),define("Workers/createVerticesFromGoogleEarthEnterpriseBuffer",["../Core/AxisAlignedBoundingBox","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/Ellipsoid","../Core/EllipsoidalOccluder","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/Rectangle","../Core/RuntimeError","../Core/TerrainEncoding","../Core/Transforms","../Core/WebMercatorProjection","./createTaskProcessorWorker"],function(e,t,r,n,i,a,o,u,s,c,l,f,d,h,p,m,y,E){"use strict";function O(e,t,r){r=a(r,c);for(var n=e.length,i=0;n>i;++i)if(r.equalsEpsilon(e[i],t,c.EPSILON12))return i;return-1}function _(e,t){e.ellipsoid=u.clone(e.ellipsoid),e.rectangle=d.clone(e.rectangle);var r=T(e.buffer,e.relativeToCenter,e.ellipsoid,e.rectangle,e.nativeRectangle,e.exaggeration,e.skirtHeight,e.includeWebMercatorT,e.negativeAltitudeExponentBias,e.negativeElevationThreshold),n=r.vertices;t.push(n.buffer);var i=r.indices;return t.push(i.buffer),{vertices:n.buffer,indices:i.buffer,numberOfAttributes:r.encoding.getStride(),minimumHeight:r.minimumHeight,maximumHeight:r.maximumHeight,boundingSphere3D:r.boundingSphere3D,orientedBoundingBox:r.orientedBoundingBox,occludeePointInScaledSpace:r.occludeePointInScaledSpace,encoding:r.encoding,vertexCountWithoutSkirts:r.vertexCountWithoutSkirts,skirtIndex:r.skirtIndex}}function T(a,u,d,E,_,T,C,P,U,D){var q,L,F,B,j,z;o(E)?(q=E.west,L=E.south,F=E.east,B=E.north,j=E.width,z=E.height):(q=c.toRadians(_.west),L=c.toRadians(_.south),F=c.toRadians(_.east),B=c.toRadians(_.north),j
|