Getting Canal Maps to Look Great When Shared on Facebook

When you share a link on Facebook, you expect to see a rich preview — a title, a description, and an image. For most websites this works out of the box. For a map-heavy site like ours, it turned out to be a more interesting problem to solve.

The challenge

Interactive maps are great in a browser but completely invisible to Facebook’s link scraper. It’s a bot — no JavaScript, no map tiles, no Leaflet rendering. When our canal map pages were shared, Facebook had nothing useful to display and fell back to generic site information. Not ideal when you’re trying to share something as visual as a detailed waterway map.

Open Graph tags

The first step was adding Open Graph meta tags to every page. These are invisible HTML tags that tell Facebook (and Twitter, WhatsApp, LinkedIn, iMessage) exactly what title, description, and image to show when a link is shared. For canal map pages we pull the canal name and description automatically, so each canal gets its own tailored preview rather than a generic site title.

The map screenshot

The real challenge was the image. We wanted to show the actual map — not just a generic canal photo. Since Facebook can’t render the map itself, we built a small automated tool that uses a headless browser (a browser with no visible window) to load each canal map page, wait for all the map tiles to fully render, then capture a screenshot at exactly the right dimensions for Facebook’s preview format.

That screenshot is then set as the preview image for that page. When someone shares the link, Facebook fetches it and displays the real map — complete with the canal route, POI markers, and everything else visible on the live map.

Weekly refresh

Canal maps get updated — new points of interest, route changes, gauge markers. So the tool is designed to run on a schedule, automatically refreshing the screenshot for every canal periodically. The Facebook preview stays current without any manual effort.

The result

Share any canal map page and you get a proper map image, the canal name, and a real description — on Facebook, Twitter, WhatsApp, anywhere that reads Open Graph tags. Click the preview and it takes you straight to the interactive map.

A bit more testing and we will roll this out for all our maps including Canal Traders, Boat Logs and CRT Maps

© 2026 . | Privacy Policy
Links on this site do not constitute a recommendation or endorsement of any business, product, or service.