I'm having problems with a map that has many layers. I'm getting one of those obscure errors that doesn't help you one bit. I believe there is an issue with one of my layers, but I've combed through the rest end point and my layer constructors and everything looks OK.
I know I've seen this before - someone posted a chuck of code that would check that the layer was valid before adding, so it was easier to troubleshoot which layer has the problem. It gave you some feedback in the console that told you if there was a problem or not.
Keywords like map, layer, add are all so generic that searching on these words doesn't help. Does anyone remember writing or seeing this code so I could incorporate it into my project?