[GIS] Embed a GeoTools map in an existing Java Swing application

geotoolsjava

I have a Java GUI Swing application with three frames. I want to load a map from a shapefile and draw the map on an existing application frame. For this I use GeoTools framework. I've looked at the examples and all examples have drawn the map on a separate GUI window JMapFrame.

(I've followed this link http://docs.geotools.org/latest/userguide/tutorial/quickstart/netbeans.html)

Is there a way which we can embed a map that we have created using Geotools to an existing Java Swing application?

Best Answer

You would use a JMapPane - for the most part I would look at the code for JMapFrame and cherry pick the parts I needed in my application.

Related Question