当我在地图上放大得足够远时,TileLayer消失了,我看到一堆瓷砖说"地图数据尚未可用".我相信这些瓷砖可能来自提供商,但我不确定(我使用的是ESRI WorldImagery数据集).
有没有办法,在某个缩放级别,只是强制瓷砖拉伸,而不是请求该缩放级别的瓷砖?我有一些模糊,但我确实需要进一步放大.
我尝试使用zoomOffset选项,但每当我放置0以外的东西时,我的瓷砖就永远不会加载(全灰色).
谢谢!
Lie*_*man 25
This can be solved by using two of the options of L.TileLayer
.
First, set maxNativeZoom
to the highest zoom level your tiles provide (the last zoom level before the "Map data not available" starts to appear - this tells Leaflet to stop requesting new tiles when zooming in beyond this level; stretched tiles will be used instead.
Second, set maxZoom
to whatever zoom is appropriate; you might not want this to be more than a couple of levels higher than maxNativeZoom
, since the stretched tiles will start to look pretty horrible.
You can find out more about the details by checking under "Options" in the documentation for L.TileLayer
: http://leafletjs.com/reference.html#tilelayer