I am unable to see route layer when I am using below code in Arcgis Javascript v4.23. It is not loading to map
let routeLayer = new MapImageLayer({
url: "https://roadsandhighwayssample.esri.com/server/rest/services/RoadsHighways/NewYork/MapServer"
});
map.add(routeLayer); // adds the layer to the map
When I am trying to add above routelayer URL in Arcgis Javascript v3.x, it is working fine.
Please suggest where it is causing issue in Arcgis Javascript v4.x