'Get Tile from internet openstreemap website
public Sub getTileFromInternet(aZ As Int,aX As Int,aY As Int) As ResumableSub
Dim j As HttpJob
Dim bmp As B4XBitmap
Try
j.Initialize("", Me)
' j.Download($"https://a.tile.openstreetmap.org/${aZ}/${aX}/${aY}.png"$)
j.Download($"https://a.tile.openstreetmap.fr/osmfr/${aZ}/${aX}/${aY}.png"$) 'see server tiles
j.GetRequest.SetHeader("User-Agent","Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0") 'see user gent
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Try
bmp=j.GetBitmap
Catch
Log($"getTileFromInternet: ${LastException.Message}"$)
End Try
End If
Catch
Log($"getTileFromInternet: ${LastException.Message}"$)
End Try
If j.IsInitialized Then
j.Release
End If
Return bmp
End Sub