File

projects/angular-cesium/src/lib/angular-cesium/models/ac-entity.ts

Description

Angular Cesium parent entity, all entities should inherit from it.

 * entity= new AcEntity({
 *      id: 0,
 *      name: 'click me',
 *      position: Cesium.Cartesian3.fromRadians(0.5, 0.5),
 * });
 *

Index

Methods

Constructor

constructor(json?: any)

Creates entity from a json

Parameters :
Name Type Optional Description
json any Yes

(Optional) entity object

Methods

Static create
create(json?: any)

Creates entity from a json

Parameters :
Name Type Optional Description
json any Yes

entity object

Returns : any

entity as AcEntity

export class AcEntity {

  /**
   * Creates entity from a json
   * @param json entity object
   * @returns entity as AcEntity
   */
  static create(json?: any) {
    if (json) {
      return Object.assign(new AcEntity(), json);
    }
    return new AcEntity();
  }

  /**
   * Creates entity from a json
   * @param json (Optional) entity object
   */
  constructor(json?: any) {
    Object.assign(this, json);
  }
}

result-matching ""

    No results matching ""