Select to view content in your preferred language

esri.renderers.RasterStretchRenderer - Depreciated - Property: statistics

141
1
11-13-2024 09:09 AM
JaredPilbeam2
MVP Alum

 

[esri.renderers.RasterStretchRenderer]  DEPRECATED - Property: statistics 
️ Replacement: customStatistics 
 Version: 4.31

 

I updated my CDN from 4.27 to 4.31 and now I'm getting this warning. I think it's coming from the imagery2024 constructor. I don't have any statistics set in the code as my layers are in webmaps. I'm unsure how to fix it. Codepen

 

<link rel="stylesheet" href="https://js.arcgis.com/4.31/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.31/"></script>

<script>
    require(["esri/Map",
        "esri/views/MapView",
        "esri/widgets/Search",
        "esri/widgets/Locate",
        "esri/widgets/LayerList",
        "esri/layers/ImageryLayer",
        "esri/widgets/Legend",
        "esri/widgets/Expand",
        "esri/widgets/Swipe",
        "esri/WebMap",
        "esri/layers/support/RasterFunction",
    ], (Map, MapView, Search, Locate, LayerList, ImageryLayer, Legend, Expand, Swipe, WebMap, RasterFunction) => {
        //webmap IDs
        const webmapids = [
            "e67a8eb6768641c19d4a7c5df394dbf4", //DTM
            "bfc5b0242adb42bfb0fc41e54497dfc8", //DSM
            "6ed3d2e495db4e859a73d2a32ce3d576", //HEDEM
            "d653b18bc941458491e06e657e10f393", //Intensity
            "a9ab25b1c7204764b2fabad6fc7a4635", //IR
            "e6bab92ebc524072a3305ec8f128e8f8", //Soil
            "2f9acebfb8db4e10bb6dddab8d3239c7", //ClosedDepressions
        ];

        /************************************************************
        * Create multiple WebMap instances
        ************************************************************/
        const webmaps = webmapids.map((webmapid) => {
            return new WebMap({
                portalItem: {
                    // autocasts as new PortalItem()
                    id: webmapid,
                }
            });
        });

        // add image services used in the swipe map
        const imagery2024 = new ImageryLayer({
            url: "https://gis.willcountyillinois.com/image/rest/services/Orthoimagery/Orthos_2024_3IN/ImageServer",
            rasterFunction: [],
            renderer: {
            type: "raster-stretch", //I added this while debugging: no difference
            }
        });
        webmaps[0].add(imagery2024);

        /************************************************************
         * Initialize the View with the first WebMap
         ************************************************************/
        const view = new MapView({
            map: webmaps[0],
            container: "viewDiv",
            constraints: {
                maxScale: 500,
                minScale: 300000,
            }
        });
        console.log('construct the view')

 

0 Kudos
1 Reply
UndralBatsukh
Esri Regular Contributor

Hi there, 

You needn't worry about these errors since your code does not touch statistics. This will be updated in the MapViewer in coming release.

0 Kudos