Adds an experimental setting that injects a geolocation button into the map views of the official Obsidian Maps plugin. Clicking the button recenters the map on the user's current position (device GPS with IP-based fallback) and drops a blue location marker; re-clicking updates it. Disabling the toggle cleanly removes the button and marker from all open maps. The integration hooks into Obsidian's Bases view registry and wraps the MapView factory, so existing map views need a tab close/reopen to pick up the button. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .github/workflows | ||
| src | ||
| .gitignore | ||
| appicon.png | ||
| CHANGELOG.md | ||
| esbuild.config.mjs | ||
| eslint.config.mjs | ||
| LICENSE | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| styles.css | ||
| tsconfig.json | ||
Geocode Note
An Obsidian plugin that adds geographic metadata to your notes — coordinates, marker icon, and color — stored in the YAML frontmatter.
Designed to work seamlessly with map plugins like Obsidian Map View.
Features
- Four ways to set coordinates:
- Current location — Uses device geolocation (GPS on mobile, IP-based fallback on desktop)
- Address search — Powered by OpenStreetMap Nominatim (free, no API key needed)
- Manual entry — Type latitude and longitude directly
- Draggable map marker — Fine-tune the position on an interactive Leaflet map (CartoCDN tiles); the address is refreshed via reverse geocoding
- Resolved address saved to frontmatter — Keeps the human-readable address alongside the coordinates
- Update mode — Reopen a previously geocoded note and the modal reloads existing coordinates, icon, color and address for quick edits
- Prefill from note content — Configure the plugin to prefill the address search from the note title or from the frontmatter
addressfield - Icon picker — 42 icons from Lucide organized in 4 categories (Places, Nature, Transport, Activities)
- Color picker — 10 color options for your map marker
- Bulk export — Export every geocoded note from your vault to standard formats (GeoJSON, KML, GPX, CSV) in one click
- Obsidian Maps integration (experimental) — Optionally inject a geolocation button into the map view of the official Obsidian Maps plugin; clicking it recenters the map on your position and drops a marker dot
- Mobile-friendly — Responsive UI with large touch targets, works on both phone and desktop
- No API key required — All services used are free and open
Frontmatter format
The plugin writes the following fields to your note's YAML frontmatter:
---
coordinates:
- "48.85837"
- "2.294481"
icon: "landmark"
color: "red"
address: "Tour Eiffel, 5, Avenue Anatole France, Paris, France"
---
| Field | Description |
|---|---|
coordinates |
Array of two strings: latitude and longitude |
icon |
Lucide icon name for the map marker |
color |
Color name for the map marker |
address |
Human-readable address resolved from the geocoder (omitted when coordinates come from manual entry or pure geolocation) |
Usage
Opening the plugin
Option 1: Click the map pin icon in the left ribbon.
Option 2: Open the command palette (Ctrl/Cmd + P) and search for "Geocode current note".
Setting coordinates
- Current location — Click "My current location". On mobile, the device GPS is used. On desktop, an approximate IP-based location is provided.
- Address search — Type an address in the search field and press Enter or click the search button. The first result from OpenStreetMap is used, and its full address is stored in the
addressfrontmatter field. - Manual entry — Click "Enter coordinates manually" to reveal latitude/longitude fields.
- Fine-tune on the map — Once coordinates are set, a Leaflet map appears. Drag the marker to adjust the position; the
addressfield is refreshed automatically via reverse geocoding.
Choosing an icon
Select an icon from the visual grid. Icons are grouped into categories:
| Category | Examples |
|---|---|
| Places | Pin, Home, Building, Landmark, Church, Castle, Hotel, Hospital... |
| Nature | Tree, Pine, Forest, Mountain, Flower, Camping, Sea... |
| Transport | Car, Bus, Train, Plane, Ship, Bike, Gas station... |
| Activities | Coffee, Restaurant, Bar, Shopping, Gym, Music, Photo... |
Choosing a color
Click one of the 10 color circles: red, blue, green, orange, purple, yellow, pink, teal, gray, or black.
Saving
Click "Save" to write the coordinates, icon, color and address to the note's frontmatter.
Updating an existing note
If the active note already contains geocoding data, opening the modal switches to update mode: the existing coordinates, icon, color and address are preloaded, the map is centered on the current position, and saving overwrites the frontmatter fields in place.
Settings
Open Settings → Community plugins → Geocode Note to access two sections:
Options
| Option | Values | Description |
|---|---|---|
| Prefill search field | Nothing (default), Note title, Frontmatter "address" field |
When the modal opens, the address search input is prefilled with the selected source. In update mode the existing address is preferred; this fallback is used when it is missing. |
Experimental
| Option | Description |
|---|---|
| Add locate button to Obsidian Maps | When the official Obsidian Maps plugin is installed and enabled, injects a geolocation button into each Bases map view. Clicking it centers the map on the user's current position (device GPS, with IP-based fallback) and draws a blue location marker. Re-clicking updates the marker. Disabling the option cleanly removes the button and marker from all open maps. |
This option hooks into internals of the Obsidian Maps plugin that are not part of its public API and may break with future updates of that plugin. If the button does not appear, try closing and reopening the base tab after toggling the option.
Export
Scans every note in the vault that has a coordinates frontmatter field and generates a download in the chosen format. The settings panel shows how many geocoded notes are currently available.
| Format | Extension | Use case |
|---|---|---|
| GeoJSON (RFC 7946) | .geojson |
Leaflet, Mapbox, QGIS, ArcGIS, and most modern web mapping libraries |
| KML 2.2 | .kml |
Google Earth, Google My Maps |
| GPX 1.1 | .gpx |
GPS devices and outdoor apps (each note is exported as a waypoint) |
| CSV | .csv |
Excel, Numbers, Google Sheets, data analysis pipelines |
Each exported entry carries the note's title, coordinates and resolved address; GeoJSON and CSV additionally include the icon, color and vault path. Files are named geocoded-notes-YYYY-MM-DD.<ext>.
Installation
From Obsidian Community Plugins (coming soon)
- Open Settings > Community plugins > Browse
- Search for "Geocode Note"
- Click Install, then Enable
Manual installation
- Download
main.js,manifest.json, andstyles.cssfrom the latest release - Create a folder:
<your-vault>/.obsidian/plugins/geocode-note/ - Copy the three files into that folder
- Open Obsidian > Settings > Community plugins > Enable "Geocode Note"
Development
# Clone the repo
git clone https://github.com/blamouche/obsidian-geocode-note.git
cd obsidian-geocode-note
# Install dependencies
npm install
# Build (one-time)
npm run build
# Development mode (watch & rebuild on changes)
npm run dev
For hot-reload during development, install the Hot Reload plugin and create an empty .hotreload file in the plugin folder.
Available icons
All icons come from Lucide and are built into Obsidian.
Full icon list (42 icons)
Places: map-pin, home, building-2, landmark, church, castle, hotel, school, library, store, warehouse, factory, hospital
Nature: tree-deciduous, tree-pine, trees, mountain, mountain-snow, flower-2, leaf, tent, waves
Transport: car, bus, train-front, plane, ship, bike, fuel, anchor
Activities: coffee, utensils, beer, wine, shopping-cart, dumbbell, music, camera, star, heart, flag, globe
Available colors
red, blue, green, orange, purple, yellow, pink, teal, gray, black