Adding WMS layer to WAB Custom Widget

432
1
10-13-2020 05:16 AM
GerardMartin
Occasional Contributor

I have develop 2D Custom Widget, and I would like to add a new layer from WMS Service (no ESRI).

More precisely, I would like to use one of layers of this WMS Service: 

http://geoserveis.icgc.cat/icc_mapesbase/wms/service?service=wms&version=1.1.1&request=GetCapabiliti...

So, I include the following code in widget.js without any result.

How can I add a new wms layer to this.map when execute widget ?

        this.wmsLayer = new WMSLayer({
          url: "http://geoserveis.icgc.cat/icc_mapesbase/wms/service",
          sublayers: [{name: "mtc5m"}]
        });
        this.map.addLayer(this.wmsLayer);
                       
0 Kudos
1 Reply
GerardMartin
Occasional Contributor

I would like to share these references that I have found

https://github.com/vojvod/CMV_addWMSLayer_Widget/blob/master/js/gis/dijit/WMSLayer2.js 

https://community.esri.com/message/906115-load-a-wms-map-service-to-map

I'm still working on that, any help would be appreciated.

Thanks in advance !

0 Kudos