Following code below crash using GoogleMapExtras!
This happens suddenly after had using the app during half a year!
I now compile with B4A 4.30
Use:Windows 7 Ultimat
lib: Core 4.01, GoogleMaps 1.02, GoogleMapExtras 1.80
GoogleMapsExtras.jar date 2014-10-20
The problem with 'gmap.addmarker' mode are the presentation of the bitmap. In the moment I got a 1/4 (up to the left)of the hole .png file as a marker on map.
What had happen with GoogleMapExtras?
Is it possible to create symbols as markers more then using LoadBitmap(File...?
This happens suddenly after had using the app during half a year!
I now compile with B4A 4.30
Use:Windows 7 Ultimat
lib: Core 4.01, GoogleMaps 1.02, GoogleMapExtras 1.80
GoogleMapsExtras.jar date 2014-10-20
B4X:
#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
Installing file.
PackageAdded: package:b4a.GisMap
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
map ready
true
java.lang.NullPointerException
at com.google.k.a.cj.a(Unknown Source)
at com.google.maps.api.android.lib6.c.dc.<init>(Unknown Source)
at com.google.maps.api.android.lib6.c.db.a(Unknown Source)
at com.google.maps.api.android.lib6.c.aj.<init>(Unknown Source)
at com.google.maps.api.android.lib6.c.al.a(Unknown Source)
at com.google.maps.api.android.lib6.c.el.a(Unknown Source)
at com.google.android.gms.maps.internal.l.onTransact(SourceFile:167)
at android.os.Binder.transact(Binder.java:380)
at com.google.android.gms.maps.internal.IGoogleMapDelegate$a$a.addMarker(Unknown Source)
at com.google.android.gms.maps.GoogleMap.addMarker(Unknown Source)
at uk.co.martinpearman.b4a.googlemapsextras.GoogleMapsExtras.AddMarker(GoogleMapsExtras.java:48)
at b4a.GisMap.main._map_ready(main.java:483)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.MapFragmentWrapper$MyMapFragment.onViewCreated(MapFragmentWrapper.java:191)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:918)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1082)
at android.app.BackStackRecord.run(BackStackRecord.java:833)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:452)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5944)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1389)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1184)
The problem with 'gmap.addmarker' mode are the presentation of the bitmap. In the moment I got a 1/4 (up to the left)of the hole .png file as a marker on map.
What had happen with GoogleMapExtras?
Is it possible to create symbols as markers more then using LoadBitmap(File...?
Last edited: