daniel-fiuk383 downloadsUpload your own maps and plant pins on important locations, each linking back to your notes.
Are you a writer, a world builder, or a really dedicated Dungeon Master or note taker? Do you want to manage and locate your notes on a map of your choosing? Introducing Simple Map for Obsidian! Upload any image to your Obsidian vault and create an interactive map where you can link to notes that call back to a specific location.
Add the 'simple-map' code block to your note and give it an image for your desired map.
```simple-map
map: world map.svg
```
This plugin is explicitly designed for use with SVG files for the best image quality and sharpness at higher zoom levels, but is also compatible with the file types PNG, JPG, JPEG, WEBP, and GIF.
Using the mouse, you can click and drag to pan around your map. By scrolling with the mouse wheel, you can zoom in and out of your map. The toolbar gives you the ability to define how fast you zoom by updating the zoom step increment. Using the toolbar, you can also zoom in and out of the center of your current view and reset your zoom back to its initial position and zoom level.
You can set a default pan and zoom for your map, as well as the zoom range for how far in and out you can zoom by defining these parameters.
```simple-map
map: world map.svg
zoom range: (1, 100)
default zoom increment: 2
default zoom level: 2
default location: (0, 316)
```
You can set up a repeating map by simply defining a repeat parameter for horizontal, vertical, or even both axes wrapping.
```simple-map
map: world map.svg
repeat: x
```
By default the map assumes a default latitude and longitude for your map. (-90, 90) latitude and (0, 360) longitude. This scales with the aspect ratio of your map by default so that a coordinate of (90, 0) would correspond to the very top left corner of your map, and (-90, 360) would map to the very bottom right. You can customize your coordinate space by defining the latitude and longitude ranges, as well as define a custom prime meridian for your worlds.
```simple-map
map: world map.svg
latitude range: (-90, 90)
longitude range: (0, 360)
prime meridian offset: (0, 222.75)
```
To add a pin to your map, simply add sm-location to your frontmatter.
---
sm-location: (lat, lng)
---
You can filter for which pins are rendered to a map by defining a map ID. Think of this like a lock and key. A pin will only appear on maps where it has a matching ID.
```simple-map
map: world map.svg
id: My Map ID
```
---
sm-location: (lat, lng)
sm-id: My Map ID
---
You can change the pin icons by uploading your own from the vault, same as you would your map.
---
sm-location: (lat, lng)
sm-pin-icon: my pin icon.svg
---
You can also change the size of the pins that appear on your map by setting the pin size parameter on your map. This parameter utilizes standard css to define the width of your pins, and auto adjusts the height to maintain the aspect ratio.
```simple-map
map: world map.svg
pin size: 24px
```
Individual notes can override the map's pin size with sm-pin-size. Use any CSS size, a percentage of the map window width, or a multiplier of the map's pin size. This is handy for flags or other icons that need to be larger to stay readable.
---
sm-location: (lat, lng)
sm-pin-icon: my nation flag.svg
sm-pin-size: 2x
---
sm-location is updated when you let go.When a pin is selected, pins overlapping or stacked on it are pushed outward so each one can be reached. Their saved locations don't change.
You can preview your notes directly from your map with images and functioning links. Drag a preview by its title bar to move it out of the way, and close it with the × button. By default several previews can be open at once; previews follow their pin while you pan until you move them.
You can search through your pins by simply typing in the search bar. Names, tags, aliases, and all other frontmatter properties you create can be used as filters to find specific pins on your map. Using quotation marks and "and / &&" or "or / ||" key words, you can search for multiple filters/queries. (i.e. "faction" or "building", "landmark" and "battle", etc.)
Each map: line starts a new map. Parameters above the first map: line are shared by every map; parameters after a map: line apply only to that map. When a block has more than one map, a dropdown appears in the toolbar to switch between them.
```simple-map
zoom range: (1, 15)
default map: Terrain
map: World Terrain.png
name: Terrain
map: World Political.svg
name: Political
filter: "nation" || "capital"
map: Kestrel Isles.png
name: Kestrel Isles
world: Kestrel
latitude range: (-10, 10)
longitude range: (0, 40)
```
Overlays are images authored at the same dimensions as your map, such as borders or regions. They appear while the pin's preview is open (for the most recently selected pin) and pan, zoom and repeat with the map.
---
sm-location: (lat, lng)
sm-overlay:
- "[[Valdoria Borders.svg]]"
- "Political: [[Valdoria Borders Flat.svg]]"
sm-overlay-opacity: 0.8
---
A plain link shows on every map; MapName: [[file]] shows only on the map with that name.
| Setting | Default | Description |
|---|---|---|
| Default pin size | 24px | Pin width when a map or note doesn't set one |
| Default zoom increment | 1 | Zoom step for buttons and the mouse wheel |
| Allow multiple previews | On | Keep existing previews open when selecting another pin |
| Clicking a pin with an open preview | Close preview | Or keep it open |
| Moved preview on new pin | Jump to new pin | Single-preview mode: or stay where you moved it |
| Spread nearby pins | On | Push overlapping pins away from the selected pin |
| Hover previews | Off | Show a preview while hovering a pin |