This sample shows how to add a WebTileLayer to a Scene.
This sample shows how to add a WebTileLayer to a Scene.
<!doctype html><html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>WebTileLayer | Sample | ArcGIS Maps SDK for JavaScript</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN --> <script type="module" src="https://js.arcgis.com/5.0/"></script>
<style> html, body, #viewDiv { height: 100%; margin: 0; } </style> </head> <body> <arcgis-scene ground="world-elevation" scale="50000000" center="-65, -17"> <arcgis-home slot="top-left"></arcgis-home> <arcgis-zoom slot="top-left"></arcgis-zoom> <arcgis-navigation-toggle slot="top-left"></arcgis-navigation-toggle> <arcgis-compass slot="top-left"></arcgis-compass> </arcgis-scene> <script type="module"> const [WebTileLayer] = await $arcgis.import(["@arcgis/core/layers/WebTileLayer.js"]);
const viewElement = document.querySelector("arcgis-scene");
await viewElement.viewOnReady(); const tiledLayer = new WebTileLayer({ urlTemplate: "https://{subDomain}.tile.openstreetmap.org/{z}/{x}/{y}.png", subDomains: ["a", "b", "c"], copyright: 'Map data from © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors', }); viewElement.map.add(tiledLayer); </script> </body></html>