B4J Tutorial [BANAnoWebix] Lesson 20 Google Map

Discussion in 'B4J Tutorials' started by Mashiane, Jun 30, 2019.

  1. Mashiane

    Mashiane Expert Licensed User

    Ola

    Simply put, this google map allows one to display a google map on their apps. One is able to also add markers that properties can be set up for.

    Lesson20GoogleMap.gif

    One needs to get their own google map key to use this on their app.

    In this instance, we create a google map instance, set its map type, add some markers and then trap the click event of markers.

    Code:
    '
        Dim R1 As WixRow
        R1.Initialize(
    "R1")
        
    '
        gmap.Initialize("gmap").SetWidth(640).SetHeight(480).SetBorderLess(False).SetStyle("margin""10px")
        gmap.SetKey(
    "YOUR-KEY-HERE").SetZoom(6).SetMapType(gmap.MAP_TYPE_ROADMAP)
        gmap.SetCenter(
    25.3352.324)
        
    '
        'add markers
        gmap.AddMarker("1"25.3552.324"Point A"TrueFalse)
        gmap.AddMarker(
    "2"25.4445.43"Point B"FalseFalse)
        gmap.AddMarker(
    "3"25.12312.375"Point C"FalseFalse)
        
    '
        R1.AddItem(gmap.Item)
       
        pg.AddRow(R1)
        
    '
        pg.ui
        
    Dim maID As String
        pg.OnItemClick(
    "gmap", BANano.CallBack(Me,"marker_click"Array(maID)))
     
    Johan Hormaza and joulongleu like 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