Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private gmap As GoogleMap
Private ApiKey As String = "AIzaSyAvyeV3neg9Jf-R2Y0Hh_zD-g8Jv-6Hx5Q"
Dim gextra As GoogleMapsExtra
Private Panel1 As Panel
Private PointList As List
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("1")
NavControl.ShowPage(Page1)
NavControl.ToolBarVisible=False
NavControl.NavigationBarVisible=False
PointList.Initialize
Dim ll As LatLng
ll.Initialize(46.57174,8.93102)
PointList.Add(ll)
Dim ll As LatLng
ll.Initialize(45.57148, 8.93083)
PointList.Add(ll)
gmap.Initialize("gmap", ApiKey)
Panel1.AddView(gmap, 0, 0, 100%X, 100%y)
Dim ll As LatLng=PointList.Get(0)
gmap.AddMarker(ll.Latitude,ll.Longitude,"test1")
Dim ll As LatLng=PointList.Get(1)
gmap.AddMarker(ll.Latitude, ll.Longitude, "test2")
gextra.Initialize(gmap)
gextra.ZoomToPoints(PointList)
ShowBounds
End Sub
Sub gmap_LongClick (Point As LatLng)
gextra.ZoomToPoints(PointList)
ShowBounds
End Sub
Sub ShowBounds
Dim bounds As Object = gextra.GetVisibleBounds
Dim ne_sw() As LatLng = gextra.GetBoundsNE_SW(bounds)
Log(ne_sw(0))
Log(ne_sw(1))
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
If gmap.IsInitialized Then gmap.SetLayoutAnimated(0, 1, 0, 0, Width, Height)
gextra.ZoomToPoints(PointList)
ShowBounds
End Sub