MapCameraLimits (API Reference)
Class MapCameraLimits
Controls constraints on map camera parameters.
When constraints are set, they are enforced for current camera state and for all future changes to the camera.
When setting, limits are applied on next rendering loop.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleAbsolute maximum possible value of tilt angle.static final doubleAbsolute maximum possible value of zoom level.static final doubleAbsolute minimum possible value of tilt angle.static final doubleAbsolute minimum possible value of zoom level. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears bearing ranges for all zoom values and resets bearing range to default.voidClears tilt ranges for all zoom values and resets tilt range to default.Gets the currently set bearing range.Gets a GeoBox that limits the camera target to a specific geographical area.Gets the current tilt range.Gets the currently set camera zoom range.voidsetBearingRange(AngleRange value) Sets a new bearing range.voidsetBearingRangeAtZoom(MapMeasure zoom, AngleRange bearingRange) Sets the bearing range within which the camera can rotate at a given zoom.voidsetTargetArea(GeoBox value) Sets a GeoBox that limits the camera target to a specific geographical area.voidsetTiltRange(AngleRange value) Sets a new tilt limit range.voidsetTiltRangeAtZoom(MapMeasure zoom, AngleRange tiltRange) Sets tilt ranges that can be set on the camera at given zoom.voidsetZoomRange(MapMeasureRange value) Sets a new camera zoom range.
-
Field Details
-
MIN_TILT
public static final double MIN_TILTAbsolute minimum possible value of tilt angle.
- See Also:
-
MAX_TILT
public static final double MAX_TILTAbsolute maximum possible value of tilt angle.
- See Also:
-
MIN_ZOOM_LEVEL
public static final double MIN_ZOOM_LEVELAbsolute minimum possible value of zoom level.
- See Also:
-
MAX_ZOOM_LEVEL
public static final double MAX_ZOOM_LEVELAbsolute maximum possible value of zoom level.
- See Also:
-
-
Method Details
-
setBearingRangeAtZoom
Sets the bearing range within which the camera can rotate at a given zoom.
The resulting camera bearing at a zoom is an interpolated value of the ranges set for closest matching zoom values. When no bearing range is specified for
MIN_ZOOM_LEVEL, the bearing range set throughsetBearingRange(com.here.sdk.core.AngleRange)is used for interpolation.Zoom values outside the supported zoom range are ignored. By default, the maximum bearing range for all zoom values is set during initialization.
- Parameters:
zoom-Zoom at which the range is set.
bearingRange-Bearing range.
-
clearBearingRanges
public void clearBearingRanges()Clears bearing ranges for all zoom values and resets bearing range to default.
-
setTiltRangeAtZoom
Sets tilt ranges that can be set on the camera at given zoom.
The resulting camera tilt at a zoom is an interpolated value of the ranges set for closest matching zoom values. When no tilt range is specified for
MIN_ZOOM_LEVEL, the tilt range set throughsetTiltRange(com.here.sdk.core.AngleRange)is used for interpolation.Zoom or tilt values outside the supported zoom and tilt range are ignored. By default, the maximum tilt range for all zoom values is set during initialization.
- Parameters:
zoom-Zoom at which the range is set.
tiltRange-Tilt range.
-
clearTiltRanges
public void clearTiltRanges()Clears tilt ranges for all zoom values and resets tilt range to default.
-
getTiltRange
Gets the current tilt range.
By default, a
MIN_TILT-MAX_TILTtilt range is set during initialization.This range might not be yet active if no rendering loop has been executed since the last call to set the range.
- Returns:
The tilt range that can be applied to the camera.
-
setTiltRange
Sets a new tilt limit range.
The supported values fall inside
MIN_TILT-MAX_TILTrange. Values outside the supported range are ignored.If the current camera tilt exceeds the new limit range, it will immediately be set to minimum or maximum, depending on which is closest.
This new limit range becomes active during the next rendering loop.
All previously set tilt ranges are cleared and the new tilt range is applied for all zoom values.
- Parameters:
value-The tilt range that can be applied to the camera.
-
getBearingRange
Gets the currently set bearing range.
This may not be active now if no rendering loop has been executed since the last call to set the range.
By default, range for a full circle is set during initialization.
- Returns:
The bearing range within which the camera can be rotated.
-
setBearingRange
Sets a new bearing range.
It will be updated during the next rendering loop. All previously set bearing ranges are cleared and the new bearing range is applied for all zoom values.
If the current camera bearing exceeds the limit range, it will immediately be set to minimum or maximum, depending on which is closest.
- Parameters:
value-The bearing range within which the camera can be rotated.
-
getZoomRange
Gets the currently set camera zoom range.
By default, a
MIN_ZOOM_LEVEL-MAX_ZOOM_LEVELzoom range is set during initialization.- Returns:
The zoom range that can be applied to the camera.
-
setZoomRange
Sets a new camera zoom range.
The supported values fall inside
MIN_ZOOM_LEVEL-MAX_ZOOM_LEVELrange. Values outside the supported zoom range are ignored.If the current camera zoom exceeds the limit range, it will immediately be set to minimum or maximum, depending on which is closest.
This new limit range becomes active during the next rendering loop.
- Parameters:
value-The zoom range that can be applied to the camera.
-
getTargetArea
Gets a GeoBox that limits the camera target to a specific geographical area. Absence of a value means that there is no limit.
- Returns:
Geographical area to which the camera target is limited.
-
setTargetArea
Sets a GeoBox that limits the camera target to a specific geographical area. Set to
nullto remove the limit.- Parameters:
value-Geographical area to which the camera target is limited.
-