Video Tutorial: https://youtu.be/47gVvg06jNM
Available In My: TTRPG Template Vault
Now, don’t get me wrong. There is nothing wrong with a good bit of pen and paper, writing out your notes and having binders full of information. However, what makes TTRPG campaign managers so powerful, especially the good ones, is the ability to use high-resolution maps to display your world with interactive markers which you can place and use to navigate.
There is something so satisfying about being able to click on a settlement, have it open and have all that settlement’s information at your fingertips! If you want to get your own interactive map going for your own TTRPG, novel writing, or something else, this is the place…
Video Tutorial: https://youtu.be/47gVvg06jNM
Available In My: TTRPG Template Vault
Now, don’t get me wrong. There is nothing wrong with a good bit of pen and paper, writing out your notes and having binders full of information. However, what makes TTRPG campaign managers so powerful, especially the good ones, is the ability to use high-resolution maps to display your world with interactive markers which you can place and use to navigate.
There is something so satisfying about being able to click on a settlement, have it open and have all that settlement’s information at your fingertips! If you want to get your own interactive map going for your own TTRPG, novel writing, or something else, this is the place to be.
Image From My Personal TTRPG Vault
🤔 What Makes This Better?
For those who don’t know, Obsidian Leaflet is a fantastic map tool inside Obsidian that lets you drop in maps, place markers, and bring your TTRPG worlds to life. While it’s great for that, there’s a problem. Using Obsidian Sync can sometimes cause Leaflet to lose track of your data, with markers or details disappearing.
So, with help from community member ZuB, we set out to fix it. We found a way to store Leaflet’s data directly inside your notes, keeping everything safe, organised, and easy to manage even if Leaflet hiccups.
If you’re still new to Obsidian, let’s get you sorted with installing Leaflet, and we’ll take it from there. Or, if you are brand new, I recommend checking out my Complete Beginner’s Guide For Obsidian before tackling this.
🧩 Installing and Enabling
Go to settings (Bottom Left ⚙️) > Community Plugins 1.
Turn off Restricted mode (If enabled) 1.
Click browse > Search Leaflet 1.
Install then enable
🗺️ Setting Up The Map
If you are already familiar with Leaflet and are just looking for the code, you’ll find that at the bottom of this chapter. But for those new to Obsidian Leaflet, we’ll build up the code together so it’s not as scary. Then obviously, you will be able to pick up the code at the end as well.
Basics
Starting off, we’ll add the bare bones of what we need to get a map going. ```leaflet and ``` mark the start and end of our map. Then, in between those, we have two lines.
id
The id is a unique identifier that allows it to separate itself from other maps. This means we can have multiple maps using the same image, to have different usage for each map.
image
This is just a link to the image we want to use for our map. For future reference, you can always use | then NAME after it to display a name for this image in the maps interface.
```leaflet
id: Valdian
image:
- [[ValdianMap.png|Main]]
**Size & Zoom**
Now, depending on your map image, it may not look great right now\. That's because we need to tell Leaflet the size of our map so it can size accordingly\. So we will add the following lines\.
**bounds**
The bounds are the size of our map, and it's quite easy to work this out\. You just need to find the Height and Width of your image in Pixels\. If you're using Windows, you can open the image, and it will be in the information of the image\. If it doesn't display, you can also use Photoshop, Gimp or other programs to get similar results\.
When inputting these, you need to make sure you input the Height first, then the width\.
Using Windows Photos
**Zooms**
These are straightforward; we are just setting the minimum and maximum zoom levels we can be at\. The default is what zoom level we start at, and the zoomDelta is how much we zoom in and out by\.
Each map will vary, so it's good practice to fine-tune these to your liking\.
id: Valdian
image:
- [[ValdianMap.png|Main]]
bounds: [[0, 0], [4388, 3823]]
minZoom: -3.5
maxZoom: 3
defaultZoom: 0
zoomDelta: 0.5
**Scale & Distance**
Setting up the correct scale in your maps is a real superpower in Obsidian Leaflet, as it allows us to accurately measure the distance between two points on our map\.
This can be furthered with Travel Calculators that I will cover down the line\. But for now, let's cover how we can do this in the map
**unit**
Unit is the text displayed for the unit of measurement we are measuring in\. This can be anything you like, as it's just a visual thing\.
**scale**
The scale, however, is where we need to hone in\. Now, don't get me wrong\. There are methods out there where you can input some numbers, and it will calculate automatically some of this stuff for you\. However, I have found that manually tweaking this only takes a few moments, and it saves having to remember a whole process and using external tools\. So, you change the number and measure \(using Left Shift \+ Left Click on the map\)\. It usually takes less than a minute and saves you the hassle if you are just making one map\.
id: Valdian
image:
- [[ValdianMap.png|Main]]
bounds: [[0, 0], [4388, 3823]]
minZoom: -3.5
maxZoom: 3
defaultZoom: 0
zoomDelta: 0.5
unit: miles
scale: 0.7
**Optimizing**
We now have a fully functioning map, congrats\! There are, however, some things I like to include in my maps to make life easier\. I will include more down below with the full code block mentioned earlier, but I want to cover some of the most important ones\.
**lat & long**
The lat \(Latitude\) and long \(Longitude\) are ways we can set the center of our map\. By default, 0, 0 works for the center of the map\. If, however, you would like to focus a large map on a smaller area, you can do so\. Just use Left Shift \+ Left click on the map to get the coordinates, then paste the first half in the lat and the second half in the long\.
Just be sure to remove the commas, as they can break the code\.
**recenter**
Recenter will set your map back to the center each time you come back to the note\. Perfect for when you want to see your whole map or focus back on that defined lat & long each time you come back to it
id: Valdian
image:
- [[ValdianMap.png|Main]]
bounds: [[0, 0], [4388, 3823]]
minZoom: -3.5
maxZoom: 3
defaultZoom: 0
zoomDelta: 0.5
unit: miles
scale: 0.7
lat: 1837.4829
long: 2125.8004
recenter: true
**🔽 Complete Leaflet Code:**
Everything we just covered above is available within the code, so you will always have points on what things do\.
Now, we need to cover how we are going to use Leaflet in a smarter way to secure our data in the long run\. So, feel free to grab the code, and let's cover the new bits\.
By using ### at the start of a line, we “comment” it out. We can use this to either leave notes or disable lines if we don’t need them.
Once you are familiar with how Leaflet works, I recommend removing the commented tips so you have a cleaner setup.
Video Tutorial: https://youtu.be/47gVvg06jNM
Height and Width allow you to determine the size of the map interface. These have been commented out by default for you.
height: 500px
width: 640px
ID is a Unique ID that allows you to define the map. So you can have multiple maps that use the same image, but are used for different things. I have left an example ID in here for you.
id: Example
Image is the main image for the map. I have left an example image in here for you.
image:
- [[PlaceholderImage.png|Main]]
Image Overlays are images we can put on top of another, allowing us to display information such as territories or districts. I have left an example image in here for you.
imageOverlay:
- [[[PlaceholderImage.png|TBD]]]
Lock means we can’t edit the map by default; this can be set to false or toggled using the lock in the UI.
lock: true
Recenter will recenter the map each time you come back to it.
recenter: true
No scroll zoom will disable the use of the scroll wheel to zoom in and out of your maps.
noScrollZoom: false
Bounds sets the size of the map, which is determined by the pixels height and width of your image. Keep the first [0,0] as it is, then set the second as [HEIGHT,WIDTH]. I have left an example for you.
bounds: [[0, 0], [4388, 3823]]
Lat (Latitude) & long (Longitude) are used to set the default location of your map. 0 & 0 is the centre. Use can use Left SHIFT + Left Click to get the coordinates of a location on your map to change the default position.
lat: 0 long: 0
Min & max zooms are used to set how far you can zoom in and out of our map.
minZoom: -3.5 maxZoom: 3
Default zoom is the zoom level you start at.
defaultZoom: -3.5
The zoom delta is the increment that you zoom in or out by.
zoomDelta: 0.5
Unit is what you measure your distance by. We can measure the distance between two points by using Left ALT & Left Click.
unit: miles
Scale is used to determine the size of the image. We use this to fine-tune our maps to the correct scale so that our measurement tools are accurate.
scale: 0.0404
Marker tags are a tag we can use the tags property to tell a map we want a specific note to be marked onto it. Change TBD to something relevant, such as #MapIt-London“.
markerTag:
- “#MapIt-EXAMPLE”
**💾 Saving Data To Our Notes:**
So, you'll be happy to hear there isn't much to do on the map to get this working\. All you need to do is add a line for 'markerTag:' and below, a line for ' - "\#MapIt-EXAMPLE" '
\#MapIt-Example can be whatever you like\. I like using this as it lets me know what the tag is meant to do\. This allows us to plot notes onto our maps\.
markerTag:
- “#MapIt-EXAMPLE”
Then all we need to do is have the following properties in a note that we want to plot:
**tags: MapIt-EXAMPLE**
Using the tag we defined a moment ago, by using it in a note, we can tell the map we want to plot this note\.
**location: Coordinates**
By using the same method as earlier to get coordinates \(Left Shift \+ Left Click\), we can plot the location we want this map to show\. Just remember to remove the commas\.
**mapmarker: Example**
You can use this to choose which map marker type you want to use\. To create a new marker, you head to Settings \> Leaflet \> Create Additional Map Markers\.
tags:
- MapIt-EXAMPLE location:
- “2473.0059”
- “2984.63” mapmarker: EXAMPLE
**🔍 The Result:**
Now, after all that, you should have a fully functioning map where all your data is now stored in your notes, and you can start to plot markers and navigate through them\! You may need to refresh the map \(leaving the note and coming back\) if you had the map open, as it doesn't update live\.
There is definitely more we could cover with this plugin, such as drawings and effective image overlaying\. But for now, this should get you well on your way and should cover 99% of use cases\.
**💭 Final Thoughts**
If you need additional support, you can always join my [Discord](https://discord.gg/Rn5PSAPTpH), where we have a community of amazing people willing to support where they can, or you can book a [1-on-1 tutoring session](https://ko-fi.com/bagoftips/commissions) with me\.
If you are looking for a bunch of TTRPG templates, I recommend checking out my [Shop](https://ko-fi.com/bagoftips/shop), where I have an entire template vault I have spent over 3 years developing, full of examples which will save you months of work\.
**🥳First Early Access Content\!**
This was the first post that my [supporters](https://ko-fi.com/bagoftips/tiers) had access to 2 weeks early\. These perks and more come with supporting me for just £1 a month, and I have a lot more on the way\! This is just one of the many ways I am giving more value to my supporters and forever showing my gratitude\. 💖