Просмотр исходного кода

Improved Live Maps to indicate currently selected asset location and improved marker displays

frankvandenbos 1 месяц назад
Родитель
Сommit
b83ca3e58f

+ 4 - 2
prs.desktop/Panels/LiveMaps/LiveMapsPanel.xaml

@@ -21,7 +21,7 @@
         <prsDesktop:EquipmentThumbnailConverter x:Key="EquipmentThumbnailConverter" />
         <prsDesktop:EquipmentColorConverter x:Key="EquipmentColorConverter" />
         <DataTemplate x:Key="MarkerTemplate" DataType="{x:Type prsDesktop:MapMarker}">
-            <Border BorderBrush="Gray" BorderThickness="0.75" CornerRadius="5" Padding="2" Background="LightYellow" Margin="120,0,0,0" >
+            <Border BorderBrush="Gray" BorderThickness="0.75" CornerRadius="0,5,5,5" Padding="2" Background="LightYellow" Margin="0,0,0,0" >
                 <TextBlock Text="{Binding Label}" TextAlignment="Center"/>
             </Border>
         </DataTemplate>
@@ -58,7 +58,9 @@
                         Center="{Binding Center, Mode=TwoWay}"
                         Radius="{Binding Radius, Mode=TwoWay}"
                         DistanceType="KiloMeter"
-                        MarkerTemplate="{StaticResource MarkerTemplate}">
+                        MarkerTemplate="{StaticResource MarkerTemplate}"
+                        MarkerHorizontalAlignment="Far"
+                        MarkerVerticalAlignment="Far">
                         <syncfusion:ImageryLayer.SubShapeFileLayers>
                             <syncfusion:SubShapeFileLayer 
                                 MapElements="{Binding Elements}" >

+ 24 - 1
prs.desktop/Panels/LiveMaps/LiveMapsPanelViewModel.cs

@@ -308,7 +308,7 @@ public class LiveMapsPanelViewModel : DependencyObject, INotifyPropertyChanged
                 var circle = new MapCircle()
                 {
                     Center = marker,
-                    Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Magenta) { Opacity = 0.5 },
+                    Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Magenta) { Opacity = 0.2 },
                     Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Black),
                     StrokeThickness = 0,
                     Radius = 10
@@ -327,6 +327,29 @@ public class LiveMapsPanelViewModel : DependencyObject, INotifyPropertyChanged
                 StrokeThickness = 4
             };
             elements.Add(line);
+
+            if (_waypoints.Count > 1)
+            {
+                var start = new MapCircle()
+                {
+                    Center = _waypoints.First(),
+                    Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.LightGreen) { Opacity = 0.9 },
+                    Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Black),
+                    StrokeThickness = 0.5,
+                    Radius = 10
+                };
+                elements.Add(start);
+            }
+
+            var end = new MapCircle()
+            {
+                Center = _waypoints.Last(),
+                Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Red) { Opacity = 0.9 },
+                Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Black),
+                StrokeThickness = 0.5,
+                Radius = 10
+            };
+            elements.Add(end);
         }
 
         Elements = elements;