Zoom issue with "exception in animation handler for: onEnd"

2294
2
07-25-2013 10:58 AM
tonylife
New Contributor III
I am having a weird zoom issue on my map.
Whenever I click zoom in/out button, I am seeing following error in development tool.
And map zoom is out of control with the click.


[INDENT]Empty string passed to getElementById()
exception in animation handler for: onEnd
(new TypeError("_3dc is null", "http://serverapi.arcgisonline.com/jsapi/arcgis/3.5", line 15, column 97887))[/INDENT]


Any help would be appreciated.

Btw, anyone can tell me what is function of column 97887, line 15 of http://serverapi.arcgisonline.com/jsapi/arcgis/3.5?
I am not able to read this script since it is minified.
I see this error message in IE 8 at the time of initializing my map app.
I really want to know what value of "_3dc" is expected.

Thanks,
Tony
0 Kudos
2 Replies
tonylife
New Contributor III
Here is compressed ESRI code.
The code in red is where throw exception.
Please give me some idea of it.

Thanks,
Tony

               _3ce.place = function place(node, _3dc, _3dd) {
                    _3dc = dom.byId(_3dc);
                    if (typeof node == "string") {
                        node = /^\s*</.test(node) ? _3ce.toDom(node, _3dc.ownerDocument) : dom.byId(node);
                    }
                    if (typeof _3dd == "number") {
                        var cn = _3dc.childNodes;
                        if (!cn.length || cn.length <= _3dd) {
                            _3dc.appendChild(node);
                        } else {
                            _3d5(node, cn[_3dd < 0 ? 0 : _3dd]);
                        }
                    } else {
                        switch (_3dd) {
                            case "before":
                                _3d5(node, _3dc);
                                break;
                            case "after":
                                _3d7(node, _3dc);
                                break;
                            case "replace":
                                _3dc.parentNode.replaceChild(node, _3dc);
                                break;
                            case "only":
                                _3ce.empty(_3dc);
                                _3dc.appendChild(node);
                                break;
                            case "first":
                                if (_3dc.firstChild) {
                                    _3d5(node, _3dc.firstChild);
                                    break;
                                }
                            default:
                                _3dc.appendChild(node);
                        }
                    }
                    return node;
                };
0 Kudos
tonylife
New Contributor III
I have nailed down the issue. It is related to Legend widget.

For some reason, if I have some feature layers included, the code of legend widget throw exception when zoom in/out, which causes map broken.

After debug it through I got the following details of stacktrace.

When click zoom button, it runs "onZoomEnd" eventhandler inside of esri API.
Then it jumps between
var _5d7 = _5d6.advice.apply(this, args);
and
return _43e[_43f].apply(_43e, arguments || []);
a couple of times.
After that, if feature layer A is included, it then runs "_refreshLayers" which will eventually hit the null reference exception as shown in above post; if feature layer A is NOT included, it bypass "_refreshLayers", and everything works fine.

"_refreshLayers" function is inside of esri's widgets.js, as follows:

"esri/dijit/Legend": function() {
  _refreshLayers: function() {
                        this.refresh();
                }
}


My question is, what is the condition "_refreshLayers" function in Legend widget get hit when clicking zoom button?
From my side, Feature Layer A is just a regular layer, nothing odd. It is loaded correctly in legend when legend widget gets initialized.

Thanks,
Tony
0 Kudos