0

这是我正在尝试的代码但它不起作用

class App extends Component {

  state =
  {
    id: "OSD",
    getImageURL: 'http://cdm16022.contentdm.oclc.org/utils/ajaxhelper',
    osdConfig: {
      setStrings: [{ name: 'Tooltips.Home', value: 'Reset' }],
      defaultZoomLevel: 0,
      tileSources: [
        {
          Image: {
            xmlns: "http://schemas.microsoft.com/deepzoom/2008",
            Url: "https://openseadragon.github.io/example-images/highsmith/highsmith_files/",
            Format: "jpg",
            Overlap: "0",
            TileSize: "256",
            Size: {
              Height: "9221",
              Width: "7026"
            }
          }
        },
        {
          Image: {
            xmlns: "http://schemas.microsoft.com/deepzoom/2008",
            Url: "https://openseadragon.github.io/example-images/highsmith/highsmith_files/",
            Format: "jpg",
            Overlap: "1",
            TileSize: "256",
            Size: {
              Height: "621",
              Width: "526"
            }
          }
        }

      ],
    },
    pages: [
      {
        id: 0,
      },
      {
        id: 1,
      }

    ],
  };






  render() {

    return (
      <div>
        <Slider click={this.clickSlider} />
        <div className="wrapper">
        </div>
        <ReactOpenSeadragon {...this.state} />
      </div>
    );
  }
}

export default App;
4

1 回答 1

1

我对 ReactOpenSeadragon 不熟悉,但我对 OpenSeadragon 级别有一些观察。除非您以某种方式定位它们,否则这两个 tileSource 将直接堆叠在彼此之上。最简单的方法是添加collectionMode: true到您的选项(让它们彼此相邻出现)或sequenceMode: true(让它们显示为您可以使用 UI 中的箭头按钮导航到的页面)。

似乎也defaultZoomLevel: 0错了;zoom 永远不应该为 0。也许现在就完全删除它。

于 2018-09-10T17:58:35.340 回答