Android Question Open Street Map viewer - GPS

davelew1s

Active Member
Licensed User
Longtime User
I downloaded this https://www.b4x.com/android/forum/threads/127827/#content last week This worked initially but after a few runs I just blue lines
in all the tiles no map.
I tried changing the server, i tried running it on a tablet and phone, i tried compiling it on a desktop and laptop, i used wifi and phone data with the same results.
Any help?
Thanks Dave.
 

drgottjr

Expert
Licensed User
Longtime User
you mean these blue lines?


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:

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:
 
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
Cookies are required to use this site. You must accept them to continue using the site. Learn more…