Do not handle map event in 3D mode
This commit is contained in:
@@ -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]
|
||||
})
|
||||
|
@@ -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";
|
||||
|
Reference in New Issue
Block a user