市北新大屏
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
35 KiB

2 years ago
/**
* 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
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
*/
!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(e){t=e.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 n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i.typeOf.number.equals=function(e,n,r,o){if(i.typeOf.number(e,r),i.typeOf.number(n,o),r!==o)throw new t(e+" must be equal to "+n+", the actual values are "+r+" and "+o)},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.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}),define("Core/decodeGoogleEarthEnterpriseData",["./Check","./RuntimeError"],function(e,t){"use strict";function n(e,o){if(n.passThroughDataForTesting)return o;var a=e.byteLength;if(0===a||a%4!=0)throw new t("The length of key must be greater than 0 and a multiple of 4.");var s=new DataView(o),f=s.getUint32(0,!0);if(f===r||f===i)return o;for(var u,c=new DataView(e),l=0,h=o.byteLength,d=h-h%8,w=a,b=8;l<d;)for(b=(b+8)%24,u=b;l<d&&u<w;)s.setUint32(l,s.getUint32(l,!0)^c.getUint32(u,!0),!0),s.setUint32(l+4,s.getUint32(l+4,!0)^c.getUint32(u+4,!0),!0),l+=8,u+=24;if(l<h)for(u>=w&&(b=(b+8)%24,u=b);l<h;)s.setUint8(l,s.getUint8(l)^c.getUint8(u)),l++,u++}var r=1953029805,i=2917034100;return n.passThroughDataForTesting=!1,n}),define("Core/isBitSet",[],function(){"use strict";function e(e,t){return 0!=(e&t)}return e}),define("Core/GoogleEarthEnterpriseTileInformation",["./defined","./isBitSet"],function(e,t){"use strict";function n(e,t,n,r,i,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=r,this.imageryProvider=i,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}var r=[1,2,4,8];return n.clone=function(t,r){return e(r)?(r._bits=t._bits,r.cnodeVersion=t.cnodeVersion,r.imageryVersion=t.imageryVersion,r.terrainVersion=t.terrainVersion,r.imageryProvider=t.imageryProvider,r.terrainProvider=t.terrainProvider):r=new n(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),r.ancestorHasTerrain=t.ancestorHa
}catch(e){c.result=void 0,c.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(c),a(c)}})}}return o}),define("Workers/decodeGoogleEarthEnterprisePacket",["../Core/decodeGoogleEarthEnterpriseData","../Core/GoogleEarthEnterpriseTileInformation","../Core/RuntimeError","../ThirdParty/pako_inflate","./createTaskProcessorWorker"],function(e,t,n,r,i){"use strict";function o(t,n){var r=h.fromString(t.type),i=t.buffer;e(t.key,i);var o=f(i);i=o.buffer;var u=o.length;switch(r){case h.METADATA:return a(i,u,t.quadKey);case h.TERRAIN:return s(i,u,n);case h.DBROOT:return n.push(i),{buffer:i}}}function a(e,r,i){function o(e,t,n){var r=!1;if(4===n){if(t.hasSubtree())return;r=!0}for(var i=0;i<4;++i){var a=e+i.toString();if(r)B[a]=null;else if(n<4)if(t.hasChild(i)){if(A===b)return void console.log("Incorrect number of instances");var s=k[A++];B[a]=s,o(a,s,n+1)}else B[a]=null}}var a=new DataView(e),s=0,f=a.getUint32(s,!0);if(s+=l,f!==d)throw new n("Invalid magic");var h=a.getUint32(s,!0);if(s+=l,1!==h)throw new n("Invalid data type. Must be 1 for QuadTreePacket");var w=a.getUint32(s,!0);if(s+=l,2!==w)throw new n("Invalid QuadTreePacket version. Only version 2 is supported.");var b=a.getInt32(s,!0);s+=c;var m=a.getInt32(s,!0);if(s+=c,32!==m)throw new n("Invalid instance size.");var g=a.getInt32(s,!0);s+=c;var p=a.getInt32(s,!0);s+=c;var v=a.getInt32(s,!0);if(s+=c,g!==b*m+s)throw new n("Invalid dataBufferOffset");if(g+p+v!==r)throw new n("Invalid packet offsets");for(var k=[],y=0;y<b;++y){var _=a.getUint8(s);++s,++s;var E=a.getUint16(s,!0);s+=u;var x=a.getUint16(s,!0);s+=u;var T=a.getUint16(s,!0);s+=u,s+=u,s+=u,s+=c,s+=c,s+=8;var S=a.getUint8(s++),O=a.getUint8(s++);s+=u,k.push(new t(_,E,x,T,S,O))}var B=[],A=0,C=0,R=k[A++];return""===i?++C:B[i]=R,o(i,R,C),B}function s(e,t,n){for(var r=new DataView(e),i=0,o=[];i<t;){for(var a=i,s=0;s<4;++s){var f=r.getUint32(i,!0);i+=l,i+=f}var u=e.slice(a,i);n.push(u),o.push(u)}return o}function f(e){var t=new DataView(e),i=0,o=t.getUint32(i,!0);if(i+=l,o!==w&&o!==b)throw new n("Invalid magic");var a=t.getUint32(i,o===w);i+=l;var s=new Uint8Array(e,i),f=r.inflate(s);if(f.length!==a)throw new n("Size of packet doesn't match header");return f}var u=Uint16Array.BYTES_PER_ELEMENT,c=Int32Array.BYTES_PER_ELEMENT,l=Uint32Array.BYTES_PER_ELEMENT,h={METADATA:0,TERRAIN:1,DBROOT:2};h.fromString=function(e){return"Metadata"===e?h.METADATA:"Terrain"===e?h.TERRAIN:"DbRoot"===e?h.DBROOT:void 0};var d=32301,w=1953029805,b=2917034100;return i(o)})}();