From: William S. <wst...@wh...> - 2003-08-27 21:17:48
|
Hi all, There seems to be a problem with MapViewer in the j2se-demos module. After successfully loading in in a polygon shapefile and creating the shapefile datasource and feature collection in the mapPane method, I got the following messages: Layers: 1 java.awt.Rectangle[x=0,y=0,width=300,height=300] Aug 27, 2003 3:50:23 PM org.geotools.gui.swing.MapPaneImpl paintComponent WARNING: Transform error while rendering. Cause is: null Aug 27, 2003 3:50:24 PM org.geotools.gui.swing.MapPaneImpl paintComponent WARNING: Transform error while rendering. Cause is: null java.awt.Rectangle[x=0,y=0,width=300,height=300] and a blank (all white) frame with no map showing. After looking at MapViewer2, a simple solution to correct this is to explicitly set the area of interest for the context in the createMapPane method of MapPaneImpl, as in context.getBoundingBox().setAreaOfInterest(fc.getBounds()); The underlying cause of the problem is that, without explicitly setting the AOI, the areaOfInterest of the variable bounds in context seems to be set with miny=180, minx=-180, maxy=180, maxx=-180--which of course is a rectangle collapsed to a point--and a call to dotToCoordinateTransform.createInverse() in the paintComponent method of MapPaneImpl triggers the "transform error" warning. Apologies, but I haven't been able to track down where the AOI for bounds in context gets set as it does, but I suspect it is in an initialization step somewhere. Fixing this would, of course, be the best solution. Best regards, Buck Stockhausen -- ************************************************************************ *William T. Stockhausen, Ph.D. |email: Wil...@no...* *NRC Postdoctoral Fellow |voice: 508-289-2238 * *Northeast Fisheries Science Center|fax: 508-457-2169 * *National Marine Fisheries Service |web: http://www.nefsc.noaa.gov * * | http://www.usglobec.org * *__________________________________|___________________________________* * mailing address: National Marine Fisheries Service * * 166 Water Street * * Woods Hole, MA 02543-1026 * ************************************************************************ |