Sub Process_Globals
Dim BodVrstvy As OSMDroid_GeoPoint
End Sub
Sub Globals
Dim MapView1 As OSMDroid_MapView
Dim CircleOverlay1 As OSMDroid_CircleOverlay
Dim ViewHostOverlay1 As OSMDroid_ViewHostOverlay
Dim ViewHostOverlay2 As OSMDroid_ViewHostOverlay
Dim MarkersOverlay1 As OSMDroid_MarkerOverlay
Dim PathOverlay1 As OSMDroid_PathOverlay
End Sub
Sub draw_points ()
Dim List1 As List
CircleOverlay1.Initialize
List1 = File.ReadList(File.DirRootExternal, "/GPStxt/" & konec_suboru)
For i = 0 To List1.Size-1
If sf.Len(List1.Get(i))>0 Then
Dim str() As String
str = Regex.split(":", List1.Get(i))
CircleOverlayItem1=CircleOverlay1.AddCircleOverlayItem2(str(1), str(2), 4, CircleOverlay1.RADIUS_UNITS_TYPE_PIXELS, 1dip,Colors.Blue)
If typoly="plny" Then CircleOverlayItem1.StrokeStyle=CircleOverlayItem1.FILL_AND_STROKE
If typoly="prazdny" Then CircleOverlayItem1.StrokeStyle=CircleOverlayItem1.STROKE
Else
End If
Next
MapView1.GetOverlays.Add(CircleOverlay1)
'------------------------------
For i = 0 To List1.Size-1
If sf.Len(List1.Get(i))>0 Then
Dim strzn() As String
strzn = Regex.split(":", List1.Get(i))
Dim marker1 As OSMDroid_Marker ' Marker
marker1.Initialize("",strzn(0), strzn(1), strzn(2))
Dim MarkerLabel As Label
MarkerLabel.Initialize("")
MarkerLabel.Color=Colors.Transparent
MarkerLabel.TextColor= Colors.Red
MarkerLabel.TextSize=16
MarkerLabel.Text=strzn(0)
Dim ViewHost2 As OSMDroid_ViewHost
ViewHost2.Initialize(MarkerLabel, marker1.GetPoint, 0, 0, Constants1.LayoutParams.ALIGN_TOP_CENTER, True)
ViewHostOverlay2.AddItem(ViewHost2)
End If
Next
'------------------------------
MapView1.Invalidate
End Sub
Sub draw_line ()
Dim List1 As List
List1 = File.ReadList(File.DirRootExternal, "/GPStxt/" & konec_suboru)
For i = 0 To List1.Size-1
If ListView4.size >0 Then
PathOverlay1.Initialize(MapView1,Colors.RGB(255,111,0))
PathOverlay1.ClearPath
MapView1.GetOverlays.Add(PathOverlay1)
PathOverlay1.SetStrokeWidth(4)
PathOverlay1.SetAlpha(250)
PathOverlay1.SetPathStyle("STROKE")
For li = 0 To ListView4.size -1
Dim str() As String
str = Regex.split(":", ListView4.GetItem(li))
BodVrstvy.Initialize(str(0),str(1))
PathOverlay1.AddPoint(BodVrstvy)
Next
ListView4.Clear
Else
End If
Next
MapView1.Invalidate
End Sub
Sub draw_polygon ()
Dim List1 As List
List1 = File.ReadList(File.DirRootExternal, "/GPStxt/" & konec_suboru)
For i = 0 To List1.Size-1
If ListView4.size >0 Then
PathOverlay1.Initialize(MapView1,Colors.RGB(255,111,0))
PathOverlay1.ClearPath
MapView1.GetOverlays.Add(PathOverlay1)
PathOverlay1.SetStrokeWidth(8)
PathOverlay1.SetAlpha(250)
If typoly="plny" Then PathOverlay1.SetPathStyle("FILL_AND_STROKE")
If typoly="prazdny" Then PathOverlay1.SetPathStyle("STROKE")
For li = 0 To ListView4.size -1
Dim str() As String
str = Regex.split(":", ListView4.GetItem(li))
BodVrstvy.Initialize(str(0),str(1))
PathOverlay1.AddPoint(BodVrstvy)
Next
ListView4.Clear
Else
End If
Next
'------------------------------
If textv <>"0" Then
For i = 0 To List1.Size-1
Dim strzn() As String
strzn = Regex.split(":", List1.Get(i))
Dim marker1 As OSMDroid_Marker
marker1.Initialize("",strzn(1), strzn(2), strzn(3))
Dim MarkerLabel As Label
MarkerLabel.Initialize("")
MarkerLabel.Color=Colors.Transparent
MarkerLabel.TextColor= Colors.Red
MarkerLabel.TextSize=16
MarkerLabel.Text=strzn(1)
Dim ViewHost2 As OSMDroid_ViewHost
ViewHost2.Initialize(MarkerLabel, marker1.GetPoint, 0, 0, Constants1.LayoutParams.ALIGN_TOP_CENTER, True)
ViewHostOverlay2.AddItem(ViewHost2)
Next
End If
MapView1.Invalidate
'------------------------------
End Sub
Sub draw_markers
' kde.png, kde1.png, markery.png, markery1.png are in "drawable-nodpi" folder
For i = 0 To ListView1.size -1
Dim str() As String
str = Regex.split(":", ListView1.GetItem(i))
Dim AndroidResources1 As AndroidResources
Dim Icon As BitmapDrawable
If smarker=1 Then Icon=AndroidResources1.GetApplicationDrawable("kde") Else Icon=AndroidResources1.GetApplicationDrawable("kde1")
Dim Icon1 As BitmapDrawable
If smarker=1 Then Icon1=AndroidResources1.GetApplicationDrawable("markery") Else Icon1=AndroidResources1.GetApplicationDrawable("markery1")
Dim marker1 As OSMDroid_Marker
If str(1)=daj_lat And str(2)=daj_lon Then
marker1.Initialize("",str(0), str(1), str(2))
marker1.SetMarkerIcon(Icon)
Else
marker1.Initialize("",str(0), str(1), str(2))
marker1.SetMarkerIcon(Icon1)
End If
Dim MarkerLabel As Label
MarkerLabel.Initialize("")
MarkerLabel.Color=Colors.Transparent
MarkerLabel.TextColor = Colors.Blue
MarkerLabel.TextSize = 14
Try
If Label23.Text="N" Then MarkerLabel.Text=str(0) Else MarkerLabel.Text=str(5)
Catch
MarkerLabel.Text=str(0)
End Try
Dim ViewHost1 As OSMDroid_ViewHost
ViewHost1.Initialize(MarkerLabel, marker1.GetPoint, 0, 0, Constants1.LayoutParams.ALIGN_TOP_CENTER, True)
ViewHostOverlay1.AddItem(ViewHost1)
Dim Markers As List
Markers.Initialize2(Array As Object(marker1))
MarkersOverlay1.AddItems(Markers) 'MarkersOverlay1.AddMarkers(Markers)
Next
MapView1 .Invalidate
End Sub