Android Question SQL ADD MARKER & GOOGLE MAPS

Discussion in 'Android Questions' started by Croïd, Jan 23, 2015.

  1. Croïd

    Croïd Active Member Licensed User

    I have a small problem ! only 1 marker displayed on maps ! You know the way


    Code:
    dbsql.Initialize(File.DirRootExternal,"Mybase.db",True)
    dbcursor = dbsql.ExecQuery(
    "SELECT * FROM Field")
    'dbcursor = dbsql.ExecQuery("SELECT Field1, Field2, Field3, field4 FROM Field")
    For i = 0 To dbcursor.RowCount -1
    DoEvents
    dbcursor.Position = i

    Dim lat, lng As Double
    Dim nms As String
    Dim colr As Int

    lat = dbcursor.GetDouble(
    "Field1"' Lat
    lng = dbcursor.GetDouble("Field2")  'Lng
    nms = dbcursor.GetString("Field3"' Name
    colr = dbcursor.GetInt("Field4")    'Color

    Next
    dbcursor.Close

    'gmap.AddMarker2(dbsql.ExecQuerySingleResult("SELECT Field1 FROM Field"),dbsql.ExecQuerySingleResult("SELECT Field2 FROM Field"),dbsql.ExecQuerySingleResult("SELECT Field3 FROM Field"), dbsql.ExecQuerySingleResult("SELECT Field4 FROM Field"))

    gmap.AddMarker2(lat,lng,nms,colr)  
    ' ???????????
     
  2. susu

    susu Well-Known Member Licensed User

    Try to move
    gmap.AddMarker2(lat,lng,nms,colr)
    before
    Next
     
  3. susu

    susu Well-Known Member Licensed User

     
    microbox likes this.
  4. Croïd

    Croïd Active Member Licensed User

    OK Thanks ( and I need clean mybase.db before too)
     
    Last edited: Jan 24, 2015
  5. susu

    susu Well-Known Member Licensed User

    And you should delete DoEvents
    Move
    Dim lat, lng As Double
    Dim nms As String
    Dim colr As Int

    out of For ... Next ... too
     
    Croïd likes this.
  6. Croïd

    Croïd Active Member Licensed User

    Big thanks Susu
     
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