| 
									
										
										
										
											2025-07-03 13:54:01 +08:00
										 |  |  |  | import BaseLayer from "../index"; | 
					
						
							|  |  |  |  | import { setSplitDirection, setActiveId } from '../../../../../Global/SplitScreen' | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | /** | 
					
						
							|  |  |  |  |  * @name: index | 
					
						
							|  |  |  |  |  * @author: Administrator | 
					
						
							|  |  |  |  |  * @date: 2023-11-20 19:18 | 
					
						
							|  |  |  |  |  * @description:index | 
					
						
							|  |  |  |  |  * @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,) | 
					
						
							|  |  |  |  |     } | 
					
						
							| 
									
										
										
										
											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) | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  |   } | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 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} |