MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / mod

Method mod

src/common/overlay/levelRenderer/Storage.js:248–280  ·  view source on GitHub ↗

* @function LevelRenderer.Storage.prototype.mod * @description 修改图形(Shape)或者组(Group)。 * * @param {string} elId - 唯一标识。 * @param {Object} params - 参数。 * @return {LevelRenderer.Storage} this。

(elId, params)

Source from the content-addressed store, hash-verified

246 * @return {LevelRenderer.Storage} this。
247 */
248 mod(elId, params) {
249 var el = this._elements[elId];
250 if (el) {
251
252 el.modSelf();
253
254 if (params) {
255 // 如果第二个参数直接使用 shape
256 // parent, _storage, __startClip 三个属性会有循环引用
257 // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数
258 if (params.parent || params._storage || params.__startClip) {
259 var target = {};
260 for (var name in params) {
261 if (
262 name == 'parent'
263 || name == '_storage'
264 || name == '__startClip'
265 ) {
266 continue;
267 }
268 if (params.hasOwnProperty(name)) {
269 target[name] = params[name];
270 }
271 }
272 new Util().merge(el, target, true);
273 } else {
274 new Util().merge(el, params, true);
275 }
276 }
277 }
278
279 return this;
280 }
281
282 /**
283 * @function LevelRenderer.Storage.prototype.drift

Callers 7

StorageSpec.jsFile · 0.80
_processDragStartMethod · 0.80
_processDropMethod · 0.80
refreshShapesMethod · 0.80
modShapeMethod · 0.80
modGroupMethod · 0.80
getFrameCallbackMethod · 0.80

Calls 2

mergeMethod · 0.80
modSelfMethod · 0.45

Tested by

no test coverage detected