Humberto Active Member Licensed User Longtime User Mar 10, 2017 #1 I´m retrieving from a database points saved to create a list and then set a polyline in google maps B4X: Dim xLatLong As LatLng xList.Initialize Do While xCursor.NextRow xLatLong.Initialize ( xCursor.GetString ( "latitude" ), xCursor.GetString ( "longitude" ) ) xList.Add ( xLatLong ) Loop xCursor.Close I initialize each time the "xlatLong" but the "xList" itens contain the last value inserted
I´m retrieving from a database points saved to create a list and then set a polyline in google maps B4X: Dim xLatLong As LatLng xList.Initialize Do While xCursor.NextRow xLatLong.Initialize ( xCursor.GetString ( "latitude" ), xCursor.GetString ( "longitude" ) ) xList.Add ( xLatLong ) Loop xCursor.Close I initialize each time the "xlatLong" but the "xList" itens contain the last value inserted
klaus Expert Licensed User Longtime User Mar 10, 2017 #2 This should work: B4X: xList.Initialize Do While xCursor.NextRow Dim xLatLong As LatLng xLatLong.Initialize ( xCursor.GetString ( "latitude" ), xCursor.GetString ( "longitude" ) ) xList.Add ( xLatLong ) Loop xCursor.Close You mst move Dim xLatLong AsLatLng inside the loop. Upvote 0
This should work: B4X: xList.Initialize Do While xCursor.NextRow Dim xLatLong As LatLng xLatLong.Initialize ( xCursor.GetString ( "latitude" ), xCursor.GetString ( "longitude" ) ) xList.Add ( xLatLong ) Loop xCursor.Close You mst move Dim xLatLong AsLatLng inside the loop.