Android Question Open Street Map viewer - GPS

drgottjr

Expert
Licensed User
Longtime User
you mean these blue lines?
bluelines.png


so annoying.
there seems to be some issue with the osmfoundation ("ResponseError. Reason: , Response: Access denied. See https://operations.osmfoundation.org/policies/tiles/").
you'll have to wait for the app's author to follow up. i can think of a number of possible explanations.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
This problem is caused by the query limit.

you need to change the tile server and user agent.

Check the servers available at:

example:
1657694784656.png

B4X:
'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
see:
1657694704274.png
 
Upvote 0

davelew1s

Active Member
Licensed User
Longtime User
Thanks '

drgottjr and​

Omar Parra A.

for the replies.
I think it's solved but i'm still playing with it.
I changed the server and the user agent, initially it didn't work as expected so i emptied the database now it seem fine.
I also tried Google Maps that works aswell.
As said i am still playing around with it.
Dave.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
I changed the server and the user agent, initially it didn't work as expected so i emptied the database now it seem fine.
You are right, it uses a database as a tile cache.

Note that this database stores images and is relatively large in size.
 
Upvote 0

Lakhtin_V

Active Member
Licensed User
Longtime User
How should the code be redone so that the map is displayed based on a previously downloaded file with the OCM extension. I don't have internet access during the map rendering process and I want to use one locality OSM file that I downloaded earlier via export from mapsource main site
 
Upvote 0
Top