我目前正在对谷歌地图API V3在这里
如果您在21到23之间缩放,地图上将会有一个图像叠加层.图像需要很长时间才能加载,我决定将其分解成不同的图块以便于加载.我正在使用自动瓷砖切割机将图像切割成瓷砖.
我的脚本有问题;
var OrgX = 31551; // the Google Maps X value of the tile at the top left corner of your Photoshop document
var OrgY = 50899; // the Google Maps Y value of the tile at the top left corner of your Photoshop document
Run Code Online (Sandbox Code Playgroud)
第一个问题如何从photoshop文档中找到X和Y的值?
如果我设法解决第一个问题,那就说吧.
第二个问题以下代码是否正确显示瓷砖取决于缩放级别?或者我错过了任何代码?
var BuildingsLayer = new google.maps.ImageMapType({
getTileUrl: function(coord, zoom) {
return "http://search.missouristate.edu/map/tilesets/baselayer/" + zoom + "_" + coord.x + "_" + coord.y + ".png";
},
tileSize: new …Run Code Online (Sandbox Code Playgroud) 我正在使用 Mapbox GL JS 使用我自己的 tile-server(它只pbf在Z/X/Y目录结构中提供 openmaptiles文件)来显示地图。
瓷砖的加载是根据当前中心坐标自动完成的。
我想为离线解决方案预加载周围的瓷砖。我知道如何获得当前的缩放级别map.getZoom()
如何获取当前磁贴 URL 的 X 和 Y 索引?