Hello,
I am trying a custom marker to rotate as per Road Direction in GMAP.
I am following the below link......
https://www.b4x.com/android/forum/threads/google_maps-marker-rotate.66242/
But the above link is not working. I am getting below error while loading the custom marker icon
The below is the code for load of custom marker:
Please advice as how to rotate a custom market as per Road direction.
Thanks
I am trying a custom marker to rotate as per Road Direction in GMAP.
I am following the below link......
https://www.b4x.com/android/forum/threads/google_maps-marker-rotate.66242/
But the above link is not working. I am getting below error while loading the custom marker icon
B4X:
actmap$ResumableSub_Activity_Resumeresume (java line: 859)
java.lang.RuntimeException: Object should first be initialized (BitmapDrawable).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.drawable.BitmapDrawable.getBitmap(BitmapDrawable.java:39)
at b4a.example.gmapstest.actmap$ResumableSub_Activity_Resume.resume(actmap.java:859)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:250)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:190)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6820)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:922)
The below is the code for load of custom marker:
B4X:
Markeropts.Initialize
Markeropts.Position2(search.pickupLocation.Latitude,search.pickupLocation.Longitude).Snippet("").Title("").Visible(True)
Mydrawable1=AndroidResources1.GetApplicationDrawable("icon1")
Icon=Mydrawable1.Bitmap
BitmapDescriptor1=BitmapDescriptorFactory1.FromBitmap(Icon)
Markeropts.Icon(BitmapDescriptor1)
Markeropts.Rotate(45) 'Rotate the marker
Dim Marker1 As Marker=GoogleMapsExtras1.AddMarker(gmap, Markeropts)
Please advice as how to rotate a custom market as per Road direction.
Thanks
Last edited: