From: Martin D. <mar...@te...> - 2004-06-28 14:41:56
|
Casson Stallings a =E9crit : > I tried this form ( getContentPane().add(mapPane.createScrollPane(), > BorderLayout.CENTER); in both my JFrame and JApplet versions with no lu= ck > (they still put out pixel coordinates). Then, this is really a bug. If you have a little bit of time, would it=20 be possible to open a JIRA task with a small test case please? http://jira.codehaus.org/secure/BrowseProject.jspa?id=3D10270 Anyway, many thanks for yours report. It is a little bit mysterious why=20 it doesn't work for you since it work for me, but we probably have=20 different data (I have not tried yours code). > Is there a function to transform pixel to map coordinates separate from= the > GeoMouseButton event functions? You can uses the 'zoom' field in ZoomPane (the MapPane ancestor) as below= : point =3D zoom.inverseTransform(point, point); It is not really the preferred way (this doesn't manage synchronization,=20 neither the mouse magnifier and stuff like that) but may be used as a=20 (deprecated!!!) work around. The ZoomPane.zoom field is protected, because user are really not=20 supposed to access it directly. So you need to either turn it public, or=20 create a small sub-class of StyledMapPane in order to gets access to=20 this field. Martin. |