Select to view content in your preferred language

Check WMS before add

04-06-2022 11:11 AM
New Contributor II

Hi ESRI Community.

I wonder before add or load or create a WMSLayer is possible to check it. I mean check if url is correct or if WMSLayer will be rigth

I would like not to show in the console when a WMS does not load because the url is malformed. When there is an error when adding to the map or creating the WMS in order to capture the error and display it



I just do

var WMSlayer = new WMSLayer({
                    id: id,
                    title: name,
                    url: url,
                    spatialReference: {
                        wkid: 3857
map.add(WMSlayer );
I used .load().then(blabla and other method and events from ArgisAPI but in any of them there are way to know if url o wms is right
0 Kudos
0 Replies