How to get your image URL tiles? (google maps)

半腔热情 提交于 2019-11-30 18:18:16

问题


I'm looking on how to generate your own image tiles and put to the server as this example do. The example load tiles from http://mt3.google.com/mapstt?..., but how if I want my image?

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);
}

I was looking on how to generate tiles form an image and I've just founded that you have to us MapTiler (http://www.maptiler.org/).

There's another way?

I think that I miss some kwnoleadge. Can anyone give an example?

Thanks!!


回答1:


I would recommend you use GDAL (a command line interface) to slice up the image. You could also use maptiler, but it places an annoying watermark on every image Might as well use the original GDAL that maptiler is based on. A very useful tutorial can be found here http://alastaira.wordpress.com/2011/07/11/maptiler-gdal2tiles-and-raster-resampling/



来源:https://stackoverflow.com/questions/8241268/how-to-get-your-image-url-tiles-google-maps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!