- Have you tried cla?
- You can obtain this information from the axes handle. See below. Notice handle is saved as variable h.
- Use geolimits. See below for an example. Note, running these lines on my desktop MATLAB did not change the Latitude coordinates.
How to use tree function from App designer to trigger a map/plot on and off
2 次查看(过去 30 天)
显示 更早的评论
I am running an app that has to incorporate a map. I am using a base map and I will do the task on top of that. So I used a "tree" function. And using the code below I am able to draw the map inside my canvas.
geoaxes(app.UIFigure,'Basemap','streets')
- I have two main questions, when I select the tree the map will show but when I unselect it the map still shows there.
2. Second question is when I am runnding the code out side of this app designer I can fetch the latitude and longitude of the map but not here. Because on this application I want to fetch latitude and longitude (that will be used for processing later)
I dont know what is wrong here so I didnt know how to approach it
3. and finally I have also tried moving the map inside the canvas using "guimove" but I am able to move the whole window not the map inside the canvas. just looking if there is a special function.
I did
gx = geoaxes(app.UIFigure,'Basemap','streets')
guimove('gx', 'right')
0 个评论
回答(1 个)
Kevin Holly
2023-1-24
fig = figure; % Using figure because uifigure is not supported on this site, but it should work for uifigure as well (App designer uses uifigure).
h = geoaxes(fig,'Basemap','streets');
geolimits(h,[-60 60],[-30 30]);
h.LatitudeLimits
h.LongitudeLimits
fig = figure; % Using figure because uifigure is not supported on this site, but it should work for uifigure as well (App designer uses uifigure).
h = geoaxes(fig,'Basemap','streets');
geolimits(h,[-60 60],[-30 30]);
geolimits(h,[h.LatitudeLimits],[h.LongitudeLimits(1) h.LongitudeLimits(2)+40])
h.LatitudeLimits
h.LongitudeLimits
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!