Initializing MapboxGL.js within a single page app

that one is a little trickier because it requires shadow dom to do correctly and browser support and polyfills for shadow dom are much shakier than custom element definitions. the way i would go first is to make types that describe layers and sources and then encode them to json and pass them as properties in the same way that the example passes zoom as an int. still declarative! but it just doesn’t look as satisfying in the dom explorer.