← ClaudeAtlas

creating-staticmap-mapslisted

Use when generating static map images with the Python `staticmap` library — embedding isochrone or drive-time polygon maps in Word (.docx) reports, placing facility or location markers over polygon fills using PIL, sizing maps for page layout, or debugging CircleMarker visibility, `m.transformer` AttributeErrors, or coordinate conversion failures. Triggers on: trade area map, isochrone map, drive-time map, map image too large, legend pushed to next page, markers not appearing, blank page in docx.
walsh-investment/clean-slate-import · ★ 0 · Data & Documents · score 38
Install: claude install-skill walsh-investment/clean-slate-import
# Creating Staticmap Maps ## Overview Covers generating a static map with the `staticmap` library, manually drawing visible markers and labels with PIL after `m.render()`, embedding the map in a Word document at the correct size, and embedding the legend inside the image so no separate legend paragraph is needed. ## Required Tools This skill requires the following tools at runtime: - **staticmap** — Tile-based static map rendering (`pip install staticmap`) - **Pillow (PIL)** — Manual marker and legend drawing after `m.render()` (`pip install Pillow`) - **python-docx** — Embedding the final map image in a Word document (`pip install python-docx`) **Before starting**: Verify that `staticmap`, `Pillow`, and `python-docx` are installed. If any are unavailable, STOP and inform the user which step cannot proceed. Do NOT silently substitute plain-image output for docx embedding. --- ## Critical Pitfalls (Read First) ### 1. `CircleMarker` is invisible under polygon fills **Problem**: `staticmap.CircleMarker` is composited *below* `Polygon` fills. If you add isochrone polygons (even with low alpha like `#FF000030`), any `CircleMarker` added via `m.add_marker()` will be invisible underneath them. **Never do this:** ```python m.add_marker(CircleMarker((lon, lat), "#FF0000", 14)) # INVISIBLE under polygons ``` **Fix**: Do NOT call `m.add_marker()` at all. Draw markers manually with PIL *after* `m.render()`, so they appear on top of everything. --- ### 2. `m.transformer` doe