Hi , I have a long list of contextual maps that are available to user for imagery overlays. If many of these are added at one time at a certain point I get
RuntimeError: Program failed to link. Link log: Pixel shader sampler count exceeds MAX_TEXTURE_IMAGE_UNITS (16).
How do I trap this error so that I can disallow that final overlay but yet continue functioning? I do not call the rendering function myself, simply set show to true …
I would want to know WHICH overlay I was attempting at the time…
Function used to do the overlays:
var widget = new Cesium.CesiumWidget(‘cesiumContainer’);
var scene = widget.scene;
…
function addLayer(scene, url, layerName, alpha) {
var imageryLayers = scene.imageryLayers;
var provider = new Cesium.WebMapServiceImageryProvider({
url : url,
layers : layerName,
parameters : {
transparent : ‘true’,
format : ‘image/png’
},
proxy : new Cesium.DefaultProxy(‘proxy/?getUrl=’)
});
var newLayer;
try {
newLayer = imageryLayers.addImageryProvider(provider);
} catch (err){
alert(err.message);
return null;
}
var alphaSetting = alpha + 0;
newLayer.alpha = alphaSetting;
newLayer.show = true;
return newLayer;
}
Thanks!
Regards
Rencia