code: public synchronized void add(int index, Layer layer, boolean redraw) {
          checkIsNull(layer);
          layer.setDisplayModel(this.displayModel);
          this.layersList.add(index, layer);
          layer.assign(this.redrawer);
          if (redraw) {
              this.redrawer.redrawLayers();
          }
      }
docs: Adds a new layer at the specified position.
  
  @param index  The position at which to add the new layer (the lowest layer has position 0)
  @param layer  The new layer to add
  @param redraw Whether the map should be redrawn after adding the layer
  @see List#add(int, Object)