How to use tree function from App designer to trigger a map/plot on and off
이전 댓글 표시
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')
답변 (1개)
- 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.
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
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Programmatically에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

