- 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 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Kevin Holly
on 24 Jan 2023
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
See Also
Categories
Find more on Develop uifigure-Based Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!