mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
LatLonBox in GeoImage
This commit is contained in:
parent
d66febcdf0
commit
1ad4c1b1a3
|
|
@ -83,9 +83,9 @@ namespace MapControl
|
|||
var p1 = geoImage.transformMatrix.Transform(new Point());
|
||||
var p2 = geoImage.transformMatrix.Transform(geoImage.BitmapSize);
|
||||
|
||||
var boundingBox = geoImage.mapProjection != null
|
||||
? geoImage.mapProjection.MapToBoundingBox(new Rect(p1, p2))
|
||||
: new LatLonBox(p1.Y, p1.X, p2.Y, p2.X, 0d);
|
||||
var latLonBox = geoImage.mapProjection != null
|
||||
? new LatLonBox(geoImage.mapProjection.MapToBoundingBox(new Rect(p1, p2)))
|
||||
: new LatLonBox(p1.Y, p1.X, p2.Y, p2.X);
|
||||
|
||||
if (element is Image image)
|
||||
{
|
||||
|
|
@ -96,7 +96,7 @@ namespace MapControl
|
|||
shape.Fill = geoImage.ImageBrush;
|
||||
}
|
||||
|
||||
MapPanel.SetBoundingBox(element, boundingBox);
|
||||
MapPanel.SetBoundingBox(element, latLonBox);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,18 +9,24 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public class LatLonBox : BoundingBox
|
||||
{
|
||||
public LatLonBox(double latitude1, double longitude1, double latitude2, double longitude2, double rotation)
|
||||
public LatLonBox(double latitude1, double longitude1, double latitude2, double longitude2, double rotation = 0d)
|
||||
: base(latitude1, longitude1, latitude2, longitude2)
|
||||
{
|
||||
Rotation = rotation;
|
||||
}
|
||||
|
||||
public LatLonBox(Location location1, Location location2, double rotation)
|
||||
public LatLonBox(Location location1, Location location2, double rotation = 0d)
|
||||
: base(location1, location2)
|
||||
{
|
||||
Rotation = rotation;
|
||||
}
|
||||
|
||||
public LatLonBox(BoundingBox boundingBox, double rotation = 0d)
|
||||
: base(boundingBox.South, boundingBox.West, boundingBox.North, boundingBox.East)
|
||||
{
|
||||
Rotation = rotation;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a counterclockwise rotation angle in degrees.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue