【问题标题】:How add custom params at XYZ url request?如何在 XYZ url 请求中添加自定义参数?
【发布时间】:2021-12-13 13:09:59
【问题描述】:

OpenLayers 在向给定的 XYZ 服务器请求切片方面做得很好。

如果我需要将额外的参数(比如说日期时间)附加到那些自动计算的 Tiles 上怎么办:

https://tile.server.com/streets/tiles/256/14/8024/6176?access_token=.....**&datetime=1000**

谢谢。

【问题讨论】:

    标签: openlayers


    【解决方案1】:

    您可以在tileUrlFunctiontileLoadFunction 中添加额外的参数,例如

    tileLoadFunction: function(imageTile, src) {
      imageTile.getImage().src = src + '&datetime=1000';
    },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-02
      • 1970-01-01
      相关资源
      最近更新 更多