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

@ -4,9 +4,12 @@ module.exports = {
// Resolve node module use of fs // Resolve node module use of fs
fs: "empty", fs: "empty",
Buffer: false, Buffer: false,
http: "empty", http: require.resolve("stream-http"),
https: "empty", https: require.resolve("https-browserify"),
zlib: "empty" url: require.resolve("url/"),
zlib: require.resolve('browserify-zlib'),
assert: require.resolve("assert/"),
util: require.resolve("util/")
} }
} }
}; };

View File

@ -28,11 +28,14 @@
"@ngrx/router-store": "^12.0", "@ngrx/router-store": "^12.0",
"@ngrx/store": "^12.0", "@ngrx/store": "^12.0",
"angular-oauth2-oidc": "^12.0", "angular-oauth2-oidc": "^12.0",
"assert": "^2.0.0",
"bootstrap": "^4.6.0", "bootstrap": "^4.6.0",
"cesium": "^1.82.1", "browserify-zlib": "^0.2.0",
"cesium": "^1.97.0",
"core-js": "^2.6.12", "core-js": "^2.6.12",
"moment": "^2.29.1", "https-browserify": "^1.0.0",
"ngrx-store-localstorage": "^12.0", "moment": "^2.29.4",
"ngrx-store-localstorage": "^14",
"ngx-avatar": "^4.1.0", "ngx-avatar": "^4.1.0",
"ngx-clipboard": "^14.0.1", "ngx-clipboard": "^14.0.1",
"ngx-image-cropper": "^3.3.5", "ngx-image-cropper": "^3.3.5",
@ -42,8 +45,12 @@
"ol-cesium": "^2.13.1", "ol-cesium": "^2.13.1",
"resumablejs": "^1.1.0", "resumablejs": "^1.1.0",
"rxjs": "^6.6.7", "rxjs": "^6.6.7",
"stream": "^0.0.2",
"stream-http": "^3.2.0",
"tassign": "^1.0.0", "tassign": "^1.0.0",
"tslib": "^2.2.0", "tslib": "^2.4.0",
"url": "^0.11.0",
"util": "^0.12.4",
"zone.js": "~0.11.4" "zone.js": "~0.11.4"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,4 +1,7 @@
import { Component, OnInit,Input,Host } from '@angular/core'; 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 { MapComponent } from 'ngx-openlayers';
import OLCesium from 'ol-cesium'; import OLCesium from 'ol-cesium';
@ -16,6 +19,7 @@ export class Switch2D3DComponent {
private ol3d: OLCesium; private ol3d: OLCesium;
private synchronizers:any[]; private synchronizers:any[];
public loading:boolean = true; public loading:boolean = true;
private interactions:Interaction[] = [];
constructor(private map: MapComponent) { 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) { handleClick(event) {
this.enable = !this.enable; this.enable = !this.enable;
if(this.enable) { if(this.enable) {
this.disableInteractions();
this.synchronize(); this.synchronize();
this.ol3d.setEnabled(true);
} else {
this.ol3d.setEnabled(false);
this.enableInteractions();
} }
this.ol3d.setEnabled(this.enable);
this.label = this.enable?"2D":"3D"; this.label = this.enable?"2D":"3D";
} }
} }