Code snippet: OneMap Basemap for ArcGIS API for JavaScript 4.x

I am happy to contribute a basemap code snippet for ArcGIS API for JavaScript 4.x.

How to use/test the code snippet: Create a html file with the below code and view it in the browser.

#web-help #onemap-under-the-sun #others #arcgis #javascript #4.x #webtilelayer

    <meta charset="utf-8" />
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
    <title>Default (ArcGIS API for JavaScript 4.x)</title>

      #viewDiv {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;

    <link href="" rel="stylesheet" type="text/css" />
    <script src=""></script>

      ], (WebTileLayer, Map, Basemap, MapView) => {
        const mapBaseLayer = new WebTileLayer({
          urlTemplate: "https://maps-{subDomain}{level}/{col}/{row}.png",
          subDomains: ["a", "b", "c"],
            `<img src="" style="height:20px;width:20px;"/> OneMap | Map data &copy; contributors, <a href="">Singapore Land Authority</a>`

        const map = new Map({
          basemap: new Basemap({
            baseLayers: [mapBaseLayer]

        const view = new MapView({
          container: "viewDiv",
          map: map,
		  center: [103.82, 1.35],
		  zoom: 12

    <div id="viewDiv"></div>