mirror of
https://github.com/dotMorten/NmeaParser.git
synced 2026-01-01 06:10:17 +01:00
FIx 2D/3D view issues
This commit is contained in:
parent
83ed2fbeb4
commit
9db4db4212
|
|
@ -10,7 +10,7 @@
|
|||
<!--Map-->
|
||||
<esri:MapView x:Name="mapView" Grid.Row="1">
|
||||
<local:RestoreAutoPanMode.RestoreAutoPanSettings>
|
||||
<local:RestoreAutoPanMode DelayInSeconds="2.5" PanMode="Navigation" IsEnabled="True" RestoreScale="5000" />
|
||||
<local:RestoreAutoPanMode DelayInSeconds="2.5" PanMode="Recenter" IsEnabled="True" RestoreScale="5000" />
|
||||
</local:RestoreAutoPanMode.RestoreAutoPanSettings>
|
||||
</esri:MapView>
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,12 @@ namespace SampleApp.WinDesktop
|
|||
|
||||
mapView.LocationDisplay.InitialZoomScale = 5000;
|
||||
mapView.LocationDisplay.AutoPanMode = Esri.ArcGISRuntime.UI.LocationDisplayAutoPanMode.Recenter;
|
||||
this.IsVisibleChanged += View2D_IsVisibleChanged;
|
||||
}
|
||||
|
||||
private void View2D_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
mapView.LocationDisplay.IsEnabled = IsVisible;
|
||||
}
|
||||
|
||||
public NmeaDevice NmeaDevice
|
||||
|
|
@ -51,8 +57,8 @@ namespace SampleApp.WinDesktop
|
|||
mapView.LocationDisplay.IsEnabled = false;
|
||||
if (newDevice != null)
|
||||
{
|
||||
mapView.LocationDisplay.DataSource = new NmeaLocationDataSource(newDevice);
|
||||
mapView.LocationDisplay.IsEnabled = true;
|
||||
mapView.LocationDisplay.DataSource = new NmeaLocationDataSource(newDevice, false);
|
||||
mapView.LocationDisplay.IsEnabled = IsLoaded;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,15 +67,16 @@ namespace SampleApp.WinDesktop
|
|||
symb.Width = 3; symb.Depth = 5; symb.Height = 2; symb.AnchorPosition = SceneSymbolAnchorPosition.Bottom;
|
||||
graphic3D.Symbol = symb;
|
||||
sceneView.GraphicsOverlays["Position"].Graphics.Add(graphic3D);
|
||||
|
||||
sceneView.CameraController = new OrbitGeoElementCameraController(sceneView.GraphicsOverlays["Position"].Graphics[0], 200);
|
||||
}
|
||||
|
||||
|
||||
private int updateId = 0;
|
||||
private async void UpdateLocation(double latitude, double longitude, double newHeading)
|
||||
{
|
||||
// Handle 3D updates on 3D Scene
|
||||
var cid = ++updateId;
|
||||
if (double.IsNaN(newHeading))
|
||||
newHeading = 0;
|
||||
var start = graphic3D.Geometry as MapPoint;
|
||||
if (start == null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue