B4A Class Open Street Map viewer - GPS

aminoacid

Active Member
Licensed User
Longtime User
Hi,

The tiles are retrieved from internet and stored in a sqlite database.
The module clMapTieManager.bas does the job.
spsp

Thanks for the reply. However, I'm looking at the B4J version of your B4XMap example and don't see this module anywhere. Am I missing something?
 

aminoacid

Active Member
Licensed User
Longtime User
Is there any way to enable the mouse scroll-wheel to zoom in and out, rather than have to use the + or - buttons?

Also, how do you get a Balloon callout when you click a marker... like in GoogleMaps ?



Thanks!
 
Last edited:

spsp

Active Member
Licensed User
Longtime User
Is there any way to enable the mouse scroll-wheel to zoom in and out, rather than have to use the + or - buttons?

Also, how do you get a Balloon callout when you click a marker... like in GoogleMaps ?

View attachment 145380

Thanks!
Hi,

I didn'tplan to updae this library but feel free to modifiy it according to yours needs.

spsp
 

synasir

Member
Licensed User
Longtime User
Hi, great library here. Using it to download Google Satellite images. However, one question. How does one change the database name "tiles.db3" to something else programmatically by inputting a filename? Thanks.
 

spsp

Active Member
Licensed User
Longtime User
Hi, great library here. Using it to download Google Satellite images. However, one question. How does one change the database name "tiles.db3" to something else programmatically by inputting a filename? Thanks.
Hi,

In clTileManager.bas, change the name in the dbInit sub.

Maybe, add a constant fDataBaseName in the class, and use it in the dbInit sub

spsp
 

papajds

Member
Hello, I discovered this subject, and very impressive.
I am new to B4A, and I am testing this project out of curiosity
question: is it possible to change the texts of the options buttons of the map, or to change the language?
THANKS
Bye
Jo
 

spsp

Active Member
Licensed User
Longtime User
Hello, I discovered this subject, and very impressive.
I am new to B4A, and I am testing this project out of curiosity
question: is it possible to change the texts of the options buttons of the map, or to change the language?
THANKS
Bye
Jo
Hi,

the file 'menu.json' contains menu options. it is used in the B4XMainPage module (sub Private Sub fcvMap_MenuClicked)

spsp
 

papajds

Member
Hi,

Yes, I saw, but if I change something in this file, it is recreated identically I even tried to delete it, it recreates itself when the program runs.

Jo
 

papajds

Member
Hi,

I found why
the files were copied from "shared files" each time the program was launched...I was not modifying the right files.

thanks
Jo
 

spsp

Active Member
Licensed User
Longtime User
Hi,

I found why
the files were copied from "shared files" each time the program was launched...I was not modifying the right files.

thanks
Jo
H,

Yes the copy is made by this line in B4XMainPage module :
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"

spsp
 

papajds

Member
Hi,

I would like to try with a button to place a marker on the map at the current coordinates.
but with each click, the application “crash”
I have the message:
java.lang.Exception: Sub button1_click signature does not match expected signature.

Any ideas ?

thanks

le code :

private Sub Button1_Click(aLatLng As TMapLatLng)
Dim d As Map=CreateMap("lat":aLatLng.fLat,"lng":aLatLng.fLng)
fcvMap.CenterLatLng=coMapUtilities.initLatLng(d.Get("lat"),d.Get("lng"))
fcvMap.draw
End Sub
 

spsp

Active Member
Licensed User
Longtime User
Hi,

The signature for a click on a button is
private sub button1_click
...
end sub

there is no parameters

if you want respond to a click on the map, take a look at this sub in the B4XMainPage
private Sub fcvmap_mapClicked(aLatLng As TMapLatLng)
.....
End Sub

spsp
 

papajds

Member
Hello, and thank you for your response, but I may have expressed myself poorly.
I would like, with a click on a button that I placed on the sheet (button1), to retrieve the coordinates "aLatLng.fLat" and "aLatLng.fLng", and be able to display them, etc...
I've done several tests, and it doesn't work...

THANKS.
Jo
 

spsp

Active Member
Licensed User
Longtime User
Hi,
Create a sub for the click évent on the button and retriever lat and lng from the cvmap

Sub button1_click
Dim lat as double=fcvmap.centerLat
Dim lng as double=fcvmap.centerLng
......
End sub

spsp
 

papajds

Member
I created it like this:

Public Sub Button1_Click
Dim lat As Double=fcvMap.CenterLatLng.fLat
Dim lng As Double=fcvMap.CenterLatLng.fLng
Log(lat & "," & lng)
End Sub

and I have the "log" of the position.

I will try to save these coordinates in a file...
And I will be able to test if it also works on the road in GPS tracking by pressing the button regularly, to start.
thank you, it's progressing slowly...I'm starting with B4A
Thanks again .
Jo
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…