I have a map with a XYZ layer:
<Layer @ref="_satelliteLayer"
Id="satellite"
SourceType="SourceType.XYZ"
Url="https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"
Visibility="PageState.ShowWorldImagery"/>
and some more fixed layers after that (heatmap, vector layer etc)
I want to programmatically add another layer. Which I do like this:
_orthomosaicLayer = new Layer()
{
Id = $"ortho_{DateTime.Now:O}",
LayerType = LayerType.Tile,
SourceType = SourceType.XYZ,
Url = url,
ZIndex = 2,
Visibility = PageState.ShowOrthomosaic
};
_mapRef.LayersList.Insert(2, _orthomosaicLayer);
await _mapRef.UpdateLayer(_orthomosaicLayer);
However, no matter what I set the ZIndex, the new XYZ layer appears on top of everything else. Ive tried:
- setting ZIndex on all layers
- removing all layers and re-adding them in the correct order
- having a single xyz layer and just changing the url
I have a map with a XYZ layer:
and some more fixed layers after that (heatmap, vector layer etc)
I want to programmatically add another layer. Which I do like this:
However, no matter what I set the ZIndex, the new XYZ layer appears on top of everything else. Ive tried: