'Get Tile from internet openstreemap website, note maximum zoom level is 19
Public Sub getTileFromInternet(iZ As Int,iX As Int,iY As Int) As ResumableSub
Dim j As HttpJob
Dim bmp As B4XBitmap
Dim strTiles As String = iZ & "/" & iX & "/" & iY & ".png"
Try
j.Initialize("", Me)
j.Download("https://a.tile.openstreetmap.org/" & strTiles)
'j.GetRequest.SetHeader("User-Agent","Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0")
j.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Try
bmp=j.GetBitmap
Catch
Log("no tile obtained!")
Log(LastException.Message)
End Try
End If
Catch
Log("no connection to tile server!")
Log(LastException.Message)
End Try
If j.IsInitialized Then
j.Release
End If
Return bmp
End Sub