The default map feature was not working on page refresh because the
onloadBehavior dropdown value was not being persisted or restored.
Changes:
- main.js: Restore onloadBehavior from localStorage on page load
- save.js: saveAsDefaultMap() now saves "default" to localStorage
- save.js: clearDefaultMap() now removes the localStorage setting
- index.html: Update version hashes to 1.108.13
Now when users click "Set as default", the setting persists across
page refreshes and their default map loads automatically.
Add typeof checks for all function calls to modules loaded with defer attribute.
This prevents ReferenceError when loading old maps (1.108.11) in version 1.108.13.
Functions protected:
- getCurrentPreset() - from style.js
- addCustomColorScheme() - from style.js
- updateTextureSelectValue() - from style.js
- focusOn() - from editors.js
- invokeActiveZooming() - from zoom.js
- fitMapToScreen() - from zoom.js
- declareFont() - from fonts.js
- moveBurgToGroup() - from burgs.js (3 locations)
This fixes zoom/pan issues when loading old maps.
Add comprehensive Obsidian integration as intermediate step toward
PostgreSQL migration, enabling modern Markdown-based note editing:
**Features:**
- Obsidian Local REST API integration for vault access
- Coordinate-based note matching (searches vault YAML frontmatter)
- Shows top 5-8 closest matches when clicking burgs/markers
- Modern Markdown editor with live preview
- [[Wikilink]] support for connecting notes
- "Open in Obsidian" button to jump to native app
- Configuration UI for API setup and testing
**Technical Implementation:**
- modules/io/obsidian-bridge.js - Core API integration layer
- modules/ui/obsidian-notes-editor.js - Markdown editor UI
- modules/ui/obsidian-config.js - Configuration panel
- OBSIDIAN_INTEGRATION.md - Complete setup/usage guide
**Coordinate Matching:**
- Parses YAML frontmatter for x/y coordinates
- Calculates distance to clicked element
- Supports nested (coordinates.x) and flat (x:) formats
- Handles missing FMG IDs (common with PostgreSQL imports)
**User Workflow:**
1. Configure Obsidian REST API connection
2. Click burg/marker in FMG
3. System finds matching notes by coordinates
4. Select note or create new one
5. Edit in modern Markdown editor
6. Save syncs to Obsidian vault instantly
This replaces the "Win95-style TinyMCE" editor with a clean,
modern Markdown experience while maintaining compatibility with
the eventual PostgreSQL backend migration. Users can edit notes
in either FMG or Obsidian - both stay in sync via file system.
Version: 1.108.13
Add ability to set a specific map as the default that opens on load:
- Add 'Open default map' option to onload behavior dropdown
- Implement saveAsDefaultMap() to store map as default in IndexedDB
- Implement clearDefaultMap() to remove default map setting
- Modify checkLoadParameters() to load default map when configured
- Add UI buttons in Save dialog for setting/clearing default map
- Update version to 1.108.12 and hash in index.html
Users can now:
1. Open any map they want as default
2. Go to Options > Onload behavior > Select "Open default map"
3. Save > Click "Set as default" button
4. The map will now open automatically every time
This sets the foundation for the planned time-based worldbuilding
and lore database features by ensuring users always start with
their primary world map.
Add detailed documentation to help AI assistants understand and work
with the Fantasy Map Generator codebase, including:
- Project architecture and technology stack
- Directory structure and file organization
- Data model and core concepts (pack object, Voronoi mesh)
- Code conventions and module patterns
- Development workflow and versioning process
- Common development tasks and patterns
- Performance considerations and best practices
- Troubleshooting guide and quick reference
This guide provides AI assistants with essential context about the
codebase's unique characteristics (no build system, global object
pattern, typed arrays, D3.js rendering) to enable more effective
contributions.
The id field for geojson export was not consistent with csv exports.
Removes the prefix on routes, rivers and markers geojson, and on
markers csv, to make them all use only an integer as id.
This makes it easier to import and do joins in other software.