public boolean moveVectorLayer(VectorLayer layer, int position) {
		if (layer == null) {
			return false;
		}

		// Find attached ClientLayerInfo object:
		ClientLayerInfo layerInfo = null;
		String layerId = layer.getId();
		for (ClientLayerInfo info : mapInfo.getLayers()) {
			if (info.getId().equals(layerId)) {
				layerInfo = info;
				break;
			}
		}
		if (layerInfo == null) {
			return false;
		}

		// First remove the layer from the list:
		if (!layers.remove(layer)) {
			return false;
		}
		if (!mapInfo.getLayers().remove(layerInfo)) {
			return false;
		}

		int rasterCount = rasterLayerCount();
		position += rasterCount;
		if (position < rasterCount) {
			position = rasterCount;
		} else if (position > layers.size()) {
			position = layers.size();
		}
		try {
			layers.add(position, layer);
			mapInfo.getLayers().add(position, layerInfo);
		} catch (Exception e) {
			return false;
		}
		handlerManager.fireEvent(new MapModelChangedEvent(this));
		return true;
	}
public boolean moveVectorLayer ( VectorLayer layer , int position ) { if ( layer == null ) { return false ; } ClientLayerInfo layerInfo = null ; String layerId = layer . getId ( ) ; for ( ClientLayerInfo info : mapInfo . getLayers ( ) ) { if ( info . getId ( ) . equals ( layerId ) ) { layerInfo = info ; break ; } } if ( layerInfo == null ) { return false ; } if ( ! layers . remove ( layer ) ) { return false ; } if ( ! mapInfo . getLayers ( ) . remove ( layerInfo ) ) { return false ; } int rasterCount = rasterLayerCount ( ) ; position += rasterCount ; if ( position < rasterCount ) { position = rasterCount ; } else if ( position > layers . size ( ) ) { position = layers . size ( ) ; } try { layers . add ( position , layer ) ; mapInfo . getLayers ( ) . add ( position , layerInfo ) ; } catch ( Exception e ) { return false ; } handlerManager . fireEvent ( new MapModelChangedEvent ( this ) ) ; return true ; }
Set a new position for the given layer. This will automatically redraw the map to apply this new order. Note that
at any time, all raster layers will always lie behind all vector layers. This means that position 0 for a vector
layer is the first(=back) vector layer to be drawn AFTER all raster layers have already been drawn.

@param layer
The vector layer to place at a new position.
@param position
The new layer order position in the layer array:
<ul>
<li>Back = 0 (but still in front of all raster layers)</li>
<li>Front = (vector layer count - 1)</li>
</ul>
@return Returns if the re-ordering was successful or not.
@since 1.8.0