UI World View

ui-world-view is a compact zoomable world-map viewer built on the beta UI framework. It combines bitmap rendering, custom viewport logic, reusable horizontal and vertical scroll bars, and generated map data in one demo.

Use This Demo When You Need…

  • A realistic example of a custom paint surface inside ui::Application.

  • A reference for combining Bitmap rendering with HeaderLine, FooterLine, actions, and scroll bars.

  • An example of building the UI shell first, then loading command line selected data into that shell.

  • A small end-to-end example of shipping generated demo data without any runtime rendering dependencies.

Run the Demo

Start the demo from the build directory:

$ ./cmake-build-debug/demo-apps/ui-world-view

Use the arrow keys to pan, + or ] to zoom in, - or [ to zoom out, L to toggle labels, C to toggle the latitude/longitude grid, and Q or Esc to quit.

Captured Output (80x25)

 UI World View              zoom 2/4  labels on  grid on              240 x 120
    120W                                                                                                     │                                       │
│                                       │
│                                       │
│                                       │                                      │                                       │                                      │                                       │                                      60N────────────────────────────────────┼──────────────────────────────────────Canada                ↓
←░░░░░░▏            ▕░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░→
 x 20..59  y 11..32       Arrows pan  +/] in  -/[ out  L labels  C grid  Q quit

Features Demonstrated

  • HorizontalScrollBar and VerticalScrollBar driven from a custom viewport model.

  • Demo-local composite layout with a viewport, both scroll bars, and a corner filler surface.

  • One multi-key Action for compact cursor-key panning and footer help.

  • processCommandLineArguments() used to load world-map.txt and attach the map panel before the UI event system starts.

  • CharCombinationStyle::commonBoxFrame() to combine latitude and longitude grid crossings on top of the map.

  • A generated world-map.txt asset loaded at runtime without external dependencies.

  • Country label overlays that stay available at lower zooms when collision filtering leaves enough room.

  • Pinned coordinate labels and a toggleable grid overlay rendered above the map terrain.

Relevant Source Files

If you want to explore the implementation, start with demo/ui-world-view/src/UiWorldViewApp.cpp, demo/ui-world-view/src/WorldMapData.cpp, and demo/ui-world-view/src/WorldMapView.cpp.