B4J Question Google Maps marker

Discussion in 'B4J Questions' started by rboeck, Dec 13, 2017.

Tags:
  1. rboeck

    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?
     
  2. magi6162

    magi6162 Well-Known Member Licensed User

    I hope help:

    Code:
    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"))
     
  3. rboeck

    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.
     
  4. magi6162

    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
    Code:
    '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
     
    rboeck likes this.
  5. rboeck

    rboeck Well-Known Member Licensed User

    I had this sub already in the app, but not used. I didnt realize the real possibilities! Thanks!
     
    magi6162 likes this.
  6. klaus

    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice