Obsidian Map View

repository·master·Indexed 21 days ago

https://github.com/esm7/obsidian-map-view

An interactive map plugin for Obsidian.md (version 6.1.4) that transforms notes into a geographic information system (GIS) by extracting geolocations and paths. It supports adding geolocations via front matter, inline links, and KML imports, as well as a rule-based system for customizing marker and path displays. Includes CLI tools for geosearching, distance calculation, and marker querying, and integrates with Obsidian Bases.

Tokens
28.8K
Snippets
97
Records
179
Agent score
74%

What's inside obsidian-map-view

  1. Overview of Obsidian Map View features

    master

    Obsidian Map View transforms an Obsidian vault into a personal geographic information system (GIS). Key capabilities include:

    • Geolocation in Notes: Store locations in note front matter or as inline links. Supports multiple locations per note.
    • Powerful Queries: Use a boolean query language to filter map markers by tags, paths, linked notes, and properties.
    • Display Rules: Customize marker icons, badges, colors, and path styles using the same query language used for filtering.
    • Paths & Shapes: View and edit paths in GPX, KML, TCX, and GeoJSON formats. Includes an 'Edit Mode' for drawing directly on the map.
    • Routing: Calculate driving, cycling, and walking routes via the GraphHopper API or external services.
    • Offline Maps: Automatic tile caching and batch-downloading for offline access.
    • Obsidian Bases Integration: Enhanced querying and display capabilities.
    • Claude Integration: Use CLI commands to allow Claude to research locations and add geolocations/pins directly to your notes.
  2. Build a personal GIS with Map View

    master

    Transform your vault into a Geographic Information System (GIS) using a three-step workflow:

    1. Collection

    Gather notes containing geographic data (recommendations, articles, etc.).

    2. Processing

    Ensure your notes have geographic context:

    • For specific places: Use "add geolocation (front matter) to current note" to attach a location to a Zettelkasten-style note. Use metadata tags like #hike, #food, or #activity for filtering.
    • For lists of places: Use inline geolocation links within a single note. You can map the "Map View: add inline geolocation link" command to a shortcut (e.g., Alt+L) for faster entry.

    3. Querying

    Use Map View to discover information based on specific needs:

    • Visual Discovery: Browse the map to see what you know about an area.
    • Tag Queries: Use boolean logic to find specific combinations, such as #dogs AND #sleep to find dog-friendly camping sites.
  3. Compare Obsidian Map View with other map plugins

    master

    If you are evaluating map plugins for Obsidian, consider these alternatives:

    • Obsidian Map View: Best for a full GIS experience with boolean querying, display rules, and path editing.
    • Obsidian Maps: The map plugin maintained by the official Obsidian developers.
    • Obsidian Leaflet: A community plugin focused on fine-grained, per-note map customization.
  4. Use the `$filename$` template parameter in map queries

    master

    To create dynamic maps that automatically reference the note they are embedded in, use the $filename$ template parameter within the query field of the code block. This is particularly useful for note templates.

    Example query for bidirectional links:

    "query":"linkedfrom:\"$filename$\" OR linkedto:\"$filename$\""

    [!warning] Known Annoyance The $filename$ replacement occurs when the code block is first processed. If you use the interactive editor to adjust the map (zoom, pan) and click Save, the query field will be overwritten with the literal file name, replacing the template.

  5. Combine queries with logical operators

    master

    You can combine multiple search operators using logical operators to create complex filters.

    Warning: Map View uses explicit AND, OR, and NOT keywords. It does not use - for negation, and spaces are not treated as AND operators.

    Logical Operators

    • AND — Both conditions must match.
    • OR — Either condition must match.
    • NOT — Negates the following condition.
    • ( ) — Used for grouping conditions to control evaluation order.
  6. How Offline Tiles work in Map View

    master

    Map View uses a local caching system to store map tiles in IndexedDB blobs. When a tile is requested, the plugin first checks local storage before fetching from the network. This improves performance and reduces data usage.

    Default Cache Behavior:

    • Retention Period: Tiles are kept for 6 months.
    • Storage Limit: Up to 2GB (oldest tiles are purged first if this limit is reached).

    These settings can be adjusted in the plugin settings under "Offline Maps".

  7. Compare Map View vs. Obsidian Leaflet

    master

    When deciding between Map View and Obsidian Leaflet, consider your primary goal: using notes as a geographic database or creating highly specific, controlled visual presentations.

    Use Map View if:

    • You want to treat your notes as a personal geographic database.
    • You need to collect places and query them using complex filters (e.g., color-coding based on tags like #food/*).
    • You require built-in, powerful geolocation search tools.
    • You want a GUI-driven interface similar to Obsidian's Graph View.
    • You need to support multiple locations per note using inline syntax with individual tags.

    Use Obsidian Leaflet if:

    • You want maximum control over a specific map's visual presentation.
    • You are working with non-geographic maps (e.g., TTRPG maps, custom fantasy worlds).
    • You prefer a code block-driven approach to map configuration.
    • You want to assign icons individually or via global tags rather than query-based rules.
  8. How Marker & Path Display Rules work

    master

    Map View uses a rule-based system to customize the appearance of markers and paths. Rules are applied in a specific order to allow for incremental styling:

    1. Default Rule: The system starts with the properties defined in the Default rule (e.g., a blue marker with a circle icon).
    2. Sequential Evaluation: The system evaluates each subsequent rule in the order they appear in your settings.
    3. Property Overwriting: If a rule's query matches a marker or path, it overwrites only the specific properties defined in that rule. Properties not mentioned in the rule are inherited from the previous state (either the Default rule or a preceding matching rule).

    Example: If the Default rule sets a blue marker with a fa-circle icon, and a rule for tag:#food only defines the icon as fa-utensils, the resulting marker will be blue (inherited) with a utensils icon (overridden).

  9. Compare Map View with Obsidian Maps

    master

    Map View is a community plugin (by esm7) that offers more advanced features compared to the official Obsidian Maps plugin. While both display notes as pins on an interactive map and support the location front matter property, Map View provides several key advantages:

    • Multiple Locations: Supports one location via front matter or unlimited inline locations with per-location tags.
    • Advanced Path Support: Supports GPX, KML, TCX, and GeoJSON files (both stand-alone and inline).
    • Powerful Marker Styling: Uses query-based display rules to set icons, colors, shapes, and badges.
    • Rich Feature Set: Includes geocoding (OpenStreetMap/Google Places), routing (GraphHopper API), GPS/current location support (on mobile), and offline usage via automatic caching.
    • Flexible Work Mode: Can be used as a stand-alone view or integrated with Obsidian Bases.
    • Filtering: Supports both Bases filters and Map View's own query language.
  10. How note links are mapped to markers

    master

    Links are drawn between markers in a source file and markers in destination files. The granularity of the link depends on how the destination is referenced:

    • Whole file link: All markers in the source file are linked to all markers in the destination file.
    • Heading or block link: All markers in the source file are linked to:
      • The front-matter marker of the destination file (if it exists).
      • Only the inline markers located within the specific referenced heading or block.