Skip to content

It renders an animated globe with Win2D and supports country interaction, custom map inputs, markers/arcs, value and flow layers, events, day/night, flat-map morphing, and tours.

Add the control ​

xml
<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dev="using:DevWinUI">
    <controls:dev x:Name="Globe" MinWidth="320" MinHeight="320" />
</Page>

Data inputs ​

The globe uses the shared WorldMapData loader. When WorldMapDataPath is null (the default), it loads the embedded Assets/WorldMap/WorldMap.bin. Set a custom URI/path to use another compatible world-map dataset. This dataset supplies country IDs, borders, and country locations.

LandMaskSource is separate from the country dataset. It optionally supplies an equirectangular image mask for land-particle placement; with no image, the control uses its procedural mask. LandThreshold controls the brightness threshold.

csharp
Globe.WorldMapDataPath = new Uri("ms-appx:///Assets/WorldMap/WorldMap.bin");
Globe.LandMaskSource = new Uri("ms-appx:///Assets/earth_mask.png");

Property reference ​

The defaults below are the dependency-property defaults unless otherwise noted. Settings are synchronized to the rendering state; ranges noted in the usage column are clamped by the control.

Rendering and data ​

PropertyDefaultUsage
ParticleCount26000Approximate surface-particle count; clamped to 0..150000. Changing it rebuilds particles.
ParticleSize1.0On-screen particle size multiplier; minimum effective value is 0.1.
GlobeScale0.74Globe size in the view; clamped to 0.2..1.2.
TiltAngle18 degreesAxial tilt.
LandThreshold0.52Land-mask/procedural threshold; changing it rebuilds particles.
LandMaskSourcenullOptional equirectangular image URI; null uses procedural land.
WorldMapDataPathnullOptional compatible .bin dataset URI/path; null uses the embedded map.
RotationSpeed0.12Automatic rotation speed; negative values reverse direction.
IsAutoRotateEnabledtrueEnables automatic rotation.
IsInteractivetrueEnables pointer rotation and wheel zoom.
ArcFrequency1.6Random data arcs per second; clamped to 0..20.
OrbitRingCount3Number of orbit rings; clamped to 0..8.
UseParallelParticlesfalseEnables parallel particle processing.

Visibility, palette, and theme ​

PropertyDefaultUsage
ShowStarstrueShow the starfield.
ShowGridtrueShow latitude/longitude grid.
ShowArcstrueShow automatically generated arcs.
ShowCitiestrueShow markers as city points.
ShowOrbitstrueShow orbital rings.
ShowHudtrueShow the HUD overlay.
LandBrushnullLand color brush; null uses the active theme palette.
OceanBrushnullOcean color brush; null uses the active theme palette.
AtmosphereBrushnullAtmosphere brush; null uses the active theme palette.
GridBrushnullGrid brush; null uses the active theme palette.
ArcBrushnullArc brush; null uses the active theme palette.
AccentBrushnullAccent brush; null uses the active theme palette.
StarBrushnullStar brush; null uses the active theme palette.
ThemeDefaultPalette: Default, Cyan, Amber, Matrix, or Hologram. In Default, the brush properties are used with palette fallbacks; a non-default preset takes precedence over explicit brushes.

Country interaction and navigation ​

PropertyDefaultUsage
IsCountryHoverEnabledtrueEnables country hover highlighting.
IsCountrySelectionEnabledtrueEnables country selection.
ShowCountryTooltiptrueShows the hovered-country tooltip.
SelectedCountryCodenullGets/sets the selected country code.
HoveredCountryCodenullRead-only publicly; current hovered country code.
IsFlyToOnSelectEnabledtrueFly to a country when it is selected.
FlyToDuration1.4 secondsDuration of a fly-to transition.
FlyToZoom0Fixed fly-to zoom; 0 chooses zoom from the country size.
ShowCountryOutlinetrueDraw the selected-country particle outline.

Selection effects and borders ​

PropertyDefaultUsage
SelectionEffectsHighlight | Pulse | OutlineCombine Highlight, Pulse, Outline, and DimOthers; None disables them and All combines them.
SelectionDimAmount0.7Strength of dimming for non-selected particles; clamped to 0..1.
ShowCountryBordersfalseEnables country border particles.
BorderParticleCount12000Target border-particle count.
BorderLineBrushnullOptional border-line color override; null uses the theme accent.
BorderIntensity1.5Border brightness multiplier.
BorderScanOnlyfalseRestricts border display to the scanning effect.
BorderFadeSeconds1.5Border appearance/fade duration.

