Select to view content in your preferred language

isVisbleOrInvisilbe is not a function - WebApp Builder

853
2
06-20-2021 02:44 AM
arahman_mdmajid
Frequent Contributor

I am using Portal for ArcGIS (version 10.4.1), and a web application is deployed in the portal with widgets. In the List layer widget, one of the services is not showing up and when the checkbox is marked following error appears in the console.

Uncaught TypeError: a.isVisbleOrInvisilbe is not a function
    at main.js:972
    at Object.traversal (main.js:840)
    at Object.traversal (main.js:841)
    at Object._setTopLayerVisible (main.js:972)
    at Object.setTopLayerVisible (main.js:841)
    at Object._onCkSelectNodeClick (Widget.js:12)
    at HTMLDivElement.<anonymous> (init.js:166)

 

When I visit the main.js, the isVisbleOrInvisilbe is only available in 3 places as follows.

_setTopLayerVisible: function(a) {
    var c;
    if (this.originOperLayer.mapService && (c = this.originOperLayer.mapService, 0 < this.originOperLayer.subLayers.length)) {
        a ? c.layerInfo.subLayerVisible[c.subId]++ : c.layerInfo.subLayerVisible[c.subId]--;
        this._visible =
            a;
        var b = {};
        this.traversal(function(a) {
            0 === a.getSubLayers().length && (b[a.originOperLayer.mapService.subId] = a.isVisbleOrInvisilbe())
        });
        c.layerInfo.setSubLayerVisible(b)
    }
},

 

and further down as follows

visbleOrInvisilbe: function() {
    var d = this.originOperLayer.mapService,
        h = {};
    h[d.subId] = this.isVisbleOrInvisilbe();
    d.layerInfo.setSubLayerVisible(h)
},
isVisbleOrInvisilbe: function() {
    for (var d = this.originOperLayer.mapService, h = -1, c = d.subId, p = 0;;) {
        h++;
        p += d.layerInfo.subLayerVisible[c];
        c = d.layerInfo._getJsapiLayerInfoById(c);
        if (-1 === c.parentLayerId) return p > h ? !0 : !1;
        c = c.parentLayerId
    }
}

 

We can clearly see that the function is present, but still, it says it is not a function. What might be the problem? 

Abdur Rahman
GIS Developer
0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor

Web AppBuilder for Portal 10.4.1 is pretty old, at version 1.4, so there might be some functionality missing for newer layers. What type of layer isn't showing?

0 Kudos
arahman_mdmajid
Frequent Contributor

There is a base map service with two different services. When the check box is toggled, one of those services shows up normally, but when the second service is fired up, it gives the error discussed previously.

layer error.png

Both service links are working normally when accessing the service link directly. 

Abdur Rahman
GIS Developer
0 Kudos