File

projects/angular-cesium/src/lib/angular-cesium/services/drawers/static-dynamic/ellipse-drawer/dynamic-ellipse-drawer.service.ts

Description

This drawer is responsible for creating the dynamic version of the ellipse component. We are using the primitive-primitives implementation of an ellipse. see: https://github.com/gotenxds/Primitive-primitives This allows us to change the position of the ellipses without creating a new primitive object as Cesium does not allow updating an ellipse.

Extends

PrimitivesDrawerService

Index

Properties
Methods

Constructor

constructor(cesiumService: CesiumService)
Parameters :
Name Type Optional
cesiumService CesiumService No

Methods

add
add(cesiumProps: any)
Inherited from BasicDrawerService
Parameters :
Name Type Optional
cesiumProps any No
Returns : any
update
update(ellipse: any, cesiumProps: any)
Inherited from BasicDrawerService
Parameters :
Name Type Optional
ellipse any No
cesiumProps any No
Returns : any
getShow
getShow()
Inherited from PrimitivesDrawerService
Returns : boolean
init
init()
Inherited from BasicDrawerService
Returns : void
remove
remove(entity: any)
Inherited from BasicDrawerService
Parameters :
Name Type Optional
entity any No
Returns : void
removeAll
removeAll()
Inherited from BasicDrawerService
Returns : void
setShow
setShow(showValue: boolean)
Inherited from BasicDrawerService
Parameters :
Name Type Optional
showValue boolean No
Returns : void
setPropsAssigner
setPropsAssigner(assigner: Function)
Inherited from BasicDrawerService
Parameters :
Name Type Optional
assigner Function No
Returns : void

Properties

Protected _cesiumCollection
Type : any
Inherited from PrimitivesDrawerService
Private _primitiveCollectionWrap
Type : any
Inherited from PrimitivesDrawerService
Protected _propsAssigner
Type : Function
Inherited from BasicDrawerService
Private _show
Default value : true
Inherited from PrimitivesDrawerService
import { Injectable } from '@angular/core';
import { PrimitiveCollection } from 'cesium';
import { CesiumService } from '../../../cesium/cesium.service';
import { Checker } from '../../../../utils/checker';
import { EllipsePrimitive } from 'primitive-primitives';
import { PrimitivesDrawerService } from '../../primitives-drawer/primitives-drawer.service';


/**
 *  This drawer is responsible for creating the dynamic version of the ellipse component.
 *  We are using the primitive-primitives implementation of an ellipse. see: https://github.com/gotenxds/Primitive-primitives
 *  This allows us to change the position of the ellipses without creating a new primitive object
 *  as Cesium does not allow updating an ellipse.
 */
@Injectable()
export class DynamicEllipseDrawerService extends PrimitivesDrawerService {
  constructor(cesiumService: CesiumService) {
    super(PrimitiveCollection, cesiumService);
  }

  add(cesiumProps: any): any {
    Checker.throwIfAnyNotPresent(cesiumProps, ['center', 'semiMajorAxis', 'semiMinorAxis']);

    return super.add(new EllipsePrimitive(cesiumProps));
  }

  update(ellipse: any, cesiumProps: any): any {
    ellipse.updateLocationData(cesiumProps);

    return ellipse;
  }
}

results matching ""

    No results matching ""