B4A Question Google maps markers' animation - JordiCP (first post)    Mar 23, 2016   (4 reactions) If you want to "update" the markers position as you keep receiving new coordinates for those points, you should keep a reference to the markers in a map when you create them
Then add a code similar to this example. It is not complete as you need to init PersonList and MarkersMap first with the appr B4A Question How to change a google map marker icon in the marker click event? - TILogistic (first post)    Aug 18, 2021   (1 reaction) Sub MapFrag_MarkerClick (SelectedMarker As Marker) As Boolean
Dim BitmapPosition As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "my.png", 26dip, 26dip, True)
SetMarkerIcon(SelectedMarker, BitmapPosition)
End Sub
Public Sub SetMarkerIcon(mMarker As Marker, mIcon As B4XBitmap)
Dim jo B4A Question Find Google Maps marker by Snippet or Name - Erel (first post)    Jan 15, 2020   (1 reaction) A Map is even better for this.
Markers.Put(NewMarker.Title, NewMarker)
...
Dim m As Marker = Markers.Get("title 1") B4J Question creating control array at runtime - Erel (first post)    Dec 14, 2020 Google map markers are not controls. They are drawing by the map engine. B4A Question How to load an image as marker in Google Map - Andrew (Digitwell) (first post)    Sep 06, 2020   (1 reaction) try using AddMarker3 on the GoogleMap object.
I pulled these lines from a working app,
marker is a list of map objects which contains 4 values, latitude, longitude,name and imagefilename.
gmap is the GoogleMap object
e.g.
For Each mrk as map In markers.values
Private mapmrk As Marke B4A Question Google Maps Markers - Erel (first post)    Nov 16, 2016 You can use a Map (the collection) with the marker as the key and then "tie" any data you like to the marker.
Example: https://www.b4x.-wrong-forum-google-maps-marker-location.61154/#post-385846 Bug? Google Map Markers color is different in latest library - Erel (first post)    Nov 23, 2022 This is handled by the underlying SDK. B4J Question Google maps marker location - Roycefer (first post)    Dec 08, 2015   (1 reaction) Whenever you create a Marker or change its position, add it and its position to a Map:
Dim markerMap as Map
markerMap.Initialize
'.... much later
Marker1.Position = MarkerLocation 'set Marker1's new location
markerMap.Put(Marker1, MarkerLocation) 'place them both in a Map so you can retrieve Marker B4i Question Custom Google Map Markers - Erel (first post)    Oct 22, 2017   (2 reactions) https://www.b4x.com/basic4android/images/SS-2017-10-22_10.15.28.png
Sub CreateBitmap(text As String) As B4XBitmap
Dim xui As XUI
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, 32dip, 20dip)
Dim c As B4XCanvas
c.Initialize(p)
c.DrawRect(c.TargetRect, xui.Color B4i Question Automatically "press" the Marker in Google Map - Erel (first post)    Jul 14, 2021 The open marker is the selected marker. Only one marker can be selected at a time. It can be done programmatically.
Untested code:
gmap.As(NativeObject).SetField("selectedMarker", OneOfTheMarkers) Page: 1   2   3   4   5   6   7   Powered by ColBERT |