Sub Globals
Dim MapView1 As MapView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim rp As RuntimePermissions
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult(Permission As String, Result As Boolean)
If File.ExternalWritable=False Then
' OSMDroid requires the use of external storage to cache tiles
' if no external storage is available then the MapView will display no tiles
Log("WARNING NO EXTERNAL STORAGE AVAILABLE")
End If
' no EventName is required as we don't need to listen for MapView events
MapView1.Initialize("")
MapView1.SetHttpRequestUserAgent("SimpleMap01")
Activity.AddView(MapView1, 0, 0, 100%x, 100%y)
' by default the map will zoom in on a double tap and also be draggable - no other user interface features are enabled
' enable the built in zoom controller - the map can now be zoomed in and out
MapView1.SetZoomEnabled(True)
' enable the built in multi touch controller - the map can now be 'pinch zoomed'
MapView1.SetMultiTouchEnabled(True)
' set the zoom level BEFORE the center (otherwise unpredictable map center may be set)
MapView1.Zoom=14
MapView1.SetCenter(52.5179, 13.4050) ' City of Berlin
Log("All Done")
End Sub