From b253d0696a0914c0eab5f29cfda90fce9694b58b Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Sat, 5 Nov 2022 17:32:29 +0100 Subject: [PATCH] Update comments --- MapControl/Shared/MapBase.cs | 12 ++++++------ MapControl/Shared/MapPanel.cs | 5 +++-- MapControl/Shared/MapPath.cs | 4 ++-- MapControl/Shared/MapProjection.cs | 8 ++++---- MapControl/Shared/ViewTransform.cs | 12 ++++++------ MapControl/Shared/ViewportChangedEventArgs.cs | 2 +- MapControl/WPF/MapPanel.WPF.cs | 4 ++-- MapControl/WinUI/MapPanel.WinUI.cs | 4 ++-- 8 files changed, 26 insertions(+), 25 deletions(-) diff --git a/MapControl/Shared/MapBase.cs b/MapControl/Shared/MapBase.cs index a2183bb2..b4aed4a5 100644 --- a/MapControl/Shared/MapBase.cs +++ b/MapControl/Shared/MapBase.cs @@ -216,20 +216,20 @@ namespace MapControl } /// - /// Gets the scaling factor from cartesian map coordinates to view coordinates, - /// i.e. pixels per meter, as a read-only dependency property. + /// Gets the scaling factor from projected map coordinates to view coordinates, + /// i.e. pixels per meter. /// public double ViewScale => (double)GetValue(ViewScaleProperty); /// - /// Gets the ViewTransform instance that is used to transform between cartesian map coordinates - /// and view coordinates. + /// Gets the ViewTransform instance that is used to transform between projected + /// map coordinates and view coordinates. /// public ViewTransform ViewTransform { get; } = new ViewTransform(); /// - /// Gets the horizontal and vertical scaling factors from cartesian map coordinates to view - /// coordinates at the specified location, i.e. pixels per meter. + /// Gets the map scale, i.e. the horizontal and vertical scaling factors from geographic + /// coordinates to view coordinates at the specified location, in pixels per meter. /// public Vector GetScale(Location location) { diff --git a/MapControl/Shared/MapPanel.cs b/MapControl/Shared/MapPanel.cs index c1746d1b..aeaf0e7f 100644 --- a/MapControl/Shared/MapPanel.cs +++ b/MapControl/Shared/MapPanel.cs @@ -98,7 +98,8 @@ namespace MapControl } /// - /// Gets the position of an element in view coordinates. + /// Gets the position of an element with Location in view coordinates, + /// or null when the element has no Location. /// public static Point? GetViewPosition(FrameworkElement element) { @@ -152,7 +153,7 @@ namespace MapControl { var location = GetLocation(element); Point? position = null; - + if (location != null) { position = GetViewPosition(location); diff --git a/MapControl/Shared/MapPath.cs b/MapControl/Shared/MapPath.cs index 6675a7b5..9256d17a 100644 --- a/MapControl/Shared/MapPath.cs +++ b/MapControl/Shared/MapPath.cs @@ -17,7 +17,7 @@ namespace MapControl { /// /// A path element with a Data property that holds a Geometry in view coordinates or - /// cartesian map coordinates that are relative to an origin Location. + /// projected map coordinates that are relative to an origin Location. /// public partial class MapPath : IMapElement { @@ -29,7 +29,7 @@ namespace MapControl /// /// Gets or sets a Location that is used as - /// - either the origin point of a geometry specified in cartesian map units (meters) + /// - either the origin point of a geometry specified in projected map coordinates (meters) /// - or as an optional value to constrain the view position of MapPaths with multiple /// Locations (like MapPolyline or MapPolygon) to the visible map viewport, as done /// for elements where the MapPanel.Location property is set. diff --git a/MapControl/Shared/MapProjection.cs b/MapControl/Shared/MapProjection.cs index 200cfed2..fe505c88 100644 --- a/MapControl/Shared/MapProjection.cs +++ b/MapControl/Shared/MapProjection.cs @@ -57,18 +57,18 @@ namespace MapControl } /// - /// Transforms a Location in geographic coordinates to a Point in cartesian map coordinates. + /// Transforms a Location in geographic coordinates to a Point in projected map coordinates. /// public abstract Point LocationToMap(Location location); /// - /// Transforms a Point in cartesian map coordinates to a Location in geographic coordinates. + /// Transforms a Point in projected map coordinates to a Location in geographic coordinates. /// Returns null when the Point can not be transformed. /// public abstract Location MapToLocation(Point point); /// - /// Transforms a BoundingBox in geographic coordinates to a Rect in cartesian map coordinates. + /// Transforms a BoundingBox in geographic coordinates to a Rect in projected map coordinates. /// public virtual Rect BoundingBoxToRect(BoundingBox boundingBox) { @@ -78,7 +78,7 @@ namespace MapControl } /// - /// Transforms a Rect in cartesian map coordinates to a BoundingBox in geographic coordinates. + /// Transforms a Rect in projected map coordinates to a BoundingBox in geographic coordinates. /// Returns null when the Rect can not be transformed. /// public virtual BoundingBox RectToBoundingBox(Rect rect) diff --git a/MapControl/Shared/ViewTransform.cs b/MapControl/Shared/ViewTransform.cs index eb15bb92..d4b0b63a 100644 --- a/MapControl/Shared/ViewTransform.cs +++ b/MapControl/Shared/ViewTransform.cs @@ -17,7 +17,7 @@ using System.Windows.Media; namespace MapControl { /// - /// Defines the transformation between cartesian map coordinates in meters + /// Defines the transformation between projected map coordinates in meters /// and view coordinates in pixels. /// public class ViewTransform @@ -33,7 +33,7 @@ namespace MapControl } /// - /// Gets the scaling factor from cartesian map coordinates to view coordinates, + /// Gets the scaling factor from projected map coordinates to view coordinates, /// i.e. pixels per meter. /// public double Scale { get; private set; } @@ -44,17 +44,17 @@ namespace MapControl public double Rotation { get; private set; } /// - /// Gets the transform matrix from cartesian map coordinates to view coordinates. + /// Gets the transform matrix from projected map coordinates to view coordinates. /// public Matrix MapToViewMatrix { get; private set; } /// - /// Gets the transform matrix from view coordinates to cartesian map coordinates. + /// Gets the transform matrix from view coordinates to projected map coordinates. /// public Matrix ViewToMapMatrix { get; private set; } /// - /// Transforms a Point from cartesian map coordinates to view coordinates. + /// Transforms a Point from projected map coordinates to view coordinates. /// public Point MapToView(Point point) { @@ -62,7 +62,7 @@ namespace MapControl } /// - /// Transforms a Point from view coordinates to cartesian map coordinates. + /// Transforms a Point from view coordinates to projected map coordinates. /// public Point ViewToMap(Point point) { diff --git a/MapControl/Shared/ViewportChangedEventArgs.cs b/MapControl/Shared/ViewportChangedEventArgs.cs index 5c6eb05e..89403d56 100644 --- a/MapControl/Shared/ViewportChangedEventArgs.cs +++ b/MapControl/Shared/ViewportChangedEventArgs.cs @@ -16,7 +16,7 @@ namespace MapControl /// /// Indicates if the map projection has changed, i.e. if a MapTileLayer or MapImageLayer should - /// be updated immediately, or MapPath Data in cartesian map coordinates should be recalculated. + /// be updated immediately, or MapPath Data in projected map coordinates should be recalculated. /// public bool ProjectionChanged { get; } diff --git a/MapControl/WPF/MapPanel.WPF.cs b/MapControl/WPF/MapPanel.WPF.cs index c35cc6f2..87239d4e 100644 --- a/MapControl/WPF/MapPanel.WPF.cs +++ b/MapControl/WPF/MapPanel.WPF.cs @@ -39,9 +39,9 @@ namespace MapControl return (MapBase)element.GetValue(ParentMapProperty); } - private static void SetViewPosition(FrameworkElement element, Point? viewPosition) + private static void SetViewPosition(FrameworkElement element, Point? position) { - element.SetValue(ViewPositionPropertyKey, viewPosition); + element.SetValue(ViewPositionPropertyKey, position); } } } diff --git a/MapControl/WinUI/MapPanel.WinUI.cs b/MapControl/WinUI/MapPanel.WinUI.cs index 6aa29033..ca61204d 100644 --- a/MapControl/WinUI/MapPanel.WinUI.cs +++ b/MapControl/WinUI/MapPanel.WinUI.cs @@ -67,9 +67,9 @@ namespace MapControl return parentMap; } - private static void SetViewPosition(FrameworkElement element, Point? viewPosition) + private static void SetViewPosition(FrameworkElement element, Point? position) { - element.SetValue(ViewPositionProperty, viewPosition); + element.SetValue(ViewPositionProperty, position); } } }