@UiThread
public final class DingiMap
extends java.lang.Object
DingiMap
object directly, rather,
you must obtain one from the getMapAsync() method on a MapFragment or MapView that you have
added to your application.
Note: Similar to a View object, a DingiMap should only be read and modified from the main thread.
Modifier and Type | Class and Description |
---|---|
static interface |
DingiMap.CancelableCallback
Interface definition for a callback to be invoked when a task is complete or cancelled.
|
static interface |
DingiMap.InfoWindowAdapter
Interface definition for a callback to be invoked when an info window will be shown.
|
static class |
DingiMap.MarkerViewAdapter<U extends MarkerView>
Deprecated.
Use a
SymbolLayer instead. |
static interface |
DingiMap.OnCameraIdleListener
Interface definition for a callback to be invoked for when camera movement has ended.
|
static interface |
DingiMap.OnCameraMoveCanceledListener
Interface definition for a callback to be invoked for when the camera's motion has been stopped or when the camera
starts moving for a new reason.
|
static interface |
DingiMap.OnCameraMoveListener
Interface definition for a callback to be invoked for when the camera changes position.
|
static interface |
DingiMap.OnCameraMoveStartedListener
Interface definition for a callback to be invoked for when the camera motion starts.
|
static interface |
DingiMap.OnCompassAnimationListener
Interface definition for a callback to be invoked for when the compass is animating.
|
static interface |
DingiMap.OnFlingListener
Interface definition for a callback to be invoked when the map is flinged.
|
static interface |
DingiMap.OnFpsChangedListener
Interface definition for a callback to be invoked when a frame is rendered to the map view.
|
static interface |
DingiMap.OnInfoWindowClickListener
Interface definition for a callback to be invoked when the user clicks on an info window.
|
static interface |
DingiMap.OnInfoWindowCloseListener
Interface definition for a callback to be invoked when a marker's info window is closed.
|
static interface |
DingiMap.OnInfoWindowLongClickListener
Interface definition for a callback to be invoked when the user long presses on a marker's info window.
|
static interface |
DingiMap.OnMapClickListener
Interface definition for a callback to be invoked when the user clicks on the map view.
|
static interface |
DingiMap.OnMapLongClickListener
Interface definition for a callback to be invoked when the user long clicks on the map view.
|
static interface |
DingiMap.OnMarkerClickListener
Interface definition for a callback to be invoked when the user clicks on a marker.
|
static interface |
DingiMap.OnMarkerViewClickListener
Interface definition for a callback to be invoked when the user clicks on a MarkerView.
|
static interface |
DingiMap.OnMoveListener
Interface definition for a callback to be invoked when the map is moved.
|
static interface |
DingiMap.OnPolygonClickListener
Interface definition for a callback to be invoked when the user clicks on a polygon.
|
static interface |
DingiMap.OnPolylineClickListener
Interface definition for a callback to be invoked when the user clicks on a polyline.
|
static interface |
DingiMap.OnRotateListener
Interface definition for a callback to be invoked when the map is rotated.
|
static interface |
DingiMap.OnScaleListener
Interface definition for a callback to be invoked when the map is scaled.
|
static interface |
DingiMap.OnShoveListener
Interface definition for a callback to be invoked when the map is tilted.
|
static interface |
DingiMap.OnStyleLoadedListener
Interface definition for a callback to be invoked when the style has finished loading.
|
static interface |
DingiMap.SnapshotReadyCallback
Interface definition for a callback to be invoked when the snapshot has been taken.
|
Modifier and Type | Method and Description |
---|---|
void |
addImage(java.lang.String name,
android.graphics.Bitmap image)
Adds an image to be used in the map's style
|
void |
addImage(java.lang.String name,
android.graphics.Bitmap image,
boolean sdf)
Adds an image to be used in the map's style
|
void |
addImages(java.util.HashMap<java.lang.String,android.graphics.Bitmap> images)
Adds an images to be used in the map's style
|
void |
addLayer(Layer layer)
Adds the layer to the map.
|
void |
addLayerAbove(Layer layer,
java.lang.String above)
Adds the layer to the map.
|
void |
addLayerAt(Layer layer,
int index)
Adds the layer to the map at the specified index.
|
void |
addLayerBelow(Layer layer,
java.lang.String below)
Adds the layer to the map.
|
Marker |
addMarker(BaseMarkerOptions markerOptions)
Adds a marker to this map.
|
MarkerView |
addMarker(BaseMarkerViewOptions markerOptions)
Deprecated.
Use a
SymbolLayer instead. |
MarkerView |
addMarker(BaseMarkerViewOptions markerOptions,
MarkerViewManager.OnMarkerViewAddedListener onMarkerViewAddedListener)
Deprecated.
Use a
SymbolLayer instead. An example of converting Android |
Marker |
addMarker(MarkerOptions markerOptions)
Adds a marker to this map.
|
java.util.List<Marker> |
addMarkers(java.util.List<? extends BaseMarkerOptions> markerOptionsList)
Adds multiple markers to this map.
|
java.util.List<MarkerView> |
addMarkerViews(java.util.List<? extends BaseMarkerViewOptions> markerViewOptions)
Deprecated.
Use a
SymbolLayer instead. |
void |
addOnCameraIdleListener(DingiMap.OnCameraIdleListener listener)
Adds a callback that is invoked when camera movement has ended.
|
void |
addOnCameraMoveCancelListener(DingiMap.OnCameraMoveCanceledListener listener)
Adds a callback that is invoked when camera movement was cancelled.
|
void |
addOnCameraMoveListener(DingiMap.OnCameraMoveListener listener)
Adds a callback that is invoked when camera position changes.
|
void |
addOnCameraMoveStartedListener(DingiMap.OnCameraMoveStartedListener listener)
Adds a callback that is invoked when camera movement has started.
|
void |
addOnFlingListener(DingiMap.OnFlingListener listener)
Adds a callback that's invoked when the map is flinged.
|
void |
addOnMapClickListener(DingiMap.OnMapClickListener listener)
Adds a callback that's invoked when the user clicks on the map view.
|
void |
addOnMapLongClickListener(DingiMap.OnMapLongClickListener listener)
Adds a callback that's invoked when the user long clicks on the map view.
|
void |
addOnMoveListener(DingiMap.OnMoveListener listener)
Adds a callback that's invoked when the map is moved.
|
void |
addOnRotateListener(DingiMap.OnRotateListener listener)
Adds a callback that's invoked when the map is rotated.
|
void |
addOnScaleListener(DingiMap.OnScaleListener listener)
Adds a callback that's invoked when the map is scaled.
|
void |
addOnShoveListener(DingiMap.OnShoveListener listener)
Adds a callback that's invoked when the map is tilted.
|
Polygon |
addPolygon(PolygonOptions polygonOptions)
Adds a polygon to this map.
|
java.util.List<Polygon> |
addPolygons(java.util.List<PolygonOptions> polygonOptionsList)
Adds multiple polygons to this map.
|
Polyline |
addPolyline(PolylineOptions polylineOptions)
Adds a polyline to this map.
|
java.util.List<Polyline> |
addPolylines(java.util.List<PolylineOptions> polylineOptionsList)
Adds multiple polylines to this map.
|
void |
addSource(Source source)
Adds the source to the map.
|
void |
animateCamera(CameraUpdate update)
Animate the camera to a new location defined within
CameraUpdate using a transition
animation that evokes powered flight. |
void |
animateCamera(CameraUpdate update,
DingiMap.CancelableCallback callback)
Animate the camera to a new location defined within
CameraUpdate using a transition
animation that evokes powered flight. |
void |
animateCamera(CameraUpdate update,
int durationMs)
Animate the camera to a new location defined within
CameraUpdate using a transition
animation that evokes powered flight. |
void |
animateCamera(CameraUpdate update,
int durationMs,
DingiMap.CancelableCallback callback)
Animate the camera to a new location defined within
CameraUpdate using a transition
animation that evokes powered flight. |
void |
cancelAllVelocityAnimations()
Interrupts any ongoing gesture velocity animations.
|
void |
cancelTransitions()
Cancels ongoing animations.
|
void |
clear()
Removes all markers, polylines, polygons, overlays, etc from the map.
|
void |
cycleDebugOptions()
Cycles through the map debug options.
|
void |
deselectMarker(Marker marker)
Deselects a currently selected marker.
|
void |
deselectMarkers()
Deselects any currently selected marker.
|
void |
easeCamera(CameraUpdate update)
Gradually move the camera by the default duration, zoom will not be affected unless specified
within
CameraUpdate . |
void |
easeCamera(CameraUpdate update,
DingiMap.CancelableCallback callback)
Gradually move the camera by the default duration, zoom will not be affected unless specified
within
CameraUpdate . |
void |
easeCamera(CameraUpdate update,
int durationMs)
Gradually move the camera by a specified duration in milliseconds, zoom will not be affected
unless specified within
CameraUpdate . |
void |
easeCamera(CameraUpdate update,
int durationMs,
boolean easingInterpolator)
Gradually move the camera by a specified duration in milliseconds, zoom will not be affected
unless specified within
CameraUpdate . |
void |
easeCamera(CameraUpdate update,
int durationMs,
boolean easingInterpolator,
DingiMap.CancelableCallback callback)
Gradually move the camera by a specified duration in milliseconds, zoom will not be affected
unless specified within
CameraUpdate . |
void |
easeCamera(CameraUpdate update,
int durationMs,
DingiMap.CancelableCallback callback)
Gradually move the camera by a specified duration in milliseconds, zoom will not be affected
unless specified within
CameraUpdate . |
Annotation |
getAnnotation(long id)
Return a annotation based on its id.
|
java.util.List<Annotation> |
getAnnotations()
Returns a list of all the annotations on the map.
|
CameraPosition |
getCameraForGeometry(com.mapbox.geojson.Geometry geometry)
Get a camera position that fits a provided shape.
|
CameraPosition |
getCameraForGeometry(com.mapbox.geojson.Geometry geometry,
double bearing,
double tilt)
Get a camera position that fits a provided shape with a given bearing and tilt.
|
CameraPosition |
getCameraForGeometry(com.mapbox.geojson.Geometry geometry,
double bearing,
int[] padding)
Deprecated.
|
CameraPosition |
getCameraForGeometry(com.mapbox.geojson.Geometry geometry,
int[] padding)
Get a camera position that fits a provided shape and padding.
|
CameraPosition |
getCameraForGeometry(com.mapbox.geojson.Geometry geometry,
int[] padding,
double bearing,
double tilt)
Get a camera position that fits a provided shape with a given padding, bearing and tilt.
|
CameraPosition |
getCameraForLatLngBounds(LatLngBounds latLngBounds)
Get a camera position that fits a provided bounds and the current camera tilt and bearing.
|
CameraPosition |
getCameraForLatLngBounds(LatLngBounds latLngBounds,
double bearing,
double tilt)
Get a camera position that fits a provided bounds, bearing and tilt.
|
CameraPosition |
getCameraForLatLngBounds(LatLngBounds latLngBounds,
int[] padding)
Get a camera position that fits a provided bounds and padding and the current camera tilt and bearing.
|
CameraPosition |
getCameraForLatLngBounds(LatLngBounds latLngBounds,
int[] padding,
double bearing,
double tilt)
Get a camera position that fits a provided bounds, padding, bearing and tilt.
|
CameraPosition |
getCameraPosition()
Gets the current position of the camera.
|
com.mapbox.android.gestures.AndroidGesturesManager |
getGesturesManager()
|
float |
getHeight()
Returns the measured height of the Map.
|
android.graphics.Bitmap |
getImage(java.lang.String name) |
DingiMap.InfoWindowAdapter |
getInfoWindowAdapter()
Gets the callback to be invoked when an info window will be shown.
|
Layer |
getLayer(java.lang.String layerId)
Get the layer by id
|
<T extends Layer> |
getLayerAs(java.lang.String layerId)
Tries to cast the Layer to T, throws ClassCastException if it's another type.
|
java.util.List<Layer> |
getLayers()
Retrieve all the layers in the style
|
Light |
getLight()
Get the global light source used to change lighting conditions on extruded fill layers.
|
LocationComponent |
getLocationComponent()
Returns the
LocationComponent that can be used to display user's location on the map. |
java.util.List<Marker> |
getMarkers()
Returns a list of all the markers on the map.
|
MarkerViewManager |
getMarkerViewManager()
Get the MarkerViewManager associated to the MapView.
|
java.util.List<MarkerView> |
getMarkerViewsInRect(android.graphics.RectF rect)
Deprecated.
Use a
SymbolLayer instead |
double |
getMaxZoomLevel()
Gets the maximum zoom level the map can be displayed at.
|
double |
getMinZoomLevel()
Gets the minimum zoom level the map can be displayed at.
|
DingiMap.OnInfoWindowClickListener |
getOnInfoWindowClickListener()
Return the InfoWindow click listener
|
DingiMap.OnInfoWindowCloseListener |
getOnInfoWindowCloseListener()
Return the InfoWindow close listener
|
DingiMap.OnInfoWindowLongClickListener |
getOnInfoWindowLongClickListener()
Return the InfoWindow long click listener
|
int[] |
getPadding()
Returns the current configured content padding on map view.
|
java.util.List<Polygon> |
getPolygons()
Returns a list of all the polygons on the map.
|
java.util.List<Polyline> |
getPolylines()
Returns a list of all the polylines on the map.
|
boolean |
getPrefetchesTiles()
Check whether tile pre-fetching is enabled or not.
|
Projection |
getProjection()
Get the Projection object that you can use to convert between screen coordinates and latitude/longitude
coordinates.
|
java.util.List<Marker> |
getSelectedMarkers()
Gets the currently selected marker.
|
Source |
getSource(java.lang.String sourceId)
Retrieve a source by id
|
<T extends Source> |
getSourceAs(java.lang.String sourceId)
Tries to cast the Source to T, returns null if it's another type.
|
java.util.List<Source> |
getSources()
Retrieve all the sources in the style
|
java.lang.String |
getStyleJson()
Returns the map style json currently displayed in the map view.
|
java.lang.String |
getStyleUrl()
Returns the map style url currently displayed in the map view.
|
long |
getTransitionDelay()
Get the animation delay for style changes.
|
long |
getTransitionDuration()
Get the animation duration for style changes.
|
UiSettings |
getUiSettings()
Gets the user interface settings for the map.
|
float |
getWidth()
Returns the measured width of the Map.
|
boolean |
isAllowConcurrentMultipleOpenInfoWindows()
Returns whether the map allows concurrent multiple infowindows to be shown.
|
boolean |
isDebugActive()
Returns whether the map debug information is currently shown.
|
void |
moveCamera(CameraUpdate update)
Repositions the camera according to the instructions defined in the update.
|
void |
moveCamera(CameraUpdate update,
DingiMap.CancelableCallback callback)
Repositions the camera according to the instructions defined in the update.
|
java.util.List<com.mapbox.geojson.Feature> |
queryRenderedFeatures(android.graphics.PointF coordinates,
Expression filter,
java.lang.String... layerIds)
Queries the map for rendered features
|
java.util.List<com.mapbox.geojson.Feature> |
queryRenderedFeatures(android.graphics.PointF coordinates,
java.lang.String... layerIds)
Queries the map for rendered features
|
java.util.List<com.mapbox.geojson.Feature> |
queryRenderedFeatures(android.graphics.RectF coordinates,
Expression filter,
java.lang.String... layerIds)
Queries the map for rendered features
|
java.util.List<com.mapbox.geojson.Feature> |
queryRenderedFeatures(android.graphics.RectF coordinates,
java.lang.String... layerIds)
Queries the map for rendered features
|
void |
removeAnnotation(Annotation annotation)
Removes an annotation from the map.
|
void |
removeAnnotation(long id)
Removes an annotation from the map
|
void |
removeAnnotations()
Removes all annotations from the map.
|
void |
removeAnnotations(java.util.List<? extends Annotation> annotationList)
Removes multiple annotations from the map.
|
void |
removeImage(java.lang.String name)
Removes an image from the map's style
|
Layer |
removeLayer(Layer layer)
Removes the layer.
|
Layer |
removeLayer(java.lang.String layerId)
Removes the layer.
|
Layer |
removeLayerAt(int index)
Removes the layer.
|
void |
removeMarker(Marker marker)
Convenience method for removing a Marker from the map.
|
void |
removeOnCameraIdleListener(DingiMap.OnCameraIdleListener listener)
Removes a callback that is invoked when camera movement has ended.
|
void |
removeOnCameraMoveCancelListener(DingiMap.OnCameraMoveCanceledListener listener)
Removes a callback that is invoked when camera movement was cancelled.
|
void |
removeOnCameraMoveListener(DingiMap.OnCameraMoveListener listener)
Removes a callback that is invoked when camera position changes.
|
void |
removeOnCameraMoveStartedListener(DingiMap.OnCameraMoveStartedListener listener)
Removes a callback that is invoked when camera movement has started.
|
void |
removeOnFlingListener(DingiMap.OnFlingListener listener)
Removes a callback that's invoked when the map is flinged.
|
void |
removeOnMapClickListener(DingiMap.OnMapClickListener listener)
Removes a callback that's invoked when the user clicks on the map view.
|
void |
removeOnMapLongClickListener(DingiMap.OnMapLongClickListener listener)
Removes a callback that's invoked when the user long clicks on the map view.
|
void |
removeOnMoveListener(DingiMap.OnMoveListener listener)
Removes a callback that's invoked when the map is moved.
|
void |
removeOnRotateListener(DingiMap.OnRotateListener listener)
Removes a callback that's invoked when the map is rotated.
|
void |
removeOnScaleListener(DingiMap.OnScaleListener listener)
Removes a callback that's invoked when the map is scaled.
|
void |
removeOnShoveListener(DingiMap.OnShoveListener listener)
Remove a callback that's invoked when the map is tilted.
|
void |
removePolygon(Polygon polygon)
Convenience method for removing a Polygon from the map.
|
void |
removePolyline(Polyline polyline)
Convenience method for removing a Polyline from the map.
|
Source |
removeSource(Source source)
Removes the source, preserving the reference for re-use
|
Source |
removeSource(java.lang.String sourceId)
Removes the source.
|
void |
resetNorth()
Resets the map view to face north.
|
void |
scrollBy(float x,
float y)
Scrolls the camera over the map, shifting the center of view by the specified number of pixels in the x and y
directions.
|
void |
scrollBy(float x,
float y,
long duration)
Scrolls the camera over the map, shifting the center of view by the specified number of pixels in the x and y
directions.
|
void |
selectMarker(Marker marker)
Selects a marker.
|
void |
setAllowConcurrentMultipleOpenInfoWindows(boolean allow)
Changes whether the map allows concurrent multiple infowindows to be shown.
|
void |
setCameraPosition(CameraPosition cameraPosition)
Repositions the camera according to the cameraPosition.
|
void |
setDebugActive(boolean debugActive)
Changes whether the map debug information is shown.
|
void |
setFocalBearing(double bearing,
float focalX,
float focalY,
long duration)
Transform the map bearing given a bearing, focal point coordinates, and a duration.
|
void |
setGesturesManager(com.mapbox.android.gestures.AndroidGesturesManager androidGesturesManager,
boolean attachDefaultListeners,
boolean setDefaultMutuallyExclusives)
|
void |
setInfoWindowAdapter(DingiMap.InfoWindowAdapter infoWindowAdapter)
Sets a custom renderer for the contents of info window.
|
void |
setLatLngBoundsForCameraTarget(LatLngBounds latLngBounds)
Sets a LatLngBounds that constraints map transformations to this bounds.
|
void |
setMaxZoomPreference(double maxZoom)
Sets the maximum zoom level the map can be displayed at.
|
void |
setMinZoomPreference(double minZoom)
Sets the minimum zoom level the map can be displayed at.
|
void |
setOnFpsChangedListener(DingiMap.OnFpsChangedListener listener)
Sets a callback that's invoked on every frame rendered to the map view.
|
void |
setOnInfoWindowClickListener(DingiMap.OnInfoWindowClickListener listener)
Sets a callback that's invoked when the user clicks on an info window.
|
void |
setOnInfoWindowCloseListener(DingiMap.OnInfoWindowCloseListener listener)
Set an callback to be invoked when an InfoWindow closes.
|
void |
setOnInfoWindowLongClickListener(DingiMap.OnInfoWindowLongClickListener listener)
Sets a callback that's invoked when a marker's info window is long pressed.
|
void |
setOnMarkerClickListener(DingiMap.OnMarkerClickListener listener)
Sets a callback that's invoked when the user clicks on a marker.
|
void |
setOnPolygonClickListener(DingiMap.OnPolygonClickListener listener)
Sets a callback that's invoked when the user clicks on a polygon.
|
void |
setOnPolylineClickListener(DingiMap.OnPolylineClickListener listener)
Sets a callback that's invoked when the user clicks on a polyline.
|
void |
setPadding(int left,
int top,
int right,
int bottom)
Sets the distance from the edges of the map view's frame to the edges of the map
view's logical viewport.
|
void |
setPrefetchesTiles(boolean enable)
Enable or disable tile pre-fetching.
|
void |
setStyle(java.lang.String style)
Loads a new map style from the specified bundled style.
|
void |
setStyle(java.lang.String style,
DingiMap.OnStyleLoadedListener callback)
Loads a new map style from the specified bundled style.
|
void |
setStyleJson(java.lang.String styleJson)
Loads a new map style from a json string.
|
void |
setStyleUrl(java.lang.String url)
Loads a new map style asynchronous from the specified URL.
|
void |
setStyleUrl(java.lang.String url,
DingiMap.OnStyleLoadedListener callback)
Loads a new map style asynchronous from the specified URL.
|
void |
setTransitionDelay(long delayMs)
Set the animation delay for style changes.
|
void |
setTransitionDuration(long durationMs)
Set the animation duration for style changes.
|
void |
snapshot(DingiMap.SnapshotReadyCallback callback)
Takes a snapshot of the map.
|
void |
updateMarker(Marker updatedMarker)
Updates a marker on this map.
|
void |
updatePolygon(Polygon polygon)
Update a polygon on this map.
|
void |
updatePolyline(Polyline polyline)
Update a polyline on this map.
|
public long getTransitionDuration()
Get the animation duration for style changes.
The default value is zero, so any changes take effect without animation.public void setTransitionDuration(long durationMs)
durationMs
- Duration in millisecondspublic long getTransitionDelay()
Get the animation delay for style changes.
The default value is zero, so any changes begin to animate immediately.public void setTransitionDelay(long delayMs)
delayMs
- Delay in millisecondspublic void setPrefetchesTiles(boolean enable)
enable
- true to enablepublic boolean getPrefetchesTiles()
setPrefetchesTiles(boolean)
@NonNull public java.util.List<Layer> getLayers()
@Nullable public Layer getLayer(@NonNull java.lang.String layerId)
layerId
- the layer's id@Nullable public <T extends Layer> T getLayerAs(@NonNull java.lang.String layerId)
T
- the generic attribute of a LayerlayerId
- the layer id used to look up a layerpublic void addLayer(@NonNull Layer layer)
layer
- the layer to addpublic void addLayerBelow(@NonNull Layer layer, @NonNull java.lang.String below)
layer
- the layer to addbelow
- the layer id to add this layer beforepublic void addLayerAbove(@NonNull Layer layer, @NonNull java.lang.String above)
layer
- the layer to addabove
- the layer id to add this layer abovepublic void addLayerAt(@NonNull Layer layer, int index)
layer
- the layer to addindex
- the index to insert the layer at@Nullable public Layer removeLayer(@NonNull java.lang.String layerId)
layerId
- the layer to remove@Nullable public Layer removeLayer(@NonNull Layer layer)
layer
- the layer to remove@Nullable public Layer removeLayerAt(int index)
index
- the layer index@NonNull public java.util.List<Source> getSources()
@Nullable public Source getSource(@NonNull java.lang.String sourceId)
sourceId
- the source's id@Nullable public <T extends Source> T getSourceAs(@NonNull java.lang.String sourceId)
T
- the generic type of a SourcesourceId
- the id used to look up a layerpublic void addSource(@NonNull Source source)
source
- the source to add@Nullable public Source removeSource(@NonNull java.lang.String sourceId)
sourceId
- the source to remove@Nullable public Source removeSource(@NonNull Source source)
source
- the source to removepublic void addImage(@NonNull java.lang.String name, @NonNull android.graphics.Bitmap image)
name
- the name of the imageimage
- the pre-multiplied Bitmappublic void addImage(@NonNull java.lang.String name, @NonNull android.graphics.Bitmap image, boolean sdf)
name
- the name of the imageimage
- the pre-multiplied Bitmapsdf
- the flag indicating image is an SDF or template imagepublic void addImages(@NonNull java.util.HashMap<java.lang.String,android.graphics.Bitmap> images)
public void removeImage(@NonNull java.lang.String name)
name
- the name of the image to remove@Nullable public android.graphics.Bitmap getImage(@NonNull java.lang.String name)
public void setMinZoomPreference(double minZoom)
Sets the minimum zoom level the map can be displayed at.
minZoom
- The new minimum zoom level.public double getMinZoomLevel()
Gets the minimum zoom level the map can be displayed at.
public void setMaxZoomPreference(double maxZoom)
Sets the maximum zoom level the map can be displayed at.
The default maximum zoomn level is 22. The upper bound for this value is 25.5.
maxZoom
- The new maximum zoom level.public double getMaxZoomLevel()
Gets the maximum zoom level the map can be displayed at.
@NonNull public UiSettings getUiSettings()
@NonNull public Projection getProjection()
@NonNull public Light getLight()
public void cancelTransitions()
This invokes the DingiMap.CancelableCallback
for ongoing camera updates.
@NonNull public final CameraPosition getCameraPosition()
public void setCameraPosition(@NonNull CameraPosition cameraPosition)
cameraPosition
- the camera position to setpublic final void moveCamera(@NonNull CameraUpdate update)
update
- The change that should be applied to the camera.public final void moveCamera(@NonNull CameraUpdate update, @Nullable DingiMap.CancelableCallback callback)
update
- The change that should be applied to the cameracallback
- the callback to be invoked when an animation finishes or is canceledpublic final void easeCamera(@NonNull CameraUpdate update)
CameraUpdate
. If getCameraPosition()
is called during the animation,
it will return the current location of the camera in flight.update
- The change that should be applied to the camera.for a set of updates.
public final void easeCamera(@NonNull CameraUpdate update, @Nullable DingiMap.CancelableCallback callback)
CameraUpdate
. If getCameraPosition()
is called during the animation,
it will return the current location of the camera in flight.update
- The change that should be applied to the camera.callback
- An optional callback to be notified from the main thread when the animation
stops. If the animation stops due to its natural completion, the callback
will be notified with onFinish(). If the animation stops due to interruption
by a later camera movement or a user gesture, onCancel() will be called.
Do not update or ease the camera from within onCancel().for a set of updates.
public final void easeCamera(@NonNull CameraUpdate update, int durationMs)
CameraUpdate
. If getCameraPosition()
is called
during the animation, it will return the current location of the camera in flight.update
- The change that should be applied to the camera.durationMs
- The duration of the animation in milliseconds. This must be strictly
positive, otherwise an IllegalArgumentException will be thrown.for a set of updates.
public final void easeCamera(@NonNull CameraUpdate update, int durationMs, @Nullable DingiMap.CancelableCallback callback)
CameraUpdate
. A callback can be used to be notified when
easing the camera stops. If getCameraPosition()
is called during the animation, it
will return the current location of the camera in flight.
Note that this will cancel location tracking mode if enabled.
update
- The change that should be applied to the camera.durationMs
- The duration of the animation in milliseconds. This must be strictly
positive, otherwise an IllegalArgumentException will be thrown.callback
- An optional callback to be notified from the main thread when the animation
stops. If the animation stops due to its natural completion, the callback
will be notified with onFinish(). If the animation stops due to interruption
by a later camera movement or a user gesture, onCancel() will be called.
Do not update or ease the camera from within onCancel().for a set of updates.
public final void easeCamera(@NonNull CameraUpdate update, int durationMs, boolean easingInterpolator)
CameraUpdate
. A callback can be used to be notified when
easing the camera stops. If getCameraPosition()
is called during the animation, it
will return the current location of the camera in flight.
Note that this will cancel location tracking mode if enabled.
update
- The change that should be applied to the camera.durationMs
- The duration of the animation in milliseconds. This must be strictly
positive, otherwise an IllegalArgumentException will be thrown.easingInterpolator
- True for easing interpolator, false for linear.public final void easeCamera(@NonNull CameraUpdate update, int durationMs, boolean easingInterpolator, @Nullable DingiMap.CancelableCallback callback)
CameraUpdate
. A callback can be used to be notified when
easing the camera stops. If getCameraPosition()
is called during the animation, it
will return the current location of the camera in flight.update
- The change that should be applied to the camera.durationMs
- The duration of the animation in milliseconds. This must be strictly
positive, otherwise an IllegalArgumentException will be thrown.easingInterpolator
- True for easing interpolator, false for linear.callback
- An optional callback to be notified from the main thread when the animation
stops. If the animation stops due to its natural completion, the callback
will be notified with onFinish(). If the animation stops due to interruption
by a later camera movement or a user gesture, onCancel() will be called.
Do not update or ease the camera from within onCancel().public final void animateCamera(@NonNull CameraUpdate update)
CameraUpdate
using a transition
animation that evokes powered flight. The animation will last the default amount of time.
During the animation, a call to getCameraPosition()
returns an intermediate location
of the camera in flight.update
- The change that should be applied to the camera.for a set of updates.
public final void animateCamera(@NonNull CameraUpdate update, @Nullable DingiMap.CancelableCallback callback)
CameraUpdate
using a transition
animation that evokes powered flight. The animation will last the default amount of time. A
callback can be used to be notified when animating the camera stops. During the animation, a
call to getCameraPosition()
returns an intermediate location of the camera in flight.update
- The change that should be applied to the camera.callback
- The callback to invoke from the main thread when the animation stops. If the
animation completes normally, onFinish() is called; otherwise, onCancel() is
called. Do not update or animate the camera from within onCancel().for a set of updates.
public final void animateCamera(@NonNull CameraUpdate update, int durationMs)
CameraUpdate
using a transition
animation that evokes powered flight. The animation will last a specified amount of time
given in milliseconds. During the animation, a call to getCameraPosition()
returns
an intermediate location of the camera in flight.update
- The change that should be applied to the camera.durationMs
- The duration of the animation in milliseconds. This must be strictly
positive, otherwise an IllegalArgumentException will be thrown.for a set of updates.
public final void animateCamera(@NonNull CameraUpdate update, int durationMs, @Nullable DingiMap.CancelableCallback callback)
CameraUpdate
using a transition
animation that evokes powered flight. The animation will last a specified amount of time
given in milliseconds. A callback can be used to be notified when animating the camera stops.
During the animation, a call to getCameraPosition()
returns an intermediate location
of the camera in flight.update
- The change that should be applied to the camera.durationMs
- The duration of the animation in milliseconds. This must be strictly
positive, otherwise an IllegalArgumentException will be thrown.callback
- An optional callback to be notified from the main thread when the animation
stops. If the animation stops due to its natural completion, the callback
will be notified with onFinish(). If the animation stops due to interruption
by a later camera movement or a user gesture, onCancel() will be called.
Do not update or animate the camera from within onCancel(). If a callback
isn't required, leave it as null.for a set of updates.
public void scrollBy(float x, float y)
x
- Amount of pixels to scroll to in x directiony
- Amount of pixels to scroll to in y directionpublic void scrollBy(float x, float y, long duration)
x
- Amount of pixels to scroll to in x directiony
- Amount of pixels to scroll to in y directionduration
- Amount of time the scrolling should takepublic void resetNorth()
public void setFocalBearing(double bearing, float focalX, float focalY, long duration)
bearing
- The bearing of the Map to be transformed tofocalX
- The x coordinate of the focal pointfocalY
- The y coordinate of the focal pointduration
- The duration of the transformationpublic float getHeight()
public float getWidth()
public boolean isDebugActive()
public void setDebugActive(boolean debugActive)
Changes whether the map debug information is shown.
The default value is false.debugActive
- If true, map debug information is shown.public void cycleDebugOptions()
Cycles through the map debug options.
The value of isDebugActive reflects whether there are any map debug options enabled or disabled.isDebugActive()
public void setStyleUrl(@NonNull java.lang.String url)
Loads a new map style asynchronous from the specified URL.
url
can take the following forms:
Style.*
: load one of the bundled styles in Style
.http://...
or https://...
:
loads the style over the Internet from any web server.asset://...
:
loads the style from the APK assets/
directory.
This is used to load a style bundled with your app.null
: loads the default Style.DINGI_ENGLISH
style.
This method is asynchronous and will return before the style finishes loading.
If you wish to wait for the map to finish loading, listen to the MapView.OnDidFinishLoadingStyleListener
callback or use the setStyleUrl(String, OnStyleLoadedListener)
method instead.
MapView.OnDidFailLoadingMapListener
callback
will be triggered.url
- The URL of the map styleStyle
public void setStyleUrl(@NonNull java.lang.String url, @Nullable DingiMap.OnStyleLoadedListener callback)
Loads a new map style asynchronous from the specified URL.
url
can take the following forms:
Style.*
: load one of the bundled styles in Style
.http://...
or https://...
:
loads the style over the Internet from any web server.asset://...
:
loads the style from the APK assets/
directory.
This is used to load a style bundled with your app.null
: loads the default Style.DINGI_ENGLISH
style.
If the style fails to load or an invalid style URL is set, the map view will become blank.
An error message will be logged in the Android logcat and MapView.OnDidFailLoadingMapListener
callback
will be triggered.
url
- The URL of the map stylecallback
- The callback that is invoked when the style has loaded.Style
public void setStyle(@NonNull java.lang.String style)
Loads a new map style from the specified bundled style.
This method is asynchronous and will return before the style finishes loading.
If you wish to wait for the map to finish loading, listen to the MapView.OnDidFinishLoadingStyleListener
callback or use the setStyle(String, OnStyleLoadedListener)
method instead.
MapView.OnDidFailLoadingMapListener
callback
will be triggered.style
- The bundled style.Style
public void setStyle(@NonNull java.lang.String style, @Nullable DingiMap.OnStyleLoadedListener callback)
Loads a new map style from the specified bundled style.
If the style fails to load or an invalid style URL is set, the map view will become blank. An error message will be logged in the Android logcat andMapView.OnDidFailLoadingMapListener
callback
will be triggered.style
- The bundled style.callback
- The callback to be invoked when the style has finished loadingStyle
@Nullable public java.lang.String getStyleUrl()
public void setStyleJson(@NonNull java.lang.String styleJson)
If the style fails to load or an invalid style URL is set, the map view will become blank.
An error message will be logged in the Android logcat and MapView.OnDidFailLoadingMapListener
callback
will be triggered.
@NonNull public java.lang.String getStyleJson()
@NonNull public Marker addMarker(@NonNull MarkerOptions markerOptions)
Adds a marker to this map.
The marker's icon is rendered on the map at the locationMarker.position
.
If Marker.title
is defined, the map shows an info box with the marker's title and snippet.markerOptions
- A marker options object that defines how to render the markerMarker
that was added to the map@NonNull public Marker addMarker(@NonNull BaseMarkerOptions markerOptions)
Adds a marker to this map.
The marker's icon is rendered on the map at the locationMarker.position
.
If Marker.title
is defined, the map shows an info box with the marker's title and snippet.markerOptions
- A marker options object that defines how to render the markerMarker
that was added to the map@NonNull @Deprecated public MarkerView addMarker(@NonNull BaseMarkerViewOptions markerOptions)
SymbolLayer
instead.Adds a marker to this map.
The marker's icon is rendered on the map at the locationMarker.position
.
If Marker.title
is defined, the map shows an info box with the marker's title and snippet.markerOptions
- A marker options object that defines how to render the markerMarker
that was added to the map@Deprecated @NonNull public MarkerView addMarker(@NonNull BaseMarkerViewOptions markerOptions, MarkerViewManager.OnMarkerViewAddedListener onMarkerViewAddedListener)
SymbolLayer
instead. An example of converting AndroidAdds a marker to this map.
The marker's icon is rendered on the map at the locationMarker.position
.
If Marker.title
is defined, the map shows an info box with the marker's title and snippet.markerOptions
- A marker options object that defines how to render the markeronMarkerViewAddedListener
- Callback invoked when the View has been added to the mapMarker
that was added to the map@NonNull @Deprecated public java.util.List<MarkerView> addMarkerViews(@NonNull java.util.List<? extends BaseMarkerViewOptions> markerViewOptions)
SymbolLayer
instead.
The marker's icon is rendered on the map at the location Marker.position
.
If Marker.title
is defined, the map shows an info box with the marker's title and snippet.
markerViewOptions
- A list of markerView options objects that defines how to render the markersMarkerView
s that were added to the map@NonNull @Deprecated public java.util.List<MarkerView> getMarkerViewsInRect(@NonNull android.graphics.RectF rect)
SymbolLayer
insteadrect
- the rectangular area on the map to query for markerViews@NonNull public java.util.List<Marker> addMarkers(@NonNull java.util.List<? extends BaseMarkerOptions> markerOptionsList)
Adds multiple markers to this map.
The marker's icon is rendered on the map at the locationMarker.position
.
If Marker.title
is defined, the map shows an info box with the marker's title and snippet.markerOptionsList
- A list of marker options objects that defines how to render the markersMarker
s that were added to the mappublic void updateMarker(@NonNull Marker updatedMarker)
Updates a marker on this map. Does nothing if the marker isn't already added.
updatedMarker
- An updated marker object@NonNull public Polyline addPolyline(@NonNull PolylineOptions polylineOptions)
polylineOptions
- A polyline options object that defines how to render the polylinePolyine
that was added to the map@NonNull public java.util.List<Polyline> addPolylines(@NonNull java.util.List<PolylineOptions> polylineOptionsList)
polylineOptionsList
- A list of polyline options objects that defines how to render the polylines.Polyline
s that were added to the map.public void updatePolyline(@NonNull Polyline polyline)
polyline
- An updated polyline object.@NonNull public Polygon addPolygon(@NonNull PolygonOptions polygonOptions)
polygonOptions
- A polygon options object that defines how to render the polygon.Polygon
that was added to the map.@NonNull public java.util.List<Polygon> addPolygons(@NonNull java.util.List<PolygonOptions> polygonOptionsList)
polygonOptionsList
- A list of polygon options objects that defines how to render the polygonsPolygon
s that were added to the mappublic void updatePolygon(@NonNull Polygon polygon)
polygon
- An updated polygon objectpublic void removeMarker(@NonNull Marker marker)
Convenience method for removing a Marker from the map.
Calls removeAnnotation() internally.marker
- Marker to removepublic void removePolyline(@NonNull Polyline polyline)
Convenience method for removing a Polyline from the map.
Calls removeAnnotation() internally.polyline
- Polyline to removepublic void removePolygon(@NonNull Polygon polygon)
Convenience method for removing a Polygon from the map.
Calls removeAnnotation() internally.polygon
- Polygon to removepublic void removeAnnotation(@NonNull Annotation annotation)
annotation
- The annotation object to remove.public void removeAnnotation(long id)
id
- The identifier associated to the annotation to be removedpublic void removeAnnotations(@NonNull java.util.List<? extends Annotation> annotationList)
annotationList
- A list of annotation objects to remove.public void removeAnnotations()
public void clear()
@Nullable public Annotation getAnnotation(long id)
id
- the id used to look up an annotation@NonNull public java.util.List<Annotation> getAnnotations()
@NonNull public java.util.List<Marker> getMarkers()
@NonNull public java.util.List<Polygon> getPolygons()
@NonNull public java.util.List<Polyline> getPolylines()
public void setOnMarkerClickListener(@Nullable DingiMap.OnMarkerClickListener listener)
listener
- The callback that's invoked when the user clicks on a marker.
To unset the callback, use null.public void setOnPolygonClickListener(@Nullable DingiMap.OnPolygonClickListener listener)
listener
- The callback that's invoked when the user clicks on a polygon.
To unset the callback, use null.public void setOnPolylineClickListener(@Nullable DingiMap.OnPolylineClickListener listener)
listener
- The callback that's invoked when the user clicks on a polyline.
To unset the callback, use null.public void selectMarker(@NonNull Marker marker)
Selects a marker. The selected marker will have it's info window opened. Any other open info windows will be closed unless isAllowConcurrentMultipleOpenInfoWindows() is true.
Selecting an already selected marker will have no effect.marker
- The marker to select.public void deselectMarkers()
public void deselectMarker(@NonNull Marker marker)
marker
- the marker to deselect@NonNull public java.util.List<Marker> getSelectedMarkers()
@NonNull public MarkerViewManager getMarkerViewManager()
public void setInfoWindowAdapter(@Nullable DingiMap.InfoWindowAdapter infoWindowAdapter)
Sets a custom renderer for the contents of info window.
When set your callback is invoked when an info window is about to be shown. By returning a customView
, the default info window will be replaced.infoWindowAdapter
- The callback to be invoked when an info window will be shown.
To unset the callback, use null.@Nullable public DingiMap.InfoWindowAdapter getInfoWindowAdapter()
public void setAllowConcurrentMultipleOpenInfoWindows(boolean allow)
allow
- If true, map allows concurrent multiple infowindows to be shown.public boolean isAllowConcurrentMultipleOpenInfoWindows()
public void setLatLngBoundsForCameraTarget(@Nullable LatLngBounds latLngBounds)
Set to null to clear current bounds, newly set bounds will override previously set bounds.
latLngBounds
- the bounds to constrain the map with@NonNull public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds)
latLngBounds
- the bounds to set the map with@NonNull public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds, @NonNull int[] padding)
latLngBounds
- the bounds to set the map withpadding
- the padding to apply to the bounds@NonNull public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds, double bearing, double tilt)
latLngBounds
- the bounds to set the map withbearing
- the bearing to transform the camera position withtilt
- to transform the camera position with@NonNull public CameraPosition getCameraForLatLngBounds(@NonNull LatLngBounds latLngBounds, @NonNull int[] padding, double bearing, double tilt)
latLngBounds
- the bounds to set the map withpadding
- the padding to apply to the boundsbearing
- the bearing to transform the camera position withtilt
- to transform the camera position with@NonNull public CameraPosition getCameraForGeometry(@NonNull com.mapbox.geojson.Geometry geometry)
geometry
- the geometry to wraps the map with@NonNull public CameraPosition getCameraForGeometry(@NonNull com.mapbox.geojson.Geometry geometry, @NonNull int[] padding)
geometry
- the geometry to wraps the map withpadding
- the padding to apply to the bounds@NonNull public CameraPosition getCameraForGeometry(@NonNull com.mapbox.geojson.Geometry geometry, double bearing, double tilt)
geometry
- the geometry to wraps the map withbearing
- the bearing at which to compute the geometry's boundstilt
- the tilt at which to compute the geometry's bounds@NonNull public CameraPosition getCameraForGeometry(@NonNull com.mapbox.geojson.Geometry geometry, @NonNull int[] padding, double bearing, double tilt)
geometry
- the geometry to wraps the map withpadding
- the padding to apply to the boundsbearing
- the bearing at which to compute the geometry's boundstilt
- the tilt at which to compute the geometry's bounds@NonNull @Deprecated public CameraPosition getCameraForGeometry(@NonNull com.mapbox.geojson.Geometry geometry, double bearing, @NonNull int[] padding)
geometry
- the geometry to wraps the map withbearing
- the bearing at which to compute the geometry's boundspadding
- the padding to apply to the boundspublic void setPadding(int left, int top, int right, int bottom)
Sets the distance from the edges of the map view's frame to the edges of the map view's logical viewport.
When the value of this property is equal to {0,0,0,0}, viewport properties such as 'centerCoordinate' assume a viewport that matches the map view's frame. Otherwise, those properties are inset, excluding part of the frame from the viewport. For instance, if the only the top edge is inset, the map center is effectively shifted downward.
left
- The left margin in pixels.top
- The top margin in pixels.right
- The right margin in pixels.bottom
- The bottom margin in pixels.@NonNull public int[] getPadding()
public void addOnCameraIdleListener(@NonNull DingiMap.OnCameraIdleListener listener)
listener
- the listener to notifypublic void removeOnCameraIdleListener(@NonNull DingiMap.OnCameraIdleListener listener)
listener
- the listener to removepublic void addOnCameraMoveCancelListener(@NonNull DingiMap.OnCameraMoveCanceledListener listener)
listener
- the listener to notifypublic void removeOnCameraMoveCancelListener(@NonNull DingiMap.OnCameraMoveCanceledListener listener)
listener
- the listener to removepublic void addOnCameraMoveStartedListener(@NonNull DingiMap.OnCameraMoveStartedListener listener)
listener
- the listener to notifypublic void removeOnCameraMoveStartedListener(@NonNull DingiMap.OnCameraMoveStartedListener listener)
listener
- the listener to removepublic void addOnCameraMoveListener(@NonNull DingiMap.OnCameraMoveListener listener)
listener
- the listener to notifypublic void removeOnCameraMoveListener(@NonNull DingiMap.OnCameraMoveListener listener)
listener
- the listener to removepublic void setOnFpsChangedListener(@Nullable DingiMap.OnFpsChangedListener listener)
listener
- The callback that's invoked on every frame rendered to the map view.
To unset the callback, use null.public void addOnFlingListener(@NonNull DingiMap.OnFlingListener listener)
listener
- The callback that's invoked when the map is flinged.public void removeOnFlingListener(@NonNull DingiMap.OnFlingListener listener)
listener
- The callback that's invoked when the map is flinged.public void addOnMoveListener(@NonNull DingiMap.OnMoveListener listener)
listener
- The callback that's invoked when the map is moved.public void removeOnMoveListener(@NonNull DingiMap.OnMoveListener listener)
listener
- The callback that's invoked when the map is moved.public void addOnRotateListener(@NonNull DingiMap.OnRotateListener listener)
listener
- The callback that's invoked when the map is rotated.public void removeOnRotateListener(@NonNull DingiMap.OnRotateListener listener)
listener
- The callback that's invoked when the map is rotated.public void addOnScaleListener(@NonNull DingiMap.OnScaleListener listener)
listener
- The callback that's invoked when the map is scaled.public void removeOnScaleListener(@NonNull DingiMap.OnScaleListener listener)
listener
- The callback that's invoked when the map is scaled.public void addOnShoveListener(@NonNull DingiMap.OnShoveListener listener)
listener
- The callback that's invoked when the map is tilted.public void removeOnShoveListener(@NonNull DingiMap.OnShoveListener listener)
listener
- The callback that's invoked when the map is tilted.public void setGesturesManager(@NonNull com.mapbox.android.gestures.AndroidGesturesManager androidGesturesManager, boolean attachDefaultListeners, boolean setDefaultMutuallyExclusives)
androidGesturesManager
- Gestures manager that interprets gestures based on the motion events.attachDefaultListeners
- If true, pre-defined listeners will be attach
to change map based on AndroidGesturesManager
callbacks.setDefaultMutuallyExclusives
- If true, pre-defined mutually exclusive gesture sets
will be added to the passed gestures manager.@NonNull public com.mapbox.android.gestures.AndroidGesturesManager getGesturesManager()
public void cancelAllVelocityAnimations()
public void addOnMapClickListener(@NonNull DingiMap.OnMapClickListener listener)
listener
- The callback that's invoked when the user clicks on the map view.public void removeOnMapClickListener(@NonNull DingiMap.OnMapClickListener listener)
listener
- The callback that's invoked when the user clicks on the map view.public void addOnMapLongClickListener(@NonNull DingiMap.OnMapLongClickListener listener)
listener
- The callback that's invoked when the user long clicks on the map view.public void removeOnMapLongClickListener(@NonNull DingiMap.OnMapLongClickListener listener)
listener
- The callback that's invoked when the user long clicks on the map view.public void setOnInfoWindowClickListener(@Nullable DingiMap.OnInfoWindowClickListener listener)
listener
- The callback that's invoked when the user clicks on an info window.
To unset the callback, use null.@Nullable public DingiMap.OnInfoWindowClickListener getOnInfoWindowClickListener()
public void setOnInfoWindowLongClickListener(@Nullable DingiMap.OnInfoWindowLongClickListener listener)
listener
- The callback that's invoked when a marker's info window is long pressed. To unset the callback,
use null.@Nullable public DingiMap.OnInfoWindowLongClickListener getOnInfoWindowLongClickListener()
public void setOnInfoWindowCloseListener(@Nullable DingiMap.OnInfoWindowCloseListener listener)
listener
- callback invoked when an InfoWindow closes@Nullable public DingiMap.OnInfoWindowCloseListener getOnInfoWindowCloseListener()
public void snapshot(@NonNull DingiMap.SnapshotReadyCallback callback)
callback
- Callback method invoked when the snapshot is taken.@NonNull public java.util.List<com.mapbox.geojson.Feature> queryRenderedFeatures(@NonNull android.graphics.PointF coordinates, @Nullable java.lang.String... layerIds)
coordinates
- the point to querylayerIds
- optionally - only query these layers@NonNull public java.util.List<com.mapbox.geojson.Feature> queryRenderedFeatures(@NonNull android.graphics.PointF coordinates, @Nullable Expression filter, @Nullable java.lang.String... layerIds)
coordinates
- the point to queryfilter
- filters the returned features with an expressionlayerIds
- optionally - only query these layers@NonNull public java.util.List<com.mapbox.geojson.Feature> queryRenderedFeatures(@NonNull android.graphics.RectF coordinates, @Nullable java.lang.String... layerIds)
coordinates
- the box to querylayerIds
- optionally - only query these layers@NonNull public java.util.List<com.mapbox.geojson.Feature> queryRenderedFeatures(@NonNull android.graphics.RectF coordinates, @Nullable Expression filter, @Nullable java.lang.String... layerIds)
coordinates
- the box to queryfilter
- filters the returned features with an expressionlayerIds
- optionally - only query these layers@NonNull public LocationComponent getLocationComponent()
LocationComponent
that can be used to display user's location on the map.
Use LocationComponent.activateLocationComponent(Context)
or any overload to activate the component,
then, enable it with LocationComponent.setLocationComponentEnabled(boolean)
.
You can customize the location icon and more with LocationComponentOptions
.