Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ngOnInit() {
const mouseOverObservable = this.mapEventsManager.register({
entityType: Track,
event: CesiumEvent.MOUSE_MOVE,
pick: PickOptions.PICK_FIRST,
priority: 2,
});
// Change color on hover
mouseOverObservable.subscribe((event) => {
const track = event.entities !== null ? event.entities[0] : null;
if (this.lastPickTrack && (!track || track.id !== this.lastPickTrack.id)) {
this.lastPickTrack.picked = false;
this.layer.update(this.lastPickTrack, this.lastPickTrack.id);
}
if (track && (!this.lastPickTrack || track.id !== this.lastPickTrack.id)) {
track.picked = true;
this.layer.update(track, track.id);
}
this.lastPickTrack = track;
ngOnInit() {
this.tracks$ = this.dataProvider.getDataSteam$().pipe(map(entity => ({
id: entity.id,
actionType: ActionType.ADD_UPDATE,
entity: entity,
})));
const mouseOverObservable = this.mapEventsManager.register({
event: CesiumEvent.MOUSE_MOVE,
pick: PickOptions.PICK_FIRST,
priority: 2,
});
// Change color on hover
mouseOverObservable.subscribe((event) => {
const track = event.entities !== null ? event.entities[0] : null;
if (this.lastPickTrack && (!track || track.id !== this.lastPickTrack.id)) {
this.lastPickTrack.picked = false;
this.layer.update(this.lastPickTrack, this.lastPickTrack.id);
}
if (track && (!this.lastPickTrack || track.id !== this.lastPickTrack.id)) {
track.picked = true;
this.layer.update(track, track.id);
}
this.lastPickTrack = track;