From: Martin D. <mar...@te...> - 2004-06-28 08:46:24
|
Casson Stallings a =E9crit : > In both JApplet and JFrame, when I add the StyledMapPane to a container= =20 > hierarchy with other components the GeoMouseEvent=20 > ..getMapCoordinate(pnt), getPixelCoordinate(pnt), and=20 > getCoordinate(mapCS,pnt) all return the pixel coordinates and not the=20 > map coordinates (NC State Plane in this case). This occurs when I=20 > uncomment the lines in Frame1() which a toolbar and button to the=20 > contentpane of the JFrame (or JApplet). This sound like a bug... Did you tried to replace the following line: getContentPane().add(mapPane, BorderLayout.CENTER); by getContentPane().add(mapPane.createScrollPane(), BorderLayout.CENTER); ? > QUESTIONS. > Am I missing some initialization step to set up the map coordinates? I=20 > have tried setting the coordinate system of the Renderer directly in=20 > addition to the StyledMapPane, but this has not helped. I don't think so. Initialization should occurs automatically. But its=20 depends what yours data CRS are. > Is there some assumption about where the StyledMapPane should be in the= =20 > container hierarchcy that I am missing? No. > Do I need to mannually reset the transform from pixel to map coordinate= s=20 > after a zoom or pan event? I am using the zoom and pan events built int= o=20 > StyledMapPane. No. StyledMapPane should work just fine. If it don't, it may have a bug=20 somewhere. Please try the 'createScrollPane()' method above. If it=20 doesn't work, then we will see. Martin. |