No description
Find a file
Benoit 63015be761
Merge pull request #7 from blamouche/feat/maplibre-match-obsidian-maps
v1.5.0: migrate to MapLibre GL with OpenFreeMap styles
2026-04-22 06:17:45 +02:00
.github/workflows Add Geocode Note plugin v1.0.0 2026-04-14 22:57:15 +02:00
src v1.5.0: migrate to MapLibre GL with OpenFreeMap styles 2026-04-21 23:47:26 +02:00
.gitignore Add Geocode Note plugin v1.0.0 2026-04-14 22:57:15 +02:00
appicon.png Add app icon to README header 2026-04-20 10:04:47 +02:00
CHANGELOG.md v1.5.0: migrate to MapLibre GL with OpenFreeMap styles 2026-04-21 23:47:26 +02:00
esbuild.config.mjs v1.5.0: migrate to MapLibre GL with OpenFreeMap styles 2026-04-21 23:47:26 +02:00
eslint.config.mjs v1.2.0: Add bulk export of geocoded notes (GeoJSON, KML, GPX, CSV) 2026-04-20 22:33:13 +02:00
LICENSE Add README documentation, LICENSE and CHANGELOG 2026-04-14 23:06:36 +02:00
manifest.json v1.5.0: migrate to MapLibre GL with OpenFreeMap styles 2026-04-21 23:47:26 +02:00
package-lock.json v1.5.0: migrate to MapLibre GL with OpenFreeMap styles 2026-04-21 23:47:26 +02:00
package.json v1.5.0: migrate to MapLibre GL with OpenFreeMap styles 2026-04-21 23:47:26 +02:00
README.md v1.3.0: Add locate button to Obsidian Maps (experimental) 2026-04-20 23:38:56 +02:00
styles.css v1.5.0: migrate to MapLibre GL with OpenFreeMap styles 2026-04-21 23:47:26 +02:00
tsconfig.json Add Geocode Note plugin v1.0.0 2026-04-14 22:57:15 +02:00

Geocode Note

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 address field
  • 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

  1. Current location — Click "My current location". On mobile, the device GPS is used. On desktop, an approximate IP-based location is provided.
  2. 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 address frontmatter field.
  3. Manual entry — Click "Enter coordinates manually" to reveal latitude/longitude fields.
  4. Fine-tune on the map — Once coordinates are set, a Leaflet map appears. Drag the marker to adjust the position; the address field 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)

  1. Open Settings > Community plugins > Browse
  2. Search for "Geocode Note"
  3. Click Install, then Enable

Manual installation

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Create a folder: <your-vault>/.obsidian/plugins/geocode-note/
  3. Copy the three files into that folder
  4. 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

License

MIT