B4J Question Google Maps marker

rboeck

Well-Known Member
Licensed User
In google maps for android we have the possibilty, to load and manipulate the bitmaps, that are used for markers.
In google maps for bj4, we use files in assets folder to set the markers. I want try to manipulate the markers to give the users a bit more information, so 5 different colors could show, how much earning each customer has. We also have code, to bring letters to bitmaps, so that we can make an index table in gmap.
Is it possible with the gmap java object, to manipulate the loaded bitmaps, after a marker is set?
 

magi6162

Well-Known Member
Licensed User
I hope help:

B4X:
        Private m As Marker = gmap.AddMarker2(coord(1),coord(0),rs.GetString("NTer") & " " & rs.GetString("NFam") & " " & rs.GetString("NV"), File.GetUri(File.DirAssets,"number_" & nterritorio & ".png"))
 
Upvote 0

rboeck

Well-Known Member
Licensed User
Thanks, i use this code already and in this form. But i want to use self created or manipulated bitmaps at runtime. Its nearly impossible, to create more than hundred markers for each combination of letter and picture.
 
Upvote 0

magi6162

Well-Known Member
Licensed User
Surely I can not understand, but
create the bitmap (runtime), save it to a file and use it.

or: (from B4J HowTos
B4X:
  'Set the marker label with properties color and size
  SetMarkerLabel(m, title, "red", 14)


'Set the marker label text, text color and size
Sub SetMarkerLabel(m As Marker, text As String, textcolor As String, textsize As Int)
  Dim jo As JavaObject = m
  jo = jo.RunMethod("getJSObject", Null)
  Dim propertyjs As String = $"this.setLabel({text: "${text}",color: "${textcolor}","fontSize": "${textsize}px"});"$
  Log(jo.RunMethod("eval", Array(propertyjs)))
End Sub
 
Upvote 0

klaus

Expert
Licensed User
How many different icons do you have?
I am afraid that you cannot manipulate the bitmaps in the code.
Authorized bitmaps are either in an url or in File.DirAssets.
But File.DirAssets is read only, and images in other directories are not allowed.
 
Upvote 0
Top