|
@@ -120,7 +120,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
- this.$props.ptaye == "gdbh" && this.GetServer();
|
|
|
+ this.$props.ptaye != "gdbh" && this.GetServer();
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$nextTick(() => {
|
|
@@ -133,6 +133,10 @@ export default {
|
|
|
this.onClick(-1);
|
|
|
removeGeoJSON("fpdb");
|
|
|
this.$emit("close");
|
|
|
+ Object.keys(this.imagelayers).forEach((key) => {
|
|
|
+ viewer.imageryLayers.remove(this.imagelayers[key]);
|
|
|
+ });
|
|
|
+ this.imagelayers = {};
|
|
|
},
|
|
|
show(data) {
|
|
|
console.log(data);
|
|
@@ -164,8 +168,18 @@ export default {
|
|
|
},
|
|
|
clickcheck(i, name, checked) {
|
|
|
if (this.$props.ptaye == "gdbh") {
|
|
|
- let geodata = geoSources[`${name}${i ? "h" : "q"}`];
|
|
|
- geodata.setVisibleInViewport(i, checked);
|
|
|
+ if (this.active == 0) {
|
|
|
+ if (i == 0) {
|
|
|
+ let dobj = this.dbdata.fp.fined((d) => d.year == name);
|
|
|
+ this.setImager(dobj, checked, (layer) => {
|
|
|
+ setImageryRoller(layer);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else if (this.active == 1) {
|
|
|
+ let lay = this.imagelayers[name];
|
|
|
+ viewer.flyTo(lay);
|
|
|
+ lay.setVisibleInViewport(i, checked);
|
|
|
+ }
|
|
|
} else {
|
|
|
let geodata = geoSources[`${name}${i ? "h" : "q"}`];
|
|
|
if (geodata) {
|
|
@@ -196,13 +210,17 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
this.active = i;
|
|
|
-
|
|
|
+ if (this.active != 0 || this.active != 1) {
|
|
|
+ Object.keys(this.imagelayers).forEach((key) => {
|
|
|
+ this.imagelayers[key].show = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
if (i == 0) {
|
|
|
this.layers = [false, false];
|
|
|
this.gdjlcheck[0].push(this.dbdata.fp[0].year);
|
|
|
this.gdjlcheck[1].push(this.dbdata.fp[1].year);
|
|
|
- this.setImager({ ...this.dbdata.fp[0] }, true);
|
|
|
- this.setImager({ ...this.dbdata.fp[1] }, true, (layer) => {
|
|
|
+ this.setImager({ ...this.dbdata.fp[0], top: true }, true);
|
|
|
+ this.setImager({ ...this.dbdata.fp[1], top: true }, true, (layer) => {
|
|
|
useRoller(true, "lrRoller", "leftRoller", "", false);
|
|
|
setImageryRoller(layer);
|
|
|
});
|
|
@@ -230,10 +248,6 @@ export default {
|
|
|
} else {
|
|
|
this.reset();
|
|
|
}
|
|
|
- // if (this.active != 0) {
|
|
|
- // this.setImager({ year: "qian" }, false);
|
|
|
- // this.setImager({ year: "hou" }, false);
|
|
|
- // }
|
|
|
},
|
|
|
async onTdzzClick(i) {
|
|
|
if (i == 3) {
|
|
@@ -364,9 +378,6 @@ export default {
|
|
|
if (this.active == 1) setImageryRoller(imageryLayer);
|
|
|
else hideImageryRoller(imageryLayer);
|
|
|
},
|
|
|
- setVisible(id, show) {
|
|
|
- imagelayer.setVisibleInViewport(id, show);
|
|
|
- },
|
|
|
},
|
|
|
watch: {
|
|
|
nolayer(newVal, oldVal) {
|
|
@@ -374,6 +385,9 @@ export default {
|
|
|
if (oldVal) this.setImager({ year: oldVal }, false);
|
|
|
},
|
|
|
},
|
|
|
+ beforeDestroy(){
|
|
|
+ this.closeInster()
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|