mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Fixed MapImageLayer boundingBox
This commit is contained in:
parent
156ebfe177
commit
1861e9ca5d
|
|
@ -223,9 +223,11 @@ namespace MapControl
|
||||||
{
|
{
|
||||||
updateInProgress = true;
|
updateInProgress = true;
|
||||||
|
|
||||||
|
UpdateBoundingBox();
|
||||||
|
|
||||||
ImageSource imageSource = null;
|
ImageSource imageSource = null;
|
||||||
|
|
||||||
if (UpdateBoundingBox())
|
if (boundingBox != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -243,7 +245,7 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool UpdateBoundingBox()
|
private void UpdateBoundingBox()
|
||||||
{
|
{
|
||||||
var width = ParentMap.RenderSize.Width * RelativeImageSize;
|
var width = ParentMap.RenderSize.Width * RelativeImageSize;
|
||||||
var height = ParentMap.RenderSize.Height * RelativeImageSize;
|
var height = ParentMap.RenderSize.Height * RelativeImageSize;
|
||||||
|
|
@ -253,11 +255,8 @@ namespace MapControl
|
||||||
|
|
||||||
boundingBox = ParentMap.MapProjection.ViewportRectToBoundingBox(rect);
|
boundingBox = ParentMap.MapProjection.ViewportRectToBoundingBox(rect);
|
||||||
|
|
||||||
if (boundingBox == null || !boundingBox.HasValidBounds)
|
if (boundingBox != null && boundingBox.HasValidBounds)
|
||||||
{
|
{
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!double.IsNaN(MinLatitude) && boundingBox.South < MinLatitude)
|
if (!double.IsNaN(MinLatitude) && boundingBox.South < MinLatitude)
|
||||||
{
|
{
|
||||||
boundingBox.South = MinLatitude;
|
boundingBox.South = MinLatitude;
|
||||||
|
|
@ -284,8 +283,7 @@ namespace MapControl
|
||||||
boundingBox.West += d;
|
boundingBox.West += d;
|
||||||
boundingBox.East -= d;
|
boundingBox.East -= d;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AdjustBoundingBox(double longitudeOffset)
|
private void AdjustBoundingBox(double longitudeOffset)
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ namespace MapControl
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual string WmsQueryParameters(BoundingBox boundingBox, string version = "1.3.0")
|
public virtual string WmsQueryParameters(BoundingBox boundingBox, string version = "1.3.0")
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(CrsId))
|
if (string.IsNullOrEmpty(CrsId) || !boundingBox.HasValidBounds)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue