Inject clicked feature in component
Some checks failed
FarmMaps/FarmMapsLib/pipeline/head There was a failure building this commit
Some checks failed
FarmMaps/FarmMapsLib/pipeline/head There was a failure building this commit
This commit is contained in:
parent
ff19d830a7
commit
af3340ed70
@ -19,6 +19,7 @@ import * as mapEffects from './effects/map.effects';
|
||||
import { IMapState} from './models/map.state';
|
||||
import { ISelectedFeatures } from './models/selected.features';
|
||||
import { IItemLayer,ItemLayer,ITemporalItemLayer,TemporalItemLayer } from './models/item.layer';
|
||||
import { IClickedFeature } from './models/clicked.feature';
|
||||
import { IPeriodState } from './models/period.state';
|
||||
|
||||
// components
|
||||
|
@ -74,7 +74,7 @@
|
||||
</div>
|
||||
</fm-side-panel>
|
||||
<fm-side-panel [resizeable]="true" [visible]="!noContent">
|
||||
<router-outlet></router-outlet>
|
||||
<router-outlet (activate)="handleSidepaneloutletActivate($event)" (deactivate)="handleSidepaneloutletDeactivate($event)"></router-outlet>
|
||||
</fm-side-panel>
|
||||
</div>
|
||||
</aol-map>
|
||||
|
@ -11,6 +11,7 @@ import { DeviceService } from '@farmmaps/common';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import * as mapActions from '../../actions/map.actions';
|
||||
import { IMapState} from '../../models/map.state';
|
||||
import { IClickedFeature} from '../../models/clicked.feature';
|
||||
import { IQuery } from '../../reducers/map.reducer'
|
||||
import { ISelectedFeatures } from '../../models/selected.features';
|
||||
import { IItemLayer } from '../../models/item.layer';
|
||||
@ -175,6 +176,18 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
this.store.dispatch(new mapActions.DoQuery(queryState));
|
||||
}
|
||||
|
||||
handleSidepaneloutletActivate(component:any) {
|
||||
if(component && component.hasOwnProperty('clickedFeature')) {
|
||||
(component as IClickedFeature).clickedFeature = this.clickedFeature;
|
||||
}
|
||||
}
|
||||
|
||||
handleSidepaneloutletDeactivate(component:any) {
|
||||
if(component && component.hasOwnProperty('clickedFeature')) {
|
||||
(component as IClickedFeature).clickedFeature = null;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.initialized = false;
|
||||
console.debug("Init");
|
||||
|
10
projects/common-map/src/fm-map/models/clicked.feature.ts
Normal file
10
projects/common-map/src/fm-map/models/clicked.feature.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import {Feature} from 'ol';
|
||||
import {Geometry} from 'ol/geom';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* @deprecated This interface will be removed soon
|
||||
*/
|
||||
export interface IClickedFeature {
|
||||
clickedFeature: Observable<Feature<Geometry>>
|
||||
}
|
Loading…
Reference in New Issue
Block a user