2026-05-22 18:14:35 +02:00
2026-05-22 18:14:35 +02:00
2026-05-22 18:14:35 +02:00
2026-05-22 18:14:35 +02:00
2026-05-22 18:14:35 +02:00
2026-05-22 18:14:35 +02:00

dpg-map

dpg-map is a Dear PyGui map widget package under rebuild.

The Step 5 interaction layer is in place:

import dpg_map as dpgm

provider = dpgm.TileProvider(
    name="custom",
    url_template="https://example.com/{z}/{x}/{y}.png",
    attribution="Tiles (c) Example",
)
dpgm.register_provider(provider)

with dpgm.map_widget(tag="map", center=(47.9029, 1.9093), zoom=15):
    dpgm.add_marker("vehicle", lat=47.9029, lon=1.9093)

dpgm.update_marker("vehicle", lat=47.9030, lon=1.9094, map_tag="map")

Implemented so far:

  • public package exports
  • tile provider definitions and registry
  • Web Mercator projection helpers
  • thread-safe logical map state and map registry
  • command queue with coalescing for overlay and view updates
  • logical marker, polyline, trajectory, and layer models
  • persistent disk cache paths, metadata, scanning, pruning, and clearing
  • Dear PyGui child_window + measured-size drawlist widget shell
  • GUI-thread frame pump that drains commands, manages textures, and draws raster tiles
  • sizing helpers that preserve the last non-zero size across hidden layouts
  • asynchronous tile workers that read disk cache, fetch HTTP, and decode images
  • memory cache with visible-tile protection and GUI-thread texture deletion
  • measured-rectangle mouse interaction for left-drag panning and wheel zooming
  • programmatic view commands and screen/latitude-longitude conversion helpers

Overlay drawing is not implemented yet. Step 6 will add overlay rendering and live update stress examples.

Examples:

uv run python examples/basic_map.py
uv run python examples/sizing_window.py
uv run python examples/sizing_child.py
uv run python examples/sizing_table.py
uv run python examples/hidden_tab.py
uv run python examples/cache_stress.py
Description
No description provided
Readme 219 KiB
Languages
Python 100%