Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the url to download map tiles from google maps?

I'm developing an android app using google maps android sdk v2 and want to allow users to download maps and use them offline.

  1. To display the tiles I use a custom TileProvider implementation as described here.
  2. I need to know the URL to download a google maps tile (vector tile if possible) based on latitude, longitude and zoom parameters (e.g. something like this )

Before anyone comments that it's violating google maps' terms, I can tell you it's ok to download a small amount of tiles specifically for this use case (see section 10.5.d in their terms here).

like image 766
BeFree Avatar asked Dec 16 '15 12:12

BeFree


Video Answer


1 Answers

This is the link

http://mt1.google.com/vt/lyrs=y&x=1325&y=3143&z=13

lyrs parameters are :

y = hybrid

s = satelite

t = train

m = map

By Overriding getTile in your TileProvider, You get the needed X and Y and Zoom. there is no need to do anything.

@Override
public Tile getTile(int x, int y, int zoom) {
    // DO YOUR STUFF HERE
}
like image 159
Omid Heshmatinia Avatar answered Oct 04 '22 20:10

Omid Heshmatinia