简体   繁体   中英

How to plot a button using longitude and latitude in matlab

Is there anyway to plot a button in a matlab using longitude and latitude instead of x and y coordinates?

I'm trying to plot a button on a 3D globe. I have the longitude and latitude coordinates of the location that I want. I used textm to plot points on it and I'm trying to do the same with the button. I want the user to be able to click on a specific location on the globe and get information back. I figured that the best way was with buttons.

Unfortunately, I have no idea how to plot them using longitude and latitude so they can move when the user rotates the globe.

Please help. Any suggestions will be greatly appreciated.

Here's how I graphed a point on the globe using longitude and latitude (matlab 3D map) textm(29.547816, -57.300522, '*', 'color', 'red')

Here's the code for the button. I'm trying to graph it with the above longitude and latitude but it uses x,y,length and height instead.

btn = uicontrol('Style', 'pushbutton', 'String', 'click',... 'Position', [200 250 50 20],... 'Callback', 'cla');

Here's an image of the globe and the button. globe

I don't have access to the mapping toolbox, but it seems that you could use the function mfwdtran to convert from lat long coordinates to x,y coordinates.

https://www.mathworks.com/help/map/ref/mfwdtran.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM