How to use the angular-cesium.CesiumEvent.LEFT_CLICK_DRAG 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
testDrag() {
    this.eventManager
      .register({event: CesiumEvent.LEFT_CLICK_DRAG, pick: PickOptions.PICK_FIRST, entityType: AcEntity})
      .pipe(
        filter(result => result.entities && result.entities[0].name === 'Drag me'),
        tap(result => {
          // disable camera rotation when dragging
          if (!result.movement.drop) {
            this.cameraService.enableInputs(false);
          } else {
            this.cameraService.enableInputs(true);
          }
        }),
        map(result => {
          const entity = result.entities[0];
          const nextPos = this.geoConverter.screenToCartesian3(result.movement.endPosition, false);
          if (nextPos) {
            entity.position = nextPos;
          }