disableDef​aultIntera​ctivity with GeographicAxes bug?

1 view (last 30 days)
I'm trying to stop a GeographicAxes from panning while I interact with it using disableDefaultInteractivity. According to the documentation the target for this function can be an Axes, PolarAxes or GeographicAxes Object
However, the function internally does not accept GeographicAxes:
function disableDefaultInteractivity(ax)
%DISABLEDEFAULTINTERACTIVITY turns off default interactivity
% DISABLEDEFAULTINTERACTIVITY(AXES) turns off default interactivity on
% given axes, uiaxes or polaraxes
% Copyright 2018 The MathWorks, Inc.
narginchk(1,1);
if isa(ax,'matlab.graphics.axis.Axes') || ...
isa(ax,'matlab.ui.control.UIAxes') || ...
isa(ax,'matlab.graphics.axis.PolarAxes')
ax.InteractionContainer.Enabled = 'off';
else
error(message('MATLAB:graphics:interaction:InvalidInputAxes'));
end
It seems the documentation contradicts the implementation: someone switched GeographicAxes for UIAxes. I can manually avoid this function and call:
myAx = geoaxes;
myAx.InteractionContainer.Enabled = 'off';
but I don't think this is the intended implementation. Either the function or the documentation (or both) should be updated.

Answers (1)

Adam Danz
Adam Danz on 4 May 2021
Edited: Adam Danz on 5 May 2021
Indeed geo axes are listed as accepted axes in the disableDefaultInteractivity r2019b documentation.
Double check that you're using r19b (type ver in the command window) and if that's confirmed, contact tech support and let us know what they say: Contact Us - MATLAB & Simulink
It's definitely supported in r2021a.

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!