Inject clicked feature in component
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
e28564c88a
commit
cc4726e85c
@ -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';
|
||||
@ -176,6 +177,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