Cursor and click effects ​

PropertyDefaultUsage
IsClickRippleEnabledtrueCreates a surface ripple after a click.
ShowCursorReticletrueShows cursor coordinates and reticle.
IsCursorForceFieldEnabledtrueEnables the particle force-field response near the cursor.
IsClickToConnectEnabledtrueAllows clicking two countries to create a connection arc.

Day/night and clock ​

PropertyDefaultUsage
ShowDayNightfalseEnables the day/night lighting layer.
IsRealTimeEnabledtrueUses current real time when the layer is enabled.
CustomTimeCurrent UTC time at registrationTime used when real-time mode is disabled.
TimeSpeed0 hours/secondSimulation-time speed.
CurrentSunTimeRead-onlyCurrent UTC sun time used by the renderer.

Flow layer ​

PropertyDefaultUsage
ShowFlowfalseShows the flow particles. With no custom field, the built-in wind field is used.
FlowParticleCount2500Requested flow-particle count; clamped to 100..20000.
FlowSpeed1.0Flow animation multiplier; clamped to 0..20.
FlowTrailLength10Trail samples; clamped to 3..16.

Events, markers, and arcs ​

PropertyDefaultUsage
ShowEventstrueShows event spikes and rings.
IsEventRippleEnabledtrueAdds a land-particle ripple for each event.
ShowEventLabelstrueShows event labels.
EventDuration4.5 secondsEvent lifetime; internally clamped to 0.5..30 seconds.
MarkersBuilt-in city markersEnumerable of ParticleGlobeMarker; assign a collection to replace/update markers.
ShowMarkerLabelstrueShows labels beside markers.
ShowCountryBarsfalseShows value bars for countries with loaded values.
BarMaxHeight0.3 globe radiiMaximum value-bar height.

Compare mode and timeline ​

PropertyDefaultUsage
IsCompareModeEnabledfalseEnables click-two-countries comparison.
CompareFlightSpeedKmh850 km/hFlight-time estimate speed; clamped to 50..100000.
TimelineFrameCount0Read-only number of loaded timeline frames.
IsTimelinePlayingfalseStarts/stops interpolation playback; playback requires at least two frames.
TimelineLooptrueLoops playback at the end.
TimelineSpeed1 frame/secondPlayback speed; clamped to 0.05..30.
TimelinePosition0Fractional frame index; setting it scrubs and interpolates.
TimelineLabelEmptyRead-only label for the nearest frame.

Tour and intro ​

PropertyDefaultUsage
IsIntroEnabledtrueEnables the initial particle-assembly animation.
IntroDuration3 secondsIntro animation duration.
TourDwellSeconds3 secondsDwell at each marker; internally clamped to 0.5..60.
TourZoom1.8Zoom used at tour stops.
IsTourOrbitEnabledtrueAdds orbit motion while touring.
IsTourDepthOfFieldEnabledtrueEnables tour depth-of-field/dimming.
TourDimAmount0.65Tour dim strength; clamped to 0..1.
IsTourLoopingtrueRestarts at the first marker after the last.
IsTourActiveRead-onlyIndicates whether a tour is running.

HUD and rendering quality ​

PropertyDefaultUsage
ShowSatellitestrueShows satellite objects and trails.
SatelliteCount6Satellite count; clamped to 0..24.
ShowCoordinateTickertrueShows the coordinate ticker.
ShowScanlinestrueShows CRT scanlines.
ShowGlitchtrueEnables occasional glitch effects.
QualityAutoAuto, High, Medium, or Low rendering quality.
QualityTargetFps55 FPSTarget for automatic quality; clamped to 30..144.
EffectiveQualityRead-only, starts at 1.0Current retained-particle fraction.
MeasuredFpsRead-only, starts at 0Smoothed measured frame rate.
ShowProfilerfalseShows the profiler overlay.
IsFlatMapEnabledfalseMorphs the globe into a flat map.
FlatMapModeScrollFlat-map behavior: Scroll, Fixed, or FixedZoom.
MorphDuration2.2 secondsFull morph transition duration.

Methods ​

