Jody Garnett wrote: > Jürgen Jacob wrote: >> Hi list, >> >> up to now I have developed applications based on UDIG but now I have >> to implement a small Swing application and therefore will use >> GeoTools directly. >> > On trunk there are a couple of Swing display widgets that Eclisa can > tell you about. > > The quick answer is: > 1. Follow this example to get a quick visual (of *any* datastore) - > basically set up a MapContext and ask the renderer to draw it > - http://docs.codehaus.org/display/GEOTDOC/09+ShapeLab > > 2. Use a memory data store rather than a shapefile - use memory > datastore to hold your data for the MapContext to draw > - http://docs.codehaus.org/display/GEOTDOC/10+Memory+DataStore
I tried this but I mess the Envelope handling. At first I generate three layer out of three shapefiles. They are added to the map. Then I want to create four other layers using . All of geometry type = point and initially without any content/features. The problem is that my featureSource has no Bounds and featureSource.getBounds() returns null. On opening/rendering the map in my JPanel this leads to a NullPointerException in DefaultMapLayer #405. There a new Envelope is created using featureSource.getBounds(). Since this is null it doesn't work. I guess (but it can be completely wrong) that the Envelope is calculated as bounding box including all features. But my layer(s) are empty. Is this the reason? How can I manually set the Bounds to 0,0,0,0? Thank you, Jürgen ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
