0

I am trying to follow the simple example in Mapbox's website here but with a custom map I have created in my Mapbox account. So based on the example I change only the token and style url properties in the script section:

<script>
mapboxgl.accessToken = 'pk.<>';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://<>', // stylesheet location
center: [74.50, 40], // starting position [lng, lat]
zoom: 5 // starting zoom
});
</script>

However when I save this as an html file in my laptop and open it in my browser, it still shows the default example map. I also made sure I published my custom style from Mapbox and that I can view the map with the https link.

What would I be doing wrong here?

1 Answer 1

2

The solution was that I had to wait for 5 more minutes for the changes to propagate. Works now.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.