icon_map in PHP annotation instead of layouts.yml
You can do this via the layout alter hook ( hook_layout_alter(&amp;$definitions) ).  The definitions variable is an array of all the defined layouts keyed by the layout machine name.
The value here is a Drupal\Core\Layout\LayoutDefinition object.  This has a setIconMap method.  You can pass this an array of arrays that define the icon.
E.g. if the yml format is:
- [top]
- [first, second]
- [bottom]

the value is something like:
$map = [
  ['top'],
  ['first', 'second'],
  ['bottom']
]