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

Function Layer

libs/echarts/echarts.simple.js:7294–7352  ·  view source on GitHub ↗
(id, painter, dpr)

Source from the content-addressed store, hash-verified

7292 * @param {number} [dpr]
7293 */
7294var Layer = function (id, painter, dpr) {
7295 var dom;
7296 dpr = dpr || devicePixelRatio;
7297 if (typeof id === 'string') {
7298 dom = createDom(id, painter, dpr);
7299 }
7300 // Not using isDom because in node it will return false
7301 else if (isObject$1(id)) {
7302 dom = id;
7303 id = dom.id;
7304 }
7305 this.id = id;
7306 this.dom = dom;
7307
7308 var domStyle = dom.style;
7309 if (domStyle) { // Not in node
7310 dom.onselectstart = returnFalse; // 避免页面选中的尴尬
7311 domStyle['-webkit-user-select'] = 'none';
7312 domStyle['user-select'] = 'none';
7313 domStyle['-webkit-touch-callout'] = 'none';
7314 domStyle['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)';
7315 domStyle['padding'] = 0; // eslint-disable-line dot-notation
7316 domStyle['margin'] = 0; // eslint-disable-line dot-notation
7317 domStyle['border-width'] = 0;
7318 }
7319
7320 this.domBack = null;
7321 this.ctxBack = null;
7322
7323 this.painter = painter;
7324
7325 this.config = null;
7326
7327 // Configs
7328 /**
7329 * 每次清空画布的颜色
7330 * @type {string}
7331 * @default 0
7332 */
7333 this.clearColor = 0;
7334 /**
7335 * 是否开启动态模糊
7336 * @type {boolean}
7337 * @default false
7338 */
7339 this.motionBlur = false;
7340 /**
7341 * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
7342 * @type {number}
7343 * @default 0.7
7344 */
7345 this.lastFrameAlpha = 0.7;
7346
7347 /**
7348 * Layer dpr
7349 * @type {number}
7350 */
7351 this.dpr = dpr;

Callers

nothing calls this directly

Calls 2

createDomFunction · 0.70
isObject$1Function · 0.70

Tested by

no test coverage detected