#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region
#Macro: Title, Export B4XPages, ide://run?File=%B4X%\Zipper.jar&Args=%PROJECT_NAME%.zip
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private OMaps As OpenMaps
Private OMapsExt As OpenMapsExt
' Private CurrentPoint As MapCircle
Private CurrentPointM As Marker
#if B4J
Dim fx As JFX
#End If
Dim StartPointLL As LatLng
Dim Point1LL As LatLng
Dim Pos As Int = 0
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
OMapsExt.Initialize(OMaps)
StartPointLL.Initialize(51.5080990163571, -0.07612096300477675)
Point1LL.Initialize(51.50835595060191, -0.09860095046380832)
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
If Pos = 0 Then
' OMaps.UpdateCircleCenter(CurrentPoint.ID,Point1LL.Latitude,Point1LL.Longitude)
OMaps.UpdateMarkerPosition(CurrentPointM.ID,Point1LL.Latitude,Point1LL.Longitude)
Else
OMaps.UpdateMarkerPosition(CurrentPointM.ID,StartPointLL.Latitude,StartPointLL.Longitude)
' OMaps.UpdateCircleCenter(CurrentPoint.ID,StartPointLL.Latitude,StartPointLL.Longitude)
End If
Log(Pos)
If Pos = 0 Then
Pos = 1
Else
Pos = 0
End If
End Sub
Private Sub OMaps_Ready
Log("OMaps Ready")
#if B4A
OMaps.MoveCamera2(StartPointLL)
Sleep(1000)
OMaps.SetZoom(15)
' CurrentPoint = OMaps.Addcircle(StartPointLL,15,5,xui.Color_Magenta,xui.Color_Magenta,1)
CurrentPointM = OMaps.AddMarker(StartPointLL.Latitude,StartPointLL.Longitude,"Test")
#else
OMaps.MoveCamera2(StartPointLL)
OMaps.Zoom = 13
' CurrentPoint = OMaps.Addcircle(StartPointLL,15,5,fx.Colors.Magenta,fx.Colors.Magenta,1)
CurrentPointM = OMaps.AddMarker(StartPointLL.Latitude,StartPointLL.Longitude,"Test")
#End If
' Log(CurrentPoint)
Log(CurrentPointM)
End Sub