界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

map-and-layers

map-and-layers

【效率与协作】Create, embed, and troubleshoot Folium maps with tiles, markers, popups, layer controls, vector and raster overlays, and browser export.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: map-and-layers description: "Create, embed, and troubleshoot Folium maps with tiles, markers, popups, layer controls, vector and raster overlays, and browser export." disable-model-invocation: true metadata: disco-role: operating license: NOASSERTION

Map and layers

Use this sub-skill when the task is about building a Folium map from scratch, composing layers, choosing tiles, adding markers or overlays, exporting HTML or PNG, or embedding Folium in a web app.

Use when

  • you need a base Map or Figure
  • you want tiles, markers, popups, tooltips, icons, or layer controls
  • you need vector or raster overlays such as polylines, polygons, circles, rectangles, image overlays, or video overlays
  • you need custom panes, JS/CSS resource overrides, notebook HTML, or Flask embedding
  • you need to save or render the map and diagnose PNG export behavior

Route elsewhere

  • GeoJSON/TopoJSON/choropleth binding, tooltips, popups, and coordinate-order diagnostics -> ../geojson-and-data/SKILL.md
  • clustering, draw/search/time, vector tiles, or WebGLEarth -> ../plugins/SKILL.md

Working order

  1. Pick the smallest map that proves the use case.
  2. Choose a base tile strategy early: built-in tiles, custom URL, or tiles=None.
  3. Add markers and overlays to FeatureGroup or LayerGroup when the layer should be toggled.
  4. Add LayerControl last.
  5. Use CustomPane only when layer ordering matters.
  6. Save HTML or embed the map once the layer stack is correct.
  7. If the user wants a PNG snapshot, confirm the Selenium/browser dependencies first.

Bundled references

Bundled scripts

Quick reminders

  • Map locations and marker positions use [lat, lon].
  • LayerControl should be added after the layers it controls.
  • TileLayer needs attribution for custom tile URLs.
  • ImageOverlay and VideoOverlay are browser-rendered; HTML generation alone does not prove visual correctness.
  • png_enabled=True switches PNG export on, but screenshot capture still needs Selenium and a browser driver.
  • JsCode is the right wrapper when a Folium callback expects JavaScript instead of a Python callable.
我的收藏