XDocument.LoadRootElementAsync

This commit is contained in:
ClemensFischer 2025-09-19 11:53:25 +02:00
parent fedf5eba12
commit cd40a627ce
6 changed files with 53 additions and 42 deletions

View file

@ -114,7 +114,7 @@ namespace MapControl
{
using var stream = await ImageLoader.HttpClient.GetStreamAsync(uri);
element = XDocument.Load(stream).Root;
element = await XDocument.LoadRootElementAsync(stream);
}
catch (Exception ex)
{
@ -170,7 +170,7 @@ namespace MapControl
if (ServiceUri != null && ParentMap?.MapProjection != null)
{
if (WmsLayers == null &&
ServiceUri.ToString().IndexOf("LAYERS=", StringComparison.OrdinalIgnoreCase) < 0)
ServiceUri.OriginalString.IndexOf("LAYERS=", StringComparison.OrdinalIgnoreCase) < 0)
{
// Get first Layer from a GetCapabilities response.
//