You will probably want to use the IDLgrWindow::PickData method to return your normalized coordinate position. It's not clear from your description if you're normalizing the data in the IDLgrPlot, or if you're scaling your container IDLgrModel to cause the normalization. I'll assume it's the latter, since that makes life simpler.
I'm also going to assume that you've stored your IDLgrView as the GRAPHICS_TREE property of the IDLgrWindow, otherwise you'll need to get your IDLgrView reference ("oview") by "some other means".
Here's some example code for extracting the data coordinates from the plot in your event handler.
widget_control, event.id, get_value = odrawwindow
odrawwindow->getproperty, graphics_tree = oview
omodel = oview->get(position = 0)
oplt = omodel->get(position = 0)
r = odrawwindow->pickdata(oview, oplt, [event.x, event.y], xyz, pick_status = ps)
if (ps eq 1) then begin
datax = xyz[0]
datay = xyz[1]
endif
If you are normalizing your data *before* you populate the IDLgrPlot object, then datax and datay will be in normalized coordinates and you will want to perform an additional mathematical inversion to convert back to lat/long.
realdatax = datax*xscaleinversion + xoffset
realdatay = data*yscaleinversion + yoffset
Jim.
|