MethodBehavior
FlyTo(double latitude, double longitude, double zoom = 0)Animates to coordinates. zoom = 0 selects the configured/default fly-to zoom.
FlyToCountry(string code)Flies to a loaded country; returns false if the code is unknown.
ResetView()Releases the current fly-to/zoom and returns to the default view.
CompareCountries(string codeA, string codeB)Compares two loaded countries; returns false for unknown or identical countries. Raises CompareChanged on success.
ClearCompare()Clears the active comparison.
AddArc(ParticleGlobeMarker from, ParticleGlobeMarker to, Color? color = null)Adds a persistent user arc between marker coordinates; returns its handle or null if the path is degenerate.
AddArc(double fromLatitude, double fromLongitude, double toLatitude, double toLongitude, Color? color = null)Coordinate overload of AddArc.
RemoveArc(ParticleGlobeArc arc) / ClearArcs()Removes one user arc or all user arcs.
SetCountryValues(IReadOnlyDictionary<string, double> values, Color low, Color high)Colors country particles by values keyed by country code.
GetCountryCodes() / ClearCountryValues()Gets loaded country codes or clears current value data.
SetCountryValueTimeline(IReadOnlyList<(string Label, IReadOnlyDictionary<string, double> Values)> frames, Color low, Color high)Loads per-frame country values, normalized across frames and interpolated during playback/scrubbing.
ClearCountryValueTimeline()Clears timeline and country-value data.
SetFlowField(Func<double, double, (double U, double V)> sampler, int columns = 180, int rows = 90)Samples a callback on a grid; latitude/longitude are degrees and U/V are east/north metres per second.
SetFlowGrid(int columns, int rows, float[] u, float[] v)Sets a raw grid. Arrays must contain at least columns * rows values; row 0 is north, last row south, longitude columns wrap.
ClearFlowField()Restores the built-in wind field.
AddEvent(double latitude, double longitude, double magnitude = 5, Color? color = null, string label = null) / ClearEvents()Adds an event (magnitude is clamped to 0..10) or clears active events. AddEvent is safe to call from any thread.
StartTour() / StopTour()Starts visiting markers in collection order or stops the tour.
ReplayIntro()Scatters particles and replays the intro animation.

Events ​

EventEvent dataPurpose
CountryClickedParticleGlobeCountryEventArgs (Code, Name)A country was clicked.
SelectionChangedParticleGlobeSelectionChangedEventArgs (OldCode, OldName, NewCode, NewName)The selected country changed.
MarkerClickedParticleGlobeMarkerEventArgs (Marker)A marker was clicked.
CompareChangedParticleGlobeCompareEventArgs (CodeA, NameA, CodeB, NameB, DistanceKm, FlightTime)A comparison was completed.
TimelineChangedstring labelTimeline playback or scrubbing changed the nearest frame.
TourMarkerReachedParticleGlobeMarkerEventArgs (Marker)The tour arrived at a marker.
TourEndedEventArgsA non-looping tour completed or no markers remain.

Examples ​

Country selection, navigation, and values ​

csharp
using System.Collections.Generic;
using Windows.UI;

Globe.CountryClicked += (_, e) =>
    System.Diagnostics.Debug.WriteLine($"{e.Name} ({e.Code})");

Globe.FlyToCountry("DE");
Globe.SetCountryValues(new Dictionary<string, double>
{
    ["DE"] = 83,
    ["IR"] = 88,
    ["US"] = 331,
}, Color.FromArgb(255, 220, 235, 255), Color.FromArgb(255, 0, 70, 160));
Globe.ShowCountryBars = true;

Custom flow field ​

csharp
Globe.SetFlowField((latitude, longitude) =>
{
    double eastward = 8.0 * Math.Cos(latitude * Math.PI / 180.0);
    double northward = 0.0;
    return (eastward, northward);
});
Globe.ShowFlow = true;

Markers, arcs, and tours ​

csharp
var markers = new List<ParticleGlobeMarker>
{
    new(35.7, 139.7, "Tokyo"),
    new(51.5, -0.1, "London"),
};
Globe.Markers = markers;
Globe.AddArc(markers[0], markers[1]);
Globe.StartTour();

ParticleGlobeMarker.CreateDefaults() returns the built-in city marker collection. Assign an ObservableCollection<ParticleGlobeMarker> to Markers when collection changes should update the display automatically.

Each marker has latitude, longitude, label, optional color, and a Tag property for arbitrary application data.

ParticleGlobe

Demo ​

you can run demo and see this feature.

Released under the MIT License.