File

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

Description

This drawer is responsible for creating the static version of the polyline component. This also allows us to change the color of the polylines.

Extends

StaticPrimitiveDrawer

Index

Properties
Methods

Constructor

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

Methods

update
update(primitive: any, geometryProps: any, instanceProps: any, primitiveProps: any)
Inherited from BasicDrawerService

Update function can only change the primitive color.

Parameters :
Name Type Optional
primitive any No
geometryProps any No
instanceProps any No
primitiveProps any No
Returns : any
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
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 { PolylineGeometry } from 'cesium';
import { CesiumService } from '../../../cesium/cesium.service';
import { StaticPrimitiveDrawer } from '../static-primitive-drawer/static-primitive-drawer.service';

/**
 *  This drawer is responsible for creating the static version of the polyline component.
 *  This also allows us to change the color of the polylines.
 */
@Injectable()
export class StaticPolylineDrawerService extends StaticPrimitiveDrawer {
  constructor(cesiumService: CesiumService) {
    super(PolylineGeometry, cesiumService);
  }

  /**
   * Update function can only change the primitive color.
   */
  update(primitive: any, geometryProps: any, instanceProps: any, primitiveProps: any) {
    const color = instanceProps.attributes.color.value;

    if (primitive.ready) {
      primitive.getGeometryInstanceAttributes().color = color;
    } else {
      primitive.readyPromise.then((readyPrimitive: any) => {
        readyPrimitive.getGeometryInstanceAttributes().color.value = color;
      });
    }

    return primitive;
  }
}

results matching ""

    No results matching ""