It’s possible to set constraints on the view, so that users remain within certain boundaries while they’re navigating the map. To constrain the user navigation on the map, you can use these constraints:
-
Above terrainAbove terrainAbove terrain: always keeps the camera at a configurable minimum altitude above the terrain. This constraint has an effect on a 3D map only.
-
Pitch constraintsPitch constraintsPitch constraints: limit how much the camera can tilt. This constraint has an effect on a 3D map only.
-
Bounds constraintBounds constraintBounds constraint: always keeps the map within the configured bounds. This constraint has an effect on a 2D map only.
-
Scale constraintScale constraintScale constraint: keeps the map within a defined minimum and maximum scale range. This constraint has an effect on a 2D map only.
If you use both a scale constraint and a bounds constraint, the two constraints may conflict. For example, you set the
'maxScale' constraint to a country level scale, and you also set the bounds constraint to the bounds of a city. In such a
case, MapNavigator respects the bounds constraint, but not the |
These constraints apply only when you are manipulating the map using MapNavigator
MapNavigator
MapNavigator
.
They don’t apply when you are manipulating the camera directly using Map::setCamera
Map::setCamera
Map::setCamera
.
When you are manipulating the camera directly, it’s the responsibility of the camera manipulation code to implement camera
constraints.