mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update GroundOverlay.cs
This commit is contained in:
parent
ee450e1a56
commit
2f9c50fb47
|
|
@ -167,10 +167,12 @@ namespace MapControl
|
||||||
var tasks = imageOverlays.Select(
|
var tasks = imageOverlays.Select(
|
||||||
async imageOverlay =>
|
async imageOverlay =>
|
||||||
{
|
{
|
||||||
|
// Limit number of simultaneous calls of loadFunc (in UI thread).
|
||||||
|
//
|
||||||
await semaphore.WaitAsync();
|
await semaphore.WaitAsync();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await loadFunc(imageOverlay); // no more than MaxLoadTasks parallel executions here
|
await loadFunc(imageOverlay);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
@ -268,7 +270,7 @@ namespace MapControl
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
return Task.Run(() => XDocument.Load(docStream, LoadOptions.None));
|
return Task.Run(() => XDocument.Load(docStream, LoadOptions.None));
|
||||||
#else
|
#else
|
||||||
return XDocument.LoadAsync(docStream, LoadOptions.None, System.Threading.CancellationToken.None);
|
return XDocument.LoadAsync(docStream, LoadOptions.None, CancellationToken.None);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue