如何在React OpenSeadragon中添加多个图块图像

问题描述 投票:0回答:1

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

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;
javascript reactjs openseadragon
1个回答
1
投票

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

defaultZoomLevel: 0似乎也错了; zoom应该永远不会是0.也许只是暂时删除它。

© www.soinside.com 2019 - 2024. All rights reserved.