Class TrimbleMapsMap
TrimbleMapsMap 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 TrimbleMapsMap should only be read and modified from the main thread.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface definition for a callback to be invoked when a task is complete or cancelled.static interfaceDeprecated.Use TrimbleMaps Annotation Plugin instead insteadstatic interfaceInterface definition for a callback to be invoked for when camera movement has ended.static interfaceInterface 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 interfaceInterface definition for a callback to be invoked for when the camera changes position.static interfaceInterface definition for a callback to be invoked for when the camera motion starts.static interfaceInterface definition for a callback to be invoked for when the compass is animating.static interfaceInternal use.static interfaceInterface definition for a callback to be invoked when the map is flinged.static interfaceInterface definition for a callback to be invoked when a frame is rendered to the map view.static interfaceInterface definition for a callback to be invoked when the user clicks on an info window.static interfaceInterface definition for a callback to be invoked when a marker's info window is closed.static interfaceInterface definition for a callback to be invoked when the user long presses on a marker's info window.static interfaceInterface definition for a callback to be invoked when the user clicks on the map view.static interfaceInterface definition for a callback to be invoked when the user long clicks on the map view.static interfaceDeprecated.Use TrimbleMaps Annotation Plugin instead insteadstatic interfaceInterface definition for a callback to be invoked when the map is moved.static interfaceDeprecated.Use TrimbleMaps Annotation Plugin instead insteadstatic interfaceDeprecated.Use TrimbleMaps Annotation Plugin instead insteadstatic interfaceInterface definition for a callback to be invoked when the map is rotated.static interfaceInterface definition for a callback to be invoked when the map is scaled.static interfaceInterface definition for a callback to be invoked when the map is tilted.static interfaceInterface definition for a callback to be invoked when the snapshot has been taken. -
Method Summary
Modifier and TypeMethodDescriptionaddMarker(BaseMarkerOptions markerOptions) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadaddMarker(MarkerOptions markerOptions) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadaddMarkers(List<? extends BaseMarkerOptions> markerOptionsList) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidAdds a callback that is invoked when camera movement has ended.voidAdds a callback that is invoked when camera movement was cancelled.voidAdds a callback that is invoked when camera position changes.voidAdds a callback that is invoked when camera movement has started.voidAdds a callback that's invoked when the map is flinged.voidAdds a callback that's invoked when the user clicks on the map view.voidAdds a callback that's invoked when the user long clicks on the map view.voidAdds a callback that's invoked when the map is moved.voidAdds a callback that's invoked when the map is rotated.voidAdds a callback that's invoked when the map is scaled.voidAdds a callback that's invoked when the map is tilted.addPolygon(PolygonOptions polygonOptions) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadaddPolygons(List<PolygonOptions> polygonOptionsList) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadaddPolyline(PolylineOptions polylineOptions) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadaddPolylines(List<PolylineOptions> polylineOptionsList) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadfinal voidanimateCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update) Animate the camera to a new location defined withinCameraUpdateusing a transition animation that evokes powered flight.final voidanimateCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs) Animate the camera to a new location defined withinCameraUpdateusing a transition animation that evokes powered flight.final voidanimateCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs, TrimbleMapsMap.CancelableCallback callback) Animate the camera to a new location defined withinCameraUpdateusing a transition animation that evokes powered flight.final voidanimateCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update, TrimbleMapsMap.CancelableCallback callback) Animate the camera to a new location defined withinCameraUpdateusing a transition animation that evokes powered flight.voidInterrupts any ongoing gesture velocity animations.voidCancels ongoing animations.voidclear()Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidDeprecated.voiddeselectMarker(Marker marker) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidDeprecated.Use TrimbleMaps Annotation Plugin instead insteadfinal voideaseCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update) Gradually move the camera by the default duration, zoom will not be affected unless specified withinCameraUpdate.final voideaseCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs) Gradually move the camera by a specified duration in milliseconds, zoom will not be affected unless specified withinCameraUpdate.final voideaseCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs, boolean easingInterpolator) Gradually move the camera by a specified duration in milliseconds, zoom will not be affected unless specified withinCameraUpdate.final voideaseCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs, boolean easingInterpolator, TrimbleMapsMap.CancelableCallback callback) Gradually move the camera by a specified duration in milliseconds, zoom will not be affected unless specified withinCameraUpdate.final voideaseCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs, TrimbleMapsMap.CancelableCallback callback) Gradually move the camera by a specified duration in milliseconds, zoom will not be affected unless specified withinCameraUpdate.final voideaseCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update, TrimbleMapsMap.CancelableCallback callback) Gradually move the camera by the default duration, zoom will not be affected unless specified withinCameraUpdate.getAnnotation(long id) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadDeprecated.Use TrimbleMaps Annotation Plugin instead insteadcom.trimblemaps.mapsdk.camera.CameraPositiongetCameraForGeometry(com.trimblemaps.geojson.Geometry geometry) Get a camera position that fits a provided shape.com.trimblemaps.mapsdk.camera.CameraPositiongetCameraForGeometry(com.trimblemaps.geojson.Geometry geometry, double bearing, double tilt) Get a camera position that fits a provided shape with a given bearing and tilt.com.trimblemaps.mapsdk.camera.CameraPositiongetCameraForGeometry(com.trimblemaps.geojson.Geometry geometry, int[] padding) Get a camera position that fits a provided shape and padding.com.trimblemaps.mapsdk.camera.CameraPositiongetCameraForGeometry(com.trimblemaps.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.com.trimblemaps.mapsdk.camera.CameraPositiongetCameraForLatLngBounds(com.trimblemaps.mapsdk.geometry.LatLngBounds latLngBounds) Get a camera position that fits a provided bounds and the current camera tilt and bearing.com.trimblemaps.mapsdk.camera.CameraPositiongetCameraForLatLngBounds(com.trimblemaps.mapsdk.geometry.LatLngBounds latLngBounds, double bearing, double tilt) Get a camera position that fits a provided bounds, bearing and tilt.com.trimblemaps.mapsdk.camera.CameraPositiongetCameraForLatLngBounds(com.trimblemaps.mapsdk.geometry.LatLngBounds latLngBounds, int[] padding) Get a camera position that fits a provided bounds and padding and the current camera tilt and bearing.com.trimblemaps.mapsdk.camera.CameraPositiongetCameraForLatLngBounds(com.trimblemaps.mapsdk.geometry.LatLngBounds latLngBounds, int[] padding, double bearing, double tilt) Get a camera position that fits a provided bounds, padding, bearing and tilt.final com.trimblemaps.mapsdk.camera.CameraPositionGets the current position of the camera.getComponent(com.trimblemaps.mapsdk.maps.TrimbleMapsMap.TrimbleLayer layer) com.trimblemaps.android.gestures.AndroidGesturesManagerfloatReturns the measured height of the Map.Deprecated.Use TrimbleMaps Annotation Plugin instead insteadReturns theLocationComponentthat can be used to display user's location on the map.Deprecated.Use TrimbleMaps Annotation Plugin instead insteaddoubleGets the maximum Pitch the map can be displayed at.doubleGets the maximum zoom level the map can be displayed at.doubleGets the minimum Pitch the map can be displayed at.doubleGets the minimum zoom level the map can be displayed at.Return the InfoWindow click listenerReturn the InfoWindow close listenerReturn the InfoWindow long click listenerint[]Deprecated.UseCameraPosition.paddinginstead.Deprecated.Use TrimbleMaps Annotation Plugin instead insteadDeprecated.Use TrimbleMaps Annotation Plugin instead insteadbooleanDeprecated.UsegetPrefetchZoomDelta()instead.intCheck current pre-fetching zoom delta.Get the Projection object that you can use to convert between screen coordinates and latitude/longitude coordinates.Deprecated.Use TrimbleMaps Annotation Plugin instead insteadgetStyle()Get the Style of the map.voidgetStyle(Style.OnStyleLoaded onStyleLoaded) Get the Style of the map asynchronously.Gets the user interface settings for the map.floatgetWidth()Returns the measured width of the Map.booleanbooleanbooleanDeprecated.Use TrimbleMaps Annotation Plugin instead insteadbooleanbooleanReturns whether the map debug information is currently shown.booleanbooleanbooleanbooleanbooleanbooleanfinal voidmoveCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update) Repositions the camera according to the instructions defined in the update.final voidmoveCamera(com.trimblemaps.mapsdk.camera.CameraUpdate update, TrimbleMapsMap.CancelableCallback callback) Repositions the camera according to the instructions defined in the update.List<com.trimblemaps.geojson.Feature>queryRenderedFeatures(android.graphics.PointF coordinates, Expression filter, String... layerIds) Queries the map for rendered featuresList<com.trimblemaps.geojson.Feature>queryRenderedFeatures(android.graphics.PointF coordinates, String... layerIds) Queries the map for rendered features.List<com.trimblemaps.geojson.Feature>queryRenderedFeatures(android.graphics.RectF coordinates, Expression filter, String... layerIds) Queries the map for rendered featuresList<com.trimblemaps.geojson.Feature>queryRenderedFeatures(android.graphics.RectF coordinates, String... layerIds) Queries the map for rendered featuresvoidremoveAnnotation(long id) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidremoveAnnotation(Annotation annotation) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidDeprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidremoveAnnotations(List<? extends Annotation> annotationList) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidremoveMarker(Marker marker) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidRemoves a callback that is invoked when camera movement has ended.voidRemoves a callback that is invoked when camera movement was cancelled.voidRemoves a callback that is invoked when camera position changes.voidRemoves a callback that is invoked when camera movement has started.voidRemoves a callback that's invoked when the map is flinged.voidRemoves a callback that's invoked when the user clicks on the map view.voidRemoves a callback that's invoked when the user long clicks on the map view.voidRemoves a callback that's invoked when the map is moved.voidRemoves a callback that's invoked when the map is rotated.voidRemoves a callback that's invoked when the map is scaled.voidRemove a callback that's invoked when the map is tilted.voidremovePolygon(Polygon polygon) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidremovePolyline(Polyline polyline) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidResets the map view to face north.voidscrollBy(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.voidscrollBy(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.voidselectMarker(Marker marker) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidset3dBuildingVisibility(boolean isVisible) voidsetAddressVisibility(boolean isVisible) voidsetAllowConcurrentMultipleOpenInfoWindows(boolean allow) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidsetAvoidFavorsFilter(List<Integer> setIds) voidsetAvoidFavorsVisibility(boolean isVisible) voidsetCameraPosition(com.trimblemaps.mapsdk.camera.CameraPosition cameraPosition) Repositions the camera according to the cameraPosition.voidsetDebugActive(boolean debugActive) Changes whether the map debug information is shown.voidsetFocalBearing(double bearing, float focalX, float focalY, long duration) Transform the map bearing given a bearing, focal point coordinates, and a duration.voidsetGesturesManager(com.trimblemaps.android.gestures.AndroidGesturesManager androidGesturesManager, boolean attachDefaultListeners, boolean setDefaultMutuallyExclusives) voidsetInfoWindowAdapter(TrimbleMapsMap.InfoWindowAdapter infoWindowAdapter) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidsetLatLngBoundsForCameraTarget(com.trimblemaps.mapsdk.geometry.LatLngBounds latLngBounds) Sets a LatLngBounds that constraints map transformations to this bounds.voidsetMaxPitchPreference(double maxPitch) Sets the maximum Pitch the map can be displayed at.voidsetMaxZoomPreference(double maxZoom) Sets the maximum zoom level the map can be displayed at.voidsetMinPitchPreference(double minPitch) Sets the minimum Pitch the map can be displayed at.voidsetMinZoomPreference(double minZoom) Sets the minimum zoom level the map can be displayed at.voidsetOfflineRegionDefinition(com.trimblemaps.mapsdk.offline.OfflineRegionDefinition definition) Loads a new style from the specified offline region definition and moves the map camera to that region.voidsetOfflineRegionDefinition(com.trimblemaps.mapsdk.offline.OfflineRegionDefinition definition, Style.OnStyleLoaded callback) Loads a new style from the specified offline region definition and moves the map camera to that region.voidSets a callback that's invoked on every frame rendered to the map view.voidSets a callback that's invoked when the user clicks on an info window.voidSet an callback to be invoked when an InfoWindow closes.voidSets a callback that's invoked when a marker's info window is long pressed.voidDeprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidDeprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidDeprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidsetPadding(int left, int top, int right, int bottom) Deprecated.UseCameraPosition.Builder.padding(double, double, double, double)orCameraUpdateFactory.paddingTo(double, double, double, double)instead.voidsetPoiVisibility(boolean isVisible) voidsetPrefetchesTiles(boolean enable) Deprecated.UsesetPrefetchZoomDelta(int)instead.voidsetPrefetchZoomDelta(int delta) Set the tile pre-fetching zoom delta.voidsetRoadSurfaceVisibility(boolean isVisible) voidsetStyle(Style.Builder builder) Loads a new map style from the specified builder.voidsetStyle(Style.Builder builder, Style.OnStyleLoaded callback) Loads a new map style from the specified builder.voidLoads a new map style from the specified bundled style.voidsetStyle(String style, Style.OnStyleLoaded callback) Loads a new map style from the specified bundled style.voidsetSwapBehaviorFlush(boolean flush) voidsetTrafficVisibility(boolean isVisible) voidsetTruckRestrictionsFilter(TruckRestrictionsFilter truckRestrictionsFilter) voidsetTruckRestrictionsVisibility(boolean isVisible) voidsetWeatherAlertVisibility(boolean isVisible) voidsetWeatherRadarVisibility(boolean isVisible) voidsnapshot(TrimbleMapsMap.SnapshotReadyCallback callback) Takes a snapshot of the map.voidvoidvoidvoidtoggleComponentVisibility(com.trimblemaps.mapsdk.maps.TrimbleMapsMap.TrimbleLayer layer) voidvoidvoidvoidvoidvoidvoidTrigger the mapview to repaint.voidupdateMarker(Marker updatedMarker) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidupdatePolygon(Polygon polygon) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadvoidupdatePolyline(Polyline polyline) Deprecated.Use TrimbleMaps Annotation Plugin instead instead
-
Method Details
-
triggerRepaint
public void triggerRepaint()Trigger the mapview to repaint. -
setSwapBehaviorFlush
public void setSwapBehaviorFlush(boolean flush) -
getStyle
Get the Style of the map asynchronously. -
getStyle
Get the Style of the map.Returns null when style is being loaded.
- Returns:
- the style of the map
-
setPrefetchesTiles
Deprecated.UsesetPrefetchZoomDelta(int)instead.Enable or disable tile pre-fetching. Pre-fetching makes sure that a low-resolution tile is rendered as soon as possible at the expense of a little bandwidth.- Parameters:
enable- true to enable
-
getPrefetchesTiles
Deprecated.UsegetPrefetchZoomDelta()instead.Check whether tile pre-fetching is enabled or not.- Returns:
- true if enabled
- See Also:
-
setPrefetchZoomDelta
public void setPrefetchZoomDelta(@IntRange(from=0L) int delta) Set the tile pre-fetching zoom delta. Pre-fetching makes sure that a low-resolution tile at the (current_zoom_level - delta) is rendered as soon as possible at the expense of a little bandwidth. Note: This operation will override the TrimbleMapsMapOptions#setPrefetchesTiles(boolean) Setting zoom delta to 0 will disable pre-fetching. Default zoom delta is 4.- Parameters:
delta- zoom delta
-
getPrefetchZoomDelta
@IntRange(from=0L) public int getPrefetchZoomDelta()Check current pre-fetching zoom delta.- Returns:
- current zoom delta.
- See Also:
-
setMinZoomPreference
public void setMinZoomPreference(@FloatRange(from=0.0,to=25.5) double minZoom) Sets the minimum zoom level the map can be displayed at.
- Parameters:
minZoom- The new minimum zoom level.
-
getMinZoomLevel
public double getMinZoomLevel()Gets the minimum zoom level the map can be displayed at.
- Returns:
- The minimum zoom level.
-
setMaxZoomPreference
public void setMaxZoomPreference(@FloatRange(from=0.0,to=25.5) 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.
- Parameters:
maxZoom- The new maximum zoom level.
-
getMaxZoomLevel
public double getMaxZoomLevel()Gets the maximum zoom level the map can be displayed at.
- Returns:
- The maximum zoom level.
-
setMinPitchPreference
public void setMinPitchPreference(@FloatRange(from=0.0,to=60.0) double minPitch) Sets the minimum Pitch the map can be displayed at.
The default and lower bound for minPitch Pitch is 0.
- Parameters:
minPitch- The new minimum Pitch.
-
getMinPitch
public double getMinPitch()Gets the minimum Pitch the map can be displayed at.
- Returns:
- The minimum Pitch.
-
setMaxPitchPreference
public void setMaxPitchPreference(@FloatRange(from=0.0,to=60.0) double maxPitch) Sets the maximum Pitch the map can be displayed at.
The default and upper bound for maximum Pitch is 60.
- Parameters:
maxPitch- The new maximum Pitch.
-
getMaxPitch
public double getMaxPitch()Gets the maximum Pitch the map can be displayed at.
- Returns:
- The maximum Pitch.
-
getUiSettings
Gets the user interface settings for the map.- Returns:
- the UiSettings associated with this map
-
getProjection
Get the Projection object that you can use to convert between screen coordinates and latitude/longitude coordinates.- Returns:
- the Projection associated with this map
-
cancelTransitions
public void cancelTransitions()Cancels ongoing animations.This invokes the
TrimbleMapsMap.CancelableCallbackfor ongoing camera updates. -
getCameraPosition
@NonNull public final com.trimblemaps.mapsdk.camera.CameraPosition getCameraPosition()Gets the current position of the camera. The CameraPosition returned is a snapshot of the current position, and will not automatically update when the camera moves.- Returns:
- The current position of the Camera.
-
setCameraPosition
public void setCameraPosition(@NonNull com.trimblemaps.mapsdk.camera.CameraPosition cameraPosition) Repositions the camera according to the cameraPosition. The move is instantaneous, and a subsequent getCameraPosition() will reflect the new position. See CameraUpdateFactory for a set of updates.- Parameters:
cameraPosition- the camera position to set
-
moveCamera
public final void moveCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update) Repositions the camera according to the instructions defined in the update. The move is instantaneous, and a subsequent getCameraPosition() will reflect the new position. See CameraUpdateFactory for a set of updates.- Parameters:
update- The change that should be applied to the camera.
-
moveCamera
public final void moveCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update, @Nullable TrimbleMapsMap.CancelableCallback callback) Repositions the camera according to the instructions defined in the update. The move is instantaneous, and a subsequent getCameraPosition() will reflect the new position. See CameraUpdateFactory for a set of updates.- Parameters:
update- The change that should be applied to the cameracallback- the callback to be invoked when an animation finishes or is canceled
-
easeCamera
public final void easeCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update) Gradually move the camera by the default duration, zoom will not be affected unless specified withinCameraUpdate. IfgetCameraPosition()is called during the animation, it will return the current location of the camera in flight.- Parameters:
update- The change that should be applied to the camera.- See Also:
-
for a set of updates.
-
easeCamera
public final void easeCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update, @Nullable TrimbleMapsMap.CancelableCallback callback) Gradually move the camera by the default duration, zoom will not be affected unless specified withinCameraUpdate. IfgetCameraPosition()is called during the animation, it will return the current location of the camera in flight.- Parameters:
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().- See Also:
-
for a set of updates.
-
easeCamera
public final void easeCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs) Gradually move the camera by a specified duration in milliseconds, zoom will not be affected unless specified withinCameraUpdate. IfgetCameraPosition()is called during the animation, it will return the current location of the camera in flight.- Parameters:
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.- See Also:
-
for a set of updates.
-
easeCamera
public final void easeCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs, @Nullable TrimbleMapsMap.CancelableCallback callback) Gradually move the camera by a specified duration in milliseconds, zoom will not be affected unless specified withinCameraUpdate. A callback can be used to be notified when easing the camera stops. IfgetCameraPosition()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.
- Parameters:
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().- See Also:
-
for a set of updates.
-
easeCamera
public final void easeCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs, boolean easingInterpolator) Gradually move the camera by a specified duration in milliseconds, zoom will not be affected unless specified withinCameraUpdate. A callback can be used to be notified when easing the camera stops. IfgetCameraPosition()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.
- Parameters:
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.
-
easeCamera
public final void easeCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs, boolean easingInterpolator, @Nullable TrimbleMapsMap.CancelableCallback callback) Gradually move the camera by a specified duration in milliseconds, zoom will not be affected unless specified withinCameraUpdate. A callback can be used to be notified when easing the camera stops. IfgetCameraPosition()is called during the animation, it will return the current location of the camera in flight.- Parameters:
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().
-
animateCamera
public final void animateCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update) Animate the camera to a new location defined withinCameraUpdateusing a transition animation that evokes powered flight. The animation will last the default amount of time. During the animation, a call togetCameraPosition()returns an intermediate location of the camera in flight.- Parameters:
update- The change that should be applied to the camera.- See Also:
-
for a set of updates.
-
animateCamera
public final void animateCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update, @Nullable TrimbleMapsMap.CancelableCallback callback) Animate the camera to a new location defined withinCameraUpdateusing 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 togetCameraPosition()returns an intermediate location of the camera in flight.- Parameters:
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().- See Also:
-
for a set of updates.
-
animateCamera
public final void animateCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs) Animate the camera to a new location defined withinCameraUpdateusing a transition animation that evokes powered flight. The animation will last a specified amount of time given in milliseconds. During the animation, a call togetCameraPosition()returns an intermediate location of the camera in flight.- Parameters:
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.- See Also:
-
for a set of updates.
-
animateCamera
public final void animateCamera(@NonNull com.trimblemaps.mapsdk.camera.CameraUpdate update, int durationMs, @Nullable TrimbleMapsMap.CancelableCallback callback) Animate the camera to a new location defined withinCameraUpdateusing 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 togetCameraPosition()returns an intermediate location of the camera in flight.- Parameters:
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.- See Also:
-
for a set of updates.
-
scrollBy
public 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.- Parameters:
x- Amount of pixels to scroll to in x directiony- Amount of pixels to scroll to in y direction
-
scrollBy
public 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.- Parameters:
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 take
-
resetNorth
public void resetNorth()Resets the map view to face north. -
setFocalBearing
public void setFocalBearing(double bearing, float focalX, float focalY, long duration) Transform the map bearing given a bearing, focal point coordinates, and a duration.- Parameters:
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 transformation
-
getHeight
public float getHeight()Returns the measured height of the Map.- Returns:
- the height of the map
-
getWidth
public float getWidth()Returns the measured width of the Map.- Returns:
- the width of the map
-
setOfflineRegionDefinition
public void setOfflineRegionDefinition(@NonNull com.trimblemaps.mapsdk.offline.OfflineRegionDefinition definition) Loads a new style from the specified offline region definition and moves the map camera to that region.- Parameters:
definition- the offline region definition- See Also:
-
OfflineRegionDefinition
-
setOfflineRegionDefinition
public void setOfflineRegionDefinition(@NonNull com.trimblemaps.mapsdk.offline.OfflineRegionDefinition definition, @Nullable Style.OnStyleLoaded callback) Loads a new style from the specified offline region definition and moves the map camera to that region.- Parameters:
definition- the offline region definitioncallback- the callback to be invoked when the style has loaded- See Also:
-
OfflineRegionDefinition
-
isDebugActive
public boolean isDebugActive()Returns whether the map debug information is currently shown.- Returns:
- If true, map debug information is currently shown.
-
setDebugActive
public void setDebugActive(boolean debugActive) Changes whether the map debug information is shown.
The default value is false.- Parameters:
debugActive- If true, map debug information is shown.
-
cycleDebugOptions
Deprecated.Cycles through the map debug options.
The value of isDebugActive reflects whether there are any map debug options enabled or disabled.- See Also:
-
setStyle
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
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.OnDidFinishLoadingStyleListenercallback or use thesetStyle(String, Style.OnStyleLoaded)method instead.MapView.OnDidFailLoadingMapListenercallback will be triggered.- Parameters:
style- The bundled style- See Also:
-
setStyle
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 and
MapView.OnDidFailLoadingMapListenercallback will be triggered.- Parameters:
style- The bundled stylecallback- The callback to be invoked when the style has loaded- See Also:
-
setStyle
Loads a new map style from the specified builder.If the builder fails to load, the map view will become blank. An error message will be logged in the Android logcat and
MapView.OnDidFailLoadingMapListenercallback will be triggered. If you wish to wait for the map to finish loading, listen to theMapView.OnDidFinishLoadingStyleListenercallback or use thesetStyle(String, Style.OnStyleLoaded)instead.- Parameters:
builder- The style builder- See Also:
-
setStyle
Loads a new map style from the specified builder.If the builder fails to load, the map view will become blank. An error message will be logged in the Android logcat and
MapView.OnDidFailLoadingMapListenercallback will be triggered.- Parameters:
builder- The style buildercallback- The callback to be invoked when the style has loaded- See Also:
-
getComponent
-
toggleComponentVisibility
public void toggleComponentVisibility(com.trimblemaps.mapsdk.maps.TrimbleMapsMap.TrimbleLayer layer) -
isTrafficVisible
public boolean isTrafficVisible() -
setTrafficVisibility
public void setTrafficVisibility(boolean isVisible) -
toggleTrafficVisibility
public void toggleTrafficVisibility() -
isWeatherAlertVisible
public boolean isWeatherAlertVisible() -
setWeatherAlertVisibility
public void setWeatherAlertVisibility(boolean isVisible) -
toggleWeatherAlertVisibility
public void toggleWeatherAlertVisibility() -
isWeatherRadarVisible
public boolean isWeatherRadarVisible() -
setWeatherRadarVisibility
public void setWeatherRadarVisibility(boolean isVisible) -
toggleWeatherRadarVisibility
public void toggleWeatherRadarVisibility() -
isRoadSurfaceVisible
public boolean isRoadSurfaceVisible() -
setRoadSurfaceVisibility
public void setRoadSurfaceVisibility(boolean isVisible) -
toggleRoadSurfaceVisibility
public void toggleRoadSurfaceVisibility() -
is3dBuildingVisible
public boolean is3dBuildingVisible() -
set3dBuildingVisibility
public void set3dBuildingVisibility(boolean isVisible) -
toggle3dBuildingVisibility
public void toggle3dBuildingVisibility() -
isPoiVisible
public boolean isPoiVisible() -
setPoiVisibility
public void setPoiVisibility(boolean isVisible) -
togglePoiVisibility
public void togglePoiVisibility() -
isTruckRestrictionsVisible
public boolean isTruckRestrictionsVisible() -
setTruckRestrictionsFilter
-
setTruckRestrictionsVisibility
public void setTruckRestrictionsVisibility(boolean isVisible) -
toggleTruckRestrictionsVisibility
public void toggleTruckRestrictionsVisibility() -
isAddressVisible
public boolean isAddressVisible() -
setAddressVisibility
public void setAddressVisibility(boolean isVisible) -
toggleAddressVisibility
public void toggleAddressVisibility() -
isAvoidFavorsVisible
public boolean isAvoidFavorsVisible() -
setAvoidFavorsVisibility
public void setAvoidFavorsVisibility(boolean isVisible) -
toggleAvoidFavorsVisibility
public void toggleAvoidFavorsVisibility() -
setAvoidFavorsFilter
-
addMarker
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadAdds a marker to this map.
The marker's icon is rendered on the map at the locationMarker.position. IfMarker.titleis defined, the map shows an info box with the marker's title and snippet.- Parameters:
markerOptions- A marker options object that defines how to render the marker- Returns:
- The
Markerthat was added to the map
-
addMarker
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadAdds a marker to this map.
The marker's icon is rendered on the map at the locationMarker.position. IfMarker.titleis defined, the map shows an info box with the marker's title and snippet.- Parameters:
markerOptions- A marker options object that defines how to render the marker- Returns:
- The
Markerthat was added to the map
-
addMarkers
@Deprecated @NonNull public List<Marker> addMarkers(@NonNull List<? extends BaseMarkerOptions> markerOptionsList) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadAdds multiple markers to this map.
The marker's icon is rendered on the map at the locationMarker.position. IfMarker.titleis defined, the map shows an info box with the marker's title and snippet.- Parameters:
markerOptionsList- A list of marker options objects that defines how to render the markers- Returns:
- A list of the
Markers that were added to the map
-
updateMarker
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadUpdates a marker on this map. Does nothing if the marker isn't already added.
- Parameters:
updatedMarker- An updated marker object
-
addPolyline
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadAdds a polyline to this map.- Parameters:
polylineOptions- A polyline options object that defines how to render the polyline- Returns:
- The
Polyinethat was added to the map
-
addPolylines
@Deprecated @NonNull public List<Polyline> addPolylines(@NonNull List<PolylineOptions> polylineOptionsList) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadAdds multiple polylines to this map.- Parameters:
polylineOptionsList- A list of polyline options objects that defines how to render the polylines.- Returns:
- A list of the
Polylines that were added to the map.
-
updatePolyline
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadUpdate a polyline on this map.- Parameters:
polyline- An updated polyline object.
-
addPolygon
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadAdds a polygon to this map.- Parameters:
polygonOptions- A polygon options object that defines how to render the polygon.- Returns:
- The
Polygonthat was added to the map.
-
addPolygons
@Deprecated @NonNull public List<Polygon> addPolygons(@NonNull List<PolygonOptions> polygonOptionsList) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadAdds multiple polygons to this map.- Parameters:
polygonOptionsList- A list of polygon options objects that defines how to render the polygons- Returns:
- A list of the
Polygons that were added to the map
-
updatePolygon
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadUpdate a polygon on this map.- Parameters:
polygon- An updated polygon object
-
removeMarker
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadConvenience method for removing a Marker from the map.
Calls removeAnnotation() internally.- Parameters:
marker- Marker to remove
-
removePolyline
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadConvenience method for removing a Polyline from the map.
Calls removeAnnotation() internally.- Parameters:
polyline- Polyline to remove
-
removePolygon
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadConvenience method for removing a Polygon from the map.
Calls removeAnnotation() internally.- Parameters:
polygon- Polygon to remove
-
removeAnnotation
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadRemoves an annotation from the map.- Parameters:
annotation- The annotation object to remove.
-
removeAnnotation
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadRemoves an annotation from the map- Parameters:
id- The identifier associated to the annotation to be removed
-
removeAnnotations
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadRemoves multiple annotations from the map.- Parameters:
annotationList- A list of annotation objects to remove.
-
removeAnnotations
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadRemoves all annotations from the map. -
clear
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadRemoves all markers, polylines, polygons, overlays, etc from the map. -
getAnnotation
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadReturn a annotation based on its id.- Parameters:
id- the id used to look up an annotation- Returns:
- An annotation with a matched id, null is returned if no match was found
-
getAnnotations
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadReturns a list of all the annotations on the map.- Returns:
- A list of all the annotation objects. The returned object is a copy so modifying this list will not update the map
-
getMarkers
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadReturns a list of all the markers on the map.- Returns:
- A list of all the markers objects. The returned object is a copy so modifying this list will not update the map.
-
getPolygons
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadReturns a list of all the polygons on the map.- Returns:
- A list of all the polygon objects. The returned object is a copy so modifying this list will not update the map.
-
getPolylines
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadReturns a list of all the polylines on the map.- Returns:
- A list of all the polylines objects. The returned object is a copy so modifying this list will not update the map.
-
setOnMarkerClickListener
@Deprecated public void setOnMarkerClickListener(@Nullable TrimbleMapsMap.OnMarkerClickListener listener) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadSets a callback that's invoked when the user clicks on a marker.- Parameters:
listener- The callback that's invoked when the user clicks on a marker. To unset the callback, use null.
-
setOnPolygonClickListener
@Deprecated public void setOnPolygonClickListener(@Nullable TrimbleMapsMap.OnPolygonClickListener listener) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadSets a callback that's invoked when the user clicks on a polygon.- Parameters:
listener- The callback that's invoked when the user clicks on a polygon. To unset the callback, use null.
-
setOnPolylineClickListener
@Deprecated public void setOnPolylineClickListener(@Nullable TrimbleMapsMap.OnPolylineClickListener listener) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadSets a callback that's invoked when the user clicks on a polyline.- Parameters:
listener- The callback that's invoked when the user clicks on a polyline. To unset the callback, use null.
-
selectMarker
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadSelects 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.- Parameters:
marker- The marker to select.
-
deselectMarkers
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadDeselects any currently selected marker. All markers will have it's info window closed. -
deselectMarker
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadDeselects a currently selected marker. The selected marker will have it's info window closed.- Parameters:
marker- the marker to deselect
-
getSelectedMarkers
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadGets the currently selected marker.- Returns:
- The currently selected marker.
-
setInfoWindowAdapter
@Deprecated public void setInfoWindowAdapter(@Nullable TrimbleMapsMap.InfoWindowAdapter infoWindowAdapter) Deprecated.Use TrimbleMaps Annotation Plugin instead insteadSets 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.- Parameters:
infoWindowAdapter- The callback to be invoked when an info window will be shown. To unset the callback, use null.
-
getInfoWindowAdapter
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadGets the callback to be invoked when an info window will be shown.- Returns:
- The callback to be invoked when an info window will be shown.
-
setAllowConcurrentMultipleOpenInfoWindows
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadChanges whether the map allows concurrent multiple infowindows to be shown.- Parameters:
allow- If true, map allows concurrent multiple infowindows to be shown.
-
isAllowConcurrentMultipleOpenInfoWindows
Deprecated.Use TrimbleMaps Annotation Plugin instead insteadReturns whether the map allows concurrent multiple infowindows to be shown.- Returns:
- If true, map allows concurrent multiple infowindows to be shown.
-
setLatLngBoundsForCameraTarget
public void setLatLngBoundsForCameraTarget(@Nullable com.trimblemaps.mapsdk.geometry.LatLngBounds latLngBounds) Sets a LatLngBounds that constraints map transformations to this bounds.Set to null to clear current bounds, newly set bounds will override previously set bounds.
- Parameters:
latLngBounds- the bounds to constrain the map with
-
getCameraForLatLngBounds
@Nullable public com.trimblemaps.mapsdk.camera.CameraPosition getCameraForLatLngBounds(@NonNull com.trimblemaps.mapsdk.geometry.LatLngBounds latLngBounds) Get a camera position that fits a provided bounds and the current camera tilt and bearing.- Parameters:
latLngBounds- the bounds to set the map with- Returns:
- the camera position that fits the bounds
-
getCameraForLatLngBounds
@Nullable public com.trimblemaps.mapsdk.camera.CameraPosition getCameraForLatLngBounds(@NonNull com.trimblemaps.mapsdk.geometry.LatLngBounds latLngBounds, @NonNull @Size(4L) int[] padding) Get a camera position that fits a provided bounds and padding and the current camera tilt and bearing.- Parameters:
latLngBounds- the bounds to set the map withpadding- the padding to apply to the bounds- Returns:
- the camera position that fits the bounds and padding
-
getCameraForLatLngBounds
@Nullable public com.trimblemaps.mapsdk.camera.CameraPosition getCameraForLatLngBounds(@NonNull com.trimblemaps.mapsdk.geometry.LatLngBounds latLngBounds, @FloatRange(from=0.0,to=360.0) double bearing, @FloatRange(from=0.0,to=60.0) double tilt) Get a camera position that fits a provided bounds, bearing and tilt.- Parameters:
latLngBounds- the bounds to set the map withbearing- the bearing to transform the camera position withtilt- to transform the camera position with- Returns:
- the camera position that fits the bounds and given bearing and tilt
-
getCameraForLatLngBounds
@Nullable public com.trimblemaps.mapsdk.camera.CameraPosition getCameraForLatLngBounds(@NonNull com.trimblemaps.mapsdk.geometry.LatLngBounds latLngBounds, @NonNull @Size(4L) int[] padding, @FloatRange(from=0.0,to=360.0) double bearing, @FloatRange(from=0.0,to=60.0) double tilt) Get a camera position that fits a provided bounds, padding, bearing and tilt.- Parameters:
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- Returns:
- the camera position that fits the bounds, bearing and tilt
-
getCameraForGeometry
@Nullable public com.trimblemaps.mapsdk.camera.CameraPosition getCameraForGeometry(@NonNull com.trimblemaps.geojson.Geometry geometry) Get a camera position that fits a provided shape.- Parameters:
geometry- the geometry to wraps the map with- Returns:
- the camera position that fits the geometry inside
-
getCameraForGeometry
@Nullable public com.trimblemaps.mapsdk.camera.CameraPosition getCameraForGeometry(@NonNull com.trimblemaps.geojson.Geometry geometry, @NonNull @Size(4L) int[] padding) Get a camera position that fits a provided shape and padding.- Parameters:
geometry- the geometry to wraps the map withpadding- the padding to apply to the bounds- Returns:
- the camera position that fits the geometry inside and padding
-
getCameraForGeometry
@Nullable public com.trimblemaps.mapsdk.camera.CameraPosition getCameraForGeometry(@NonNull com.trimblemaps.geojson.Geometry geometry, @FloatRange(from=0.0,to=360.0) double bearing, @FloatRange(from=0.0,to=60.0) double tilt) Get a camera position that fits a provided shape with a given bearing and tilt.- Parameters:
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- Returns:
- the camera position that the geometry inside with bearing and tilt
-
getCameraForGeometry
@Nullable public com.trimblemaps.mapsdk.camera.CameraPosition getCameraForGeometry(@NonNull com.trimblemaps.geojson.Geometry geometry, @NonNull @Size(4L) int[] padding, @FloatRange(from=0.0,to=360.0) double bearing, @FloatRange(from=0.0,to=60.0) double tilt) Get a camera position that fits a provided shape with a given padding, bearing and tilt.- Parameters:
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- Returns:
- the camera position that fits the geometry inside with padding, bearing and tilt
-
setPadding
Deprecated.UseCameraPosition.Builder.padding(double, double, double, double)orCameraUpdateFactory.paddingTo(double, double, double, double)instead.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.
This method sets the padding "lazily". This means that the padding is going to be applied with the next camera transformation. To apply the padding immediately use
CameraPosition.Builder.padding(double, double, double, double)orCameraUpdateFactory.paddingTo(double, double, double, double).- Parameters:
left- The left margin in pixels.top- The top margin in pixels.right- The right margin in pixels.bottom- The bottom margin in pixels.
-
getPadding
Deprecated.UseCameraPosition.paddinginstead.Returns the current configured content padding on map view. This might return the currently visible padding or the padding cached but not yet applied bysetPadding(int, int, int, int).- Returns:
- An array with length 4 in the LTRB order.
-
addOnCameraIdleListener
Adds a callback that is invoked when camera movement has ended.- Parameters:
listener- the listener to notify
-
removeOnCameraIdleListener
Removes a callback that is invoked when camera movement has ended.- Parameters:
listener- the listener to remove
-
addOnCameraMoveCancelListener
public void addOnCameraMoveCancelListener(@NonNull TrimbleMapsMap.OnCameraMoveCanceledListener listener) Adds a callback that is invoked when camera movement was cancelled.- Parameters:
listener- the listener to notify
-
removeOnCameraMoveCancelListener
public void removeOnCameraMoveCancelListener(@NonNull TrimbleMapsMap.OnCameraMoveCanceledListener listener) Removes a callback that is invoked when camera movement was cancelled.- Parameters:
listener- the listener to remove
-
addOnCameraMoveStartedListener
public void addOnCameraMoveStartedListener(@NonNull TrimbleMapsMap.OnCameraMoveStartedListener listener) Adds a callback that is invoked when camera movement has started.- Parameters:
listener- the listener to notify
-
removeOnCameraMoveStartedListener
public void removeOnCameraMoveStartedListener(@NonNull TrimbleMapsMap.OnCameraMoveStartedListener listener) Removes a callback that is invoked when camera movement has started.- Parameters:
listener- the listener to remove
-
addOnCameraMoveListener
Adds a callback that is invoked when camera position changes.- Parameters:
listener- the listener to notify
-
removeOnCameraMoveListener
Removes a callback that is invoked when camera position changes.- Parameters:
listener- the listener to remove
-
setOnFpsChangedListener
Sets a callback that's invoked on every frame rendered to the map view.- Parameters:
listener- The callback that's invoked on every frame rendered to the map view. To unset the callback, use null.
-
addOnFlingListener
Adds a callback that's invoked when the map is flinged.- Parameters:
listener- The callback that's invoked when the map is flinged.
-
removeOnFlingListener
Removes a callback that's invoked when the map is flinged.- Parameters:
listener- The callback that's invoked when the map is flinged.
-
addOnMoveListener
Adds a callback that's invoked when the map is moved.- Parameters:
listener- The callback that's invoked when the map is moved.
-
removeOnMoveListener
Removes a callback that's invoked when the map is moved.- Parameters:
listener- The callback that's invoked when the map is moved.
-
addOnRotateListener
Adds a callback that's invoked when the map is rotated.- Parameters:
listener- The callback that's invoked when the map is rotated.
-
removeOnRotateListener
Removes a callback that's invoked when the map is rotated.- Parameters:
listener- The callback that's invoked when the map is rotated.
-
addOnScaleListener
Adds a callback that's invoked when the map is scaled.- Parameters:
listener- The callback that's invoked when the map is scaled.
-
removeOnScaleListener
Removes a callback that's invoked when the map is scaled.- Parameters:
listener- The callback that's invoked when the map is scaled.
-
addOnShoveListener
Adds a callback that's invoked when the map is tilted.- Parameters:
listener- The callback that's invoked when the map is tilted.
-
removeOnShoveListener
Remove a callback that's invoked when the map is tilted.- Parameters:
listener- The callback that's invoked when the map is tilted.
-
setGesturesManager
public void setGesturesManager(@NonNull com.trimblemaps.android.gestures.AndroidGesturesManager androidGesturesManager, boolean attachDefaultListeners, boolean setDefaultMutuallyExclusives) - Parameters:
androidGesturesManager- Gestures manager that interprets gestures based on the motion events.attachDefaultListeners- If true, pre-defined listeners will be attach to change map based onAndroidGesturesManagercallbacks.setDefaultMutuallyExclusives- If true, pre-defined mutually exclusive gesture sets will be added to the passed gestures manager.- See Also:
-
getGesturesManager
@NonNull public com.trimblemaps.android.gestures.AndroidGesturesManager getGesturesManager()- Returns:
- Current gestures manager.
-
cancelAllVelocityAnimations
public void cancelAllVelocityAnimations()Interrupts any ongoing gesture velocity animations. -
addOnMapClickListener
Adds a callback that's invoked when the user clicks on the map view.- Parameters:
listener- The callback that's invoked when the user clicks on the map view.
-
removeOnMapClickListener
Removes a callback that's invoked when the user clicks on the map view.- Parameters:
listener- The callback that's invoked when the user clicks on the map view.
-
addOnMapLongClickListener
Adds a callback that's invoked when the user long clicks on the map view.- Parameters:
listener- The callback that's invoked when the user long clicks on the map view.
-
removeOnMapLongClickListener
Removes a callback that's invoked when the user long clicks on the map view.- Parameters:
listener- The callback that's invoked when the user long clicks on the map view.
-
setOnInfoWindowClickListener
public void setOnInfoWindowClickListener(@Nullable TrimbleMapsMap.OnInfoWindowClickListener listener) Sets a callback that's invoked when the user clicks on an info window.- Parameters:
listener- The callback that's invoked when the user clicks on an info window. To unset the callback, use null.
-
getOnInfoWindowClickListener
Return the InfoWindow click listener- Returns:
- Current active InfoWindow Click Listener
-
setOnInfoWindowLongClickListener
public void setOnInfoWindowLongClickListener(@Nullable TrimbleMapsMap.OnInfoWindowLongClickListener listener) Sets a callback that's invoked when a marker's info window is long pressed.- Parameters:
listener- The callback that's invoked when a marker's info window is long pressed. To unset the callback, use null.
-
getOnInfoWindowLongClickListener
Return the InfoWindow long click listener- Returns:
- Current active InfoWindow long Click Listener
-
setOnInfoWindowCloseListener
public void setOnInfoWindowCloseListener(@Nullable TrimbleMapsMap.OnInfoWindowCloseListener listener) Set an callback to be invoked when an InfoWindow closes.- Parameters:
listener- callback invoked when an InfoWindow closes
-
getOnInfoWindowCloseListener
Return the InfoWindow close listener- Returns:
- Current active InfoWindow Close Listener
-
snapshot
Takes a snapshot of the map.- Parameters:
callback- Callback method invoked when the snapshot is taken.
-
queryRenderedFeatures
@NonNull public List<com.trimblemaps.geojson.Feature> queryRenderedFeatures(@NonNull android.graphics.PointF coordinates, @Nullable String... layerIds) Queries the map for rendered features.Returns an empty list if either the map or underlying render surface has been destroyed.
- Parameters:
coordinates- the point to querylayerIds- optionally - only query these layers- Returns:
- the list of feature
-
queryRenderedFeatures
@NonNull public List<com.trimblemaps.geojson.Feature> queryRenderedFeatures(@NonNull android.graphics.PointF coordinates, @Nullable Expression filter, @Nullable String... layerIds) Queries the map for rendered featuresReturns an empty list if either the map or underlying render surface has been destroyed.
- Parameters:
coordinates- the point to queryfilter- filters the returned features with an expressionlayerIds- optionally - only query these layers- Returns:
- the list of feature
-
queryRenderedFeatures
@NonNull public List<com.trimblemaps.geojson.Feature> queryRenderedFeatures(@NonNull android.graphics.RectF coordinates, @Nullable String... layerIds) Queries the map for rendered featuresReturns an empty list if either the map or underlying render surface has been destroyed.
- Parameters:
coordinates- the box to querylayerIds- optionally - only query these layers- Returns:
- the list of feature
-
queryRenderedFeatures
@NonNull public List<com.trimblemaps.geojson.Feature> queryRenderedFeatures(@NonNull android.graphics.RectF coordinates, @Nullable Expression filter, @Nullable String... layerIds) Queries the map for rendered featuresReturns an empty list if either the map or underlying render surface has been destroyed.
- Parameters:
coordinates- the box to queryfilter- filters the returned features with an expressionlayerIds- optionally - only query these layers- Returns:
- the list of feature
-
getLocationComponent
Returns theLocationComponentthat can be used to display user's location on the map.Use
LocationComponent.activateLocationComponent(LocationComponentActivationOptions)or any overload to activate the component, then, enable it withLocationComponent.setLocationComponentEnabled(boolean).You can customize the location icon and more with
LocationComponentOptions.- Returns:
- the Location Component
-