简体   繁体   English

单张图的瓦工显示未找到图像的缺少瓷砖的图标

[英]Leaflet tilelayer showing image not found icon for missing tiles

I am using Leaflet 1.0 for my interactive map. 我正在为我的交互式地图使用Leaflet 1.0。 I have created my own tiles for the Netherlands, added them: 我为荷兰创建了自己的瓷砖,并添加了它们:

L.tileLayer('/gem/{z}/{x}/{y}.png', {zIndex: 10})

Everything is working fine in Chrome and Firefox. Chrome和Firefox一切正常。 Note: the layer conatains administrative boundaries, white coloured borders, therefor they are barely visible in the image. 注意:该图层包含管理边界,即白色边框,因此在图像中几乎看不到它们。

IE and Microsoft Edge are displaying these 'image not found' icons for all missing tiles. IE和Microsoft Edge正在为所有丢失的图块显示这些“找不到图像”图标。

找不到图块,IE和Edge

Make sure that the bounds and zoom levels match the actual bounds / zoomlevels of the WMS Tilelayer. 确保范围和缩放级别与WMS Tilelayer的实际范围/缩放级别匹配。 In that case IE/Edge nor any other browser will request these missing images from the server. 在那种情况下,IE / Edge或任何其他浏览器都将从服务器请求这些丢失的图像。

You can pass the options maxZoom, minZoom and bounds to your L.TileLayer object. 您可以将选项maxZoom,minZoom和bounds传递给L.TileLayer对象。 Also there's this option: errorTileUrl, which is an URL to the tile image to show in place of the tile that failed to load. 还有一个选项:errorTileUrl,它是平铺图像的URL,用于代替未能加载的平铺显示。

For more info check: Leaflet Tilelayer WMS docs 有关更多信息,请检查: Leaflet Tilelayer WMS文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM