How to use angular-cesium - 10 common examples

To help you get started, we’ve selected a few angular-cesium examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Webiks / GeoStrike / packages / client / src / app / game / views / game-map / path-creator / path-creator.component.ts View on Github external
ngOnInit() {
    this.cameraService.cameraFlyTo({destination: GameMapComponent.DEFAULT_START_LOCATION});
    this.mapEventManager
      .register({event: CesiumEvent.LEFT_CLICK, pick: PickOptions.PICK_FIRST})
      .subscribe((result) => {
        const clickPosition = this.geoConverter.screenToCartesian3(result.movement.endPosition);
        const existingPoint: PathNode = result.entities && result.entities.length && result.entities[0];

        if (!existingPoint) {
          this.createNewPathNode(clickPosition)
        } else {
          // update existing point
          this.updatePathNode(existingPoint);
        }

        this.polyLinePoints.push(clickPosition);
      })
  }
github articodeltd / angular-cesium / projects / demo / src / app / components / tracks-layer / tracks-layer.component.ts View on Github external
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;
    });
github articodeltd / angular-cesium / projects / demo / src / app / components / entities-with-arrays-example / entities-with-arrays-example.component.ts View on Github external
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;
    });
github articodeltd / angular-cesium / projects / demo / src / app / components / editor-layer / polyline-example / polyline-editor-example.component.ts View on Github external
this.editing$.subscribe((editUpdate: PolylineEditUpdate) => {

      if (editUpdate.editAction === EditActions.DRAG_POINT_FINISH) {
        console.log(editUpdate.points); // point = position with id
        console.log(editUpdate.positions); // or just position
        console.log(editUpdate.updatedPosition); // added position
      }
    });
  }
github articodeltd / angular-cesium / demo / app / components / editor-layer / polygons-editor-layer / polygons-editor-layer.component.ts View on Github external
this.editing$.subscribe((editUpdate: PolygonEditUpdate) => {
      if (editUpdate.editAction === EditActions.DRAG_POINT_FINISH) {
        console.log(editUpdate.points); // point = position with id
        console.log(editUpdate.positions); // or just position
        console.log(editUpdate.updatedPosition); // added position
      }
    });
  }
github articodeltd / angular-cesium / projects / demo / src / app / components / editor-layer / hippodrome-example / hippodrome-editor-example.component.ts View on Github external
this.editing$.subscribe((editUpdate: HippodromeEditUpdate) => {
      if (editUpdate.editAction === EditActions.DRAG_POINT_FINISH) {
        console.log(editUpdate.points); // point = position with id
        console.log(editUpdate.positions); // or just position
        console.log(editUpdate.updatedPosition); // added position
      }
    });
  }
github articodeltd / angular-cesium / demo / app / components / editor-layer / polygons-editor-layer / polygons-editor-example.component.ts View on Github external
this.editing$.subscribe((editUpdate: PolygonEditUpdate) => {
      if (editUpdate.editAction === EditActions.DRAG_POINT_FINISH) {
        console.log(editUpdate.points); // point = position with id
        console.log(editUpdate.positions); // or just position
        console.log(editUpdate.updatedPosition); // added position
      }
    });
  }
github articodeltd / angular-cesium / projects / demo / src / app / components / editor-layer / polyline-example / polyline-editor-example.component.ts View on Github external
this.editing$.subscribe((editUpdate: PolylineEditUpdate) => {
      if (editUpdate.editAction === EditActions.DRAG_POINT_FINISH) {
        console.log(editUpdate.points); // point = position with id
        console.log(editUpdate.positions); // or just position
        console.log(editUpdate.updatedPosition); // added position
      }
    });
    this.editing$.subscribe((editUpdate: PolylineEditUpdate) => {
github articodeltd / angular-cesium / projects / demo / src / app / components / tracks-layer / tracks-layer.component.ts View on Github external
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;
github articodeltd / angular-cesium / projects / demo / src / app / components / entities-with-arrays-example / entities-with-arrays-example.component.ts View on Github external
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;