code: public void setMapSize(int mapWidth, int mapHeight) {
  		double x = horizontalMargin;
  		double y = verticalMargin;
  
  		// Calculate horizontal position:
  		switch (alignment) {
  			case LEFT:
  				break;
  			case CENTER:
  				x = Math.round((mapWidth - width) / 2);
  				break;
  			case RIGHT:
  				x = mapWidth - width - horizontalMargin;
  		}
  
  		// Calculate vertical position:
  		switch (verticalAlignment) {
  			case TOP:
  				break;
  			case CENTER:
  				y = Math.round((mapHeight - height) / 2);
  				break;
  			case BOTTOM:
  				y = mapHeight - height - verticalMargin;
  		}
  
  		upperLeftCorner = new Coordinate(x, y);
  	}
docs: Apply a new width and height for the map onto whom this add-on is drawn. This method is triggered automatically
  when the map resizes.
  
  @param mapWidth
  The map's new width.
  @param mapHeight
  The map's new height.