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.
Private xui AS XUI
Public GoogleMapsExtras1 As GoogleMapsExtras
Public MarkerExtras1 As MarkerExtras
Public BitmapCar As B4XBitmap
Public Marker1 As Marker
Hello, @oparra ... I have fixed some of the issue regarding the rotation of Marker in GMAP.
I have used the below parameter
B4X:
Dim mx As MarkerExtras
mx.SetRotation(mrkr(vhlMarkerId),newloc.BearingTo(lastLocation))
But while I am back to the source [From where I started] the car head is not moving to the source location. It seems that I am parking the car at back gear.
Hello, I am trying to move Custom Marker as per road direction in google map. The marker is moving successfully, but the head of the car [custom marker] is not moving to the forward direction. I want to move the head of the car dynamically as per road direction and curve of Road Attach...