2025-07-03 13:54:01 +08:00
|
|
|
|
/**
|
|
|
|
|
* @name: index
|
|
|
|
|
* @author: Administrator
|
|
|
|
|
* @date: 2023-11-20 15:51
|
|
|
|
|
* @description:index
|
|
|
|
|
* @update: 2023-11-20 15:51
|
|
|
|
|
*/
|
|
|
|
|
import BaseLayer from "../index";
|
|
|
|
|
import { setSplitDirection, setActiveId } from '../../../../../Global/SplitScreen'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Layer3rdparty extends BaseLayer {
|
|
|
|
|
constructor(sdk, options = {}) {
|
|
|
|
|
super(sdk, options)
|
|
|
|
|
this.loadLayer()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get type() {
|
|
|
|
|
return "layer"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
loadLayer(data) {
|
|
|
|
|
let params = {
|
|
|
|
|
url: this.options.url,
|
|
|
|
|
mimmumLevel: this.options.minimumLevel || 0,
|
|
|
|
|
maximumLevel: this.options.maximumLevel || 20,
|
|
|
|
|
subdomains: ['0','1','2','3','4','5','6','7'],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let layer
|
|
|
|
|
|
|
|
|
|
layer = new Cesium.UrlTemplateImageryProvider(params)
|
|
|
|
|
if (this.options.hasOwnProperty("layer_index")) {
|
|
|
|
|
this.entity =
|
|
|
|
|
this.sdk.viewer.scene.imageryLayers.addImageryProvider(layer, this.options.layer_index)
|
|
|
|
|
} else {
|
|
|
|
|
this.entity =
|
|
|
|
|
this.sdk.viewer.scene.imageryLayers.addImageryProvider(layer,)
|
|
|
|
|
}
|
2025-07-08 16:48:22 +08:00
|
|
|
|
this.entity._id = this.options.id
|
2025-07-03 13:54:01 +08:00
|
|
|
|
for (let i = 0; i < this.sdk.viewer.imageryLayers._layers.length; i++) {
|
|
|
|
|
if (this.sdk.viewer.imageryLayers._layers[i]._imageryProvider && this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type && (this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type === 'flw' || this.sdk.viewer.imageryLayers._layers[i]._imageryProvider._type === 'jww')) {
|
|
|
|
|
let layer = this.sdk.viewer.imageryLayers._layers[i]
|
|
|
|
|
this.sdk.viewer.imageryLayers.raiseToTop(layer)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.show = this.options.show
|
|
|
|
|
this.alpha = this.options.alpha
|
|
|
|
|
this.brightness = this.options.brightness
|
|
|
|
|
|
|
|
|
|
if(this.options.show) {
|
|
|
|
|
setSplitDirection(0, this.options.id)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Layer3rdparty
|