Main Content

MapAxesInteractionOptions Properties

Map axes interaction behavior for apps

Since R2024a

MapAxesInteractionOptions properties control the behavior of map axes interactions for apps. By changing property values, you can customize the behavior of associated map axes interactions. Use dot notation to query and set properties.

f = uifigure;
mx = mapaxes(f);
mx.InteractionOptions.ZoomSupported = "off";

The options set by the MapAxesInteractionOptions object apply to the built-in interactions specified by the Interactions property of the map axes object and to interactions enabled using the axes toolbar.

The properties listed here are valid for map axes objects in App Designer, or in figures created using the uifigure function.

Supported Interactions

expand all

Pan support indicator, specified as "on", "off", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

A value of "off" means that the pan interaction is not included in the default interactions of the map axes object.

Example: mx.InteractionOptions.PanSupported = "off"

Zoom support indicator, specified as "on", "off", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

A value of "off" means that the zoom interaction is not included in the default interactions of the map axes object.

Example: mx.InteractionOptions.ZoomSupported = "off"

Data tip support indicator, specified as "on", "off", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

A value of "off" means that the data tip interaction is not included in the default interactions of the map axes object, and the data cursor mode is not supported. For example, changing this value to "off" removes the Data Tips button from the axes toolbar.

Example: mx.InteractionOptions.DatatipsSupported = "off"

Interaction Display

expand all

Method for placing data tips, specified as one of these values:

  • "vertex" — Hover to preview, or click to create, a data tip at the data point closest to the pointer location. The means of determining the closest data point depends on the type of plot. For example, on a plotted curve, the closest data point is the data point with the smallest Euclidean distance from the specified location.

  • "interpolate" — Hover to preview, or click to create, a data tip at the closest interpolated location on the plot to the pointer location, even if it is between data points.

Example: mx.InteractionOptions.DatatipsPlacementMethod = "interpolate"

Restore View

expand all

Minimum and maximum limits for restoring the view of the map axes object, specified as a two-element vector of the form [min max], where max must be greater than min.

When you click the Restore View button in the axes toolbar, the map axes object uses this value to reset the limits. Note that the map axes object typically uses wider limits than the limits you specify to maintain the aspect ratio of the map.

Example: mx.InteractionOptions.RestoredLatitudeLimits = [47.62 61.2]

Example: mx.InteractionOptions.RestoredLongitudeLimits = [-149.9 -122.33]

Version History

Introduced in R2024a