Sam Robbins's Avatar

Sam Robbins

@samrobbins.uk.bsky.social

Software developer

100 Followers  |  97 Following  |  9 Posts  |  Joined: 26.05.2023  |  1.6415

Latest posts by samrobbins.uk on Bluesky

Now for actually integrating it, I've been wanting to rebuild my personal website (again) for a while now and @astro.build has looked interesting and content collections could work nicely for storing the JSON of the routes alongside a markdown file for the content

28.02.2025 18:22 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Ended up just going with expanding the bounds by a fixed amount for now, might look at detecting aspect ratio of the map and generating the bounds based on that at some point but this works pretty well

28.02.2025 18:20 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Started working on getting bounds working tonight so that you can't pan way away from the route, bbox in turfjs worked great for getting the bounding box, but because the window I'm previewing it in has a wide aspect ratio it was fixed super zoomed in, expanding the bounds fixed this but not ideal

17.02.2025 18:16 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
A map of Northumberland with a red line showing my route

A map of Northumberland with a red line showing my route

And it worked, route now showing on the embed, now I just need to do some tidying up and to work out the best way to store the routes as they're arrays with hundreds of points

16.02.2025 20:59 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

The data exported from geojson.io isn't quite what mapbox is expecting, the main data is in the "features" key out of geojson.io but the "data" key is expected, easy to change because the rest of the data is the same

16.02.2025 20:41 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
A map showing a straight black line overlaid on a wiggly orange line

A map showing a straight black line overlaid on a wiggly orange line

Though saying that there isn't a snap to path option, it uses the existing snap to path that OS maps has done but isn't perfect, so the route (black) doesn't exactly follow the paths on the map which is annoying but not the end of the world

16.02.2025 20:31 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Now getting the routes to show on top of the map, OS Maps has GPX export and geojson.io imports those and gives GeoJSON back, and I can clean up the route in there too which is helpful

16.02.2025 20:23 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

First step, how to embed any kind of map on my website, mapbox seems the obvious choice for this, it's a bit worrying that if too many people load the page I'll end up getting charged, but it's a pretty high limit so hopefully not an issue

16.02.2025 20:22 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

New mini project: Showing my walking routes exported from OS Maps on my website, doing a thread on it, so I remember what I did when I blog about it

16.02.2025 20:20 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

@samrobbins.uk is following 20 prominent accounts