DJI Mobile SDK Documentation

      class IMapWidgetManager

      interface IMapWidgetManager 
      Package:dji.open.pilot.client.interfaces
      Description:

      Server-side map operation interface. Manages server-side map widgets, map elements, layers and AR annotations, supporting operations such as adding, removing, updating and querying.

      Supported since MSDK 5.20.1

      Class Members:
      method addMapWidget
      void addMapWidget(@NonNull MapWidget widget)
      Package:dji.open.pilot.client.interfaces
      Description:

      Adds a map widget to the server.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull MapWidget widgetMap widget.
      method removeMapWidget
      void removeMapWidget(@NonNull MapWidget widget)
      Package:dji.open.pilot.client.interfaces
      Description:

      Removes a map widget.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull MapWidget widgetMap widget.
      method hideARAnnotations
      void hideARAnnotations(boolean isHided, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Hides the server-side AR annotations.

      Supported since MSDK 5.20.1

      Input Parameters:
      boolean isHidedWhether to hide.
      CommonCallbacks.CompletionCallback callbackResult callback.
      method queryMapElement
      void queryMapElement(@NonNull CommonCallbacks.CompletionCallbackWithParam<List<MapElement>> callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Queries the server-side map elements.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull CommonCallbacks.CompletionCallbackWithParam<List<MapElement>> callbackCallback for the map element query result.
      method insertMapElement
      void insertMapElement(@NonNull MapElement element, CommonCallbacks.CompletionCallbackWithParam<UUID> callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Inserts a server-side map element.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull MapElement elementMap element, supports AR.
      CommonCallbacks.CompletionCallbackWithParam<UUID> callbackCallback for the map element insertion result.
      method deleteMapElement
      void deleteMapElement(@NonNull MapElement element, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Deletes a server-side map element.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull MapElement elementMap element, supports AR.
      CommonCallbacks.CompletionCallback callbackCallback for the map element deletion result.
      method updateMapElement
      void updateMapElement(@NonNull MapElement element, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Updates a server-side map element.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull MapElement elementMap element, supports AR.
      CommonCallbacks.CompletionCallback callbackCallback for the map element update result.
      method addMapStateListener
      void addMapStateListener(@NonNull IMapStateListener listener)
      Package:dji.open.pilot.client.interfaces
      Description:

      Adds a server-side map state listener.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull IMapStateListener listenerMap state listener.
      method removeMapStateListener
      void removeMapStateListener(@NonNull IMapStateListener listener)
      Package:dji.open.pilot.client.interfaces
      Description:

      Removes a server-side map state listener.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull IMapStateListener listenerMap state listener.
      method addMapWidget
      void addMapWidget(@NonNull MapWidget widget, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Adds a map widget to the server (with result callback).

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull MapWidget widgetMap widget.
      CommonCallbacks.CompletionCallback callbackResult callback.
      method removeMapWidget
      void removeMapWidget(@NonNull MapWidget widget, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Removes a map widget (with result callback).

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull MapWidget widgetMap widget.
      CommonCallbacks.CompletionCallback callbackResult callback.
      method updateMapWidgets
      void updateMapWidgets(@NonNull List<MapWidget> widgets, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Updates map widgets in batch.

      Widgets are matched by id and their properties are updated in place (without visual flicker). If the id of any widget in the list does not exist, or an attempt is made to modify an immutable field (id / source / layerId), the whole batch update fails and no IPC is issued.

      The following fields cannot be modified via this method, otherwise the WIDGET_FIELD_IMMUTABLE error is returned in the callback: id (unique widget identifier, immutable); source (source package name, immutable); layerId (the layer it belongs to; to move a widget to another layer, first call removeMapWidgetsByIds and then addMapWidgets again).

      Note: Due to the Android Binder transmission limit, the total data volume of a single batch update should not exceed 512KB. When exceeded, the PAYLOAD_TOO_LARGE error is returned in the callback.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull List<MapWidget> widgetsMap widget list.
      CommonCallbacks.CompletionCallback callbackResult callback.
      method queryMapWidgets
      void queryMapWidgets(@NonNull CommonCallbacks.CompletionCallbackWithParam<List<MapWidget>> callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Queries all map widgets added by the current plugin.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull CommonCallbacks.CompletionCallbackWithParam<List<MapWidget>> callbackQuery result callback.
      method queryMapWidgetsByLayer
      void queryMapWidgetsByLayer(@NonNull String layerId,
      @NonNull CommonCallbacks.CompletionCallbackWithParam<List<MapWidget>> callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Queries all map widgets under the specified layer.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull String layerIdLayer ID.
      @NonNull CommonCallbacks.CompletionCallbackWithParam<List<MapWidget>> callbackQuery result callback.
      method addMapWidgets
      void addMapWidgets(@NonNull List<MapWidget> widgets, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Adds map widgets in batch.

      Multiple widgets are added in a single IPC call, suitable for batch synchronization of GIS data.

      Note: Due to the Android Binder transmission limit, the total data volume of a single batch addition should not exceed 512KB. It is recommended not to exceed 500 simple Marker widgets, or 200 polyline/polygon widgets that contain coordinate lists at a time. When exceeded, the PAYLOAD_TOO_LARGE error is returned in the callback.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull List<MapWidget> widgetsMap widget list.
      CommonCallbacks.CompletionCallback callbackResult callback.
      method removeMapWidgetsByIds
      void removeMapWidgetsByIds(@NonNull List<String> widgetIds, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Removes map widgets in batch by id list.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull List<String> widgetIdsList of ids of the map widgets to be removed.
      CommonCallbacks.CompletionCallback callbackResult callback.
      method
      method addLayer
      void addLayer(@NonNull MapWidgetLayer layer, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Adds a layer.

      A layer is a logical grouping container for map widgets. It can organize MapWidgets into different layers by business semantics (such as “fire point layer”, “personnel layer”), and supports showing/hiding and clearing an entire layer. A layer can contain MapWidgets of any DrawerType.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull MapWidgetLayer layerLayer.
      CommonCallbacks.CompletionCallback callbackResult callback.
      method removeLayer
      void removeLayer(@NonNull String layerId, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Removes a layer.

      This also removes all map widgets under the layer. The default layer (empty layerId) cannot be removed, otherwise the LAYER_READONLY error is returned in the callback. If the layer does not exist, the LAYER_NOT_FOUND error is returned in the callback.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull String layerIdLayer ID.
      CommonCallbacks.CompletionCallback callbackResult callback.
      method setLayerVisible
      void setLayerVisible(@NonNull String layerId, boolean visible, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Sets the layer visibility.

      Controls the display/hiding of all map widgets under the entire layer. The visibility of the default layer (empty layerId) cannot be set, otherwise the LAYER_READONLY error is returned in the callback. If the layer does not exist, the LAYER_NOT_FOUND error is returned in the callback.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull String layerIdLayer ID.
      boolean visibletrue to show, false to hide.
      CommonCallbacks.CompletionCallback callbackResult callback.
      method clearLayer
      void clearLayer(@NonNull String layerId, CommonCallbacks.CompletionCallback callback)
      Package:dji.open.pilot.client.interfaces
      Description:

      Clears a layer.

      Removes all map widgets under the layer but keeps the layer itself. The default layer (empty layerId) cannot be cleared, otherwise the LAYER_READONLY error is returned in the callback. If the layer does not exist, the LAYER_NOT_FOUND error is returned in the callback.

      Supported since MSDK 5.20.1

      Input Parameters:
      @NonNull String layerIdLayer ID.
      CommonCallbacks.CompletionCallback callbackResult callback.
      class MapCircleOptions ↗
      @Keep
      class MapCircleOptions implements Parcelable
      描述

      Circle configuration of a map widget element.

      MSDK 5.20.1开始支持

      enum MapDrawerType
      @Keep
      enum MapDrawerType
      Package:dji.open.pilot.base.manager.map
      Description:

      Map widget drawer type.

      Supported since MSDK 5.20.1

      Enum Members:
      NONENot set.
      MARKERMap marker.
      POLYLINEMap polyline.
      POLYGONMap polygon.
      CIRCLEMap circle.
      PINMap pin point.
      Class Members:
      class MapElement ↗
      @Keep
      class MapElement implements Parcelable
      描述

      Map element.

      MSDK 5.20.1开始支持

      enum MapElementColor
      enum MapElementColor 
      Package:dji.open.pilot.base.manager.map
      Description:

      Color of a map element.

      Supported since MSDK 5.20.1

      Enum Members:
      BLUESemi-transparent blue.
      GREENSemi-transparent green.
      YELLOWSemi-transparent yellow.
      ORANGESemi-transparent orange.
      REDSemi-transparent red.
      NAME_DEFAULTDefault color.
      Class Members:
      class MapMarkerOptions ↗
      @Keep
      class MapMarkerOptions implements Parcelable
      描述

      Marker configuration of a map widget element.

      MSDK 5.20.1开始支持

      class MapPolygonOptions ↗
      @Keep
      class MapPolygonOptions implements Parcelable
      描述

      Polygon configuration of a map widget element.

      MSDK 5.20.1开始支持

      class MapPolylineOptions ↗
      @Keep
      class MapPolylineOptions implements Parcelable
      描述

      Polyline configuration of a map widget element.

      MSDK 5.20.1开始支持

      class MapWidget ↗
      @Keep
      class MapWidget implements Parcelable
      描述

      Map widget.

      MSDK 5.20.1开始支持

      class MapWidgetItem ↗
      @Keep
      class MapWidgetItem implements Parcelable
      描述

      Map widget item, used to describe the custom configuration of a map widget.

      MSDK 5.20.1开始支持

      enum MapWidgetItemType
      @Keep
      enum MapWidgetItemType
      Package:dji.open.pilot.base.manager.map
      Description:

      Map widget item type.

      Supported since MSDK 5.20.1

      Enum Members:
      DIALOGDialog.
      NONENot set.
      Class Members:
      class MapWidgetLayer ↗
      @Keep
      class MapWidgetLayer implements Parcelable
      描述

      Map widget layer.

      MSDK 5.20.1开始支持