File

projects/angular-cesium/src/lib/angular-cesium-widgets/models/edit-point.ts

Extends

AcEntity

Index

Properties
Methods
Accessors

Constructor

constructor(entityId: string, position: Cartesian3, pointProps?: PointProps, virtualPoint)
Parameters :
Name Type Optional
entityId string No
position Cartesian3 No
pointProps PointProps Yes
virtualPoint No

Properties

Private _show
_show:
Default value : true
Private _virtualEditPoint
_virtualEditPoint: boolean
Type : boolean
Static counter
counter: number
Type : number
Default value : 0
Private editedEntityId
editedEntityId: string
Type : string
Private id
id: string
Type : string
Private pointProps
pointProps: PointProps
Type : PointProps
Private position
position: Cartesian3
Type : Cartesian3

Methods

Private generateId
generateId()
Returns : string
getEditedEntityId
getEditedEntityId()
Returns : string
getId
getId()
Returns : string
getPosition
getPosition()
Returns : Cartesian3
getPositionCallbackProperty
getPositionCallbackProperty()
Returns : Cartesian3
isVirtualEditPoint
isVirtualEditPoint()
Returns : boolean
setPosition
setPosition(position: Cartesian3)
Parameters :
Name Type Optional
position Cartesian3 No
Returns : void
setVirtualEditPoint
setVirtualEditPoint(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
Static create
create(json?: any)
Inherited from AcEntity
Defined in AcEntity:18

Creates entity from a json

Parameters :
Name Type Optional Description
json any Yes

entity object

Returns : any

entity as AcEntity

Accessors

show
getshow()
setshow(value)
Parameters :
Name Optional
value No
Returns : void
props
getprops()
setprops(value)
Parameters :
Name Optional
value No
Returns : void
import { AcEntity } from '../../angular-cesium/models/ac-entity';
import { Cartesian3 } from '../../angular-cesium/models/cartesian3';
import { PointProps } from './point-edit-options';

export class EditPoint extends AcEntity {
  static counter = 0;
  private id: string;
  private editedEntityId: string;
  private position: Cartesian3;
  private _virtualEditPoint: boolean;
  private pointProps: PointProps;
  private _show = true;

  constructor(entityId: string, position: Cartesian3, pointProps?: PointProps, virtualPoint = false) {
    super();
    this.editedEntityId = entityId;
    this.position = position;
    this.id = this.generateId();
    this.pointProps = {...pointProps};
    this._virtualEditPoint = virtualPoint;
  }

  get show() {
    return this._show;
  }

  set show(value) {
    this._show = value;
  }

  get props(): PointProps {
    return this.pointProps;
  }

  set props(value: PointProps) {
    this.pointProps = value;
  }

  isVirtualEditPoint(): boolean {
    return this._virtualEditPoint;
  }

  setVirtualEditPoint(value: boolean) {
    this._virtualEditPoint = value;
  }

  getEditedEntityId(): string {
    return this.editedEntityId;
  }

  getPosition(): Cartesian3 {
    return this.position.clone();
  }

  getPositionCallbackProperty(): Cartesian3 {
    return new Cesium.CallbackProperty(this.getPosition.bind(this), false);
  }


  setPosition(position: Cartesian3) {
    this.position.x = position.x;
    this.position.y = position.y;
    this.position.z = position.z;
  }

  getId(): string {
    return this.id;
  }

  private generateId(): string {
    return 'edit-point-' + EditPoint.counter++;
  }
}

result-matching ""

    No results matching ""