Place cards in Obsidian: a map in the middle of my daily note
I keep a daily note in Obsidian, and most of it is a log of what I did during the day. Places show up there all the time: the bakery, a café, the snack bar, the doctor’s office. So do my rides and walks, which I pull from Strava. A link to a place note does the job, but it’s not pretty to look into a wall of text to understand how was my day. I wanted something closer to what map apps show you: a small map, the address, and one line about why I was there. A single tap should open it in Google Maps, or in Strava for an activity.
It turns out you can build that with a custom callout, a CSS snippet and two static map images. This is how it looks in light and dark mode, in a made-up daily note from a day in Florence:

The markup
A card is a callout with a custom type, place:
> [!place] Lucciola Bakery, Florence
> ![[lucciola-bakery.png|400]]![[lucciola-bakery-dark.png|400]]
>
> 📍 [Piazza Santo Spirito · Oltrarno](https://www.google.com/maps/search/?api=1&query=43.766855,11.2474139)
>
> Best schiacciata in town, apparently.
A few details matter here:
- The empty
>lines split the card into three paragraphs (map, address, note), so the CSS can style each one. - Both map images go on the same line. The CSS shows the light one in light mode and the one ending in
-darkin dark mode. The dark one is optional. - The address is the link to Google Maps, using the
maps/search/?api=1&query=LAT,LNGURL, which opens the app on the phone. If the snippet isn’t loaded on some device, the address still works as a plain link. > [!place]- …(with the dash) makes a collapsed card, which is nice when a day has several places.
My log is a bullet list, so the card goes right below the bullet it belongs to, indented with two spaces:
- 08:40 — Breakfast at Lucciola Bakery before the crowds
> [!place] Lucciola Bakery, Florence
> ![[lucciola-bakery.png|400]]![[lucciola-bakery-dark.png|400]]
> …
Route cards for rides, walks and runs
Activities get the same card with a different type, route. The map shows the route instead of a pin, the line below it has the numbers, and tapping the card opens the activity on Strava:
> [!route] Saturday ride
> ![[ride-2099-06-14.png|400]]![[ride-2099-06-14-dark.png|400]]
>
> 🚴 [26.8 km · 1h22 · 610 m elevation](https://www.strava.com/activities/<id>)
>
> Espresso stop in Panzano.
The icon is a bike. For walks and runs, I add walk or run after the type (> [!route|walk] Tuesday walk), which Obsidian exposes as data-callout-metadata, and the CSS swaps the icon for footprints. Obsidian’s icon set has no runner, so the emoji in the stats line (🚶 or 🏃) tells them apart. I also keep the distance out of the title: it’s already in the stats line, and the card looks cleaner that way.
The CSS
Save this as .obsidian/snippets/place.css and turn it on under Settings → Appearance → CSS snippets. It uses CSS nesting and the callout variables of Obsidian 1.15, so it needs a recent Obsidian (and iOS 16.5 or later on the phone):
/* Place and route cards: [!place] and [!route] callouts */
.callout:is([data-callout="place"], [data-callout="route"]) {
--pad: 14px;
/* Obsidian (1.15) paints the title, icon, fold arrow and border from these variables.
Color = the accent picked under Appearance (--text-accent already reads well in both modes). */
--callout-color: var(--text-accent);
--callout-icon: lucide-map-pin;
--callout-radius: 14px;
--callout-border-width: 1px;
--callout-border-opacity: 0.3;
--callout-padding: 0;
--callout-title-padding: 12px var(--pad);
--callout-title-size: 1.05em;
--callout-content-padding: 0 var(--pad) var(--pad);
/* Desktop: at most 480 px, centered, with some room above and below.
!important because Live Preview resets callout margins with a stronger selector. */
max-width: 480px;
margin: 14px auto !important;
background-color: color-mix(in srgb, var(--callout-color) 6%, transparent);
box-shadow: 0 1px 3px rgb(0 0 0 / 0.06);
.theme-dark & {
background-color: color-mix(in srgb, var(--callout-color) 9%, transparent);
box-shadow: none;
}
&[data-callout="route"] { --callout-icon: lucide-bike; }
&[data-callout-metadata~="walk"],
&[data-callout-metadata~="run"] { --callout-icon: lucide-footprints; }
.callout-content {
position: relative;
cursor: pointer;
&:active { background: color-mix(in srgb, var(--callout-color) 15%, transparent); }
> p:first-child { margin: 0; } /* map */
> p:nth-child(2) { /* address / activity stats */
margin: 10px 0 0;
font-size: 0.85em;
color: var(--text-muted);
}
> p:nth-child(3) { /* personal note */
margin: 8px 0 0;
font-style: italic;
color: var(--text-normal);
}
/* The address link looks like plain text, and its tap area covers the whole card body */
> p:nth-child(2) a.external-link {
color: inherit;
background-image: none;
padding-right: 0;
text-decoration: none;
-webkit-tap-highlight-color: transparent;
&::after { content: ""; position: absolute; inset: 0; z-index: 1; }
}
/* Other links (e.g. [[My bike]] in the note) stay clickable on top of that area */
> p:not(:nth-child(2)) a { position: relative; z-index: 2; }
}
/* Edge-to-edge map */
.image-embed {
display: block;
width: calc(100% + 2 * var(--pad)) !important;
margin: 0 calc(-1 * var(--pad));
border-block: 1px solid color-mix(in srgb, var(--callout-color) 30%, transparent);
& img { display: block; width: 100% !important; margin: 0; border-radius: 0; }
}
/* Each theme shows its own map (file name ending in "-dark"); no dark file = dimmed light map */
.theme-light & .image-embed[src*="-dark."] { display: none; }
.theme-dark &:has(.image-embed[src*="-dark."]) .image-embed:not([src*="-dark."]) { display: none; }
.theme-dark & .image-embed:not([src*="-dark."]) img {
filter: invert(0.9) hue-rotate(180deg) brightness(0.95) contrast(0.9);
}
}
The parts I like the most:
- Let Obsidian do the work. Obsidian already draws the callout’s title, icon, fold arrow, border and padding from
--callout-*variables, so most of the card is just setting them.--callout-color: var(--text-accent)makes everything follow the theme’s accent color, which Obsidian already adjusts to read well in both modes. - The whole card is the link. There’s no “open in Maps” button. The address link gets an invisible
::afterlayer that covers the card body, so tapping the map, the address or the note opens Google Maps (or Strava). Internal links inside the card sit above that layer, so they still open their notes. - A real dark map. My first try only inverted the light map with a CSS filter in dark mode. It works, but it looks muddy and brownish. A second image made for dark mode looks much better, and the filter stays as a fallback for cards that don’t have one.
- It behaves on desktop too. The card has a maximum width of 480 px, centered, with a little margin above and below, so on a wide window it doesn’t turn into a giant map in the middle of the log.
Getting the map images
I use the Google Maps Static API: one request returns a PNG. These are the parameters I settled on for a place, with the key in an environment variable:
curl -o lucciola-bakery.png "https://maps.googleapis.com/maps/api/staticmap?\
center=43.766855,11.2474139&zoom=16&size=600x300&scale=2&format=png&\
markers=color:red|43.766855,11.2474139&\
style=feature:poi.business|visibility:off&\
key=$GOOGLE_MAPS_API_KEY"
size=600x300&scale=2gives a 1200×600 image that stays sharp on a phone.style=feature:poi.business|visibility:offhides shops, restaurants and the “special offer” pins, and keeps landmarks and metro stations.- The dark version is the same request with more
stylerules: dark grey geometry, lighter roads, grey labels. I skipped Google’s navy “night” style because it clashed with Obsidian’s neutral dark background. A few of the rules:
style=element:geometry|color:0x2b2b2b
style=element:labels.text.fill|color:0x9a9a9a
style=element:labels.text.stroke|color:0x1e1e1e
style=feature:road|element:geometry|color:0x404040
style=feature:road.highway|element:geometry|color:0x575757
style=feature:water|element:geometry|color:0x1c2733
For the coordinates and the short address, the Geocoding API does it in one call. You can also copy them from the Google Maps URL.
For a route, the same API draws a path. Every Strava activity comes with map.summary_polyline, the route compressed into a string, and it’s the same encoded format Google uses, so it goes straight into the request:
path=color:0xFC4C02ff|weight:5|enc:<summary_polyline>
markers=size:tiny|color:0x2EA043|<start lat,lng>
markers=size:tiny|color:0xE24B4A|<end lat,lng>
Without center and zoom, Google frames the whole route by itself, but it hugs the edges. I add a visible= parameter with the route’s bounding box padded by about 15%, which gives it some room. The whole URL must stay under 16,384 characters; the summary polyline fits easily, even for a long ride.
Some notes on the key:
- Google Maps needs a billing account, but each of these APIs has 10,000 free requests a month. A card costs two (light and dark), so a personal journal won’t get close.
- Restrict the key to the Static Maps and Geocoding APIs, and lower the daily quota of each one in the Cloud console. Mine is 100 a day. If the key ever leaks, nobody can use it for anything else or run up a bill.
- Google’s terms limit storing their map images for a long time, which is exactly what saving PNGs in a vault does. For a personal journal I’m fine with it, but you should know. If that bothers you, OpenStreetMap tiles (keep the attribution and respect their tile usage policy) or Mapbox’s static images work the same way with the same CSS.
- Routes usually start and end at home. Strava’s privacy zones already trim the summary polyline, but if you share a map anywhere public, drop the start and end markers too.
The result
Each kind of card on its own, in light and dark mode:

Things that bit me
- A pencil icon instead of the pin means the snippet isn’t loaded on that device. On the phone, check that Obsidian Sync has “Themes and snippets” turned on, then refresh the list under Appearance → CSS snippets.
- The icon stayed blue. I was coloring the title by hand, but Obsidian colors the icon’s SVG with
--callout-color. Setting that variable instead fixes the icon, the arrow and the border at once. - Cards under a bullet showed up as code blocks on desktop. I had indented them with a tab. The phone rendered it fine, but the desktop app read it as a code block. Two spaces work on both.
- The card wouldn’t center in Live Preview. Obsidian resets callout margins there with a stronger selector, so the margins need
!important. - Replacing an image doesn’t update it on the phone if the file keeps the same name. Obsidian caches images, so when a map changes, save it under a new name and update the embed.
- In Live Preview, tapping the card body may open the link instead of showing the markdown. Tap the title, or edit in source mode.
- Only the address link should stretch. My first version stretched every external link in the card, so a link in the note would have hijacked taps on the map. The CSS now targets only the link in the second paragraph.
I built this in a late-night session with my AI agent writing the CSS and the API calls while I checked the result on my phone and asked for changes. If you build something like this, I’d love to see it.