Just came across this and thinking about moving to this from OSMDroid.
Trying to figure out how to download a map area based on min and max latitude and longitude and can't figure out
how to get from latitude and longitude to the Open Street Map x and y tile numbers, so I can do something like this:
Any suggestions?
RBS
Trying to figure out how to download a map area based on min and max latitude and longitude and can't figure out
how to get from latitude and longitude to the Open Street Map x and y tile numbers, so I can do something like this:
B4X:
Sub DownLoadTiles(iMinX As Int, iMaxX As Int, iMinY As Int, iMaxY As Int, iMinZoom As Int, iMaxZoom As Int)
Dim x As Int
Dim y As Int
Dim z As Int
cTileManager.Initialize
For z = iMinZoom To iMaxZoom
cTileManager.DeleteTilesFromDB(iMinX, iMaxX, iMinY, iMaxY, z)
Next
For x = iMinX To iMaxX
For y = iMinY To iMaxY
For z = iMinZoom To iMaxZoom
Dim rs As ResumableSub = cTileManager.getTileFromInternet(z, x, y)
Wait For (rs) Complete (b4xbmp As B4XBitmap)
cTileManager.setTileToDB(z, x, y, b4xbmp)
Next
Next
Next
End Sub
Any suggestions?
RBS