How to use the @igo2/utils.SubjectStatus.Working function in @igo2/utils

To help you get started, we’ve selected a few @igo2/utils 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 infra-geo-ouverte / igo2-lib / projects / geo / src / lib / layer / utils / tile-watcher.ts View on Github external
private handleLoadStart(event: any) {
    // This is to avoid increasing
    // the number of loaded tiles if a tile was loading
    // before subscribing to this watcher
    if (!event.tile.__watchers__) {
      event.tile.__watchers__ = [];
    }
    event.tile.__watchers__.push(this.id);

    this.loading += 1;
    this.status = SubjectStatus.Working;
  }
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / map / utils / layer-watcher.ts View on Github external
.subscribe(status => {
        if (status === SubjectStatus.Working) {
          this.loading += 1;
        } else if (status === SubjectStatus.Done) {
          this.loaded += 1;
        }

        if (this.loaded >= this.loading) {
          this.loading = this.loaded = 0;
          this.status = SubjectStatus.Done;
        } else if (this.loading > 0) {
          this.status = SubjectStatus.Working;
        }
      });
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / map / utils / layer-watcher.ts View on Github external
.subscribe(status => {
        if (status === SubjectStatus.Working) {
          this.loading += 1;
        } else if (status === SubjectStatus.Done) {
          this.loaded += 1;
        }

        if (this.loaded >= this.loading) {
          this.loading = this.loaded = 0;
          this.status = SubjectStatus.Done;
        } else if (this.loading > 0) {
          this.status = SubjectStatus.Working;
        }
      });
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / map / map-browser / map-browser.component.ts View on Github external
private handleStatusChange(status: SubjectStatus) {
    if (status === SubjectStatus.Working && this.activityId === undefined) {
      this.activityId = this.activityService.register();
    } else if (status === SubjectStatus.Done && this.activityId !== undefined) {
      this.activityService.unregister(this.activityId);
      this.activityId = undefined;
    }
  }
}
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / map / map-browser / map-browser.component.ts View on Github external
private handleStatusChange(status: SubjectStatus) {
    if (status === SubjectStatus.Working && this.activityId === undefined) {
      this.activityId = this.activityService.register();
    } else if (status === SubjectStatus.Done && this.activityId !== undefined) {
      this.activityService.unregister(this.activityId);
      this.activityId = undefined;
    }
  }
}
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / layer / utils / image-watcher.ts View on Github external
private handleLoadStart(event: any) {
    if (!event.image.__watchers__) {
      event.image.__watchers__ = [];
    }
    event.image.__watchers__.push(this.id);

    this.loading += 1;
    this.status = SubjectStatus.Working;
  }
github infra-geo-ouverte / igo2-lib / projects / geo / src / lib / map / utils / layer-watcher.ts View on Github external
.subscribe(status => {
        if (status === SubjectStatus.Working) {
          this.loading += 1;
        } else if (status === SubjectStatus.Done) {
          this.loaded += 1;
        }

        if (this.loaded >= this.loading) {
          this.loading = this.loaded = 0;
          this.status = SubjectStatus.Done;
        } else if (this.loading > 0) {
          this.status = SubjectStatus.Working;
        }
      });
github infra-geo-ouverte / igo2-lib / packages / geo / src / lib / map / utils / layer-watcher.ts View on Github external
.subscribe(status => {
        if (status === SubjectStatus.Working) {
          this.loading += 1;
        } else if (status === SubjectStatus.Done) {
          this.loaded += 1;
        }

        if (this.loaded >= this.loading) {
          this.loading = this.loaded = 0;
          this.status = SubjectStatus.Done;
        } else if (this.loading > 0) {
          this.status = SubjectStatus.Working;
        }
      });