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.
1 line
13 KiB
1 line
13 KiB
|
1 year ago
|
var CLOUD=CLOUD||{};function BDImageryProvider(e){this._url="https://api.map.baidu.com/customimage/tile?udt=20181205&scale=1&ak=1XjLLEhZhQNUzd93EjU5nOGQ&customid=white",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._height=33746824,this._width=33554054;var i=new Cesium.Cartesian2(-this._width,-this._height),t=new Cesium.Cartesian2(this._width,this._height);this._tilingScheme=new Cesium.WebMercatorTilingScheme({rectangleSouthwestInMeters:i,rectangleNortheastInMeters:t}),this._credit=void 0,this._rectangle=this._tilingScheme.rectangle,this._ready=!0}function buildImageUrl(e,i,t,r){var a=e._url+"&x={x}&y={y}&z={z}",s=e._tilingScheme.getNumberOfXTilesAtLevel(r),n=e._tilingScheme.getNumberOfYTilesAtLevel(r);return a=a.replace("{x}",i-s/2).replace("{y}",n/2-t-1).replace("{z}",r)}function createAMapByUrl(e,i){i=e.defaultValue(i,{});var t=e.defaultValue(i.url,"//webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"),r=new e.Credit("AMap"),a=new e.WebMercatorTilingScheme({ellipsoid:i.ellipsoid}),s=e.defaultValue(i.minimumLevel,0),n=e.defaultValue(i.minimumLevel,18),o=e.defaultValue(i.rectangle,a.rectangle),l=a.positionToTileXY(e.Rectangle.southwest(o),s),u=a.positionToTileXY(e.Rectangle.northeast(o),s),m=(Math.abs(u.x-l.x)+1)*(Math.abs(u.y-l.y)+1);if(m>4)throw new e.DeveloperError("The rectangle and minimumLevel indicate that there are "+m+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");var c=e.defaultValue(i.credit,r);return"string"==typeof c&&(c=new e.Credit(c)),new e.UrlTemplateImageryProvider({url:t,proxy:i.proxy,credit:c,tilingScheme:a,tileWidth:256,tileHeight:256,minimumLevel:s,maximumLevel:n,rectangle:o})}Cesium.defineProperties(BDImageryProvider.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new DeveloperError("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),BDImageryProvider.prototype.getTileCredits=function(e,i,t){},BDImageryProvider.prototype.requestImage=function(e,i,t){if(!this._ready)throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");var r=buildImageUrl(this,e,i,t);return Cesium.ImageryProvider.loadImage(this,r)};var fixGltf=function(e){if(e.extensionsUsed){var i=e.extensionsUsed.indexOf("KHR_technique_webgl");if(-1!==i){e.extensionsRequired.splice(r,1,"KHR_techniques_webgl"),e.extensionsUsed.splice(i,1,"KHR_techniques_webgl"),e.extensions=e.extensions||{},e.extensions.KHR_techniques_webgl={},e.extensions.KHR_techniques_webgl.programs=e.programs,e.extensi
|