panel-map

GitHub

基于Leaflet的地理可视化面板,支持NavSatFix、GeoJSON等GPS数据。核心包含FilteredPointLayer,通过像素级稀疏网格去重优化渲染性能,实现海量点位的高效展示与自动居中功能。

.github/skills/panel-map/SKILL.md lichtblick-suite/lichtblick

Trigger Scenarios

需要查看或调试GPS轨迹数据 分析地图面板的性能瓶颈 配置自定义瓦片图层或地图行为

Install

npx skills add lichtblick-suite/lichtblick --skill panel-map -g -y
More Options

Non-standard path

npx skills add https://github.com/lichtblick-suite/lichtblick/tree/develop/.github/skills/panel-map -g -y

Use without installing

npx skills use lichtblick-suite/lichtblick@panel-map

指定 Agent (Claude Code)

npx skills add lichtblick-suite/lichtblick --skill panel-map -a claude-code -g -y

安装 repo 全部 skill

npx skills add lichtblick-suite/lichtblick --all -g -y

预览 repo 内 skill

npx skills add lichtblick-suite/lichtblick --list

SKILL.md

Frontmatter
{
    "name": "panel-map",
    "description": "Deep Map panel knowledge: Leaflet lifecycle, NavSatFix\/LocationFix\/GeoJSON handling, tile layers, and the FilteredPointLayer pixel-deduplication grid that bounds rendering cost."
}

Panel Map Skill

A geographic visualization tool built on Leaflet for displaying GPS/NavSatFix data.

Structure

panels/Map/
├── MapPanel.tsx          # main panel, Leaflet lifecycle, PanelExtensionContext
├── FilteredPointLayer.ts # performance-critical point deduplication
├── support.ts            # message type detection (NavSatFix, GeoJSON, GPS)
└── config.ts             # settings tree, tile layer config

Leaflet Integration

  • Map instance created on mount, destroyed on unmount
  • Tile layers configurable (OpenStreetMap default, custom tile servers)
  • Markers use FeatureGroup for efficient bulk operations
  • View can follow the latest GPS point (auto-center)

FilteredPointLayer (Performance Critical)

Pixel-deduplication using a sparse 2D grid.

Problem

GPS at 10 Hz for 1 hour = 36,000 points. Rendering each as a Leaflet marker is prohibitively slow.

Solution

Screen space is divided into a sparse grid of pixel-sized cells.
Each cell holds at most ONE marker.
Points overlapping in screen space → only one is rendered.
On zoom change → the grid is recalculated.

Implementation

  • Sparse 2D grid indexed by `${Math.floor(pixelX)},${Math.floor(pixelY)}`
  • A new point mapping to an occupied cell is skipped (deduplicated)
  • Result: O(visible pixels) markers instead of O(data points)
  • Zoom in → more cells visible → more points; zoom out → heavy dedup → fast

Supported Message Types

Message Type Fields Used
sensor_msgs/NavSatFix latitude, longitude, altitude
sensor_msgs/msg/NavSatFix (ROS 2 variant)
foxglove.LocationFix latitude, longitude, altitude
GeoJSON Feature / FeatureCollection geometry

Performance Notes

  • FilteredPointLayer is the primary optimization — bounds rendering cost
  • FeatureGroup enables bulk add/remove (single DOM update)
  • Only the visible viewport bounds are processed
  • Leaflet handles tile caching internally
  • An upper bound on stored points prevents unbounded memory growth

Key Files

  • packages/suite-base/src/panels/Map/MapPanel.tsx
  • packages/suite-base/src/panels/Map/FilteredPointLayer.ts
  • packages/suite-base/src/panels/Map/support.ts
  • packages/suite-base/src/panels/Map/config.ts

Version History

  • cab9317 Current 2026-07-24 12:17

Same Skill Collection

.github/skills/3d-rendering/SKILL.md
.github/skills/caching-internals/SKILL.md
.github/skills/deserialization/SKILL.md
.github/skills/e2e-playwright-mcp/SKILL.md
.github/skills/electron-internals/SKILL.md
.github/skills/extensions-internals/SKILL.md
.github/skills/layouts-internals/SKILL.md
.github/skills/mcap-format/SKILL.md
.github/skills/message-path/SKILL.md
.github/skills/message-pipeline/SKILL.md
.github/skills/panel-extension-api/SKILL.md
.github/skills/panel-image/SKILL.md
.github/skills/panel-log/SKILL.md
.github/skills/panel-raw-messages/SKILL.md
.github/skills/panel-state-transitions/SKILL.md
.github/skills/panel-user-scripts/SKILL.md
.github/skills/performance/SKILL.md
.github/skills/player-internals/SKILL.md
.github/skills/plot-internals/SKILL.md
.github/skills/remote-caching/SKILL.md
.github/skills/test-conventions/SKILL.md
.github/skills/theme/SKILL.md
.github/skills/unit-testing/SKILL.md
.github/skills/web-workers/SKILL.md
.github/skills/websocket-connection/SKILL.md

Metadata

Files
0
Version
cab9317
Hash
a7f33309
Indexed
2026-07-24 12:17

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-07 11:26
浙ICP备14020137号-1 $Carte des visiteurs$