mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update WmsImageLayer.cs
This commit is contained in:
parent
85646597d1
commit
fa5368e77a
|
|
@ -222,7 +222,7 @@ namespace MapControl
|
||||||
string uri = null;
|
string uri = null;
|
||||||
var projection = ParentMap?.MapProjection;
|
var projection = ParentMap?.MapProjection;
|
||||||
|
|
||||||
if (projection != null && !string.IsNullOrEmpty(projection.CrsId))
|
if (projection != null)
|
||||||
{
|
{
|
||||||
uri = GetRequestUri("GetMap");
|
uri = GetRequestUri("GetMap");
|
||||||
|
|
||||||
|
|
@ -244,8 +244,8 @@ namespace MapControl
|
||||||
var mapRect = projection.BoundingBoxToRect(BoundingBox);
|
var mapRect = projection.BoundingBoxToRect(BoundingBox);
|
||||||
var viewScale = ParentMap.ViewTransform.Scale;
|
var viewScale = ParentMap.ViewTransform.Scale;
|
||||||
|
|
||||||
uri += "&CRS=" + projection.GetCrsValue();
|
uri += "&" + GetCrsParam(projection);
|
||||||
uri += "&BBOX=" + projection.GetBboxValue(mapRect);
|
uri += "&" + GetBboxParam(projection, mapRect);
|
||||||
uri += "&WIDTH=" + (int)Math.Round(viewScale * mapRect.Width);
|
uri += "&WIDTH=" + (int)Math.Round(viewScale * mapRect.Width);
|
||||||
uri += "&HEIGHT=" + (int)Math.Round(viewScale * mapRect.Height);
|
uri += "&HEIGHT=" + (int)Math.Round(viewScale * mapRect.Height);
|
||||||
|
|
||||||
|
|
@ -263,7 +263,7 @@ namespace MapControl
|
||||||
string uri = null;
|
string uri = null;
|
||||||
var projection = ParentMap?.MapProjection;
|
var projection = ParentMap?.MapProjection;
|
||||||
|
|
||||||
if (projection != null && !string.IsNullOrEmpty(projection.CrsId))
|
if (projection != null)
|
||||||
{
|
{
|
||||||
uri = GetRequestUri("GetFeatureInfo");
|
uri = GetRequestUri("GetFeatureInfo");
|
||||||
|
|
||||||
|
|
@ -292,8 +292,8 @@ namespace MapControl
|
||||||
|
|
||||||
var imagePos = transform.Transform(position);
|
var imagePos = transform.Transform(position);
|
||||||
|
|
||||||
uri += "&CRS=" + projection.GetCrsValue();
|
uri += "&" + GetCrsParam(projection);
|
||||||
uri += "&BBOX=" + projection.GetBboxValue(mapRect);
|
uri += "&" + GetBboxParam(projection, mapRect);
|
||||||
uri += "&WIDTH=" + (int)Math.Round(viewRect.Width);
|
uri += "&WIDTH=" + (int)Math.Round(viewRect.Width);
|
||||||
uri += "&HEIGHT=" + (int)Math.Round(viewRect.Height);
|
uri += "&HEIGHT=" + (int)Math.Round(viewRect.Height);
|
||||||
uri += "&I=" + (int)Math.Round(imagePos.X);
|
uri += "&I=" + (int)Math.Round(imagePos.X);
|
||||||
|
|
@ -306,6 +306,16 @@ namespace MapControl
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual string GetCrsParam(MapProjection projection)
|
||||||
|
{
|
||||||
|
return "CRS=" + projection.GetCrsValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual string GetBboxParam(MapProjection projection, Rect mapRect)
|
||||||
|
{
|
||||||
|
return "BBOX=" + projection.GetBboxValue(mapRect);
|
||||||
|
}
|
||||||
|
|
||||||
protected string GetRequestUri(string request)
|
protected string GetRequestUri(string request)
|
||||||
{
|
{
|
||||||
var uri = ServiceUri.ToString();
|
var uri = ServiceUri.ToString();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue