Slow loading time for WMS layers - JS API

173
0
11-12-2020 11:10 AM
julienrobitaille
New Contributor III

Hello,

I was wondering if it was normal how slow arcgis API JS laods WMS layers.Here is an example:

<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>Intro</title>
    <style>
        html,
        body,
        #viewDiv {
            padding0;
            margin0;
            height100%;
            width100%;
        }
    </style>

    <link rel="stylesheet" href="https://js.arcgis.com/4.17/esri/css/main.css">
    <script src="https://js.arcgis.com/4.17/"></script>
    <script>
        require(["esri/Map""esri/views/MapView""esri/layers/WMSLayer""esri/widgets/LayerList"], function(
            Map,
            MapView,
            WMSLayer,
            LayerList,
        ) {
            const map = new Map({
                basemap: "streets-navigation-vector"
            });

            const view = new MapView({
                container: "viewDiv",
                map: map,
                zoom: 3,
                center: {
                    latitude: 32.7353,
                    longitude: -117.1490
                }
            });
            var layer_precipitations = new WMSLayer({
                url: "https://geo.weather.gc.ca/geomet?",
                title: "Précipitation radar",
                sublayers: [{
                    name: "RADAR_1KM_RRAI",
                    title: "precipitations",
                    popupEnabled: false,
                    queryable: false,
                    visible: true,
                }, ],
                visible: true,
            });

            map.add(layer_precipitations);

            var layerList = new LayerList({
                view: view,
            });
            view.ui.add(layerList, {
                position: "top-left"
            });
        });
    </script>
</head>

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

</html>
 
 
The page takes about 4 seconds to load with chrome, and about 8 seconds with firefox. If I try loading the same layer with leaflet or openlayers, it doesnt even take 1 second. 
Any one knows how I can make it faster? 
Thank you!
Julien
0 Kudos
0 Replies