[feat] feature icons and feature labels #3

Merged
brad merged 7 commits from features into main 2026-01-10 17:25:13 -08:00
Owner
No description provided.
The label text was not being extracted because it appears as the 'tail'
of the <location> child element in the XML, not as direct text content
of the <label> element.

Changes:
- Updated parse_label() to check location.tail for text content
- Added fallback to label_elem.text for alternate formats
- Added explanatory comments about XML structure

Result:
 All 143 labels from Aendrim map now render with proper text
 Labels display with correct styling (bold, scale, color, etc.)
 Labels positioned using same coordinate transform as features

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Three critical fixes for label rendering:

1. PRECISE POSITIONING: Labels now use exact sub-hex positioning
   - Removed hex grid snapping (Math.round calls)
   - Labels now position at precise pixel coordinates from Worldographer
   - Prevents labels from jumping to nearest hex center

2. OUTLINE PROPERTIES: Added proper stroke rendering
   - Parser now extracts outlineColor and outlineSize from WXX
   - HTML template uses these properties instead of hardcoded values
   - Respects Worldographer's outline styling

3. ITALIC STYLING: Working as intended
   - Labels like "Barony of Dalrath" are marked italic in Worldographer
   - This is intentional styling, not a bug

Technical changes:
- wxx_parser.py: Added outlineColor and outlineSize extraction
- hex-map-prototype.html: Direct coordinate scaling without hex snapping
- hex-map-prototype.html: Dynamic stroke properties from label data

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed label positioning by using the exact same coordinate transformation
as features (just without hex grid snapping).

The transformation now:
1. Removes Worldographer offset/scale: base = (coord - 150) / scale
2. Converts to hex grid coordinates (preserving float precision)
3. Applies hexToPixel formula with exact values

This ensures labels appear in the correct regions across the map while
maintaining sub-hex positioning precision.

Verified: Labels now distributed correctly across entire map area

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
In Worldographer, outlineSize=1.0 means no outline.
Only apply stroke when outlineSize > 1.0.

Result:
- 110 labels with size=1.0: no outline (cleaner appearance)
- 33 labels with size=5.0: thick outline (region names)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
brad merged commit 486c4c79db into main 2026-01-10 17:25:13 -08:00
brad deleted branch features 2026-01-10 17:25:19 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dungeonchurch/webographer!3
No description provided.