Load a public CARTO Builder URL dynamically
✓ Published0🌍 Public
Aandrewbt
Last edited Oct 29, 2019
Created on Oct 29, 2019
This example loads a public CARTO Builder URL into a Mapbox GL map as a raster tile layer. It shows how a user can paste a CARTO embed URL, select specific layers from a dropdown, and dynamically add the corresponding map tiles to the Mapbox GL view. The code parses the URL to extract the username and named map template, constructs an XYZ tile request, and uses `map.addLayer` with a raster source to display the data. The interface includes an input field, layer selector, and a button to trigger the tile loading.
AI-generated description