Fix #1284 : Remove preview layer when a new layer is added to the map

Removes correctly the preview layer.