How to use the angular-cesium.PickOptions.PICK_ONE function in angular-cesium

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 articodeltd / angular-cesium / projects / demo / src / app / components / map-events-example / map-events-example.component.ts View on Github external
testPlonter() {
    this.eventManager
      .register({
        event: CesiumEvent.LEFT_CLICK,
        pick: PickOptions.PICK_ONE,
        pickFilter: entity => entity.id === '1' || entity.id === '2' || entity.id === '11' || entity.id === '10',
      })
      .pipe(map(result => result.entities))
      .subscribe(result => {
        console.log('plonter result: ' + JSON.stringify(result));
        alert('picked: ' + JSON.stringify(result));
      });
  }
github Webiks / GeoStrike / packages / client / src / app / game / views / game-container / viewer-controls / viewer-controls.component.ts View on Github external
ngAfterViewInit(): void {
    setTimeout(() => this.snackBar.open('Click on player icon to choose him', '', {duration: 3000}), 3000);

    this.eventManager = this.mapsManager.getMap().getMapEventsManager();

    this.clickEvent = this.eventManager.register({
      event: CesiumEvent.LEFT_CLICK,
      pick: PickOptions.PICK_ONE,
      entityType: AcEntity,
    });

    this.clickEvent
      .filter(result => result.entities && (result.entities[0] as PlayerFields.Fragment).type === 'PLAYER')
      .map(result => result.entities[0])
      .subscribe(selectedPlayer => {
        if (selectedPlayer.state !== 'DEAD'){
          const currentSelected = this.takeControlService.selectedPlayerToControl;
          if (currentSelected) {
            this.takeControlService.selectedPlayerToControl = currentSelected.id === selectedPlayer.id ? null : selectedPlayer;
          } else {
            this.takeControlService.selectedPlayerToControl = selectedPlayer;
          }
        }
      })
github articodeltd / angular-cesium / projects / demo / src / app / components / track-entity-layer / track-entity-layer.component.ts View on Github external
const position = Cesium.Cartesian3.fromRadians(oldPos.longitude + 0.0001, oldPos.latitude);
      this.points$.next({
        id: '1',
        actionType: ActionType.ADD_UPDATE,
        entity: AcEntity.create({
          width: 10,
          color: Cesium.Color.BLUE,
          position,
        }),
      });
    }, 500);


    this.mapEventsManager.register({
      event: CesiumEvent.LEFT_CLICK,
      pick: PickOptions.PICK_ONE
    }).subscribe(result => {
      if (result.cesiumEntities && result.cesiumEntities.length) {
        this.cameraService.trackEntity(result.cesiumEntities[0], {flyTo: true, altitude: 10000});
      }
    });


  }