Do not handle map event in 3D mode

This commit is contained in:
Willem Dantuma
2022-09-28 21:17:57 +02:00
parent cf84f8c93d
commit ac5bd7d635
6 changed files with 36 additions and 9 deletions

View File

@@ -1,12 +1,14 @@
import { NgModule } from '@angular/core';
import { Switch2D3DComponent } from './components/olcs/switch2d3d/switch2d3d.component';
import { AppCommonModule} from '@farmmaps/common';
import { AppCommonMapModule} from '@farmmaps/common-map';
@NgModule({
declarations: [Switch2D3DComponent],
imports: [
AppCommonModule
AppCommonModule,
AppCommonMapModule
],
exports: [Switch2D3DComponent]
})

View File

@@ -4,6 +4,8 @@ import { MapComponent } from 'ngx-openlayers';
import OLCesium from 'olcs/OLCesium';
import RasterSynchronizer from 'olcs/RasterSynchronizer';
import VectorSynchronizer from 'olcs/VectorSynchronizer';
import { mapReducers,mapActions } from '@farmmaps/common-map';
import { Store } from '@ngrx/store';
@Component({
selector: 'fm-map3d-switch2d3d',
@@ -20,7 +22,7 @@ export class Switch2D3DComponent {
private interactions:Interaction[] = [];
constructor(private map: MapComponent) {
constructor(private map: MapComponent,private store: Store<mapReducers.State>) {
}
@@ -62,12 +64,14 @@ export class Switch2D3DComponent {
handleClick(event) {
this.enable = !this.enable;
if(this.enable) {
this.store.dispatch(new mapActions.SetViewState(false));
this.disableInteractions();
this.synchronize();
this.ol3d.setEnabled(true);
} else {
this.ol3d.setEnabled(false);
this.enableInteractions();
this.store.dispatch(new mapActions.SetViewState(true));
}
this.label = this.enable?"2D":"3D";