projects/angular-cesium/src/lib/angular-cesium/services/drawers/czml-drawer/czml-drawer.service.ts
This drawer is responsible for drawing czml dataSources.
Properties |
Methods |
constructor(cesiumService: CesiumService)
|
||||||
Parameters :
|
add | ||||||
add(cesiumProps: any)
|
||||||
Parameters :
Returns :
any
|
init | ||||||
init(options?: EntitiesDrawerOptions)
|
||||||
Parameters :
Returns :
{}
|
remove | ||||||
remove(entity: any)
|
||||||
Parameters :
Returns :
void
|
removeAll |
removeAll()
|
Returns :
void
|
setShow | ||||||
setShow(showValue: boolean)
|
||||||
Parameters :
Returns :
void
|
update |
update(entity: any, cesiumProps: any)
|
Returns :
void
|
czmlStream |
czmlStream:
|
Type : any
|
import { Injectable } from '@angular/core';
import { CesiumService } from '../../cesium/cesium.service';
import { BasicDrawerService } from '../basic-drawer/basic-drawer.service';
import { EntitiesDrawerOptions } from '../../../models/entities-drawer-options';
/**
* This drawer is responsible for drawing czml dataSources.
*/
@Injectable()
export class CzmlDrawerService extends BasicDrawerService {
czmlStream: any;
constructor(
private cesiumService: CesiumService,
) {
super();
}
init(options?: EntitiesDrawerOptions) {
const dataSources = [];
this.czmlStream = new Cesium.CzmlDataSource('czml');
dataSources.push(this.czmlStream);
this.cesiumService.getViewer().dataSources.add(this.czmlStream);
return dataSources;
}
// returns the packet, provided by the stream
add(cesiumProps: any): any {
this.czmlStream.process(cesiumProps.czmlPacket);
return cesiumProps;
}
update(entity: any, cesiumProps: any) {
this.czmlStream.process(cesiumProps.czmlPacket);
}
remove(entity: any) {
this.czmlStream.entities.removeById(entity.acEntity.id);
}
removeAll() {
this.czmlStream.entities.removeAll();
}
setShow(showValue: boolean) {
this.czmlStream.entities.show = showValue;
}
}