Name of BaseMap in AllLayers property is not set ?

08-30-2017 11:49 PM
New Contributor III


I have a piece of code to display Name of all layers of a WebMap.

I am using the AllLayers property to enumerate the layers.

I am surprised to get an empty Name for the first layer in the collection that correspond to the BaseMap layer whereas the BaseMap property has the correct Name.

The base map is OpenStreetMap. The problem seems not to happen with the Topographic base map.

Can someone tell me if there is any reason ? Or is it a known issue ?


Tags (2)
0 Kudos
1 Reply
Occasional Contributor III


I am able to see the same issue as you see. But if I used "Attribution" property of the layer, it gives me the name of the OpenStreetMap as "OpenStreetMap contributors". For other basemaps, "Name" property provides the name of the basemap in the webmap.

private async Task Initialize()
string webMapURL = "";
var webMap = await Map.LoadFromUriAsync(new Uri(webMapURL));
MyMapView.Map = webMap;

IReadOnlyList<Layer> allLyrs = MyMapView.Map.AllLayers;
foreach (Layer l in allLyrs)

Console.WriteLine(l.Attribution);  // for the OpenStreetMap only


For this webmap, it displays the result as below:

OpenStreetMap contributors
operations - Incident Areas
operations - Incident Lines
operations - Incident Points

Hope that helps.


0 Kudos