问题描述
我正在寻找如何生成自己的图像切片并将其放入服务器的示例。来自?...的示例加载图块,但如何如果我想要我的图像?
var trafficOptions = {
getTileUrl:function(coord,zoom){
返回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;
函数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/)。
还有另一种方法吗?
我认为我错过了一些kwnoleadge。任何人都可以举个例子吗?
谢谢!! 会建议您使用GDAL(命令行界面)来分割图像。
您也可以使用maptiler,但它会在每张图片上放置令人讨厌的水印
也可能使用maptiler基于的原始GDAL。
一个非常有用的教程可以在这里找到
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!!
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 imageMight as well use the original GDAL that maptiler is based on.A very useful tutorial can be found herehttp://alastaira.wordpress.com/2011/07/11/maptiler-gdal2tiles-and-raster-resampling/
这篇关于如何让你的图片网址磁贴? (谷歌地图)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!