#Region Project Attributes
#ApplicationLabel: B4A GisMap
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#AdditionalRes: L:\Program\Android\adt-bundle-windows-x86_64-20140702\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim GoogleMapsExtras1 As GoogleMapsExtras
End Sub
Sub Globals
Dim mFragment As MapFragment
Dim gmap As GoogleMap
Dim MapPanel As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
MapPanel.Initialize("")
Activity.AddView(MapPanel, 0, 0, 100%x, 100%y)
If mFragment.IsGooglePlayServicesAvailable = False Then
ToastMessageShow("Google Play services not available.", True)
Else
mFragment.Initialize("Map", MapPanel)
End If
End Sub
Sub Map_Ready
Log("map ready")
gmap = mFragment.GetMap
If gmap.IsInitialized = False Then
ToastMessageShow("Error initializing map.", True)
Else
Dim MarkerOptions1 As MarkerOptions
MarkerOptions1.Initialize
'
'full function
Dim tmpMarker As Marker
tmpMarker= gmap.AddMarker3(64.47619, 18.3980,"Sparpkt",LoadBitmap(File.DirAssets, "ring.png")) ' Ok so far
'but Crasch using GoogleMapsExtras below
Dim BD As BitmapDescriptor
Dim BF As BitmapDescriptorFactory
BD=BF.FromAsset("ring.png")
MarkerOptions1.Icon(BD)
MarkerOptions1.Position2(64.79619, 18.3980)
tmpMarker=GoogleMapsExtras1.AddMarker(gmap, MarkerOptions1.Snippet("pkt").Title("1"))
'this line crash see error message, quote below
Dim cp As CameraPosition
cp.Initialize(64, 18, gmap.CameraPosition.Zoom)
gmap.AnimateCamera(cp)
End If
End Sub