全球地图图块在缩放级别 19 后消失
问题描述
我将 OpenStreetMap 与
<小时>
编辑:
我猜你用过map.options.maxZoom
设置为高数字,让用户缩放以查看您的室内图像细节.
但是,OSM 磁贴在缩放级别 19 之后不可用,因此服务器返回 404 错误,并且您的磁贴被错误磁贴替换(或者如果未指定,则只是灰色磁贴).
在这种情况下,您只需在 Tile Layer 上使用这 2 个选项(一起)来告诉 Leaflet 重新使用较低缩放比例的图块并展开它们:
maxNativeZoom
设置为 19.maxZoom
设置为您需要的任何值,并且相等到map.options.maxZoom
如果指定.
演示:http://jsfiddle.net/ve2huzxw/68/
I use OpenStreetMap with Leaflet.js.
I have a map with an indoor picture on it. The problem is when I zoom in, streets disapears. Do you know anything that can solve this plz? Tricks or tips!
EDIT:
I guess you have used map.options.maxZoom
at a high number to let the user zoom to see your indoor image details.
However, OSM tiles are not available past zoom level 19, so the server returns 404 errors and your tiles are replaced by the Error Tile (or just a grey tile if not specified).
In that case, you would simply need to use these 2 options (together) on Tile Layer to tell Leaflet to re-use tiles from a lower zoom and to expand them:
maxNativeZoom
set at 19.maxZoom
set at whatever you need, and equal tomap.options.maxZoom
if specified.
Demo: http://jsfiddle.net/ve2huzxw/68/
这篇关于全球地图图块在缩放级别 19 后消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!