232 lines
249 KiB
JavaScript
232 lines
249 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
|
||
|
c=Math.min(c,E.longitude),l=Math.max(l,E.longitude),d=Math.min(d,E.latitude),p=Math.max(p,E.latitude);var O=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;f=Math.min(f,O),h=Math.max(h,O)}return l-c>h-f&&(c=f,l=h,l>u.PI&&(l-=u.TWO_PI),c>u.PI&&(c-=u.TWO_PI)),n(o)?(o.west=c,o.south=d,o.east=l,o.north=p,o):new s(c,d,l,p)},s.clone=function(e,t){return n(e)?n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){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)),h=u.negativePiToPi(Math.min(a,c));if(!((e.west<e.east||r.west<r.east)&&f>=h)){var d=Math.max(e.south,r.south),p=Math.min(e.north,r.north);if(!(d>=p))return n(i)?(i.west=f,i.south=d,i.east=h,i.north=p,i):new s(f,d,h,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)),h=u.convertLongitudeRange(Math.max(a,c));return i.west=f,i.south=Math.min(e.south,r.south),i.east=h,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("
|
||
|
n};var y=new e;l.getMaximumScale=function(t){return l.getScale(t,y),e.maximumComponent(y)},l.multiply=function(e,t,n){r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n);var i=e[0],a=e[1],o=e[2],u=e[3],s=e[4],c=e[5],l=e[6],f=e[7],h=e[8],d=e[9],p=e[10],y=e[11],m=e[12],E=e[13],O=e[14],v=e[15],w=t[0],_=t[1],T=t[2],g=t[3],R=t[4],b=t[5],A=t[6],S=t[7],N=t[8],x=t[9],I=t[10],M=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=i*w+s*_+h*T+m*g,q=a*w+c*_+d*T+E*g,F=o*w+l*_+p*T+O*g,B=u*w+f*_+y*T+v*g,z=i*R+s*b+h*A+m*S,j=a*R+c*b+d*A+E*S,G=o*R+l*b+p*A+O*S,V=u*R+f*b+y*A+v*S,W=i*N+s*x+h*I+m*M,X=a*N+c*x+d*I+E*M,H=o*N+l*x+p*I+O*M,Y=u*N+f*x+y*I+v*M,k=i*C+s*P+h*D+m*L,Z=a*C+c*P+d*D+E*L,K=o*C+l*P+p*D+O*L,J=u*C+f*P+y*D+v*L;return n[0]=U,n[1]=q,n[2]=F,n[3]=B,n[4]=z,n[5]=j,n[6]=G,n[7]=V,n[8]=W,n[9]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=K,n[15]=J,n},l.add=function(e,t,n){return r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n);var i=e[0],a=e[1],o=e[2],u=e[4],s=e[5],c=e[6],l=e[8],f=e[9],h=e[10],d=e[12],p=e[13],y=e[14],m=t[0],E=t[1],O=t[2],v=t[4],w=t[5],_=t[6],T=t[8],g=t[9],R=t[10],b=t[12],A=t[13],S=t[14],N=i*m+u*E+l*O,x=a*m+s*E+f*O,I=o*m+c*E+h*O,M=i*v+u*w+l*_,C=a*v+s*w+f*_,P=o*v+c*w+h*_,D=i*T+u*g+l*R,L=a*T+s*g+f*R,U=o*T+c*g+h*R,q=i*b+u*A+l*S+d,F=a*b+s*A+f*S+p,B=o*b+c*A+h*S+y;return n[0]=N,n[1]=x,n[2]=I,n[3]=0,n[4]=M,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=L,n[10]=U,n[11]=0,n[12]=q,n[13]=F,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("rotation",t),r.typeOf.object("result",n);var i=e[0],a=e[1],o=e[2],u=e[4],s=e[5],c=e[6],l=e[8],f=e[9],h=e[10],d=t[0],p=t[1],y=t[2],m=t[3],E=t[4],O=t[5],v=t[6],w=t[7],_=t[8],T=i*d+u*p+l*y,g=a*d+s*p+f*y,R=o*d+c*p+h*y,b=i*m+u*E+l*O,A=a*m+s*E+f*O,S=o*m+c*E+h*O,N=i*v+u*w+l*_,x=a*v+s*w+f*_,I=o*v+c*w+h*_;return n[0]=T,n[1]=g,n[2]=R,n[3]=0,n[4]=b,n[5]=A,n[6]=S,n[7]=0,n[8]=N,n[9]=x,n[10]=I,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("translation",t),r.typeOf.object("result",n);var i=t.x,a=t.y,o=t.z,u=i*e[0]+a*e[4]+o*e[8]+e[12],s=i*e[1]+a*e[5]+o*e[9]+e[13],c=i*e[2]+a*e[6]+o*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=u,n[13]=s,n[14]=c,n[15]=e[15],n};var m=new e;l.multiplyByUniformScale=function(e,t,n){return r.typeOf.object("matrix",e),r.typeOf.number("scale",t),r.typeOf.object("result",n),m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,n)},l.multiplyByScale=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("scale",t),r.typeOf.object("result",n);var i=t.x,a=t.y,o=t.z;return 1===i&&1===a&&1===o?l.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=o*e[8],n[9]=o*e[9],n[10]=o*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("cartesian",t),r.typeOf.object("result",n);var i=t.x,a=t.y,o=t.z,u=t.w,s=e[0]*i+e[4]*a+e[8]*o+e[12]*u,c=e[1]*i+e[5]*a+e[9]*o+e[13]*u,l=e[2]*i+e[6]*a+e[10]*o+e[14]*u,f=e[3]*i+e[7]*a+e[11]*o+e[15]*u;return n.x=s,n.y=c,n.z=l,n.w=f,n},l.multiplyByPointAsVector=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("cartesian",t)
|
||
|
SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLO
|
||
|
if(3>o)throw new r("cacheSize must be greater than two.");if(!t(a)){a=0;for(var s=0,c=i[s];u>s;)c>a&&(a=c),++s,c=i[s]}for(var l=[],f=0;a+1>f;f++)l[f]=0;for(var h=o+1,d=0;u>d;++d)h-l[i[d]]>o&&(l[i[d]]=h,++h);return(h-o+1)/(u/3)},n.tipsify=function(n){function i(e,t,r,n){for(;t.length>=1;){var i=t[t.length-1];if(t.splice(t.length-1,1),e[i].numLiveTriangles>0)return i}for(;n>o;){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function a(e,t,r,n,a,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var h=r[f];n[h].numLiveTriangles&&(s=0,a-n[h].timeStamp+2*n[h].numLiveTriangles<=t&&(s=a-n[h].timeStamp),(s>l||-1===l)&&(l=s,c=h)),++f}return-1===c?i(n,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var o,u=n.indices,s=n.maximumIndex,c=e(n.cacheSize,24);if(!t(u))throw new r("indices is required.");var l=u.length;if(3>l||l%3!==0)throw new r("indices length must be a multiple of three.");if(0>=s)throw new r("maximumIndex must be greater than zero.");if(3>c)throw new r("cacheSize must be greater than two.");var f=0,h=0,d=u[h],p=l;if(t(s))f=s+1;else{for(;p>h;)d>f&&(f=d),++h,d=u[h];if(-1===f)return 0;++f}var y,m=[];for(y=0;f>y;y++)m[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;for(var E=0;p>h;)m[u[h]].vertexTriangles.push(E),++m[u[h]].numLiveTriangles,m[u[h+1]].vertexTriangles.push(E),++m[u[h+1]].numLiveTriangles,m[u[h+2]].vertexTriangles.push(E),++m[u[h+2]].numLiveTriangles,++E,h+=3;var O=0,v=c+1;o=1;var w,_,T=[],g=[],R=0,b=[],A=l/3,S=[];for(y=0;A>y;y++)S[y]=!1;for(var N,x;-1!==O;){T=[],_=m[O],x=_.vertexTriangles.length;for(var I=0;x>I;++I)if(E=_.vertexTriangles[I],!S[E]){S[E]=!0,h=E+E+E;for(var M=0;3>M;++M)N=u[h],T.push(N),g.push(N),b[R]=N,++R,w=m[N],--w.numLiveTriangles,v-w.timeStamp>c&&(w.timeStamp=v,++v),++h}O=a(u,c,T,m,v,g,f)}return b},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,y,m,E,O,v,w,_,T,g,R){"use strict";function b(e,t,r,n,i){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=i,e[t++]=i,e[t]=r}function A(e){for(var t=e.length,r=t/3*6,n=m.createTypedArray(t,r),i=0,a=0;t>a;a+=3,i+=6)b(n,i,e[a],e[a+1],e[a+2]);return n}function S(e){var t=e.length;if(t>=3){var r=6*(t-2),n=m.createTypedArray(t,r);b(n,0,e[0],e[1],e[2]);for(var i=6,a=3;t>a;++a,i+=6)b(n,i,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function N(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=m.createTypedArray(t,r),i=e[0],a=0,o=1;t>o;++o,a+=6)b(n,a,i,e[o],e[o+1]);return n}return new Uint16Array}function x(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new p({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function I(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var i=t[n],a=0;a<i.componentsPerAttribute;++a)e[n].values.push(i.values[r*i.componentsPerAttribute+a])}function M(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;n>a;a+=3)i.unpack(r,a,ae),_.multiplyByPoint(e,ae,ae),i.pack(ae,r,a)}function C(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;n>a;a+=3)i.unpack(r,a,ae),w.multiplyByVector(e,ae,ae),ae=i.normalize(ae,ae),i.pack(ae,r,a)}function P(e,t){var r,n=e.length,i={},a=e[0][t].attributes;for(r in a)if(a.hasOwnProperty(r)&&c(a[r])&&c(a[r].values)){for(var o=a[r],s=o.values.length,l=!0,f=1;n>f;++f){var h=e[f][t].attributes[r];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(i[r]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return i}funct
|
||
|
(h>s||s===h&&n.x>r.x)&&T(n,e)&&(r=n,h=s)),n=n.next;return r}function h(e,t,r,n){var i=e;do null===i.z&&(i.z=p(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,d(i)}function d(e){var t,r,n,i,a,o,u,s,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,u=0,t=0;c>t&&(u++,n=n.nextZ,n);t++);for(s=c;u>0||s>0&&n;)0===u?(i=n,n=n.nextZ,s--):0!==s&&n?r.z<=n.z?(i=r,r=r.nextZ,u--):(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1);return e}function p(e,t,r,n,i){return e=32767*(e-r)/i,t=32767*(t-n)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function y(e){var t=e,r=e;do t.x<r.x&&(r=t),t=t.next;while(t!==e);return r}function m(e,t,r,n,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(n-u)-(r-o)*(t-u)>=0&&(r-o)*(a-u)-(i-o)*(n-u)>=0}function E(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!_(e,t)&&T(e,t)&&T(t,e)&&g(e,t)}function O(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function w(e,t,r,n){return v(e,t)&&v(r,n)||v(e,n)&&v(r,t)?!0:O(e,t,r)>0!=O(e,t,n)>0&&O(r,n,e)>0!=O(r,n,t)>0}function _(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&w(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function T(e,t){return O(e.prev,e,e.next)<0?O(e,t,e.next)>=0&&O(e,e.prev,t)>=0:O(e,t,e.prev)<0||O(e,e.next,t)<0}function g(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function R(e,t){var r=new S(e.i,e.x,e.y),n=new S(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function b(e,t,r,n){var i=new S(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function A(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function S(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function N(e,t,r,n){for(var i=0,a=t,o=r-n;r>a;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,o=Math.abs(N(e,0,a,r));if(i)for(var u=0,s=t.length;s>u;u++){var c=t[u]*r,l=s-1>u?t[u+1]*r:e.length;o-=Math.abs(N(e,c,l,r))}var f=0;for(u=0;u<n.length;u+=3){var h=n[u]*r,d=n[u+1]*r,p=n[u+2]*r;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;t>o;o++)r.vertices.push(e[i][a][o]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h){"use strict";var d=new r,p=new r,y={};y.computeArea2D=function(e){n.defined("positions",e),n.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);for(var t=e.length,r=0,i=t-1,a=0;t>a;i=a++){var o=e[i],u=e[a];r+=o.x*u.y-u.x*o.y}return.5*r},y.computeWindingOrder2D=function(e){var t=y.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},y.triangulate=function(r,i){n.defined("positions",r);var a=t.packArray(r);return e(a,i,2)};var m=new r,E=new r,O=new r,v=new r,w=new r,_=new r,T=new r;return y.computeSubdivision=function(e,t,u,h){h=a(h,l.RADIANS_PER_DEGREE),n.typeOf.object("ellipsoid",e),n.defined("positions",t),n.defined("indices",u),n.typeOf.nu
|
||
|
T.reserve(e)}}}),l.update=function(){var e,t,r=0,n=g.length;for(e=0;n>e;++e)t=g[e],t.cancelled&&E(t),t.state===s.ACTIVE?r>0&&(g[e-r]=t):++r;g.length-=r;var i=T.internalArray,a=T.length;for(e=0;a>e;++e)f(i[e]);T.resort();for(var o=Math.max(l.maximumRequests-g.length,0),u=0;o>u&&T.length>0;)t=T.pop(),t.cancelled?E(t):!t.throttleByServer||h(t.serverKey)?(m(t),++u):E(t);v()},l.getServerKey=function(t){r.typeOf.string("url",t);var i=new e(t).resolve(b);i.normalize();var a=i.authority;/:/.test(a)||(a=a+":"+("https"===i.scheme?"443":"80"));var o=R[a];return n(o)||(R[a]=0),a},l.request=function(e){if(r.typeOf.object("request",e),r.typeOf.string("request.url",e.url),r.typeOf.func("request.requestFunction",e.requestFunction),u(e.url)||o(e.url))return e.state=s.RECEIVED,e.requestFunction();if(++w.numberOfAttemptedRequests,n(e.serverKey)||(e.serverKey=l.getServerKey(e.url)),!l.throttleRequests||!e.throttle)return m(e);if(!(g.length>=l.maximumRequests)&&(!e.throttleByServer||h(e.serverKey))){f(e);var t=T.insert(e);if(n(t)){if(t===e)return;E(t)}return d(e)}},l.clearForSpecs=function(){for(;T.length>0;){var e=T.pop();E(e)}for(var t=g.length,r=0;t>r;++r)E(g[r]);g.length=0,R={},w.numberOfAttemptedRequests=0,w.numberOfActiveRequests=0,w.numberOfCancelledRequests=0,w.numberOfCancelledActiveRequests=0,w.numberOfFailedRequests=0,w.numberOfActiveRequestsEver=0},l.numberOfActiveRequestsByServer=function(e){return R[e]},l.requestHeap=T,l}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var i=n.getAuthority();if(t(i)){if(-1!==i.indexOf("@")){var a=i.split("@");i=a[1]}if(-1===i.indexOf(":")){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)i+=":80";else{if("https"!==o)return;i+=":443"}}return i}}var i={},a={};return i.add=function(e,n){if(!t(e))throw new r("host is required.");if(!t(n)||0>=n)throw new r("port is required to be greater than 0.");var i=e.toLowerCase()+":"+n;t(a[i])||(a[i]=!0)},i.remove=function(e,n){if(!t(e))throw new r("host is required.");if(!t(n)||0>=n)throw new r("port is required to be greater than 0.");var i=e.toLowerCase()+":"+n;t(a[i])&&delete a[i]},i.contains=function(e){if(!t(e))throw new r("url is required.");var i=n(e);return t(i)&&t(a[i])?!0:!1},i.clear=function(){a={}},i}),define("Core/loadWithXhr",["../ThirdParty/when","./Check","./defaultValue","./defined","./DeveloperError","./Request","./RequestErrorEvent","./RequestScheduler","./RuntimeError","./TrustedServers"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(i){i=r(i,r.EMPTY_OBJECT),t.defined("options.url",i.url);var o=i.url,s=i.responseType,c=r(i.method,"GET"),f=i.data,h=i.headers,d=i.overrideMimeType;o=r(o,i.url);var p=n(i.request)?i.request:new a;return p.url=o,p.requestFunction=function(){var t=e.defer(),r=l.load(o,s,c,f,h,t,d);return n(r)&&n(r.abort)&&(p.cancelFunction=function(){r.abort()}),t.promise},u.request(p)}function f(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function h(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 d(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 h(a,o);case"blob":var u=h(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(d(f,t));var h=new XMLHttpRequest;if(c.contains(e)&&(h.withCredentials=!0),n(l)&&n(h.overrideMimeType)&&h.overrideMimeType(l),h.open(r,e,!0),n(a))for(var y in a)a.hasOwnProperty(y)&&h.setRequestHeader(y,a[y]);n(t)&&(h.responseType=t);var m=!1;return"string"==typeof e&&(m=0===e.indexOf("file://")),h.onload=function(){if((h.status<200||h.status>=300)&&(!m||0!==h.status))return void u.reject(new o(h.status,h.response,h.getAllResponseHeaders()));var
|
||
|
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 v=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=v,f=0;n>f;++f){var h=e[f];r.multiplyByScalar(s,h.x,l),a(t[f])||(t[f]=new r);var d=r.add(o,l,t[f]);r.multiplyByScalar(c,h.y,l),r.add(d,l,d),i.scaleToGeocentricSurface(d,d)}return t},p}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Math"],function(e,t,r,n,i,a,o,u){"use strict";function s(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,n=e._ellipsoid.minimumRadius,i=(r-n)/r,a=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-i)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,a),f=s*o,h=f*f,d=1-h,p=Math.sqrt(d),y=t/4,m=y*y,E=m*y,O=m*m,v=1+y-3*m/4+5*E/4-175*O/64,w=1-y+15*m/8-35*E/8,_=1-3*y+35*m/4,T=1-5*y,g=v*l-w*Math.sin(2*l)*y/2-_*Math.sin(4*l)*m/16-T*Math.sin(6*l)*E/48-5*Math.sin(8*l)*O/512,R=e._constants;R.a=r,R.b=n,R.f=i,R.cosineHeading=a,R.sineHeading=o,R.tanU=u,R.cosineU=s,R.sineU=c,R.sigma=l,R.sineAlpha=f,R.sineSquaredAlpha=h,R.cosineSquaredAlpha=d,R.cosineAlpha=p,R.u2Over4=y,R.u4Over16=m,R.u6Over64=E,R.u8Over256=O,R.a0=v,R.a1=w,R.a2=_,R.a3=T,R.distanceRatio=g}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,r,n,i,a,o){var u=c(e,r);return(1-u)*e*t*(n+u*i*(o+u*a*(2*o*o-1)))}function f(e,t,r,n,i,a,o){var s,c,f,h,d,p=(t-r)/t,y=a-n,m=Math.atan((1-p)*Math.tan(i)),E=Math.atan((1-p)*Math.tan(o)),O=Math.cos(m),v=Math.sin(m),w=Math.cos(E),_=Math.sin(E),T=O*w,g=O*_,R=v*_,b=v*w,A=y,S=u.TWO_PI,N=Math.cos(A),x=Math.sin(A);do{N=Math.cos(A),x=Math.sin(A);var I=g-b*N;f=Math.sqrt(w*w*x*x+I*I),c=R+T*N,s=Math.atan2(f,c);var M;0===f?(M=0,h=1):(M=T*x/f,h=1-M*M),S=A,d=c-2*R/h,isNaN(d)&&(d=0),A=y+l(p,M,h,s,f,c,d)}while(Math.abs(A-S)>u.EPSILON12);var C=h*(t*t-r*r)/(r*r),P=1+C*(4096+C*(C*(320-175*C)-768))/16384,D=C*(256+C*(C*(74-47*C)-128))/1024,L=d*d,U=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),q=r*P*(s-U),F=Math.atan2(w*x,g-b*N),B=Math.atan2(O*x,g*N-b);e._distance=q,e._startHeading=F,e._endHeading=B,e._uSquared=C}function h(n,i,a,o){var u=e.normalize(o.cartographicToCartesian(i,y),p),c=e.normalize(o.cartographicToCartesian(a,y),y);r.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(e.angleBetween(u,c))-Math.PI),.0125),f(n,o.maximumRadius,o.minimumRadius,i.longitude,i.latitude,a.longitude,a.latitude),n._start=t.clone(i,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,r,a){var u=n(a,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,i(e)&&i(r)&&h(this,e,r,u)}var p=new e,y=new e;return a(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return r.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return r.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return r.defined("distance",this._distance),this._endHeading}}}),d.prototype.setEndPoints=function(e,t){r.defined("start",e),r.defined("end",t),h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){r.defined("distance",this._distance);var a=this._constants,o=a.distanceRatio+e/a.b,u=Math.cos(2*o),s=Math.cos(4*o),c=Math.cos(6*o),f
|