When initiating two LayerDirective's with a urlTemplate(one type='Layer' the second type='SubLayer' within the MapComponent it appears that the second layers tile array is not initialized correctly and maintains a reference to the first tile array so that when the tile src attribute is initialized with the information from the second LayerDirective it overwrites the first tile arrays information.
the offending code appears to be here
instead of
let subtile: Tile = extend(baseTile, {}, {}, true) as Tile;
the following appears to correct the issue by properly cloning the original object into a new object
let subtile: Tile = extend({}, baseTile, {}, true) as Tile;
These tile layers are expected to overlay each other. In my uses the first tile layer is a base layer and the second is an overlay layer with transparency.
I have provided a sample at:
This is not the best sample since the overlay layer being used (type="SubLayer") has no transparencies, but you can inspect the html document and see that the defined tiles in the div id="
maps_tile_parent" all have the same base source url from the sublayer since the object attributes from the first tile array are being overwritten by the SubLayer tile collection initialization. I'm unable to provide a direct example using the urlTemplates I am using due to CORS settings in that container but you can see the effects by inspecting the div.