MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / traverse

Method traverse

src/common/overlay/levelRenderer/Group.js:203–217  ·  view source on GitHub ↗

* @function LevelRenderer.Group.prototype.traverse * @description 深度优先遍历所有子孙节点。 * @param {function} cb - 回调函数。 * @param {Object} context - 上下文。

(cb, context)

Source from the content-addressed store, hash-verified

201 * @param {Object} context - 上下文。
202 */
203 traverse(cb, context) {
204 var haveContext = !!context;
205 for (var i = 0; i < this._children.length; i++) {
206 var child = this._children[i];
207 if (haveContext) {
208 cb.call(context, child);
209 } else {
210 cb(child);
211 }
212
213 if (child.type === 'group') {
214 child.traverse(cb, context);
215 }
216 }
217 }
218
219
220 /**

Callers 15

GroupSpec.jsFile · 0.80
rsFunction · 0.80
CsFunction · 0.80
OcFunction · 0.80
BcFunction · 0.80
NsFunction · 0.80
slFunction · 0.80
zdFunction · 0.80
RdFunction · 0.80
ZvFunction · 0.80

Calls 1

cbFunction · 0.50

Tested by

no test coverage detected