B4J Library jGoogleMaps library

Status
Not open for further replies.

javiers

Active Member
Licensed User
Longtime User

Thank you! always so excellent in providing assistance .
 

ivanomonti

Expert
Licensed User
Longtime User
How can I re-read the title of a maker to be used as query call record database

SelectedMarker.Title and only writing

example

B4X:
"select * fron table where field = SelectedMarker.Title"
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Create a global Map that maps between markers and any other data you need to store (title for example).

B4X:
Sub AddMarker(..., Title As String)
Dim m As Marker = gmap.AddMarker(lat, lon, Title)
MapOfMarkers.Put(m, Title)
End Sub

Dim title As String = MapOfMarkers.Get(SelectedMarker)
 
Last edited:

ivanomonti

Expert
Licensed User
Longtime User
possible map error due to the links of credits google below right, leads to the menu page of info service, and then returns to map.


 

Douglas Farias

Expert
Licensed User
Longtime User
@Erel
its possible show a panel with mensage like the image on github?


like pop up on fred wilkie with a x to close the panel, this pop up is from lib ?
 

Douglas Farias

Expert
Licensed User
Longtime User
thx man this works i want only show a car speed =) ty
 

vfafou

Well-Known Member
Licensed User
Longtime User
Hello!
Is it possible to use this library within a Web Application, or it's used only within desktop apps?
Thank you in advance!
 

valentino s

Active Member
Licensed User
Longtime User

Sorry Erel, is it possible that code in post #26 doesn't work, but works the following ? :

B4X:
Dim title As String = MapOfMarkers.Get(SelectedMarker)

To me works. Is it correct ?
 

Roger Daley

Well-Known Member
Licensed User
Longtime User


Hi Erel/All

When I run the code below I get an error that BTSMarkerX should be first initialized. Not an option.
B4X:
Dim BTSMarkerX As Marker = markerMap.Get("BTSMarker")
        BTSMarkerX.Remove

Anyone see what I have missed this time?

Regards Roger
 

Roger Daley

Well-Known Member
Licensed User
Longtime User
Erel,

Code below.

B4X:
Sub Process_Globals
    Private  markerMap As Map
    Private MarkerFlag As String
' Etc.
End Sub

Sub gmap_Ready

   'CreatE BTSMarker
        MarkerLocation.Initialize(BTSLat,BTSLng)
        Private BTSMarker = gmap.AddMarker2(BTSLat , BTSLng, "BASE", File.GetUri(File.DirAssets, "bts.png")) As Marker
        BTSMarker.Position = MarkerLocation         'set BTSMarker new location
        markerMap.Put(BTSMarker, 1)                 'place them both in a Map so you can retrieve Marker1's location (MarkerLocation)

    'CreatE LANDMarker
        MarkerLocation.Initialize(LANDLat,LANDLng)
        Private LANDMarker = gmap.AddMarker2(LANDLat , LANDLng, "LANDMARK", File.GetUri(File.DirAssets, "landmark.png")) As Marker
        LANDMarker.Position = MarkerLocation         'set LANDMarker new location
        markerMap.Put(LANDMarker, 2)                 'place them both in a Map so you can retrieve Marker1's location (MarkerLocation)
   
        HorizonPointLatLng
        DrawLandMarkLine
        DrawAntBearingLine
       
        cp.Initialize(MapLat, MapLng, MapZoom )
        gmap.MoveCamera(cp)
End Sub

#End Region
Sub gmap_Click (Point As LatLng)
    Private MapCenter As LatLng   
    Private BTSLatLng As LatLng
    Private LandMarkLatLng As LatLng       
       
    If MarkerFlag = 1 Then
        BTSLatLng = Point
        BTSLat = BTSLatLng.Latitude
        BTSLng = BTSLatLng.Longitude

'Remove marker before placing marker at new location
        Dim BTSMarkerx As Marker  = markerMap.Get("BTSMarker")
        BTSMarkerx.Remove

'Add marker at new location       
        MarkerLocation.Initialize(BTSLat,BTSLng)
        Private BTSMarker = gmap.AddMarker2(10 , 10, "BASE", File.GetUri(File.DirAssets, "bts.png")) As Marker
        BTSMarker.Position = MarkerLocation         'set BTSMarker new location
        markerMap.Put(BTSMarker, 1)    

    End If
    If MarkerFlag = 2 Then
        LandMarkLatLng = Point
        LANDLat = LandMarkLatLng.Latitude
        LANDLng = LandMarkLatLng.Longitude        

'Remove marker before placing marker at new location       
        Dim LANDMarkerX As Marker = markerMap.Get("LANDMarker")
        LANDMarkerX.Remove


'Add marker at new location   
        MarkerLocation.Initialize(LANDLat,LANDLng)
        Private LANDMarker = gmap.AddMarker2(LANDLat , LANDLng, "LANDMARK", File.GetUri(File.DirAssets, "landmark.png")) As Marker
        LANDMarker.Position = MarkerLocation         'set LANDMarker new location
        markerMap.Put(LANDMarker, 2)                 'place them both in a Map so you can retrieve Marker1's location (MarkerLocation)    
    End If


    DispBTSLat.Text = NumberFormat2 (BTSLat, 1 ,  5, 5, False)
    DispBTSLng.Text = NumberFormat2 (BTSLng, 1 , 5, 5, False)
    DispLandLat.Text = NumberFormat2 (LANDLat, 1 , 5, 5, False)
    DispLandLng.Text = NumberFormat2 (LANDLng, 1 , 5, 5, False)
    DispAntBearing.Text = NumberFormat2 (AntBearing, 1 , 1 , 1, False)
   
    HorizonPointLatLng
    DrawLandMarkLine
    DrawAntBearingLine
   
'Force re-draw of map to remove old marker icon
    MapZoom = gmap.CameraPosition.Zoom
    MapCenter = gmap.CameraPosition.Target
    cp.Initialize(MapCenter.Latitude, MapCenter.Longitude, 10 )
    gmap.MoveCamera(cp)
    cp.Initialize(MapCenter.Latitude, MapCenter.Longitude, MapZoom )
    gmap.MoveCamera(cp)
   
    MarkerFlag = 0
End Sub

Regards Roger
 

jmon

Well-Known Member
Licensed User
Longtime User

jmon

Well-Known Member
Licensed User
Longtime User
I get an error when starting the app with no internet connection:
And it seems that it cannot be caught, even with a Try / Catch at the initialization of Gmap, thoough it does not crash the app.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…