File

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

Description

This drawer is deprecated. General static primitives drawer responsible of drawing static Cesium primitives with material.

Extends

PrimitivesDrawerService

Index

Properties
Methods

Constructor

constructor(geometryType: any, cesiumService: CesiumService)
Parameters :
Name Type Optional
geometryType any No
cesiumService CesiumService No

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

Methods

add
add(geometryProps: any, instanceProps: any, primitiveProps: any)
Inherited from BasicDrawerService
Parameters :
Name Type Optional
geometryProps any No
instanceProps any No
primitiveProps any No
Returns : any
update
update(primitive: any, geometryProps: any, instanceProps: any, primitiveProps: any)
Inherited from BasicDrawerService
Parameters :
Name Type Optional
primitive any No
geometryProps any No
instanceProps any No
primitiveProps 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
import { PrimitiveCollection, GeometryInstance, Primitive } from 'cesium';
import { PrimitivesDrawerService } from '../../primitives-drawer/primitives-drawer.service';
import { CesiumService } from '../../../cesium/cesium.service';

/**
 *
 * This drawer is deprecated.
 * General static primitives drawer responsible of drawing static Cesium primitives with material.
 */
export abstract class StaticPrimitiveDrawer extends PrimitivesDrawerService {
  constructor(private geometryType: any, cesiumService: CesiumService) {
    super(PrimitiveCollection, cesiumService);
  }

  add(geometryProps: any, instanceProps: any, primitiveProps: any): any {
    if (Object.keys(instanceProps).length === 0) {
      throw(new Error('instanceProps object is empty'));
    }
    instanceProps.geometry = new this.geometryType(geometryProps);
    primitiveProps.geometryInstances = new GeometryInstance(instanceProps);
    primitiveProps.asynchronous = false;
    const primitive = new Primitive(primitiveProps);
    return super.add(primitive);
  }

  update(primitive: any, geometryProps: any, instanceProps: any, primitiveProps: any) {
    instanceProps.geometry = new this.geometryType(geometryProps);
    primitiveProps.geometryInstances = new GeometryInstance(instanceProps);
    this._cesiumCollection.remove(primitive);
    return super.add(new Primitive(primitiveProps));
  }
}

results matching ""

    No results matching ""