27 lines
84 KiB
JavaScript
27 lines
84 KiB
JavaScript
|
|
define(["exports","./Cartesian4-b0ddc4ba","./Check-7b2a090c","./when-b60132fc","./Math-31e539c2","./WebGLConstants-aba9fc67"],(function(e,t,r,n,a,i){"use strict";function o(e,r,i,o){r=n.defaultValue(r,0),i=n.defaultValue(i,0),o=n.defaultValue(o,0),a.Math3D.equalsEpsilon(o,6356752.314245179,a.Math3D.EPSILON10)&&(a.Math3D.Radius=o),e._radii=new t.Cartesian3(r,i,o),e._radiiSquared=new t.Cartesian3(r*r,i*i,o*o),e._radiiToTheFourth=new t.Cartesian3(r*r*r*r,i*i*i*i,o*o*o*o),e._oneOverRadii=new t.Cartesian3(0===r?0:1/r,0===i?0:1/i,0===o?0:1/o),e._oneOverRadiiSquared=new t.Cartesian3(0===r?0:1/(r*r),0===i?0:1/(i*i),0===o?0:1/(o*o)),e._minimumRadius=Math.min(r,i,o),e._maximumRadius=Math.max(r,i,o),e._centerToleranceSquared=a.Math3D.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function u(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,o(this,e,t,r)}Object.defineProperties(u.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),u.clone=function(e,r){if(n.defined(e)){var a=e._radii;return n.defined(r)?(t.Cartesian3.clone(a,r._radii),t.Cartesian3.clone(e._radiiSquared,r._radiiSquared),t.Cartesian3.clone(e._radiiToTheFourth,r._radiiToTheFourth),t.Cartesian3.clone(e._oneOverRadii,r._oneOverRadii),t.Cartesian3.clone(e._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=e._minimumRadius,r._maximumRadius=e._maximumRadius,r._centerToleranceSquared=e._centerToleranceSquared,r):new u(a.x,a.y,a.z)}},u.fromCartesian3=function(e,t){return n.defined(t)||(t=new u),n.defined(e)?(o(t,e.x,e.y,e.z),t):t},u.WGS84=Object.freeze(new u(6378137,6378137,a.Math3D.Radius)),u.XIAN80=Object.freeze(new u(6378140,6378140,6356755.29)),u.CGCS2000=Object.freeze(new u(6378137,6378137,6356752.31)),u.UNIT_SPHERE=Object.freeze(new u(1,1,1)),u.MOON=Object.freeze(new u(a.Math3D.LUNAR_RADIUS,a.Math3D.LUNAR_RADIUS,a.Math3D.LUNAR_RADIUS)),u.prototype.clone=function(e){return u.clone(this,e)},u.packedLength=t.Cartesian3.packedLength,u.pack=function(e,r,a){return a=n.defaultValue(a,0),t.Cartesian3.pack(e._radii,r,a),r},u.unpack=function(e,r,a){r=n.defaultValue(r,0);var i=t.Cartesian3.unpack(e,r);return u.fromCartesian3(i,a)},u.prototype.geocentricSurfaceNormal=t.Cartesian3.normalize,u.prototype.geodeticSurfaceNormalCartographic=function(e,r){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n.defined(r)||(r=new t.Cartesian3),r.x=u,r.y=s,r.z=c,t.Cartesian3.normalize(r,r)},u.prototype.geodeticSurfaceNormal=function(e,r){return n.defined(r)||(r=new t.Cartesian3),r=t.Cartesian3.multiplyComponents(e,this._oneOverRadiiSquared,r),t.Cartesian3.normalize(r,r)};var s=new t.Cartesian3,c=new t.Cartesian3;u.prototype.cartographicToCartesian=function(e,r){var a=s,i=c;this.geodeticSurfaceNormalCartographic(e,a),t.Cartesian3.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.Cartesian3.dot(a,i));return t.Cartesian3.divideByScalar(i,o,i),t.Cartesian3.multiplyByScalar(a,e.height,a),n.defined(r)||(r=new t.Cartesian3),t.Cartesian3.add(i,a,r)},u.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n.defined(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new t.Cartesian3,f=new t.Cartesian3,l=new t.Cartesian3;function h(e){this._ellipsoid=n.defaultValue(e,u.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}u.prototype.cartesianToCartographic=function(e,r){var i=this.scal
|
||
|
|
/**
|
||
|
|
* @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 ze(e){if(e instanceof ze)this.scheme=e.scheme,this.authority=e.authority,this.path=e.path,this.query=e.query,this.fragment=e.fragment;else if(e){var t=Pe.exec(e);this.scheme=t[1],this.authority=t[2],this.path=t[3],this.query=t[4],this.fragment=t[5]}}ze.prototype.scheme=null,ze.prototype.authority=null,ze.prototype.path="",ze.prototype.query=null,ze.prototype.fragment=null;var Pe=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");ze.prototype.getScheme=function(){return this.scheme},ze.prototype.getAuthority=function(){return this.authority},ze.prototype.getPath=function(){return this.path},ze.prototype.getQuery=function(){return this.query},ze.prototype.getFragment=function(){return this.fragment},ze.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},ze.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},ze.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},ze.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(De,Ue).replace(Ve,Ne)),this.path&&(this.path=this.path.replace(Ve,Ne)),this.query&&(this.query=this.query.replace(Ve,Ne)),this.fragment&&(this.fragment=this.fragment.replace(Ve,Ne))};var Ve=/%[0-9a-z]{2}/gi,Le=/[a-zA-Z0-9\-\._~]/,De=/(.*@)?([^@:]*)(:.*)?/;function Ne(e){var t=unescape(e);return Le.test(t)?t:e.toUpperCase()}function Ue(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}function ke(e,t){if(null===e||"object"!=typeof e)return e;t=n.defaultValue(t,!1);var r=new e.constructor;for(var a in e)if(e.hasOwnProperty(a)){var i=e[a];t&&(i=ke(i,t)),r[a]=i}return r}function Be(e,t,r){r=n.defaultValue(r,!1);var a,i,o,u={},s=n.defined(e),c=n.defined(t);if(s)for(a in e)e.hasOwnProperty(a)&&(i=e[a],c&&r&&"object"==typeof i&&t.hasOwnProperty(a)?(o=t[a],u[a]="object"==typeof o?Be(i,o,r):i):u[a]=i);if(c)for(a in t)t.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(o=t[a],u[a]=o);return u}function je(e,t){var r;return"undefined"!=typeof document&&(r=document),je._implementation(e,t,r)}ze.prototype.resolve=function(e){var t=new ze;return this.scheme?(t.scheme=this.scheme,t.authority=this.authority,t.path=this.path,t.query=this.query):(t.scheme=e.scheme,this.authority?(t.authority=this.authority,t.path=this.path,t.query=this.query):(t.authority=e.authority,""==this.path?(t.path=e.path,t.query=this.query||e.query):("/"==this.path.charAt(0)?(t.path=this.path,t.removeDotSegments()):(e.authority&&""==e.path?t.path="/"+this.path:t.path=e.path.substring(0,e.path.lastIndexOf("/")+1)+this.path,t.removeDotSegments()),t.query=this.query))),t.fragment=this.fragment,t},ze.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];for(n&&t.shift(),""==t[0]&&t.shift();t.length;)".."==(e=t.shift())?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},ze.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},je._implementation=function(e,t,r){if(!n.defined(t)){if(void 0===r)return e;t=n.defaultValue(r.baseURI,r.location.href)}var a=new ze(t);return new ze(e).resolve(a).toString()};var We,Fe=/^blob:/i;function Ke(e){return Fe.test(e)}var He=/^data:/i;function Ge(e){return He.test(e)}var Xe=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),Ye=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3,PACK:4,BLOCK:5,BLOCKPACK:6});function Ze(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);var t=n.defaultValue(e.throttleByServer,!1),r=n.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=n.defaultValue(e.priority,0),this.throttle=r,this.throttleByServer=t,this.type=n.defaultValue(e.type,Ye.OTHER),this.ser
|