cesium 图层构建的那些事 (四)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了cesium 图层构建的那些事 (四)相关的知识,希望对你有一定的参考价值。

参考技术A 我们通过构建百度地图容器类

```javascript

import ImageryLayer from "../ImageryLayer";

const urls:any =

digital:"http://onlines.map.bdimg.com/onlinelabel/?qt=tile&x=x&y=y&z=z&styles=pl&scaler=1&p=1",//电子地图

image:"http://shangetus.map.bdimg.com/it/u=x=x;y=y;z=z;v=009;type=sate&fm=46",//影像地图

mark:"http://onlines.map.bdimg.com/tile/?qt=tile&x=x&y=y&z=z&styles=sl&v=020",//注记

xxx:'http://apis.map.bdimg.com/customimage/tile?&x=x&y=y&z=z&scale=1&customid=style'



//百度地图

export class BDImageryLayer extends ImageryLayer

public imageryProvider:any;//影像提供者

constructor(option:any=)

super(option.name);

const url:string = urls[option.mold] || urls.digital;

option = url,...option;

this.type = "BDImageryLayer";//重写类型

this.imageryProvider = new BaiduImageryProvider(option);

this.cesiumLayer = new Cesium.ImageryLayer(this.imageryProvider);





class BaiduImageryProvider

public _errorEvent:any;

public _tileWidth:any;

public _tileHeight:any;

public _maximumLevel:any;

public _minimumLevel:any;

public _tilingScheme:any;

public _rectangle:any;

public _tileDiscardPolicy:any;

public _resource:any;

public _credit:any;

public _readyPromise:any;

constructor(options:any)

this._errorEvent = new Cesium.Event();

this._tileWidth = 256;

this._tileHeight = 256;

this._maximumLevel = 18;

this._minimumLevel = 1;

var southwestInMeters = new Cesium.Cartesian2(-33554054, -33746824);

var northeastInMeters = new Cesium.Cartesian2(33554054, 33746824);

this._tilingScheme = new Cesium.WebMercatorTilingScheme(

rectangleSouthwestInMeters: southwestInMeters,

rectangleNortheastInMeters: northeastInMeters

);

this._rectangle = this._tilingScheme.rectangle;

var resource = Cesium.Resource.createIfNeeded(options.url);

this._resource = resource;

this._tileDiscardPolicy = undefined;

 更多参考 https://xiaozhuanlan.com/topic/7254138609

以上是关于cesium 图层构建的那些事 (四)的主要内容,如果未能解决你的问题,请参考以下文章

JS异步那些事 四(HTML 5 Web Workers)

强迫症与 AS 的那些事

angular的那些事

关于Android性能监控Matrix那些事?你知道那些(中)?

定位的那些事

SQL开发实战技巧系列:SQL排序的那些事