How to use the openseadragon.Rect function in openseadragon

To help you get started, we’ve selected a few openseadragon 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 digirati-co-uk / canvas-panel / packages / canvas-panel-core / src / viewers / OpenSeadragonViewer / OpenSeadragonViewer.js View on Github external
goToRect(
    { x, y, width, height }: Bounds,
    padding: number = 0,
    speed: number
  ) {
    if (!this.viewer) {
      return null;
    }

    const selectHighlight = this.viewer.viewport.imageToViewportRectangle(
      new OpenSeadragon.Rect(
        x - padding / 2,
        y - padding / 2,
        width + padding,
        height + padding,
        0
      )
    );

    this.viewportAction('fitBounds', [selectHighlight, speed === null], speed);
  }
github ProjectMirador / mirador / src / components / OpenSeadragonViewer.js View on Github external
return new Promise((resolve, reject) => {
      if (!this.viewer) {
        return;
      }
      this.viewer.addTiledImage({
        error: event => reject(event),
        fitBounds: new OpenSeadragon.Rect(
          ...canvasWorld.canvasToWorldCoordinates(i),
        ),
        success: event => resolve(event),
        tileSource,
      });
    });
  }
github ProjectMirador / mirador / src / components / OpenSeadragonViewer.js View on Github external
fitBounds(x, y, w, h, immediately = true) {
    this.viewer.viewport.fitBounds(
      new OpenSeadragon.Rect(x, y, w, h),
      immediately,
    );
  }
github digirati-co-uk / canvas-panel / src / viewers / OpenSeadragonViewer / OpenSeadragonViewer.js View on Github external
goToRect({ x, y, width, height }, padding = 0) {
    const selectHighlight = this.viewer.viewport.imageToViewportRectangle(new OpenSeadragon.Rect(
      x - (padding / 2),
      y - (padding / 2),
      width + padding,
      height + padding,
      0
    ));
    this.viewer.viewport.fitBounds(selectHighlight);
  }

openseadragon

Provides a smooth, zoomable user interface for HTML/Javascript.

BSD-3-Clause
Latest version published 3 months ago

Package Health Score

89 / 100
Full package analysis