mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update MapBase.cs
This commit is contained in:
parent
3fc839c67a
commit
f97a3f0797
|
|
@ -444,7 +444,10 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
if (oldLayer != null)
|
if (oldLayer != null)
|
||||||
{
|
{
|
||||||
Children.Remove(oldLayer);
|
if (Children.Count > 0 && Children[0] == oldLayer)
|
||||||
|
{
|
||||||
|
Children.RemoveAt(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (oldLayer is IMapLayer mapLayer)
|
if (oldLayer is IMapLayer mapLayer)
|
||||||
{
|
{
|
||||||
|
|
@ -461,7 +464,10 @@ namespace MapControl
|
||||||
|
|
||||||
if (newLayer != null)
|
if (newLayer != null)
|
||||||
{
|
{
|
||||||
Children.Insert(0, newLayer);
|
if (Children.Count == 0 || Children[0] != newLayer)
|
||||||
|
{
|
||||||
|
Children.Insert(0, newLayer);
|
||||||
|
}
|
||||||
|
|
||||||
if (newLayer is IMapLayer mapLayer)
|
if (newLayer is IMapLayer mapLayer)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue