Terminator
The Terminator is the curve across the earth's surface that at any given time separates day from night. The distinction is made according to whether the sun is above or below the horizon. At the given time, the Terminator indicates those locations experiencing either sun set or sun rise.
At any given time there is precisely one location on earth where the sun is in zenith position. Once this zenith vector is predicted, calculating the Terminator is straight forward.
To show the current Terminator as a map overlay - as a curve, as night shadow or both, make use of the supplied TerminatorViewModel, which inherits from IGeoLayerViewModel. The constructor takes the IGeoContext as input.
//...
using TPG.GeoFramework.Terminator;
//...
ITerminatorViewModel _terminatorViewModel;
var fac = new TerminatorViewModelFactory(new TerminatorViewFactory());
_terminatorViewModel = fac.New(_geoContext);
The ITerminatorViewModel interface offers the following properties and methods:
Property/method | Type | Description |
---|---|---|
AutoUpdate | bool | Turn auto update on (true) or off, or get current setting. Default is on. |
UpdateInterval | TimeSpan | Get or set update interval (default = 10 min) |
UtcTime | DateTime | Get or set time explicitly. Default is current UTC time, updated periodically (according to UpdateInterval) if AutoUpdate is on. Before setting this property to other than current time - for history or prediction views, AutoUpdate should be turned off. |
Contour | bool | Show (true) or hide Terminator line, or get current setting. Default is true. |
LineColor | Color | Get or set line colour (default is Beige). |
LineThickness | double | Get or set line thickness (default is 5.0). |
NightShading | bool | Turn night shading on (true) or off, or get current setting. Default is on. |
NightShadingColor | Color | Get or set night shading colour (default is 50% grey). |