DJI Mobile SDK Documentation

      class DUXMapWidget

      @interface DUXMapWidget : DUXWidget
      Header:DUXMapWidget.h
      Inherits From:DUXWidget
      Display:

      Widget that displays the aircraft's state and information on the map this includes aircraft location, home location, aircraft trail path, aircraft heading, and No Fly Zones.

      Usage:

      Preferred Aspect Ratio: 1:1

      Class Members:
      method clearCurrentFlightPath
      - (void)clearCurrentFlightPath
      Header:DUXMapWidget.h
      Description:

      Clears the flight path up to the current location. The flight path is removed even if it is hidden.

      method setFlyZoneOverlayColor:forFlyZoneCategory
      - (void)setFlyZoneOverlayColor:(nullable UIColor *)color
      forFlyZoneCategory:(DJIFlyZoneCategory)category
      Header:DUXMapWidget.h
      Description:

      Change the rendered color for a given fly zone category.

      Input Parameters:
      nullable UIColor * colorThe desired color.
      DJIFlyZoneCategory categoryThe fly zone category for which the color would apply.
      method setFlyZoneOverlayAlpha:forFlyZoneCategory
      - (void)setFlyZoneOverlayAlpha:(CGFloat)alpha
      forFlyZoneCategory:(DJIFlyZoneCategory)category
      Header:DUXMapWidget.h
      Description:

      Change the rendered alpha for a given fly zone category.

      Input Parameters:
      CGFloat alphaThe desired alpha.
      DJIFlyZoneCategory categoryThe fly zone category for which the alpha would apply.
      property tapToUnlockEnabled
      @property (nonatomic, assign) BOOL tapToUnlockEnabled
      Header:DUXMapWidget.h
      Description:

      Gets whether tap to unlock is enabled.

      property showDirectionToHome
      @property (nonatomic, assign) BOOL showDirectionToHome
      Header:DUXMapWidget.h
      Description:

      Defaults to NO. A Boolean value indicating whether the map displays a line showing the direction to home.

      property showFlightPath
      @property (nonatomic, assign) BOOL showFlightPath
      Header:DUXMapWidget.h
      Description:

      YES if the flight path is visible. The default value is NO

      property showHomeAnnotation
      @property (nonatomic, assign) BOOL showHomeAnnotation
      Header:DUXMapWidget.h
      Description:

      YES if the map displays the home point of the aircraft. The default value of this property is YES.

      enum DUXMapAnnotationType
      typedef NS_ENUM(NSUInteger, DUXMapAnnotationType)
      Header:DUXMapWidget.h
      Description:

      An enum about different annotations on the map.

      Enum Members:
      DUXMapAnnotationTypeAircraftAnnotation of the aircraft currently on the map.
      DUXMapAnnotationTypeHomeAnnotation of the home location currently on the map.
      DUXMapAnnotationTypeEligibleFlyZonesAnnotation of a self-unlock fly zone that can be unlocked, currently on the map. Only visible when DUXMapWidget_tapToUnlockEnabled is set to YES.
      DUXMapAnnotationTypeUnlockedFlyZonesAnnotation of a self-unlock fly zone that is unlocked currently. Only visible when DUXMapWidget_tapToUnlockEnabled is set to YES.
      DUXMapAnnotationTypeCustomUnlockedFlyZonesAnnotation of a custom unlock fly zone. Only visible when DUXMapWidget_tapToUnlockEnabled is set to YES.
      property
      property mapView
      @property (nonatomic, strong) MKMapView *mapView
      Header:DUXMapWidget.h
      Description:

      Standard iOS Map for manipulating general settings.

      property isMapCameraLockedOnAircraft
      @property (nonatomic, assign) BOOL isMapCameraLockedOnAircraft
      Header:DUXMapWidget.h
      Description:

      Defaults to NO. A Boolean value that determines whether the map locks the camera view on the aircraft.

      method changeAnnotation:withImage
      - (void)changeAnnotation:(DUXMapAnnotationType)annotationType withImage:(UIImage *)image DEPRECATED_ATTRIBUTE
      Header:DUXMapWidget.h
      Description:

      Replaces current annotation type with given image. The default image for all annotation types are set.

      Input Parameters:
      DUXMapAnnotationType annotationTypeAn enum value of DUXMapAnnotationType.
      UIImage * imageImage used to represent the annotation.
      method changeAnnotationOfType:toCustomImage:withCenterOffset
      - (void)changeAnnotationOfType:(DUXMapAnnotationType)annotationType toCustomImage:(nonnull UIImage *)image withCenterOffset:(CGPoint)centerOffset
      Header:DUXMapWidget.h
      Description:

      Change the annotation type of the map widget.

      Input Parameters:
      DUXMapAnnotationType annotationTypeAn enum value of DUXMapAnnotationType.
      nonnull UIImage * imageImage used to represent the annotation.
      CGPoint centerOffsetA CGPoint struct for the center offset.
      property visibleFlyZones
      @property (nonatomic, assign) DUXMapVisibleFlyZones visibleFlyZones
      Header:DUXMapWidget.h
      Description:

      Sets the types of fly zones to be displayed on the map. Set to DUXMapWidget_DUXMapVisibleFlyZonesNone to hide all fly zone types.

      See Also:

      DUXMapVisibleFlyZones

      NS_OPTIONS DUXMapVisibleFlyZones
      typedef NS_OPTIONS(NSUInteger, DUXMapVisibleFlyZones)
      Header:DUXMapWidget.h
      Description:

      An enum bitmask indicating which fly zones are to be displayed by the map widget.

      Members:
      DUXMapVisibleFlyZonesNoneNo fly zones will be visible on the map widget.
      DUXMapVisibleFlyZonesRestrictedRestricted fly zones will be visible on the map widget.
      DUXMapVisibleFlyZonesAuthorizationAuthorization fly zones will be visible on the map widget.
      DUXMapVisibleFlyZonesWarningWarning fly zones will be visible on the map widget.
      DUXMapVisibleFlyZonesEnhancedWarningEnhanced warning fly zones will be visible on the map widget.
      method flyZoneOverlayColorForFlyZoneCategory
      - (nonnull UIColor *)flyZoneOverlayColorForFlyZoneCategory:(DJIFlyZoneCategory)category
      Header:DUXMapWidget.h
      Description:

      Returns the currently used color for a given fly zone category. This does not include unlocked zones.

      Input Parameters:
      DJIFlyZoneCategory categoryThe fly zone category associated with the returned color.
      Return:
      nonnull UIColor *A UIColor object.
      method flyZoneOverlayAlphaForFlyZoneCategory
      - (CGFloat)flyZoneOverlayAlphaForFlyZoneCategory:(DJIFlyZoneCategory)category
      Header:DUXMapWidget.h
      Description:

      Returns the currently used alpha for a given fly zone category. This does not include unlocked zones.

      Input Parameters:
      DJIFlyZoneCategory categoryThe fly zone category associated with the returned alpha.
      Return:
      CGFloatA CGFloat value.
      property showFlyZoneLegend
      @property (nonatomic, assign) BOOL showFlyZoneLegend
      Header:DUXMapViewController.h
      Description:

      Boolean value controlling whether the fly zone legend is shown inside the map view controller. The fly zone legend indicates the color for all zone categories and self-unlock zones.

      property isMapCameraLockedOnHomePoint
      @property (nonatomic, assign) BOOL isMapCameraLockedOnHomePoint
      Header:DUXMapWidget.h
      Description:

      Boolean property that if enabled will lock map center onto aircraft home location.

      property flightPathStrokeColor
      @property (nonatomic, strong, nonnull) UIColor *flightPathStrokeColor
      Header:DUXMapWidget.h
      Description:

      Current color of the rendered flight path.

      property flightPathStrokeWidth
      @property (nonatomic, assign) CGFloat flightPathStrokeWidth
      Header:DUXMapWidget.h
      Description:

      Current stroke width of the rendered flight path.

      property flyZoneOverlayBorderWidth
      @property (nonatomic, assign) CGFloat flyZoneOverlayBorderWidth
      Header:DUXMapWidget.h
      Description:

      Width of the solid colored boreder of all fly zone overlays.

      property maximumHeightFlyZoneOverlayAlpha
      @property (nonatomic, assign) CGFloat maximumHeightFlyZoneOverlayAlpha
      Header:DUXMapWidget.h
      Description:

      Current alpha of a fly zone with maximum height.

      property maximumHeightFlyZoneOverlayColor
      @property (nonatomic, strong, nonnull) UIColor *maximumHeightFlyZoneOverlayColor
      Header:DUXMapWidget.h
      Description:

      Current color of a fly zone with maximum height.

      property directionToHomeStrokeColor
      @property (nonatomic, strong, nonnull) UIColor *directionToHomeStrokeColor
      Header:DUXMapWidget.h
      Description:

      Current color of the rendered direction to home line.

      property directionToHomeStrokeWidth
      @property (nonatomic, assign) CGFloat directionToHomeStrokeWidth
      Header:DUXMapWidget.h
      Description:

      Current stroke width of the rendered direction to home line.

      property unlockedFlyZoneOverlayColor
      @property (nonatomic, strong, nonnull) UIColor *unlockedFlyZoneOverlayColor
      Header:DUXMapWidget.h
      Description:

      Current color of a self-unlock fly zone overlay.

      property unlockedFlyZoneOverlayAlpha
      @property (nonatomic, assign) CGFloat unlockedFlyZoneOverlayAlpha
      Header:DUXMapWidget.h
      Description:

      Current alpha of a self-unlock fly zone overlay.

      property customUnlockFlyZoneOverlayColor
      @property (nonatomic, strong, nonnull) UIColor *customUnlockFlyZoneOverlayColor
      Header:DUXMapWidget.h
      Description:

      Current color of a custom unlock fly zone overlay.

      property customUnlockFlyZoneSentToAircraftOverlayColor
      @property (nonatomic, strong, nonnull) UIColor *customUnlockFlyZoneSentToAircraftOverlayColor
      Header:DUXMapWidget.h
      Description:

      Current color of a custom unlock fly zone overlay that has been sent to aircraft.

      property customUnlockFlyZoneOverlayAlpha
      @property (nonatomic, assign) CGFloat customUnlockFlyZoneOverlayAlpha
      Header:DUXMapWidget.h
      Description:

      Current alpha of a custom unlock fly zone overlay.

      property customUnlockFlyZoneSentToAircraftOverlayAlpha
      @property (nonatomic, assign) CGFloat customUnlockFlyZoneSentToAircraftOverlayAlpha
      Header:DUXMapWidget.h
      Description:

      Current alpha of a custom unlock fly zone overlay that has been sent to the aircraft.

      property customUnlockFlyZoneEnabledOverlayColor
      @property (nonatomic, strong, nonnull) UIColor *customUnlockFlyZoneEnabledOverlayColor
      Header:DUXMapWidget.h
      Description:

      Current color of a custom unlock fly zone overlay that has been sent to aircraft and enabled.

      property customUnlockFlyZoneEnabledOverlayAlpha
      @property (nonatomic, assign) CGFloat customUnlockFlyZoneEnabledOverlayAlpha
      Header:DUXMapWidget.h
      Description:

      Current alpha of a custom unlock fly zone overlay that has been sent to aircraft and enabled.

      property showDJIAccountLoginIndicator
      @property (nonatomic, assign) BOOL showDJIAccountLoginIndicator
      Header:DUXMapWidget.h
      Description:

      Defaults to NO. Show a small indicator displaying the latest DJI account login state. Useful if using FlySafe features.

      property showCustomUnlockZones
      @property (nonatomic, assign) BOOL showCustomUnlockZones
      Header:DUXMapWidget.h
      Description:

      Defaults to NO. Shows custom unlock zones if any are available for the currently connected aircraft.

      method syncCustomUnlockZones
      - (void)syncCustomUnlockZones
      Header:DUXMapWidget.h
      Description:

      Call this to sync currently shown custom unlock zones to aircraft. They will still need to be manually enabled.