Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
AcLayerComponent,
AcNotification,
ActionType,
CameraService,
CesiumEvent,
MapEventsManagerService,
PickOptions,
SceneMode
} from 'angular-cesium';
import { BehaviorSubject } from 'rxjs';
import { MatSnackBar } from '@angular/material/snack-bar';
const initialLocation = {
id: '1',
actionType: ActionType.ADD_UPDATE,
entity: AcEntity.create({
width: 10,
color: Cesium.Color.BLUE,
position: Cesium.Cartesian3.fromDegrees(32, 40),
}),
};
@Component({
selector: 'track-entity-layer',
templateUrl: 'track-entity-layer.component.html',
styleUrls: [],
})
export class TrackEntityLayerComponent implements OnInit, AfterViewInit {
@ViewChild(AcLayerComponent, {static: false}) layer: AcLayerComponent;
points$: BehaviorSubject = new BehaviorSubject(initialLocation);
private geoConverter: CoordinateConverter,
) {
const track1: AcNotification = {
id: '0',
actionType: ActionType.ADD_UPDATE,
entity: AcEntity.create({
id: '0',
name: 'click me',
color: Cesium.Color.BLUE,
position: Cesium.Cartesian3.fromDegrees(-95, 40),
}),
};
const track2: AcNotification = {
id: '1',
actionType: ActionType.ADD_UPDATE,
entity: AcEntity.create({
id: '1',
name: 'choose me',
color: Cesium.Color.AQUA,
position: Cesium.Cartesian3.fromDegrees(-85, 35),
}),
};
const track10: AcNotification = {
id: '10',
actionType: ActionType.ADD_UPDATE,
entity: AcEntity.create({
id: '10',
name: 'click me now please!',
color: Cesium.Color.BLUE,
position: Cesium.Cartesian3.fromDegrees(-84, 35),
}),
};
width: 2,
positions: Cesium.Cartesian3.fromDegreesArray(
[
Math.floor(Math.random() * 50), Math.floor(Math.random() * 50),
Math.floor(Math.random() * 50), Math.floor(Math.random() * 50)
]),
material: entity.id === 1 ? yellowMaterial : redMaterial
};
entity.point = {
pixelSize: 15,
color: new Cesium.Color(1.0, 1.0, 0.0, 1.0),
position: new Cesium.Cartesian3.fromDegrees(Math.floor(Math.random() * 50), Math.floor(Math.random() * 50))
};
return AcEntity.create(entity);
}