传单进一步放大并拉伸瓷砖 [英] Leaflet zoom in further and stretch tiles

查看:23
本文介绍了传单进一步放大并拉伸瓷砖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在地图上放大到足够远时,TileLayer 消失了,我看到一堆显示地图数据尚不可用"的图块.我相信这些图块可能来自提供商,但我不确定(我使用的是 ESRI WorldImagery 数据集).

When I zoom in far enough on my map, the TileLayer disappears and I see a bunch of tiles that say "Map data not yet available". I believe these tiles may be coming from the provider, but I am not sure (I am using ESRI WorldImagery dataset).

有没有什么方法可以在某个缩放级别下,只强制图块拉伸,而不是请求该缩放级别的图块?有些模糊我没问题,但我确实需要进一步放大.

Is there any way to, at a certain zoom level, just force the tiles to stretch, instead of requesting the tiles for that zoom level? I am ok with some blur, but I do need to zoom in further.

我尝试使用 zoomOffset 选项,但每当我放 0 以外的东西时,我的图块永远不会加载(全是灰色).

I tried playing around with the zoomOffset option, but whenever I put something there other than 0, my tiles just never load (all grey).

谢谢!

推荐答案

这可以通过L.TileLayer的两个选项来解决.

This can be solved by using two of the options of L.TileLayer.

首先,将 maxNativeZoom 设置为您的图块提供的最高缩放级别(地图数据不可用"开始出现之前的最后一个缩放级别 - 这告诉 Leaflet 在放大时停止请求新图块超出此级别;将使用拉伸的图块.

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.

其次,将 maxZoom 设置为合适的缩放;您可能不希望它比 maxNativeZoom 高几个级别,因为拉伸的图块会开始看起来很糟糕.

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.

您可以通过查看 L.TileLayer 文档中的选项"下的选项"了解更多详细信息:http://leafletjs.com/reference.html#tilelayer

You can find out more about the details by checking under "Options" in the documentation for L.TileLayer: http://leafletjs.com/reference.html#tilelayer

这篇关于传单进一步放大并拉伸瓷砖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