irstv/orbisgis — pull request #135 by agueganno (2012-09-26 16:12:22+00:00)
Title: Because of the recent changes in the management of maps, there were some

misbehaviours in the MapControl.

Until now, when removing the last spatial layer, we put a null extent
in the map control and set adjustExtent to null in order to be able to
zoom again to the right place when adding a new layer. This had some
unexpected consequence, once multi-map management was enabled. Indeed,
when enabling a map without any spatial layers, it seems we set it an
actual enveloppe. Consequently, some tests in
MapControl$RefreshLayerListener#layerAdded failed, and we do not adjust
extent anymore. Moreover, we don't zoom to the first added layer either.

This commit intends to fix that. The test it performs is more general :
it basically counts the spatial layers in the layer model and, if there
is exactly one, it sets the adjustExtent and the extent to the needed
values in the MapTransform.