|
 |
(21 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| === Map rotation ===
| | == Map rotation == |
|
| |
|
| As default, 2D maps are displayed with north up, but you may rotate the map by modifying the map layer rotation parameter - GeoContext.RotateValue. | | As default, 2D maps are displayed with north up, but you may rotate the map by modifying the map layer rotation parameter - GeoContext.RotateValue. |
| | |
| | === Additional components and code === |
|
| |
|
| Add the following components: | | Add the following components: |
Line 36: |
Line 38: |
| public ICommand RotateRightCmnd { get { return new DelegateCommand(OnRotateRight); } } | | public ICommand RotateRightCmnd { get { return new DelegateCommand(OnRotateRight); } } |
|
| |
|
| private void OnRotateLeft(object obj) | | private void OnRotateLeft(object obj) { Rotation += 1;} |
| { | | private void OnRotateRight(object obj) { Rotation -= 1;} |
| Â Â Rotation += 1;
| |
| } | |
| Â | |
| private void OnRotateRight(object obj) | |
| { | |
| Â Â Rotation -= 1;
| |
| } | |
|
| |
|
| public int Rotation | | public int Rotation |
Line 57: |
Line 52: |
| . . . | | . . . |
| </source> | | </source> |
|
| |
|
| |
|
| === Running with map rotation === | | === Running with map rotation === |
Line 90: |
Line 84: |
| ! scope="row" style="text-align:left;" | Target altitude  | | ! scope="row" style="text-align:left;" | Target altitude  |
| | colspan="2" | | | | colspan="2" | |
| Height above sea level (0-elevation)Â at target position. | | Height above sea level (0-elevation)Â at target position.<br> |
| Changes are not applicable while:
| |
| * auto follow is active, as the target elevation is defined by the item followed.
| |
| * follow ground is active.
| |
| |- | | |- |
| ! scope="row" style="text-align:left;" | Target position  | | ! scope="row" style="text-align:left;" | Target position  |
| | colspan="2" | Â | | | colspan="2" | Â |
| Latitude and longitude. Changes are not applicable while: | | Latitude and longitude. <br> |
| * auto follow is active, as the target position is defined by the item followed.
| |
| |- | | |- |
| ! scope="row" style="text-align:left;" | Target distance | | ! scope="row" style="text-align:left;" | Target distance |
Line 109: |
Line 99: |
| :: Performing the same rotations in different order will give different results. | | :: Performing the same rotations in different order will give different results. |
|
| |
|
| === Implementation === | | === Additional components and code === |
|
| |
|
| To visualise how these parameters are connected, add the following elements to your main window: | | To visualise the 3D settings, add display, with ability of modification, for: |
| Â | | ;Camera |
| <source lang="xml">
| | :* Yaw |
| . . .
| | :* Pitch |
| <GroupBox Header="3D Settings"
| | :* Roll |
| Â Â Â Â Â IsEnabled="{Binding MapViewModel.Is3DMode}" >
| | ;Target |
| Â Â <Grid >
| | :* Follow ground |
| Â Â Â Â <Grid.RowDefinitions>
| | :* Altitude |
| Â Â Â Â Â Â <RowDefinition Height="Auto" />
| | ::Changes are not applicable while: |
| Â Â Â Â Â Â <RowDefinition Height="Auto" />
| | ::* auto follow is active, as the target elevation is defined by the item followed. |
| Â Â Â Â Â Â <RowDefinition Height="Auto" />
| | ::* follow ground is active. |
| Â Â Â Â Â Â <RowDefinition Height="Auto" />
| | :* Position |
| Â Â Â Â Â Â <RowDefinition Height="Auto" />
| | ::Changes are not applicable while: |
| Â Â Â Â Â Â <RowDefinition Height="Auto" />
| | ::* auto follow is active, as the target position is defined by the item followed. |
| Â Â Â Â Â Â <RowDefinition Height="Auto" />
| | :* Distance |
| Â Â Â Â Â Â <RowDefinition Height="Auto" />
| |
| Â Â Â Â Â Â <RowDefinition Height="Auto" />
| |
| Â Â Â Â Â Â <RowDefinition Height="Auto" />
| |
| Â Â Â Â </Grid.RowDefinitions>
| |
| Â Â Â Â <Grid.ColumnDefinitions>
| |
| Â Â Â Â Â Â <ColumnDefinition Width="Auto"/>
| |
| Â Â Â Â Â Â <ColumnDefinition Width="Auto"/>
| |
| Â Â Â Â Â Â <ColumnDefinition Width="Auto"/>
| |
| Â Â Â Â Â Â <ColumnDefinition Width="Auto"/>
| |
| Â Â Â Â </Grid.ColumnDefinitions>
| |
|
| |
|
| Â Â Â Â <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4"
| | {{Note|Example of necessary components, properties and command handlers [[Maria globe client/Advanced map settings/3D_settings_code_sample|''are described separately'' '''''here''''']].}} |
| Â Â Â Â Â Â Â Content="Camera" FontWeight="DemiBold" />
| |
| Â Â Â Â
| |
| Â Â Â Â <Label Grid.Row="1" Grid.Column="0"
| |
| Â Â Â Â Â Â Â Content="Yaw"Â />
| |
| Â Â Â Â <TextBox Grid.Row="1" Grid.Column="1" Margin="3" Width="60"
| |
| Â Â Â Â Â Â Â Â Text="{Binding MapViewModel.CameraYaw, StringFormat=N2}" TextAlignment="Right"Â Â Â Â Â Â Â Â Â Â Â Â Â Â
| |
| Â Â Â Â Â Â Â Â IsReadOnly="True"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="1" Grid.Column="2" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="+"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.IncreaseYawCmnd}"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="1" Grid.Column="3" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="-"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.DecreaseYawCmnd}"/>
| |
| Â Â Â Â
| |
| Â Â Â Â <Label Grid.Row="2" Grid.Column="0"
| |
| Â Â Â Â Â Â Â Content="Roll" />
| |
| Â Â Â Â <TextBox Grid.Row="2" Grid.Column="1" Margin="3" Width="60"
| |
| Â Â Â Â Â Â Â Â Text="{Binding MapViewModel.CameraRoll, StringFormat=N2}" TextAlignment="Right"
| |
| Â Â Â Â Â Â Â Â IsReadOnly="True"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="2" Grid.Column="2" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="+"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.IncreaseRollCmnd}"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="2" Grid.Column="3" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="-"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.DecreaseRollCmnd}"/>
| |
| Â Â Â Â
| |
| Â Â Â Â <Label Grid.Row="3" Grid.Column="0"
| |
| Â Â Â Â Â Â Â Content="Pitch" />
| |
| Â Â Â Â <TextBox Grid.Row="3" Grid.Column="1" Margin="3" Width="60"
| |
| Â Â Â Â Â Â Â Â Text="{Binding MapViewModel.CameraPitch, StringFormat=N2}" TextAlignment="Right"
| |
| Â Â Â Â Â Â Â Â IsReadOnly="True"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="3" Grid.Column="2" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="+"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.IncreasePitchCmnd}"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="3" Grid.Column="3" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="-"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.DecreasePitchCmnd}"/>
| |
|
| |
|
| Â Â Â Â <Label Grid.Row="4" Grid.Column="0"
| | === Synchronise with map actions === |
| Â Â Â Â Â Â Â Content="Target" FontWeight="DemiBold" />
| |
| Â Â Â Â <CheckBox Grid.Row="4"Â Grid.Column="1" Grid.ColumnSpan="3" VerticalAlignment="Center" Margin="3"
| |
| Â Â Â Â Â Â Â Â Â Content="Follow ground"
| |
| Â Â Â Â Â Â Â Â Â IsChecked="{Binding MapViewModel.FollowGround}"/>
| |
|
| |
|
| Â Â Â Â <Label Grid.Row="5" Grid.Column="0"
| | We need to synchronise the 3D map settings when 3D mode is entered, and also whenever altered by mouse actions in the map area. Â |
| Â Â Â Â Â Â Â Content="Altitude" />
| |
| Â Â Â Â <TextBox Grid.Row="5" Grid.Column="1" Margin="3" Width="60"
| |
| Â Â Â Â Â Â Â Â Text="{Binding MapViewModel.TargetAltitude, StringFormat=N0}" TextAlignment="Right"
| |
| Â Â Â Â Â Â Â Â IsReadOnly="True"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="5" Grid.Column="2" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="+"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.IncreaseTargetAltitudeCmnd}"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="5" Grid.Column="3" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="-"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.DecreaseTargetAltitudeCmnd}"/>
| |
| Â Â Â Â
| |
| Â Â Â Â <Label Grid.Row="6" Grid.Column="0"
| |
| Â Â Â Â Â Â Â Content="Distance" />
| |
| Â Â Â Â <TextBox Grid.Row="6" Grid.Column="1" Margin="3" Width="60"
| |
| Â Â Â Â Â Â Â Â Text="{Binding MapViewModel.TargetDistance, StringFormat=N0}" TextAlignment="Right"
| |
| Â Â Â Â Â Â Â Â IsReadOnly="True"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="6" Grid.Column="2" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="+"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.IncreaseTargetDistanceCmnd}"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="6" Grid.Column="3" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="-"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.DecreaseTargetDistanceCmnd}"/>
| |
|
| |
|
| Â Â Â Â <Label Grid.Row="7" Grid.Column="0"
| | To do that, subscribe to events from: |
| Â Â Â Â Â Â Â Content="Position" />
| |
| Â Â Â Â <TextBox Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="3" Margin="3"Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
| |
| Â Â Â Â Â Â Â Â Text="{Binding MapViewModel.TargetPosText, Mode=OneWay}" TextAlignment="Right"
| |
| Â Â Â Â Â Â Â Â IsReadOnly="True"/>
| |
| Â Â Â Â <Label Grid.Row="8" Grid.Column="1"
| |
| Â Â Â Â Â Â Â Content="Latitude"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="8" Grid.Column="2" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="+"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.IncreaseTargetPosLatCmnd}"/>
| |
| Â Â Â Â <RepeatButton Grid.Row="8" Grid.Column="3" Width="12" Margin="3" HorizontalAlignment="Center"
| |
| Â Â Â Â Â Â Â Â Â Â Â Content="-"
| |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.DecreaseTargetPosLatCmnd}"/>
| |
|
| |
|
| Â Â Â Â <Label Grid.Row="9" Grid.Column="1"
| | :;GlobeMapViewModel |
| Â Â Â Â Â Â Â Content="Longitude"/>
| | :* Entered2DMode |
| Â Â Â Â <RepeatButton Grid.Row="9" Grid.Column="2" Width="12" Margin="3" HorizontalAlignment="Center"
| | :* Entered3DMode |
| Â Â Â Â Â Â Â Â Â Â Â Content="+"
| | :;GlobeMapViewModel.Globe3DViewModel.CameraControl |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.IncreaseTargetPosLonCmnd}"/>
| | :* AfterPan |
| Â Â Â Â <RepeatButton Grid.Row="9" Grid.Column="3" Width="12" Margin="3" HorizontalAlignment="Center"
| | :* TargetDistanceChanged |
| Â Â Â Â Â Â Â Â Â Â Â Content="-"
| | :* TargetPosChanged |
| Â Â Â Â Â Â Â Â Â Â Â Command="{Binding MapViewModel.DecreaseTargetPosLonCmnd}"/>
| | :* OrientationChanged |
| Â Â </Grid>
| |
| </GroupBox>
| |
| . . .
| |
| </source>
| |
|
| |
|
| And add necessary command handlers and properties to '''''MapViewModel'''''
| | In '''''MapViewModel''''': |
|
| |
|
| <source lang="csharp"> | | <source lang="C#"> |
| . . . | | . . . |
| public ICommand IncreaseYawCmnd { get { return new DelegateCommand(OnIncreaseCameraYaw); } } | | public void SetGlobeMapViewModel(IGlobeMapViewModel globeMapViewModel) |
| public ICommand DecreaseYawCmnd { get { return new DelegateCommand(OnDecreaseCameraYaw); } }
| |
| Â | |
| public ICommand IncreaseRollCmnd { get { return new DelegateCommand(OnIncreaseCameraRoll); } }
| |
| public ICommand DecreaseRollCmnd { get { return new DelegateCommand(OnDecreaseCameraRoll); } }
| |
| Â | |
| public ICommand IncreasePitchCmnd { get { return new DelegateCommand(OnIncreaseCameraPitch); } }
| |
| public ICommand DecreasePitchCmnd { get { return new DelegateCommand(OnDecreaseCameraPitch); } }
| |
| Â | |
| public ICommand IncreaseTargetDistanceCmnd { get { return new DelegateCommand(OnIncreaseTargetDistance); } }
| |
| public ICommand DecreaseTargetDistanceCmnd { get { return new DelegateCommand(OnDecreaseTargetDistance); } }
| |
| Â | |
| public ICommand IncreaseTargetAltitudeCmnd { get { return new DelegateCommand(OnIncreaseTargetAlttitude, CanModTargetAltitude); } }
| |
| public ICommand DecreaseTargetAltitudeCmnd { get { return new DelegateCommand(OnDecreaseTargetAltitide, CanModTargetAltitude); } }
| |
| Â | |
| public ICommand IncreaseTargetPosLatCmnd { get { return new DelegateCommand(OnIncreaseTargetPosLat, CanModTargetPosition); } }
| |
| public ICommand DecreaseTargetPosLatCmnd { get { return new DelegateCommand(OnDecreaseTargetPosLat, CanModTargetPosition); } }
| |
| public ICommand IncreaseTargetPosLonCmnd { get { return new DelegateCommand(OnIncreaseTargetPosLon, CanModTargetPosition); } }
| |
| public ICommand DecreaseTargetPosLonCmnd { get { return new DelegateCommand(OnDecreaseTargetPosLon, CanModTargetPosition); } }
| |
| Â | |
| public bool Autofollow
| |
| {
| |
| Â Â get { return _autoFollow; }
| |
| Â Â set
| |
| Â Â {
| |
| Â Â Â Â _autoFollow = value;
| |
| Â | |
| Â Â Â Â RefreshTargetAndCameraValues();
| |
| Â Â }
| |
| }
| |
| Â | |
| private void OnIncreaseCameraYaw(object obj) { CameraYaw += 1; }
| |
| private void OnDecreaseCameraYaw(object obj) { CameraYaw -= 1; }
| |
| Â | |
| private void OnIncreaseCameraRoll(object obj) { CameraRoll += 1; }
| |
| private void OnDecreaseCameraRoll(object obj) { CameraRoll -= 1; }
| |
| Â | |
| private void OnIncreaseCameraPitch(object obj) { CameraPitch += 1; }
| |
| private void OnDecreaseCameraPitch(object obj) { CameraPitch -= 1; }
| |
| Â | |
| private void OnIncreaseTargetAlttitude(object obj) { TargetAltitude += 10; }
| |
| private void OnDecreaseTargetAltitide(object obj) { TargetAltitude -= 10; }
| |
| Â | |
| private void OnIncreaseTargetPosLat(object obj) { TargetPos = new GeoPos(TargetPos.Lat + (1.0 / (60 * 60)), TargetPos.Lon ); }
| |
| private void OnDecreaseTargetPosLat(object obj) { TargetPos = new GeoPos(TargetPos.Lat - (1.0 / (60 * 60)), TargetPos.Lon ); }
| |
| private void OnIncreaseTargetPosLon(object obj) { TargetPos = new GeoPos(TargetPos.Lat, TargetPos.Lon + (1.0 / (60 * 60))); }
| |
| private void OnDecreaseTargetPosLon(object obj) { TargetPos = new GeoPos(TargetPos.Lat, TargetPos.Lon - (1.0 / (60 * 60))); }
| |
| Â | |
| private bool CanModTargetAltitude(object obj) { return !FollowGround && !Autofollow; }
| |
| private bool CanModTargetPosition(object obj) { return !Autofollow; }
| |
| Â | |
| private void OnIncreaseTargetDistance(object obj) { TargetDistance += 10; }
| |
| private void OnDecreaseTargetDistance(object obj) { TargetDistance -= 10; }
| |
| Â | |
| public double CameraYaw
| |
| { | | { |
| Â Â Â get | | Â Â Â _globeMapViewModel = globeMapViewModel; Â Â Â Â Â |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â Â Â return GlobeMapViewModel.Globe3DViewModel.CameraControl.Yaw;
| |
| Â Â Â Â return 0;
| |
| Â Â }
| |
| Â Â set
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â {
| |
| Â Â Â Â Â Â GlobeMapViewModel.Globe3DViewModel.CameraControl.Yaw = value;
| |
| Â Â Â Â }
| |
|
| |
|
| Â Â Â Â NotifyPropertyChanged(() => CameraYaw);
| | Â Â _globeMapViewModel.Globe3DViewModel.CameraControl.AfterPan += OnModeOrSettingsChanged; |
| Â Â Â } | | Â Â _globeMapViewModel.Globe3DViewModel.CameraControl.TargetDistanceChanged += OnModeOrSettingsChanged; |
| } | | Â Â _globeMapViewModel.Globe3DViewModel.CameraControl.TargetPosChanged += OnModeOrSettingsChanged; |
| Â | | Â Â _globeMapViewModel.Globe3DViewModel.CameraControl.OrientationChanged += OnModeOrSettingsChanged; |
| public double CameraRoll
| | Â Â _globeMapViewModel.Entered2DMode += OnModeOrSettingsChanged; |
| | Â Â Â _globeMapViewModel.Entered3DMode += OnModeOrSettingsChanged; |
| | } Â |
| | private void OnModeOrSettingsChanged(object sender, EventArgs args) |
| { | | { |
| Â Â Â get | | Â Â Â RefreshTargetAndCameraValues(); |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â Â Â return GlobeMapViewModel.Globe3DViewModel.CameraControl.Roll;
| |
| Â Â Â Â return 0;
| |
| Â Â }
| |
| Â Â set
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â {
| |
| Â Â Â Â Â Â GlobeMapViewModel.Globe3DViewModel.CameraControl.Roll = value;
| |
| Â Â Â Â }
| |
| Â | |
| Â Â Â Â NotifyPropertyChanged(() => CameraRoll);
| |
| Â Â }
| |
| }
| |
| Â | |
| public double CameraPitch
| |
| {
| |
| Â Â get
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â Â Â return GlobeMapViewModel.Globe3DViewModel.CameraControl.Pitch;
| |
| Â Â Â Â return 0;
| |
| Â Â }
| |
| Â Â set
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â {
| |
| Â Â Â Â Â Â GlobeMapViewModel.Globe3DViewModel.CameraControl.Pitch = value;
| |
| Â Â Â Â }
| |
| Â | |
| Â Â Â Â NotifyPropertyChanged(() => CameraPitch);
| |
| Â Â }
| |
| }
| |
| Â | |
| public string TargetPosText { get { return TargetPos.ToString(); } }
| |
| Â | |
| public GeoPos TargetPos
| |
| {
| |
| Â Â get
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â Â Â return GlobeMapViewModel.Globe3DViewModel.CameraControl.TargetPos;
| |
| Â | |
| Â Â Â Â return GeoPos.InvalidPos;
| |
| Â Â }
| |
| Â Â set
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â {
| |
| Â Â Â Â Â Â GlobeMapViewModel.Globe3DViewModel.CameraControl.TargetPos = value;
| |
| Â Â Â Â }
| |
| Â | |
| Â Â Â Â RefreshTargetAndCameraValues();
| |
| Â Â }
| |
| }
| |
| Â | |
| public double TargetAltitude
| |
| {
| |
| Â Â get
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â Â Â return GlobeMapViewModel.Globe3DViewModel.CameraControl.TargetAltitude;
| |
| Â Â Â Â return 0;
| |
| Â Â }
| |
| Â Â set
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â {
| |
| Â Â Â Â Â Â GlobeMapViewModel.Globe3DViewModel.CameraControl.TargetAltitude = value;
| |
| Â Â Â Â }
| |
| Â | |
| Â Â Â Â NotifyPropertyChanged(() => TargetAltitude);
| |
| Â Â }
| |
| }
| |
| Â | |
| public bool FollowGround
| |
| {
| |
| Â Â get
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â Â Â return GlobeMapViewModel.Globe3DViewModel.CameraControl.FollowGround;
| |
| Â Â Â Â return true;
| |
| Â Â }
| |
| Â Â set
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â {
| |
| Â Â Â Â Â Â GlobeMapViewModel.Globe3DViewModel.CameraControl.FollowGround = value;
| |
| Â Â Â Â }
| |
| Â | |
| Â Â Â Â NotifyPropertyChanged(() => FollowGround);
| |
| Â Â }
| |
| }
| |
| Â | |
| public double TargetDistance
| |
| {
| |
| Â Â get
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â Â Â return GlobeMapViewModel.Globe3DViewModel.CameraControl.TargetDistance;
| |
| Â Â Â Â return 0;
| |
| Â Â }
| |
| Â Â set
| |
| Â Â {
| |
| Â Â Â Â if (GlobeMapViewModel?.Globe3DViewModel?.CameraControl != null)
| |
| Â Â Â Â {
| |
| Â Â Â Â Â Â GlobeMapViewModel.Globe3DViewModel.CameraControl.TargetDistance = value;
| |
| Â Â Â Â }
| |
| Â | |
| Â Â Â Â NotifyPropertyChanged(() => TargetDistance);
| |
| Â Â }
| |
| }
| |
| . . .
| |
| private void RefreshTargetAndCameraValues()
| |
| {
| |
| Â Â NotifyPropertyChanged(() => FollowGround);
| |
| Â Â NotifyPropertyChanged(() => Autofollow);
| |
| Â | |
| Â Â NotifyPropertyChanged(() => CameraPitch);
| |
| Â Â NotifyPropertyChanged(() => CameraRoll);
| |
| Â Â NotifyPropertyChanged(() => CameraYaw);
| |
| Â | |
| Â Â NotifyPropertyChanged(() => TargetAltitude);
| |
| Â Â NotifyPropertyChanged(() => TargetPos);
| |
| Â Â NotifyPropertyChanged(() => TargetPosText);
| |
| Â Â NotifyPropertyChanged(() => TargetDistance);
| |
| } | | } |
| . . . | | . . . |
| </source> | | </source> |
|
| |
|
| ... and update '''''MapViewModel.Autofollow''''' when auto follow has changed in '''''MainViewModel'''''!
| | === Running with displayed 3D settings === |
| Â | |
| <source lang="c#">
| |
| . . .
| |
| public bool IsAutoFollowActive
| |
| {
| |
| Â . . .
| |
| Â Â set
| |
| Â Â {
| |
| Â Â Â Â if (!(value && GlobeMapViewModel.AutoFollow.FollowSelectedItem()))
| |
| Â Â Â Â Â Â GlobeMapViewModel.AutoFollow.TargetItem = null;
| |
| Â | |
| Â Â Â Â MapViewModel.Autofollow = IsAutoFollowActive;
| |
| Â Â Â Â NotifyPropertyChanged(() => IsAutoFollowActive);
| |
| Â Â Â Â NotifyPropertyChanged(() => AutoFollowItemName);
| |
| Â Â }
| |
| }
| |
| . . .
| |
| </source>
| |
| Â | |
| Â | |
| === Running with display of 3D settings === | |
|
| |
|
| Running the '''''Globe client''''' in 3D mode, altering the 3D parameters will give results like this: | | Running the '''''Globe client''''' in 3D mode, altering the 3D parameters will give results like this: |
Line 487: |
Line 178: |
| | | | | |
| [[File:3D_Set_P15_Y120_af_close.png|450px|Auto follow - closer ]] <br> | | [[File:3D_Set_P15_Y120_af_close.png|450px|Auto follow - closer ]] <br> |
| Auto follow - closer
| | With auto follow, modified target distance (camera closer) |
| | | | | |
| [[File:3D_Set_P15_Y120_R30_af.png|450px| Modified ''roll'' ]]<br> | | [[File:3D_Set_P15_Y120_R30_af.png|450px| Modified ''roll'' ]]<br> |