4

I already successful to load map tiles from SD Card of osmdroid (Mapnik)

But now i want to give a option in my android app to download map tile that user want to use mean map show online user select a specific area and cashes it for his use i don't know how to do please help thanks

1 Answers1

0

I am not sure where the question points to. As far as I understand it, you have the user select an area - which is expressed in geographical coordinates - and then use these coordinates to calculate the tiles to be retrieved.

Under Slippy map tilenames in the OSM wiki there is a very good explanation how to do this:

  • Reproject the coordinates to the Mercator projection (from EPSG:4326 to EPSG:3857):

    x = lon
    y = arsinh(tan(lat)) = log[tan(lat) + sec(lat)]
    

    (lat and lon are in radians)

  • Transform range of x and y to 01 and shift origin to top left corner:

    x = [1 + (x / π)] / 2
    y = [1 − (y / π)] / 2
    
  • Calculate the number of tiles across the map, n, using 2^zoom
  • Multiply x and y by n. Round results down to give tilex and tiley.
glglgl
  • 89,107
  • 13
  • 149
  • 217