DJI Mobile SDK Documentation

class DJIMap

interface DJIMap
Package:com.dji.mapkit.core.maps
Description:

The public interface of map object.

Class Members:
Add Marker
method
method addMarker
@NonNull
DJIMarker addMarker(DJIMarkerOptions markerOptions)
Package:com.dji.mapkit.core.maps
Description:

Adds a marker to this map.

Input Parameters:
DJIMarkerOptions markerOptionsDescribes how to create the marker.
Return:
DJIMarkerThe marker that was added to the map.
Get Map
method
method getMap
Object getMap()
Package:com.dji.mapkit.core.maps
Description:

Gets the base Map Object. This will enable all the features available by default in each Map Provider

Return:
ObjectThe DJIMap object.
Animate Camera
method
method animateCamera
void animateCamera(DJICameraUpdate cameraUpdate)
Package:com.dji.mapkit.core.maps
Description:

Moves the camera position with default animation.

Input Parameters:
DJICameraUpdate cameraUpdateThe change to apply to the camera.
Set Listener
method
method setOnCameraChangeListener
void setOnCameraChangeListener(final OnCameraChangeListener listener)
Package:com.dji.mapkit.core.maps
Description:

Sets the OnCameraChangeListener which can listen to camera changes.

Input Parameters:
final OnCameraChangeListener listenerThe listener that is added to this map.
method setOnMarkerClickListener
void setOnMarkerClickListener(OnMarkerClickListener listener)
Package:com.dji.mapkit.core.maps
Description:

Sets the which can listen to click events on the map's markers.

Input Parameters:
OnMarkerClickListener listenerThe listener that is added to this map.
method setOnMapClickListener
void setOnMapClickListener(OnMapClickListener listener)
Package:com.dji.mapkit.core.maps
Description:

Sets the .

Input Parameters:
OnMapClickListener listenerThe listener that is added to this map.
method setOnMarkerDragListener
void setOnMarkerDragListener(OnMarkerDragListener listener)
Package:com.dji.mapkit.core.maps
Description:

Sets the map's .

Input Parameters:
OnMarkerDragListener listenerThe listener that is added to this map.
method removeAllOnCameraChangeListeners
void removeAllOnCameraChangeListeners()
Package:com.dji.mapkit.core.maps
Description:

Removes all instances of OnCameraChangeListener from the map.

method removeOnMarkerClickListener
void removeOnMarkerClickListener(OnMarkerClickListener listener)
Package:com.dji.mapkit.core.maps
Description:

Removes the from the map.

Input Parameters:
OnMarkerClickListener listenerThe listener to remove.
method removeOnMapClickListener
void removeOnMapClickListener(OnMapClickListener listener)
Package:com.dji.mapkit.core.maps
Description:

Removes the from the map.

Input Parameters:
OnMapClickListener listenerThe listener to remove.
method removeOnMarkerDragListener
void removeOnMarkerDragListener(OnMarkerDragListener listener)
Package:com.dji.mapkit.core.maps
Description:

Removes the from the map.

Input Parameters:
OnMarkerDragListener listenerThe listener to remove.
method removeAllOnMarkerDragListener
void removeAllOnMarkerDragListener()
Package:com.dji.mapkit.core.maps
Description:

Removes all instances of from the map.

Get Camera Position
method
method getCameraPosition
DJICameraPosition getCameraPosition()
Package:com.dji.mapkit.core.maps
Description:

Gets the camera position.

Return:
DJICameraPositionThe DJICameraPosition object.
Move Camera
method
method moveCamera
void moveCamera(DJICameraUpdate cameraUpdate)
Package:com.dji.mapkit.core.maps
Description:

Moves the camera position.

Input Parameters:
DJICameraUpdate cameraUpdateThe camera position.
Set Map Type
method
method setMapType
void setMapType(MapType type)
Package:com.dji.mapkit.core.maps
Description:

Sets the map type of this map.

Input Parameters:
MapType typeThe map type that the map will be set to.
method setMapType
void setMapType(MapType type, OnMapTypeLoadedListener listener)
Package:com.dji.mapkit.core.maps
Description:

Sets the map type of this map with an OnMapTypeLoadedListener which can listen to the event when the map type is finished loading.

Input Parameters:
MapType typeThe map type that the map will be set to.
OnMapTypeLoadedListener listenerThe listener that is added to this map.
Add Polyline
method
method addPolyline
@NonNull
DJIPolyline addPolyline(DJIPolylineOptions options)
Package:com.dji.mapkit.core.maps
Description:

Adds a polyline.

Input Parameters:
DJIPolylineOptions optionsThe polyline options.
Return:
DJIPolylineThe DJIPolyline that was added to the map.
Add Polygon
method
method addPolygon
@Nullable
DJIPolygon addPolygon(DJIPolygonOptions options)
Package:com.dji.mapkit.core.maps
Description:

Adds a polygon.

Input Parameters:
DJIPolygonOptions optionsThe polygon options.
Return:
DJIPolygonThe DJIPolygon that was added to the map. Returns null if the polygon is invalid.
Add Circle
method
method addSingleCircle
@Nullable
DJICircle addSingleCircle(DJICircleOptions options)
Package:com.dji.mapkit.core.maps
Description:

Adds a circle.

Input Parameters:
DJICircleOptions optionsThe circle options.
Return:
DJICircleThe DJICircle that was added to the map. Returns null if the circle is invalid.
Get UI Settings
method
method getUiSettings
DJIUiSettings getUiSettings()
Package:com.dji.mapkit.core.maps
Description:

Gets the UI Settings.

Return:
DJIUiSettingsThe DJIUiSettings object.
Map Type
unknown
unknown
enum MapType
Package:com.dji.mapkit.core.maps
Description:

The overall representation of the map.

State Updates
unknown
unknown
interface OnMarkerClickListener
Package:com.dji.mapkit.core.maps
Description:

Listener on the marker click event.

unknown
unknown
interface OnMapClickListener
Package:com.dji.mapkit.core.maps
Description:

Listener on the map click event.

unknown
unknown
interface OnMarkerDragListener
Package:com.dji.mapkit.core.maps
Description:

Listener on the marker drag event.

class