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

1

3

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!!

Stines answered 23/11, 2011 at 11:18 Comment(1)
For reference, this is the current URL format for Google map tiles: mts1.google.com/vt/….Interbrain
L
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/

Libradalibrarian answered 16/4, 2014 at 19:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.