【发布时间】:2015-04-21 13:55:50
【问题描述】:
我必须将现有 openlayers 2 应用程序的地图图块提供程序从 OpenStreetMaps 更改为 Here 地图。为此,我尝试实现与UsingCustomTiles 中描述的类似方法。
现在我不知道如何将我的 EPSG:3857 坐标(边界)映射到正确的 z/x/y 平铺地址。 Map Tile API Developer's Guide 中有一个计算示例来获取 EPSG:4326 坐标的正确图块地址,我认为不需要重新投影我的坐标,因为地图和坐标是墨卡托投影的。
我也不确定在 openlayers 地图中为 maxExtent 和 maxResolution 设置什么值,也许这就是我的 UsingCustomTiles 示例失败的原因。
有人可以提供提示吗?
【问题讨论】:
-
如果不能使用 XYZ 层:var x = Math.round ((bounds.left - this.maxExtent.left) / (res * this.tileSize.w)); var y = Math.round ((this.maxExtent.top - bounds.top) / (res * this.tileSize.h)) 需要 maxResolution: 156543.0339 设置为地图选项
标签: javascript geolocation openlayers here-api