Javascript 如何在OpenSeadragon中添加多个瓷砖图像
这里的代码我正在尝试,但它不工作Javascript 如何在OpenSeadragon中添加多个瓷砖图像,javascript,reactjs,openseadragon,Javascript,Reactjs,Openseadragon,这里的代码我正在尝试,但它不工作 class App extends Component { state = { id: "OSD", getImageURL: 'http://cdm16022.contentdm.oclc.org/utils/ajaxhelper', osdConfig: { setStrings: [{ name: 'Tooltips.Home', value: 'Reset' }], defaultZoomLeve
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;
类应用程序扩展组件{
陈述=
{
id:“OSD”,
getImageURL:'http://cdm16022.contentdm.oclc.org/utils/ajaxhelper',
osdConfig:{
设置字符串:[{name:'Tooltips.Home',值:'Reset'}],
defaultZoomLevel:0,
瓷砖资源:[
{
图片:{
xmlns:“http://schemas.microsoft.com/deepzoom/2008",
Url:“https://openseadragon.github.io/example-images/highsmith/highsmith_files/",
格式:“jpg”,
重叠:“0”,
瓷砖大小:“256”,
尺寸:{
高度:“9221”,
宽度:“7026”
}
}
},
{
图片:{
xmlns:“http://schemas.microsoft.com/deepzoom/2008",
Url:“https://openseadragon.github.io/example-images/highsmith/highsmith_files/",
格式:“jpg”,
重叠:“1”,
瓷砖大小:“256”,
尺寸:{
身高:“621”,
宽度:“526”
}
}
}
],
},
页码:[
{
id:0,
},
{
id:1,
}
],
};
render(){
返回(
);
}
}
导出默认应用程序;
我不熟悉OpenSeadragon,但我在OpenSeadragon级别上有一些观察。这两个瓷砖资源将直接堆叠在彼此的顶部,除非您以某种方式定位它们。最简单的方法是将collectionMode:true
添加到选项中(使它们彼此相邻显示)或sequenceMode:true
(使它们显示为可以使用UI中的箭头按钮导航到的页面)
而且defaultZoomLevel:0
似乎是错误的;缩放永远不应为0。也许现在就把它完全去掉