Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setTimeout(() => {
entX.show = true;
entX.outlineColor = Cesium.Color.RED;
entX.material = Cesium.Color.BLUE;
this.updater.next({
id: 'x',
actionType: ActionType.ADD_UPDATE,
entity: entX
});
}, 4500);
.map(player => {
return {
id: player.id,
actionType: ActionType.ADD_UPDATE,
entity: player,
}
})
.subscribe(shotEntity => this.gunShots$.next(shotEntity))
this.entities$ = from(this.entities).pipe(map(entity => ({
id: entity.id,
actionType: ActionType.ADD_UPDATE,
entity: entity,
})));
}
});
this.polygons$ = observableFrom([
{
id: '0',
entity: new AcEntity({
hierarchy: Cesium.Cartesian3.fromDegreesArrayHeights([-108.0, 25.0, 100000,
-100.0, 25.0, 100000,
-100.0, 30.0, 100000,
-108.0, 30.0, 300000]),
extrudedHeight: 0,
perPositionHeight: true,
material: Cesium.Color.ORANGE.withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.BLACK
}),
actionType: ActionType.ADD_UPDATE
},
{
id: '1',
entity: new AcEntity({
hierarchy: {
positions: Cesium.Cartesian3.fromDegreesArray([-99.0, 30.0,
-85.0, 30.0,
-85.0, 40.0,
-99.0, 40.0]),
holes: [{
positions: Cesium.Cartesian3.fromDegreesArray([
-97.0, 31.0,
-97.0, 39.0,
-87.0, 39.0,
-87.0, 31.0
]),
`,
providers: []
})
export class HippodromeLayerExampleComponent implements OnInit {
simTracks$: Observable = observableOf({
id: '1',
actionType: ActionType.ADD_UPDATE,
entity: {
color: Cesium.Color.RED.withAlpha(0.5),
positions: Cesium.Cartesian3.fromDegreesArray([
-90.0, 40.0,
-93.0, 40.0,
]),
}
},
{
id: '2',
actionType: ActionType.ADD_UPDATE,
entity: {
color: Cesium.Color.BLUE.withAlpha(0.5),
positions: Cesium.Cartesian3.fromDegreesArray([
-92.0, 38.0,
-93.0, 38.0,
constructor() {
const base1: AcNotification = {
id: '0',
actionType: ActionType.ADD_UPDATE,
entity: {name: 'base alpha', position: Cesium.Cartesian3.fromRadians(1.0, 1.0), show: true}
};
const base2 = {
id: '1',
actionType: ActionType.ADD_UPDATE,
entity: {name: 'base beta', position: Cesium.Cartesian3.fromRadians(1.2, 1.2), show: true}
};
const baseArray = [base1, base2];
this.bases$ = observableFrom(baseArray);
setTimeout(() => {
base2.entity.name = 'base gama';
this.layer.updateNotification(base2);
}, 5000);
setTimeout(() => {
this.layer.refreshAll(baseArray);
}, 10000);
}
createNewPathNode(clickPosition: Cartesian3) {
const newPathNode: PathNode = {
id: this.idCounter.toString(),
location: clickPosition,
points: this.lastPathNode ? [this.lastPathNode.id] : [] as [string],
};
if (this.lastPathNode) {
this.lastPathNode.points.push(newPathNode.id);
}
this.points$.next({
id: newPathNode.id,
entity: newPathNode,
actionType: ActionType.ADD_UPDATE,
});
this.pointsPathMap.set(newPathNode.id, newPathNode);
this.idCounter++;
this.lastPathNode = newPathNode;
}
.map(player => {
return {
id: player.id,
actionType: ActionType.ADD_UPDATE,
entity: player,
}
})
.subscribe(me => {
this.polylines$ = from(this.entities).pipe(map(entity => ({
id: entity.id,
actionType: ActionType.ADD_UPDATE,
entity: entity,
})));
}
this.boxes$ = from(this.entities).pipe(map(entity => ({
id: entity.id,
actionType: ActionType.ADD_UPDATE,
entity: entity,
}
)));
}