【问题标题】:leaflet js + gMapCatcher tiles at zoom -2 not rendering传单 js + gMapCatcher 缩放 -2 的瓷砖不渲染
【发布时间】:2017-03-17 16:44:47
【问题描述】:

我正在使用带有 gmapcatcher 的传单 js。我阅读了以下问题的答案:

https://stackoverflow.com/questions/18695623/leaflet-gmapcatcher-change-zxy-template#=

这对我帮助很大。虽然有一个小问题,但我似乎无法解决这个问题。我使用 gmapcatcher 下载的磁贴适用于办公室周围小区域的缩放级别 -2 到 1。上述问题中建议的解决方案适用于传单的缩放级别 16 17 和 18(gmapcatcher 瓷砖的缩放 -1 0 和 1)但是当我进一步放大到 19 级时,它只是无法渲染瓷砖和显示灰色背景。我查看了 leaflet.js 文件和 getTileUrl 函数。此函数生成的所有图块...

getTileUrl: function (t) {
    return L.Util.template(this._url, L.extend({
        s: this._getSubdomain(t),
        z: t.z,
        x: t.x,
        y: t.y,
        z0: 17-t.z,
        x0: Math.floor(t.x/1024),
        x1: Math.floor(t.x%1024),
        y0: Math.floor(t.y/1024),
        y1: Math.floor(t.y%1024)
    }, this.options))
},

存在于相应的文件夹中。有人可以建议我忽略什么吗?

【问题讨论】:

  • 您确定您的切片服务器具有缩放级别为 19 及以上的切片吗?灰色瓷砖听起来这些瓷砖不可用。

标签: javascript google-maps leaflet openstreetmap


【解决方案1】:

确保在您的切片图层上设置maxZoom 选项。默认值为stands in the documentation,为18。还要注意maxNativeZoom 选项。

【讨论】:

  • 是的,这正是正在发生的事情。为愚蠢的问题道歉,并感谢您的回答。至少我阅读了大部分传单代码来弄清楚这一点。
猜你喜欢
  • 2016-11-03
  • 1970-01-01
  • 2015-08-28
  • 1970-01-01
  • 2015-01-06
  • 1970-01-01
  • 1970-01-01
  • 2021-07-13
  • 1970-01-01
相关资源
最近更新 更多