This layer contains a MapBean, and any layer that gets added to it simply gets added to the MapBean. When a layer needs to redraw itself, it can act normally, and the BufferedLayer will get updated as needed. If the MapBean is a BufferedMapBean (which it is by default), then the layers will get buffered into an image.
There are some special considerations to think about when using this layer if the background is at all transparent. The image buffer will need to be recreated at certain times in order to prevent leftover images from the previous paintings. When the background is set for the layer, the transparency is tested if the background is a Color and the setHasTransparentBackground() method is called accordingly. If a different Paint object is set in the BufferedLayer, it's up to you to set this variable. This causes a new image to be created every time a new projection is provided to the layer. If the layers added to this BufferedLayer are active, meaning that their content could change between projection changes, you should set the hasActiveLayers flag to true. this causes a new image buffer to be created every time a layer repaints itself. Again, this is only important if the background color of the layer is transparent.
The BufferedLayer can be configured in the openmap.properties file:
bufLayer.class=com.bbn.openmap.layer.BufferedLayer bufLayer.prettyName=My Layer Group bufLayer.layers=layer1 layer2 layer3 bufLayer.visibleLayers=layer1 layer3 bufLayer.hasActiveLayers=falselayer1, layer2, etc should be defined as any other openmap layer.
|
|
|
|
|
|