Hi All
I need a punch in the right direction please.
I have the following codes that converts my grid Coordinates to Lats\Longs and plots the points on Googlemap. The points are circles. How can I display the name of each coordinate point (Circle) next to each Point?
I need a punch in the right direction please.
I have the following codes that converts my grid Coordinates to Lats\Longs and plots the points on Googlemap. The points are circles. How can I display the name of each coordinate point (Circle) next to each Point?
B4X:
[/
Sub PlotPoints(A As Int)
Dim AveY, AveX As Double
Dim cp As CameraPosition
Dim Co As CircleOptions
Co.Initialize
Try
Gmap.Clear
If CGlobals.CoordCode=1 Then
'Site Coords
Dim rs As ResultSet = CGlobals.sql1.ExecQuery("SELECT Name, East, North, Elevation, Description FROM SCoords")
else if CGlobals.CoordCode=2 Then
'Global Coords
Dim rs As ResultSet = CGlobals.sql1.ExecQuery("SELECT Name, East, North, Elevation, Description FROM GCoords")
Else
'Job Coords
Dim rs As ResultSet = CGlobals.sql1.ExecQuery("SELECT Name, East, North, Elevation, Description FROM Coords")
End If
i=0: AveY=0: AveX=0
Do While rs.NextRow
Dim row(5) As Object
row(0) = rs.GetString("Name")
row(1) = NumberFormat2(rs.GetDouble("East"),1,3,3,False)
row(2) = NumberFormat2(rs.GetDouble("North"),1,3,3,False)
Geo.get_point_From_local(row(1),row(2))
Co.StrokeWidth(2)
If Engine.Lat<>0 And Engine.Lon<>0 Then
'GmapExtra.AddMarker(Engine.Lon,Engine.Lat, row(0))
'Gmap.AddMarker(Engine.Lon,Engine.Lat, row(0))
Co.Center2(Engine.Lon,Engine.Lat).Radius(5).FillColor(Colors.White).StrokeColor(Colors.DarkGray)
GmapExtra.AddCircle(Gmap,Co)
i=i+1
AveY=AveY+row(1)
AveX=AveX+row(2)
End If
Loop
rs.Close
If (AveY<>0 Or AveX<>0) And A=0 Then
'Zoom in to center of points
AveY=AveY/i
AveX=AveX/i
Geo.get_point_From_local(AveY,AveX)
cp.Initialize(Engine.Lon,Engine.Lat,10)
Gmap.MoveCamera(cp)
End If
Catch
Log(LastException)
End Try
End Sub
]