Mobile-SDK-Android
Mobile-SDK-Android copied to clipboard
Marker Angle rotation
In our application, the marker is currently only moving in one direction along the given flight path without rotating to reflect its angle. This behavior contrasts with the expected rotation, as demonstrated in the attached screenshot of the DJI Mavic 2 Enterprise. i was using this code for marker rotation:-
droneLocation = mapFragment.addMarker(latLng1, R.drawable.
ic_direction
, 0.5f, 0.5f, droneRotation);
You can achieve the changes indicated by the arrow by updating the marker, for example, using marker.setRotation(rotation). The logic for updating the airplane icon in the MSDK V5 sample code is attached.
I need the sample code for MSDK V4. how to implement this code for mavic 2 Enterprise ??
Agent comment from yating.liao in Zendesk ticket #103808:
The map control of the UXSDK you are using encapsulates this logic internally. If you need a reference, there is also an open-source version of the V4 example code available here: https://github.com/dji-sdk/Mobile-UXSDK-Beta-Android/blob/master/android-uxsdk-beta-map/src/main/java/dji/ux/beta/map/widget/map/MapWidget.java#L670 You can search for aircraftMarker to find all relevant code.
°°°