Skip to content

Instantly share code, notes, and snippets.

View yuletide's full-sized avatar
🤘

Alex Yule yuletide

🤘
View GitHub Profile
@yuletide
yuletide / index.html
Last active May 29, 2020 21:40
Mapbox Swap Studio Source for GeoJSON
<!DOCTYPE html>
<html lang="en">
<head>
<title>Swap Studio Source for GeoJSON</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="shortcut icon"
href="https://static-assets.mapbox.com/branding/favicon/v1/favicon.ico"
type="image/x-icon"
@yuletide
yuletide / .block
Last active April 5, 2022 17:44 — forked from alexmacy/.block
Projection Transitions v4
license: gpl-3.0
@yuletide
yuletide / getStyleComponents.js
Last active February 23, 2023 20:52
Get a list of all mapbox layer ids grouped by feature component for easy toggling of mapbox streets layers
#!/usr/bin/env node
// usage node getStyleComponents.js > groups.json
// looks for a style named style.json, rename to match or use process.argv if you want
// then save these ids to an array and toggle with:
// layers?.forEach(lyr => map.setLayoutProperty(lyr, "visibility", value));
const style = require("./style.json");
const components = style.layers.reduce((map, lyr) => {