Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Push any mapboxGL map style to maputnik using planning labs' maputnik-push service
// this will only work if === your mapboxgl map instance
// we usually set = map in the callback using map.on('style.load', function () { ... })
fetch('', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
body: JSON.stringify(,
.then(d => d.json())
.then((res) => {
const { styleid } = res;
console.log(`${styleid}#${}/${}/${}`, '_blank');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.