Sub Process_Globals
Private Page3 As Page
Private Gmap As GoogleMap
Private GMX As GoogleMapsExtra
Type TextMetric(Height As Float,Width As Float)
Private TM As TextMetric
End Sub
Sub DrawMap
..................
..................
Dim wp As Bitmap 'Use a custom waypoint bitmap
wp.Initialize(File.DirAssets,"waypoint.png")
Dim m1 As Marker = Gmap.AddMarker3(Latitude,Longitude,"", wp) 'Add custom waypoint markers
GMX.SetGroundAnchor(m1,0.5,0.5)
Dim m2 As Marker = Gmap.AddMarker3(Latitude,Longitude,"", TextLabel(Ident,Font.DEFAULT))
GMX.SetGroundAnchor(m2,0.5,1.5)
..................
..................
End Sub
Sub TextLabel(Text As String, Font1 As Font) As Bitmap
TM.Height = Text.MeasureHeight(Font1)
TM.Width = Text.MeasureWidth(Font1)
Dim c As Canvas
c.Initialize(Gmap)
Dim r As Rect
r.Initialize(0,0,TM.Width + 10dip,TM.Height + 5dip)
c.DrawRectRounded(r,Colors.White,True,1,6)
c.DrawText(Text,r.Width /2 ,r.Height /2 + 8dip, Font1,Colors.Black,"CENTER")
Dim bm As Bitmap = c.CreateBitmap
Return bm.Crop(0,0,r.Width,r.Height)
End Sub