ArcGIS JS API Integration

The following provides an example of the AerisWeather Mapping Platform's radar layer integrated with the ArcGIS JS library to create a 2D map.

 
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title></title>
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no"/>

    <link rel="stylesheet" href="https://js.arcgis.com/4.17/esri/themes/light/main.css">
    <script src="https://js.arcgis.com/4.17/"></script>
    <style>
        body { margin:0; padding:0; }
        #map { position:absolute; top:0; bottom:0; width:100%; }
    </style>
</head>
<body>

<div id='map'></div>
<script>
    require([
        "esri/layers/WebTileLayer",
        "esri/Map",
        "esri/views/MapView"
    ], function (WebTileLayer, Map, MapView) {
        const map = new Map({
            basemap: 'streets',
            ground: "world-elevation"
        });

        const view = new MapView({
            container: "map",
            map: map,
            zoom: 4,
            center: [-72.47,11.05] // longitude, latitude
        });

        const weatherLayer = new WebTileLayer({
            urlTemplate: "http://maps{subDomain}.aerisapi.com/[clientId]_[clientKey]/radar-global/{level}/{col}/{row}/current.png",
            subDomains: ["1", "2", "3", "4"],
            copyright:
                'Weather Layers by <a href="http://aerisweather.com/">AerisWeather.com</a>, '
        });
        map.add(weatherLayer);
    });


</script>
</body>
</html>

Last modified: October 30, 2020