增加底图的二三维单独显示
This commit is contained in:
@ -409,11 +409,25 @@ function syncImageryLayerRemoved(layer, index) {
|
|||||||
sdk2D.viewer.imageryLayers.remove(layer2d)
|
sdk2D.viewer.imageryLayers.remove(layer2d)
|
||||||
}
|
}
|
||||||
function syncImageryLayerShownOrHidden(layer, index, state) {
|
function syncImageryLayerShownOrHidden(layer, index, state) {
|
||||||
|
return
|
||||||
let layer2d = sdk2D.viewer.imageryLayers._layers[index]
|
let layer2d = sdk2D.viewer.imageryLayers._layers[index]
|
||||||
|
let layer3d = sdk3D.viewer.imageryLayers._layers[index]
|
||||||
|
console.log('layer2d', layer2d, sdk2D, layer3d)
|
||||||
|
|
||||||
if (!layer2d) {
|
if (!layer2d) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if(layer3d._objectState) {
|
||||||
|
if(!layer3d._showView || layer3d._showView==2) {
|
||||||
|
layer2d.show = true
|
||||||
|
}
|
||||||
|
if(layer3d._showView==3) {
|
||||||
|
layer2d.show = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
layer2d.show = state
|
layer2d.show = state
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function syncPrimitives(primitive) {
|
async function syncPrimitives(primitive) {
|
||||||
@ -543,6 +557,7 @@ function syncViewer() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get2DView() {
|
function get2DView() {
|
||||||
return sdk2D
|
return sdk2D
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
import { getHost, getToken } from "../../../on";
|
import { getHost, getToken } from "../../../on";
|
||||||
import Base from '../index'
|
import Base from '../index'
|
||||||
import Tools from '../../../Tools'
|
import Tools from '../../../Tools'
|
||||||
|
import { syncSplitData } from "../../../Global/SplitScreen";
|
||||||
|
import { syncData } from '../../../Global/MultiViewportMode'
|
||||||
import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../Global/global'
|
import { setActiveViewer, closeRotateAround, closeViewFollow} from '../../../Global/global'
|
||||||
|
|
||||||
class GeoJson extends Base {
|
class GeoJson extends Base {
|
||||||
@ -27,6 +29,7 @@ class GeoJson extends Base {
|
|||||||
this.primitive = undefined
|
this.primitive = undefined
|
||||||
this.positions = []
|
this.positions = []
|
||||||
|
|
||||||
|
|
||||||
this.loading = true
|
this.loading = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +51,26 @@ class GeoJson extends Base {
|
|||||||
return this.options.show
|
return this.options.show
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set show(status) {
|
||||||
|
// if (!this.isShowView) {
|
||||||
|
// this.options.show = status
|
||||||
|
// }
|
||||||
|
// if (this.entity) {
|
||||||
|
// if (!this.showView || this.showView == 3) {
|
||||||
|
// for (let i = 0; i < this.entity.entities.values.length; i++) {
|
||||||
|
// this.entity.entities.values[i].show = this.options.show
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// for (let i = 0; i < this.entity.entities.values.length; i++) {
|
||||||
|
// this.entity.entities.values[i].show = false
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// syncData(this.sdk, this.options.id)
|
||||||
|
// syncSplitData(this.sdk, this.options.id)
|
||||||
|
// this.isShowView = false
|
||||||
|
// }
|
||||||
set show(status) {
|
set show(status) {
|
||||||
this.options.show = status
|
this.options.show = status
|
||||||
if (this.entity) {
|
if (this.entity) {
|
||||||
@ -74,6 +97,7 @@ class GeoJson extends Base {
|
|||||||
})
|
})
|
||||||
let json = await rsp.json()
|
let json = await rsp.json()
|
||||||
this.geojson = json
|
this.geojson = json
|
||||||
|
// this.sdk.addIncetance(this.options.id, this)
|
||||||
return GeoJson.addDataToGlobe(this, json.features)
|
return GeoJson.addDataToGlobe(this, json.features)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,9 +62,11 @@ class Base extends Tools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set showView(v) {
|
set showView(v) {
|
||||||
|
|
||||||
|
|
||||||
let sdk2D = get2DSdk().sdkD
|
let sdk2D = get2DSdk().sdkD
|
||||||
if(!sdk2D) {
|
if (!sdk2D) {
|
||||||
v=0
|
v = 0
|
||||||
}
|
}
|
||||||
if (!this.#_showView && !this.show) {
|
if (!this.#_showView && !this.show) {
|
||||||
return
|
return
|
||||||
@ -124,6 +126,12 @@ class Base extends Tools {
|
|||||||
this.originalOptions.show = v
|
this.originalOptions.show = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.entity._showView = this.showView
|
||||||
|
if (this.type == 'layer') {
|
||||||
|
if (this.entity) {
|
||||||
|
this.entity._objectState = this.options.show
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!this.showView || this.showView == 3) {
|
if (!this.showView || this.showView == 3) {
|
||||||
this.entity && (this.entity.show = this.options.show)
|
this.entity && (this.entity.show = this.options.show)
|
||||||
if (this.options.label && this.options.label.show && this.label) {
|
if (this.options.label && this.options.label.show && this.label) {
|
||||||
@ -141,9 +149,31 @@ class Base extends Tools {
|
|||||||
this._DialogObject.showBtn.checked = this.options.show
|
this._DialogObject.showBtn.checked = this.options.show
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
syncData(this.sdk, this.options.id)
|
syncData(this.sdk, this.options.id)
|
||||||
syncSplitData(this.sdk, this.options.id)
|
syncSplitData(this.sdk, this.options.id)
|
||||||
this.isShowView = false
|
this.isShowView = false
|
||||||
|
|
||||||
|
let { sdkP, sdkD } = get2DSdk()
|
||||||
|
if (this.type == 'layer' && sdkD) {
|
||||||
|
let layer2d = sdkD.viewer.imageryLayers._layers[this.layerIndex]
|
||||||
|
let layer3d = this.entity
|
||||||
|
|
||||||
|
if (!layer2d) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (layer3d._objectState) {
|
||||||
|
if (!layer3d._showView || layer3d._showView == 2) {
|
||||||
|
layer2d.show = true
|
||||||
|
}
|
||||||
|
if (layer3d._showView == 3) {
|
||||||
|
layer2d.show = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
layer2d.show = this.options.show
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error("参数必须为boolean")
|
console.error("参数必须为boolean")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user