projects/angular-cesium/src/lib/angular-cesium-widgets/models/edit-polyline.ts
Properties |
|
Methods |
Accessors |
constructor(entityId: string, startPosition: Cartesian3, endPosition: Cartesian3, polylineProps?: PolylineProps)
|
|||||||||||||||
Parameters :
|
Private _polylineProps |
_polylineProps:
|
Type : PolylineProps
|
Static counter |
counter:
|
Type : number
|
Default value : 0
|
Private editedEntityId |
editedEntityId:
|
Type : string
|
Private id |
id:
|
Type : string
|
Private positions |
positions:
|
Type : Cartesian3[]
|
Private generateId |
generateId()
|
Returns :
string
|
getEditedEntityId |
getEditedEntityId()
|
Returns :
string
|
getEndPosition |
getEndPosition()
|
Returns :
any
|
getId |
getId()
|
Returns :
string
|
getPositions |
getPositions()
|
Returns :
any[]
|
getPositionsCallbackProperty |
getPositionsCallbackProperty()
|
Returns :
Cartesian3[]
|
getStartPosition |
getStartPosition()
|
Returns :
any
|
setEndPosition | ||||||
setEndPosition(position: Cartesian3)
|
||||||
Parameters :
Returns :
void
|
setStartPosition | ||||||
setStartPosition(position: Cartesian3)
|
||||||
Parameters :
Returns :
void
|
validatePositions |
validatePositions()
|
Returns :
boolean
|
Static create | ||||||||
create(json?: any)
|
||||||||
Inherited from
AcEntity
|
||||||||
Defined in AcEntity:18
|
||||||||
Creates entity from a json
Parameters :
Returns :
any
entity as AcEntity |
props | ||||
getprops()
|
||||
setprops(value)
|
||||
Parameters :
Returns :
void
|
import { AcEntity } from '../../angular-cesium/models/ac-entity';
import { Cartesian3 } from '../../angular-cesium/models/cartesian3';
import { PolylineProps } from './polyline-edit-options';
export class EditPolyline extends AcEntity {
static counter = 0;
private editedEntityId: string;
private id: string;
private positions: Cartesian3[];
private _polylineProps: PolylineProps;
constructor(entityId: string, startPosition: Cartesian3, endPosition: Cartesian3, polylineProps?: PolylineProps) {
super();
this.editedEntityId = entityId;
this.id = this.generateId();
this.positions = [startPosition, endPosition];
this._polylineProps = {...polylineProps};
}
get props(): PolylineProps {
return this._polylineProps;
}
set props(value: PolylineProps) {
this._polylineProps = value;
}
getEditedEntityId(): string {
return this.editedEntityId;
}
getPositions(): any[] {
return this.positions.map(p => p.clone());
}
getPositionsCallbackProperty(): Cartesian3[] {
return new Cesium.CallbackProperty(this.getPositions.bind(this), false);
}
validatePositions(): boolean {
return this.positions[0] !== undefined && this.positions[1] !== undefined;
}
getStartPosition() {
return this.positions[0];
}
getEndPosition() {
return this.positions[1];
}
setStartPosition(position: Cartesian3) {
this.positions[0] = position;
}
setEndPosition(position: Cartesian3) {
this.positions[1] = position;
}
getId(): string {
return this.id;
}
private generateId(): string {
return 'edit-polyline-' + EditPolyline.counter++;
}
}