Android Question Oops wrong forum Google maps marker location

Roger Daley

Well-Known Member
Licensed User
Hi All,

[Private MarkerLocation as LatLng]

In B4A the code "MarkerLocation = Marker1.Position" loads MarkerLocation with the LatLng of Marker1.
In B4J Marker.Position is write only.

I can't find anywhere how to get LatLng in B4J

Regards Roger
 
Last edited:

Roycefer

Well-Known Member
Licensed User
When you create the Marker, also place it in a Map as the key and the LatLng as the value. Then you can retrieve the Marker's LatLng.
 

Roger Daley

Well-Known Member
Licensed User
Hi Roycefer
Thanks for the reply, firstly I have re-posted the question in B4J where it was intended.:oops:

I really can't follow your answer:confused:[my issue, not yours] but from what it appears I should have mentioned that there are two moveable markers which I need to track.

Regards Roger
 

eurojam

Well-Known Member
Licensed User
Hi Roger,
Roycefer means the following
B4X:
    Type MarkerInfo (id As Int, name As String, Latitude As Double , Longitude As Double)  
    Private MarkerMap As Map
you have Map and a type for example to store additional information to your Marker
later when you add the marker to the map:
B4X:
    Dim m As Marker
    m = gmap.AddMarker(Point.Latitude, Point.Longitude, "some text")
    Dim MI As MarkerInfo
    MI.id=1
    MI.Latitude
    MI.Longitude
    MarkerMap.Put(m, MI)
If you want to retrieve information for your marker:
B4X:
Sub gmap_MarkerClick (SelectedMarker As Marker)  
    Dim MI As MarkerInfo
    MI = MarkerMap.Get(SelectedMarker)
    Log(MI.Latitude)
End Sub
ok, wrong forum, should be in B4J....:mad:
 
Top