MapView not focus
479 3 2020-9-12
Uploading and Loding Picture ...(0/1)
o(^-^)o
djiuser_0wZiRVZwQQOj
lvl.2
Flight distance : 131860 ft
Israel
Offline

Hello ,
I build app from DUXDefaultLayoutViewController, this is connected to the drone.
The mapView widget not focus on user location, there is an example how to do that progratcally ?


Thanks Yakir.  
2020-9-12
Use props
JohanH
lvl.3
Flight distance : 30479 ft

Netherlands
Offline

The following will keep the map centered to the drone:
mapWidget.isMapCameraLockedOnAircraft = YES;

The following will keep the map centered to the homepoint:
mapWidget.isMapCameraLockedOnHomePoint = YES;

You can use the above in viewDidLoad of the DefaultLayoutController

The following will show user location (that is location of the mobile device which is only accurate if it has GPS enabled) :
mapWidget.mapView.showsUserLocation = YES;

The following you can use in viewDidAppear of the DefaultLayoutController to center the map to the user location:
[mapWidget.mapView setCenterCoordinate: mapWidget.mapView.userLocation.location.coordinate];

I hope this helps!
2020-9-12
Use props
djiuser_0wZiRVZwQQOj
lvl.2
Flight distance : 131860 ft
Israel
Offline

Thanks i’ll try and keep you update.

Another question-the active track is just one of the option and this is will work on the mavic mini , or i need to add some code for this ?

Regards Yakir
2020-9-12
Use props
djiuser_0wZiRVZwQQOj
lvl.2
Flight distance : 131860 ft
Israel
Offline

JohanH Posted at 9-12 05:21
The following will keep the map centered to the drone:
mapWidget.isMapCameraLockedOnAircraft = YES;


Thanks i’ll try and keep you update.

Another question-the active track is just one of the option and this is will work on the mavic mini , or i need to add some code for this ?

Regards Yakir
2020-9-12
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules