I Added SVG Maps to My Travel Posts
Josh Erb enhanced his travel blog by adding SVG maps using 11ty and d3-geo, focusing on performance and consistency, with plans for future geographical details and interactivity.
Read original articleJosh Erb recently enhanced his travel blog by adding maps to the top of his posts, motivated by a personal affinity for maps and nostalgia from his early blogging experiences. He outlined three main requirements for this feature: avoiding third-party platforms, generating maps at build time for performance, and ensuring consistent appearance across devices. To implement this, he utilized the 11ty static site generator and created a shortcode to integrate maps into his blog's template. He chose to generate maps as SVGs using the d3-geo library, which allowed him to convert geographic data into SVG paths. He also organized location data in a JSON file to streamline the mapping process. The final implementation includes styled SVG elements that adapt to different screen sizes. Looking ahead, Erb considers adding more geographical details, an overview map of all locations, and potential interactivity to the maps. He reflects on the evolution of his blogging journey and the enduring nature of the internet.
- Josh Erb added maps to his travel blog for personal and nostalgic reasons.
- He established requirements to avoid third-party dependencies and ensure performance.
- The implementation involved using 11ty and d3-geo to generate SVG maps.
- Future enhancements may include more geographical data and interactivity.
- Erb appreciates the longevity of his early blogging platform and the evolving nature of online content.
Related
Microfeatures I love in blogs and personal websites
The article explores microfeatures for blogs and websites inspired by programming concepts. It highlights sidenotes, navigation tools, progress indicators, and interactive elements to improve user experience subtly. Examples demonstrate practical implementations.
Mapping with Leaflet
Raymond Camden highlights the Leaflet JavaScript library for mapping, noting its simplicity, quick setup, and flexibility for integrating data sources, while emphasizing the utility of GeoJSON for mapping data.
Dawarich: Self-hosted alternative to Google Location History
Dawarich is a self-hosted web application for managing location history, allowing data import from various sources, customizable maps, and setup via Docker, while still in active development with available documentation.
My Blog Engine Is the Erlang Build Tool
The author uses Rebar3 to power a minimalist, static blog focused on fast loading and accessibility, utilizing erlydtl for templates and a DAG for efficient file rebuilding, despite its complexity.
Dynamic Viewpoint Symbols
Advancements in dynamic symbol rendering for maps enhance readability and interaction, featuring non-blocking tree symbols and viewpoint visualization with direction tags, supported by technical modifications to Mapnik.
- 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.
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!
love the craft. now I need to set aside some time to read the post… !
Related
Microfeatures I love in blogs and personal websites
The article explores microfeatures for blogs and websites inspired by programming concepts. It highlights sidenotes, navigation tools, progress indicators, and interactive elements to improve user experience subtly. Examples demonstrate practical implementations.
Mapping with Leaflet
Raymond Camden highlights the Leaflet JavaScript library for mapping, noting its simplicity, quick setup, and flexibility for integrating data sources, while emphasizing the utility of GeoJSON for mapping data.
Dawarich: Self-hosted alternative to Google Location History
Dawarich is a self-hosted web application for managing location history, allowing data import from various sources, customizable maps, and setup via Docker, while still in active development with available documentation.
My Blog Engine Is the Erlang Build Tool
The author uses Rebar3 to power a minimalist, static blog focused on fast loading and accessibility, utilizing erlydtl for templates and a DAG for efficient file rebuilding, despite its complexity.
Dynamic Viewpoint Symbols
Advancements in dynamic symbol rendering for maps enhance readability and interaction, featuring non-blocking tree symbols and viewpoint visualization with direction tags, supported by technical modifications to Mapnik.