Using ButtonDownFcn w/ mapshow() in GUI
1 view (last 30 days)
Show older comments
Hi,
I'm just starting to experiment w/ the GUI capabilities of MATLAB. I'm building a simple GUI which will allow for the display and manipulation of geotiffs and shapefiles. For testing purposes I created a bare-bones GUI which includes an axes object and a pushbutton. The button does nothing more than simply call mapshow() on a geotiff and shapefile at this point, but I was happy to see them displayed properly in the axes object.
Now on to my question: the next thing I wanted to play with was displaying the easting and northing location underneath the mouse cursor when a mouse button is clicked. So, I used GUIDE to define a ButtonDownFcn callback for the axes object. In the code I query the current point and update a couple of static text objects.
However, this callback only gets hit when I click on the axes object prior to displaying the geotiff/shapefile via mapshow(). Before calling mapshow() the callback works as expected. Once I call mapshow() the callback does not get called when I click over the image.
What is the proper way to specify callbacks when using mapshow()? Or is there a more appropriate way altogether to use mapshow capabilities within a MATLAB GUI?
Thanks!
-- Dan
0 Comments
Accepted Answer
Walter Roberson
on 29 Jun 2011
mapshow() is creating an object on the axes, and the callback for that function has priority.
Try
h = mapshow(...);
set(findobj(h),'HitTest','off');
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!