projects/angular-cesium/src/lib/angular-cesium/services/plonter/plonter.service.ts
Service for solving plonter. Used by map-event-manager and plonter context component
Properties |
|
Methods |
Accessors |
constructor()
|
plonterIt | ||||||
plonterIt(eventResult: EventResult)
|
||||||
Parameters :
Returns :
any
|
resolvePlonter | ||||||
resolvePlonter(entity: AcEntity)
|
||||||
Parameters :
Returns :
void
|
Private _entitesToPlonter |
_entitesToPlonter:
|
Type : AcEntity[]
|
Default value : []
|
Private _eventResult |
_eventResult:
|
Type : EventResult
|
Private _plonterChangeNotifier |
_plonterChangeNotifier:
|
Type : EventEmitter<any>
|
Default value : new EventEmitter()
|
Private _plonterObserver |
_plonterObserver:
|
Type : Subject<EventResult>
|
Private _plonterShown |
_plonterShown:
|
Type : boolean
|
plonterChangeNotifier |
getplonterChangeNotifier()
|
plonterShown |
getplonterShown()
|
entitesToPlonter |
getentitesToPlonter()
|
plonterClickPosition |
getplonterClickPosition()
|
import { EventEmitter, Injectable } from '@angular/core';
import { AcEntity } from '../../models/ac-entity';
import { Subject } from 'rxjs';
import { EventResult, Movement } from '../map-events-mananger/map-events-manager';
/**
* Service for solving plonter.
* Used by map-event-manager and plonter context component
*/
@Injectable()
export class PlonterService {
private _plonterShown: boolean;
private _entitesToPlonter: AcEntity[] = [];
private _plonterObserver: Subject<EventResult>;
private _eventResult: EventResult;
private _plonterChangeNotifier: EventEmitter<any> = new EventEmitter();
constructor() {
this._plonterObserver = new Subject<EventResult>();
}
get plonterChangeNotifier(): EventEmitter<any> {
return this._plonterChangeNotifier;
}
get plonterShown(): boolean {
return this._plonterShown;
}
get entitesToPlonter(): AcEntity[] {
return this._entitesToPlonter;
}
get plonterClickPosition(): Movement {
return this._eventResult.movement;
}
plonterIt(eventResult: EventResult) {
this._eventResult = eventResult;
this._entitesToPlonter = eventResult.entities;
this._plonterShown = true;
this._plonterChangeNotifier.emit();
return this._plonterObserver;
}
resolvePlonter(entity: AcEntity) {
this._plonterShown = false;
this._eventResult.entities = [entity];
this._plonterChangeNotifier.emit();
this._plonterObserver.next(this._eventResult);
}
}