Mapbox toggle satellite view as user

Hey!

Right now I am implementing a map into my webapp. I want the user to be able to toggle between satellite mode and street mode.
I thought it would be possible to bind the Mapbox View to a variable like this:

This is the binding:

The available Map Styles are for example:

  • Mapbox Streets
  • Mapbox Light
  • Mapbox Dark
  • Mapbox Satellite

But I just get this error:
Error: Unexpected token ‘<’, "<!doctype "… is not valid JSON

Does anyone know how to achieve this toggle function?

Hi!

For streets it should be mapbox://styles/mapbox/streets-v11, for satellite its mapbox://styles/mapbox/satellite-v9

Hope this helps

Thank you so much Max!
This solved the issue perfectly.

Great!