top | item 41532958

I Added SVG Maps to My Travel Posts

115 points| todsacerdoti | 1 year ago |cyberb.space

16 comments

order
[+] kylehotchkiss|1 year ago|reply
I love this Josh! I recently discovered Protomaps (https://protomaps.com) and have been having a lot of fun doing mapping without paying Google or Mapbox a small fortune for the privilege. I found the the basemaps look much better than the protomaps site makes them appear (they're super zoomed out in the samples where the styles don't come together as well as they do when zoomed in)
[+] lelandfe|1 year ago|reply
Super neat, the end result looks great and adds a lot to the posts. On the downside, inlining the map causes the HTML to balloon up to ~500kB/~180kB gzipped, compared to 30kB/10kB on this post (which lacks a map). The site is already insanely fast, but you could pull the map SVG into an actual file, so it's cached between pages, and becomes a lower-priority resource (which will ~halve First Contentful Paint). Then you'd just position the circle on top of that generic map file!
[+] gampleman|1 year ago|reply
You could then also run it through SVGO to compress it further.
[+] ipsento606|1 year ago|reply
the author is also using many large, multi-megabyte photos in their travel posts, so I'm not sure how significant the size of the SVG content is, in comparison
[+] mbforbes|1 year ago|reply
Really impressive! I've implemented a few kinds of maps on my blog, and I fail all of their requirements:

- I use a 3rd party platform

- My maps are generated at runtime

- They looks... let's say vaguely consistent on mobile & desktop

Maps were the most painful and time-consuming part of building a travel blog, but also perhaps the most satisfying.

[+] throw0101c|1 year ago|reply
It would be cool if OpenStreetMap (OSM) could do something like a 'print/export to SVG' for whatever is on currently the screen.
[+] habi|1 year ago|reply
The export button in the right sidebar (third from the bottom) does exactly this, up to a certain size bounding box size.
[+] kymikz|1 year ago|reply
Great post!

I had myself this itch to scratch and ended up making an overly over-engineered tool to do just that: https://cartosvg.com/

I think it might interest you as it covers all your use cases (except the responsiveness part maybe), and personally I thin it can lead to quite beautiful results :)

Cheers!

[+] djangelic|1 year ago|reply
Great post, love the amount of thought that went into this! I look forward to keeping up with your posts.
[+] apsurd|1 year ago|reply
what a great looking website.

love the craft. now I need to set aside some time to read the post… !

[+] loremm|1 year ago|reply
same here, looks really nice. Some websites are cool, if slightly gratuitous in how they try to look fancy. This looks elegant and cohesive
[+] bebna|1 year ago|reply
I like it, thanks.