【问题标题】:How to get your image URL tiles? (google maps)如何获取您的图像 URL 磁贴? (谷歌地图)
【发布时间】:2011-11-23 11:18:33
【问题描述】:

我正在研究如何生成您自己的图像图块并像此示例一样将其放入服务器。该示例从 http://mt3.google.com/mapstt?... 加载图块,但是如果我想要我的图像怎么办?

var trafficOptions = {
  getTileUrl: function(coord, zoom) {
    return "http://mt3.google.com/mapstt?" +
    "zoom=" + zoom + "&x=" + coord.x + "&y=" + coord.y + "&client=google";
  },
  tileSize: new google.maps.Size(256, 256),
  isPng: true
};

var trafficMapType = new google.maps.ImageMapType(trafficOptions);

var map;
function initialize() {
  map = new google.maps.Map(document.getElementById("map_canvas"));
  map.setCenter(new google.maps.LatLng(37.76, -122.45));
  map.setZoom(12);
  map.setMapTypeId('satellite');
  map.overlayMapTypes.insertAt(0, trafficMapType);
}

我正在研究如何从图像中生成图块,我刚刚发现您必须使用我们的 MapTiler (http://www.maptiler.org/)。

还有其他方法吗?

我想我想念一些知识。谁能举个例子?

谢谢!!

【问题讨论】:

标签: google-maps overlay tile


【解决方案1】:

我建议您使用 GDAL(命令行界面)来分割图像。 您也可以使用 maptiler,但它会在每张图像上放置一个烦人的水印 还不如使用maptiler所基于的原始GDAL。 一个非常有用的教程可以在这里找到 http://alastaira.wordpress.com/2011/07/11/maptiler-gdal2tiles-and-raster-resampling/

【讨论】:

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