这个传单代码如何加载图像

时间:2016-03-23 09:50:38

标签: leaflet

从此网址http://thematicmapping.org/playground/zoomify/example.html

获取的代码
var map = L.map('photo').setView(new L.LatLng(0,0), 0);

L.tileLayer.zoomify('http://thematicmapping.org/playground/zoomify/books/', {
    width: 5472,
    height: 3648,
    tolerance: 0.8,
    attribution: 'Photo: Bjørn Sandvik'
}).addTo(map);

如果有人转到我粘贴在顶部的url并检查源代码,那么必须注意代码中没有提到z,y或x但是他们的代码工作文件和加载tile。代码是如何工作的?

任何人都可以看到代码并告诉我如何在没有z,y和x的情况下加载tile?

请分享知识。感谢

1 个答案:

答案 0 :(得分:2)

“魔法”在Leaflet.Zoomify plugindocumentation)内编码。

插件会将zxy值附加到网址路径,这假设切片结构遵循Zoomify约定(因此名称为插件)。