Upgrade cesium to 1.97

This commit is contained in:
Willem Dantuma
2022-09-28 21:16:21 +02:00
parent b76a933dba
commit 4872dee094
3 changed files with 44 additions and 9 deletions

View File

@@ -1,4 +1,7 @@
import { Component, OnInit,Input,Host } from '@angular/core';
import { OldCircularArc } from 'arcgis-rest-api';
import { Map } from 'ol';
import { Interaction} from 'ol/interaction';
import { MapComponent } from 'ngx-openlayers';
import OLCesium from 'ol-cesium';
@@ -16,6 +19,7 @@ export class Switch2D3DComponent {
private ol3d: OLCesium;
private synchronizers:any[];
public loading:boolean = true;
private interactions:Interaction[] = [];
constructor(private map: MapComponent) {
@@ -41,12 +45,33 @@ export class Switch2D3DComponent {
});
}
disableInteractions() {
this.interactions=[];
this.map.instance.getInteractions().forEach((i) => {
if(i.getActive()) {
this.interactions.push(i);
i.setActive(false);
}
});
}
enableInteractions() {
this.interactions.forEach((i) => {
i.setActive(true);
});
}
handleClick(event) {
this.enable = !this.enable;
if(this.enable) {
this.synchronize();
this.disableInteractions();
this.synchronize();
this.ol3d.setEnabled(true);
} else {
this.ol3d.setEnabled(false);
this.enableInteractions();
}
this.ol3d.setEnabled(this.enable);
this.label = this.enable?"2D":"3D";
}
}