Open bbenson09 opened 2 years ago
This is easily done by creating a key listener for aircraft location:
private val aircraftLocationKey = FlightControllerKey.create(FlightControllerKey.AIRCRAFT_LOCATION)
creating a listener to this event and using the map's moveCamera or animateCamera like this:
val djiCameraPosition = DJICameraPosition.Builder().bearing(currentBearing).target(djiLatLng).zoom(20f) .build()
val cameraUpdate = DJICameraUpdateFactory.newCameraPosition(djiCameraPosition)
if (!snapToPosition) {
binding.mapViewFragmentCommonMapWidget.map!!.animateCamera(cameraUpdate)
} else {
binding.mapViewFragmentCommonMapWidget.map!!.moveCamera(cameraUpdate)
}
Hi, I'm trying to center the MapWidget on the aircraft WITHOUT locking it. After centering, I want to be able to drag the map without it popping back to the aircraft.
This does not work reliably:
Is there a way to do this? It seems like this should be a simple thing to implement if it's not already.