Mobile-SDK-Android icon indicating copy to clipboard operation
Mobile-SDK-Android copied to clipboard

Marker Angle rotation

Open 1232Ga opened this issue 10 months ago • 3 comments

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); Image

1232Ga avatar Mar 28 '24 09:03 1232Ga

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. image

dji-lyt avatar Mar 29 '24 11:03 dji-lyt

I need the sample code for MSDK V4. how to implement this code for mavic 2 Enterprise ??

1232Ga avatar Apr 01 '24 06:04 1232Ga

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.

°°°

dji-dev avatar Apr 01 '24 13:04 dji-dev