Adding a graphics layer

A graphics layer is the container for your graphics. The graphics layer will need to be added to the JMap. A graphics layer can also be contained in a group layer. A JMap can contain a number of graphics layers.

The following code shows how a graphics layer is created and added to an existing JMap:

//create a map
map = new JMap();
window.getContentPane().add(map);

//...maybe add a tiled layer to the map...

//create and add a graphics layer to a map
GraphicsLayer myGraphicsLayer = new GraphicsLayer();
map.getLayers().add(myGraphicsLayer);

The graphics layer is now ready to have graphics added to it which will be displayed in the JMap. Graphics to be added to a graphics layer will be created as follows:

2/7/2013