Drawpolygon not working with geoaxes

4 ビュー (過去 30 日間)
Murat Panayirci
Murat Panayirci 2022 年 10 月 6 日
コメント済み: Murat Panayirci 2022 年 10 月 13 日
Hi,
I am developing a GUI with app designer, when I want to enable users to select a region interactively on a geoaxes. I am using the drawpolygon function, which does not seem to work with geoaxes (it works on a regular axis). I get following error:
Warning: Error occurred while executing the listener callback for event WindowMousePress defined for class matlab.ui.Figure:
Dot indexing is not supported for variables of this type.
Error in imageslib.internal.app.utilities.isAxesInteractionModeActive (line 17)
TF = ax.InteractionContainer.CurrentMode ~= "none";
Error in images.roi.internal.ROI/isModeManagerActive
Error in images.roi.internal.ROI/waitForButtonPressToBegin
Error in images.roi.internal.ROI
is drawpolygon not available for geoaxes or is there an option I need to set correctly for this axes type. Any help would be appreciated.
Thanks!
Murat

採用された回答

Adam Danz
Adam Danz 2022 年 10 月 6 日
This is supported in the latest release, MATLAB R2022b.
The example below produced the results you described when run in R2022a but is functional in R2022b.
uif = uifigure();
gx = geoaxes(uif);
drawpolygon(gx)
  3 件のコメント
Adam Danz
Adam Danz 2022 年 10 月 12 日
Can you think of any workaround
Assuming it's not possible to update to 22b, you could replace the uifigure with a regular figure and it will work in 22a.
fig = figure();
gx = geoaxes(fig);
drawpolygon(gx)
If this is within an app, then it gets more complicated. You'd need to generate the figure outside of the app, using a regular figure as shown above. copyobj may come in handy to copy the entire axes from your uifigure to a regular figure. Then, when the drawpolygon actions are done, you could copy the results to the axes in your app and close the external figure.
Murat Panayirci
Murat Panayirci 2022 年 10 月 13 日
ok thank you for the explanation Adam.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by