Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions EGIS.Controls/BaseMapLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EGIS.Projections;


namespace EGIS.Controls
Expand Down Expand Up @@ -105,6 +106,7 @@ private void Map_ZoomLevelChanged(object sender, EventArgs e)
}

private TileSource _tileSource;
private ICRS _initialMapReferenceSystem;
private bool disposedValue;

/// <summary>
Expand All @@ -124,9 +126,14 @@ public TileSource TileSource
_tileSource = value;
if (previousTileSource == null)
{
_initialMapReferenceSystem = mapReference.MapCoordinateReferenceSystem;
//if TileSource changed from null set the maps CRS to Wgs84PseudoMercator
mapReference.MapCoordinateReferenceSystem = EGIS.Projections.CoordinateReferenceSystemFactory.Default.GetCRSById(EGIS.Projections.CoordinateReferenceSystemFactory.Wgs84PseudoMercatorEpsgCode);
}
else if (_tileSource == null)
{
mapReference.MapCoordinateReferenceSystem = _initialMapReferenceSystem;
}
mapReference.Invalidate(RefreshMode.BaseMapLayer);
}
}
Expand Down