Current mouse point from map axes
pt = gcpmap
pt = gcpmap(hndl)
Set up a map axes with a graticule and display a world map:
axesm robinson gridm on geoshow('landareas.shp')
Click somewhere near Boston, Massachusetts to obtain a current point:
pt = gcpmap pt = 44.171 -69.967 2 44.171 -69.967 0 whos Name Size Bytes Class Attributes pt 2x3 48 double array
gcpmap works much like the standard MATLAB® function get(gca,'CurrentPoint'), except that the returned matrix is in [lat lon z], not [x y z].
You must use view(2) and an ordinary projection (not the Globe projection) when working with the gcpmap function.
The CurrentPoint property is updated whenever a button-click event occurs in a MATLAB figure window. The pointer does not have to be within the axes, or even the figure window. Coordinates with respect to the requested axes are returned regardless of the pointer location. Likewise, gcpmap will return values that may look reasonable whether the current point is within the graticule bounds or not, and thus must be used with care.