File

projects/angular-cesium/src/lib/angular-cesium/services/plonter/plonter.service.ts

Description

Service for solving plonter. Used by map-event-manager and plonter context component

Index

Properties
Methods
Accessors

Constructor

constructor()

Methods

plonterIt
plonterIt(eventResult: EventResult)
Parameters :
Name Type Optional
eventResult EventResult No
Returns : any
resolvePlonter
resolvePlonter(entity: AcEntity)
Parameters :
Name Type Optional
entity AcEntity No
Returns : void

Properties

Private _entitesToPlonter
_entitesToPlonter: AcEntity[]
Type : AcEntity[]
Default value : []
Private _eventResult
_eventResult: EventResult
Type : EventResult
Private _plonterChangeNotifier
_plonterChangeNotifier: EventEmitter<any>
Type : EventEmitter<any>
Default value : new EventEmitter()
Private _plonterObserver
_plonterObserver: Subject<EventResult>
Type : Subject<EventResult>
Private _plonterShown
_plonterShown: boolean
Type : boolean

Accessors

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);
  }
}

result-matching ""

    No results matching ""