mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Minor improvements
This commit is contained in:
parent
91879054fa
commit
7cf4ed47a3
|
|
@ -179,10 +179,10 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
if (geoKeyDirectory[i] == ProjectedCRSGeoKey && geoKeyDirectory[i + 1] == 0)
|
if (geoKeyDirectory[i] == ProjectedCRSGeoKey && geoKeyDirectory[i + 1] == 0)
|
||||||
{
|
{
|
||||||
var crsId = $"EPSG:{geoKeyDirectory[i + 3]}";
|
int epsgCode = geoKeyDirectory[i + 3];
|
||||||
|
|
||||||
projection = MapProjection.Factory.GetProjection(crsId) ??
|
projection = MapProjection.Factory.GetProjection(epsgCode) ??
|
||||||
throw new ArgumentException($"Can not create projection {crsId} in {sourcePath}.");
|
throw new ArgumentException($"Can not create projection EPSG:{epsgCode} in {sourcePath}.");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,8 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
using (var archive = await Task.Run(() => ZipFile.OpenRead(archiveFilePath)))
|
using (var archive = await Task.Run(() => ZipFile.OpenRead(archiveFilePath)))
|
||||||
{
|
{
|
||||||
var docEntry = await Task.Run(() => archive.GetEntry("doc.kml")
|
var docEntry = await Task.Run(() => archive.GetEntry("doc.kml") ??
|
||||||
?? archive.Entries.FirstOrDefault(e => e.Name.EndsWith(".kml")));
|
archive.Entries.FirstOrDefault(e => e.Name.EndsWith(".kml")));
|
||||||
|
|
||||||
if (docEntry == null)
|
if (docEntry == null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -142,8 +142,8 @@ namespace MapControl
|
||||||
|
|
||||||
foreach (var tileMatrix in currentMatrixes)
|
foreach (var tileMatrix in currentMatrixes)
|
||||||
{
|
{
|
||||||
var layer = currentLayers.FirstOrDefault(l => l.WmtsTileMatrix == tileMatrix)
|
var layer = currentLayers.FirstOrDefault(l => l.WmtsTileMatrix == tileMatrix) ??
|
||||||
?? new WmtsTileMatrixLayer(tileMatrix, tileMatrixSet.TileMatrixes.IndexOf(tileMatrix));
|
new WmtsTileMatrixLayer(tileMatrix, tileMatrixSet.TileMatrixes.IndexOf(tileMatrix));
|
||||||
|
|
||||||
if (layer.UpdateTiles(ParentMap.ViewTransform, ParentMap.RenderSize))
|
if (layer.UpdateTiles(ParentMap.ViewTransform, ParentMap.RenderSize))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,8 @@ namespace MapControl.Projections
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var projection = coordinateSystem.Projection
|
var projection = coordinateSystem.Projection ??
|
||||||
?? throw new ArgumentException("CoordinateSystem.Projection must not be null.", nameof(value));
|
throw new ArgumentException("CoordinateSystem.Projection must not be null.", nameof(value));
|
||||||
|
|
||||||
var centralMeridian = projection.GetParameter("central_meridian") ?? projection.GetParameter("longitude_of_origin");
|
var centralMeridian = projection.GetParameter("central_meridian") ?? projection.GetParameter("longitude_of_origin");
|
||||||
var centralParallel = projection.GetParameter("central_parallel") ?? projection.GetParameter("latitude_of_origin");
|
var centralParallel = projection.GetParameter("central_parallel") ?? projection.GetParameter("latitude_of_origin");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue