FeatureVisibility
Constants indicating the visibility of different adaptive map features.
Declaration
const FeatureVisibility: Readonly<{
readonly Adaptive: "adaptive";
readonly Hidden: "hidden";
readonly Visible: "visible";
}>Overview
Indicates whether the map shows adaptive features like the scale, compass, and annotation title and subtitle text. The display of an adaptive feature depends on the current map state. You can show or hide controls that aren’t adaptive, such as the map type control or zoom controls, by setting map properties to true or false, respectively.
The following example shows the compass only when the map rotation is changing, and hides the zoom controls:
// Create a map.
const map = new mapkit.Map("my-map-element-id");
// Show the compass only when the rotation is actively changing.
map.showsCompass = mapkit.FeatureVisibility.Adaptive;
// Hide the zoom controls.
map.showsZoomControl = false;