projects/angular-cesium/src/lib/angular-cesium/services/drawers/static-dynamic/ellipse-drawer/dynamic-ellipse-drawer.service.ts
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.
Properties |
|
Methods |
constructor(cesiumService: CesiumService)
|
||||||
Parameters :
|
add | ||||||
add(cesiumProps: any)
|
||||||
Inherited from
BasicDrawerService
|
||||||
Defined in
BasicDrawerService:21
|
||||||
Parameters :
Returns :
any
|
update |
update(ellipse: any, cesiumProps: any)
|
Inherited from
BasicDrawerService
|
Defined in
BasicDrawerService:27
|
Returns :
any
|
getShow |
getShow()
|
Inherited from
PrimitivesDrawerService
|
Defined in
PrimitivesDrawerService:51
|
Returns :
boolean
|
init |
init()
|
Inherited from
BasicDrawerService
|
Defined in
BasicDrawerService:19
|
Returns :
void
|
remove | ||||||
remove(entity: any)
|
||||||
Inherited from
BasicDrawerService
|
||||||
Defined in
BasicDrawerService:38
|
||||||
Parameters :
Returns :
void
|
removeAll |
removeAll()
|
Inherited from
BasicDrawerService
|
Defined in
BasicDrawerService:42
|
Returns :
void
|
setShow | ||||||
setShow(showValue: boolean)
|
||||||
Inherited from
BasicDrawerService
|
||||||
Defined in
BasicDrawerService:46
|
||||||
Parameters :
Returns :
void
|
setPropsAssigner | ||||||
setPropsAssigner(assigner: Function)
|
||||||
Inherited from
BasicDrawerService
|
||||||
Defined in
BasicDrawerService:23
|
||||||
Parameters :
Returns :
void
|
Protected _cesiumCollection |
Type : any
|
Inherited from
PrimitivesDrawerService
|
Defined in
PrimitivesDrawerService:12
|
Private _primitiveCollectionWrap |
Type : any
|
Inherited from
PrimitivesDrawerService
|
Defined in
PrimitivesDrawerService:11
|
Protected _propsAssigner |
Type : Function
|
Inherited from
BasicDrawerService
|
Defined in
BasicDrawerService:13
|
Private _show |
Default value : true
|
Inherited from
PrimitivesDrawerService
|
Defined in
PrimitivesDrawerService:10
|
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;
}
}