代码迁移

This commit is contained in:
zh
2025-07-03 13:54:01 +08:00
parent b04de8a084
commit 2a4da33e62
985 changed files with 358292 additions and 13 deletions

View File

@ -0,0 +1,71 @@
import BaseLayer from "../index";
import { setSplitDirection, setActiveId } from '../../../../../Global/SplitScreen'
/**
* @name: index
* @author: Administrator
* @date: 2023-11-20 19:18
* @descriptionindex
* @update: 2023-11-20 19:18
*/
class GdImagery extends BaseLayer {
constructor(sdk, options = {}) {
super(sdk, options);
}
get type() {
return "layer"
}
createGD(url) {
let gdLayer = new Cesium.UrlTemplateImageryProvider({
url,
minimumLevel: 3,
maximumLevel: 18,
tilingScheme: this.amapMercatorTilingScheme()
})
if (this.options.hasOwnProperty("layer_index")) {
this.entity = this.sdk.viewer.imageryLayers.addImageryProvider(gdLayer, this.options.layer_index)
} else {
this.entity = this.sdk.viewer.imageryLayers.addImageryProvider(gdLayer,)
}
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)
}
}
}
class GDLWImagery extends GdImagery {
constructor(earth, options = {}) {
super(earth, options);
this.createGD("https://webst02.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8")
}
}
class GDWXImagery extends GdImagery {
constructor(earth, options = {}) {
super(earth, options);
this.createGD("https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}")
}
}
class GDSLImagery extends GdImagery {
constructor(earth, options = {}) {
super(earth, options);
this.createGD("https://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}")
}
}
export {GDLWImagery, GDWXImagery, GDSLImagery}