mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-20 22:05:07 +00:00
Update MapBase.cs
This commit is contained in:
parent
3fc839c67a
commit
f97a3f0797
1 changed files with 8 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue