iOS Question Google maps marker modification

Discussion in 'iOS Questions' started by rboeck, Jun 4, 2018.

Tags:
  1. rboeck

    rboeck Well-Known Member Licensed User

    In B4A i was able to change a bitmap and add a number, before i used this bitmap for a marker.

    In B4I i tried this code:
    Code:
    Dim Bitm As B4XBitmap = LoadBitmap(File.DirAssets,"Markerg.png")
        Cv.Initialize(Bitm)
        Cv.DrawCircle(
    25dip,39dip,14dip,Colors.DarkGray,True,0)
        
    Dim f As Font=Font.CreateNewBold(14)
        Cv.DrawText(
    "1",25dip45dip, f,Colors.Yellow,"CENTER")
        m1= gmap.AddMarker3(
    48.5416.132"Marker Nr.1", Bitm)
    but i got this error: Expected: UIView, object type: UIImage
    So my question: is it possible and which type of object has to be used?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You are not using Canvas correctly.

    Code to create a B4XCanvas:
    Code:
    Public Sub CreateCanvas (width1 As Int, height1 As Int) As B4XCanvas
       
    Dim iv As ImageView
       iv.Initialize(
    "")
       iv.SetLayoutAnimated(
    0100, width1, height1)
       
    Dim c As B4XCanvas
       c.Initialize(iv)
       
    Return c
    End Sub
    You should then draw the bitmap, draw the other stuff, call Cv.Invalidate and get the bitmap with Cv.CreateBitmap.
    Then release the canvas with Cv.Release (unless you want to keep it and use it again).
     
    rboeck likes this.
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