From de10d8e35764c58e0ba8c4c990635e6eb2c24969 Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Thu, 21 Apr 2022 11:23:45 +0800 Subject: [PATCH] style: lint style --- examples/earth/arc3d/demo/flyline.js | 48 +++--- examples/earth/point/demo/cylinder.js | 38 ++--- examples/earth/point/demo/point.js | 36 ++--- examples/point/text/demo/iconfonts.js | 154 +++++++++---------- examples/point/text/demo/simpleCoordinate.js | 62 ++++---- examples/point/text/demo/styleMap.js | 84 +++++----- 6 files changed, 211 insertions(+), 211 deletions(-) diff --git a/examples/earth/arc3d/demo/flyline.js b/examples/earth/arc3d/demo/flyline.js index 592248431b..bb5e550249 100644 --- a/examples/earth/arc3d/demo/flyline.js +++ b/examples/earth/arc3d/demo/flyline.js @@ -47,31 +47,31 @@ scene.on('loaded', () => { scene.addLayer(bloomLayer); fetch('https://gw.alipayobjects.com/os/bmw-prod/20a69b46-3d6d-4ab5-b8b5-150b6aa52c88.json') - .then(res => res.json()) - .then(flydata => { - const flyLine = new LineLayer({ blend: 'normal' }) - .source(flydata, { - parser: { - type: 'json', - coordinates: 'coord' - } - }) - .color('#b97feb') - .shape('arc3d') - .size(0.5) - .active(true) - .animate({ - interval: 2, - trailLength: 2, - duration: 1 - }) - .style({ - opacity: 1, - segmentNumber: 60, - globalArcHeight: 20 + .then(res => res.json()) + .then(flydata => { + const flyLine = new LineLayer({ blend: 'normal' }) + .source(flydata, { + parser: { + type: 'json', + coordinates: 'coord' + } + }) + .color('#b97feb') + .shape('arc3d') + .size(0.5) + .active(true) + .animate({ + interval: 2, + trailLength: 2, + duration: 1 + }) + .style({ + opacity: 1, + segmentNumber: 60, + globalArcHeight: 20 + }); + scene.addLayer(flyLine); }); - scene.addLayer(flyLine); - }) earthlayer.setEarthTime(4.0); }); diff --git a/examples/earth/point/demo/cylinder.js b/examples/earth/point/demo/cylinder.js index 18c893da9d..b5e0e1e783 100644 --- a/examples/earth/point/demo/cylinder.js +++ b/examples/earth/point/demo/cylinder.js @@ -40,26 +40,26 @@ const bloomLayer = new EarthLayer().color('#fff').shape('bloomSphere') scene.on('loaded', () => { scene.addLayer(earthlayer); - + fetch('https://gw.alipayobjects.com/os/bmw-prod/efef6c2b-2922-4c03-b9e0-d3743f68eaf2.json') - .then(res => res.json()) - .then(data => { - const pointlayer = new PointLayer() - .source(data, - { - parser: { - type: 'json', - x: 'lng', - y: 'lat' - } - } - ) - .shape('cylinder') - .color('#f00') - .size('', () => [ 1, 1, 10 ]) - .active(true); - scene.addLayer(pointlayer); - }) + .then(res => res.json()) + .then(data => { + const pointlayer = new PointLayer() + .source(data, + { + parser: { + type: 'json', + x: 'lng', + y: 'lat' + } + } + ) + .shape('cylinder') + .color('#f00') + .size('', () => [ 1, 1, 10 ]) + .active(true); + scene.addLayer(pointlayer); + }); scene.addLayer(atomLayer); scene.addLayer(bloomLayer); diff --git a/examples/earth/point/demo/point.js b/examples/earth/point/demo/point.js index 0f992d2442..9807a36406 100644 --- a/examples/earth/point/demo/point.js +++ b/examples/earth/point/demo/point.js @@ -41,24 +41,24 @@ const bloomLayer = new EarthLayer().color('#fff').shape('bloomSphere') scene.on('loaded', () => { scene.addLayer(earthlayer); fetch('https://gw.alipayobjects.com/os/bmw-prod/efef6c2b-2922-4c03-b9e0-d3743f68eaf2.json') - .then(res => res.json()) - .then(data => { - const pointlayer = new PointLayer() - .source(data, - { - parser: { - type: 'json', - x: 'lng', - y: 'lat' - } - } - ) - .shape('circle') - .color('#f00') - .size(10) - .active(true); - scene.addLayer(pointlayer); - }) + .then(res => res.json()) + .then(data => { + const pointlayer = new PointLayer() + .source(data, + { + parser: { + type: 'json', + x: 'lng', + y: 'lat' + } + } + ) + .shape('circle') + .color('#f00') + .size(10) + .active(true); + scene.addLayer(pointlayer); + }); scene.addLayer(atomLayer); scene.addLayer(bloomLayer); diff --git a/examples/point/text/demo/iconfonts.js b/examples/point/text/demo/iconfonts.js index be1e2eb6f1..0f4de42488 100644 --- a/examples/point/text/demo/iconfonts.js +++ b/examples/point/text/demo/iconfonts.js @@ -24,94 +24,94 @@ scene.addIconFonts([ scene.on('loaded', () => { fetch('https://gw.alipayobjects.com/os/bmw-prod/9eb3f1b5-0c3b-49b2-8221-191d4ba8aa5e.json') - .then(res => res.json()) - .then(originData => { - const layer = new PointLayer() - .source(originData, { - parser: { - type: 'json', - x: 'lng', - y: 'lat' - } - }) - .shape('circle') - .color('backgoundColor') - .size(42); - scene.addLayer(layer); - - const pointIconFontLayer = new PointLayer({}) - .source(originData, { - parser: { - type: 'json', - x: 'lng', - y: 'lat' - } - } - ) - .shape('iconType', 'text') - .size(30) - .color('iconColor') - .style({ - textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left - textOffset: [ -10, 10 ], // 文本相对锚点的偏移量 [水平, 垂直] - fontFamily, - iconfont: true, - textAllowOverlap: true - }); - scene.addLayer(pointIconFontLayer); - - const textLayer = new PointLayer({}) - .source(originData, - { + .then(res => res.json()) + .then(originData => { + const layer = new PointLayer() + .source(originData, { parser: { type: 'json', x: 'lng', y: 'lat' } - } - ) - .shape('temperature', 'text') - .size(10) - .color('#ffffff') - .style({ - textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left - textOffset: [ 5, -55 ], // 文本相对锚点的偏移量 [水平, 垂直] - spacing: 2, // 字符间距 - padding: [ 1, 1 ], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 - stroke: '#ffffff', // 描边颜色 - strokeWidth: 0.3, // 描边宽度 - strokeOpacity: 1.0, - fontFamily: 'Times New Roman', - textAllowOverlap: true - }); - scene.addLayer(textLayer); + }) + .shape('circle') + .color('backgoundColor') + .size(42); + scene.addLayer(layer); - const textLayer2 = new PointLayer({}) - .source(originData, - { + const pointIconFontLayer = new PointLayer({}) + .source(originData, { parser: { type: 'json', x: 'lng', y: 'lat' } } - ) - .shape('weather', 'text') - .size(14) - .color('#ffffff') - .style({ - textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left - textOffset: [ 5, -15 ], // 文本相对锚点的偏移量 [水平, 垂直] - spacing: 2, // 字符间距 - padding: [ 1, 1 ], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 - stroke: '#ffffff', // 描边颜色 - strokeWidth: 0.3, // 描边宽度 - strokeOpacity: 1.0, - fontFamily: 'Times New Roman', - textAllowOverlap: true - }); - scene.addLayer(textLayer2); - }) - + ) + .shape('iconType', 'text') + .size(30) + .color('iconColor') + .style({ + textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left + textOffset: [ -10, 10 ], // 文本相对锚点的偏移量 [水平, 垂直] + fontFamily, + iconfont: true, + textAllowOverlap: true + }); + scene.addLayer(pointIconFontLayer); + + const textLayer = new PointLayer({}) + .source(originData, + { + parser: { + type: 'json', + x: 'lng', + y: 'lat' + } + } + ) + .shape('temperature', 'text') + .size(10) + .color('#ffffff') + .style({ + textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left + textOffset: [ 5, -55 ], // 文本相对锚点的偏移量 [水平, 垂直] + spacing: 2, // 字符间距 + padding: [ 1, 1 ], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 + stroke: '#ffffff', // 描边颜色 + strokeWidth: 0.3, // 描边宽度 + strokeOpacity: 1.0, + fontFamily: 'Times New Roman', + textAllowOverlap: true + }); + scene.addLayer(textLayer); + + const textLayer2 = new PointLayer({}) + .source(originData, + { + parser: { + type: 'json', + x: 'lng', + y: 'lat' + } + } + ) + .shape('weather', 'text') + .size(14) + .color('#ffffff') + .style({ + textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left + textOffset: [ 5, -15 ], // 文本相对锚点的偏移量 [水平, 垂直] + spacing: 2, // 字符间距 + padding: [ 1, 1 ], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 + stroke: '#ffffff', // 描边颜色 + strokeWidth: 0.3, // 描边宽度 + strokeOpacity: 1.0, + fontFamily: 'Times New Roman', + textAllowOverlap: true + }); + scene.addLayer(textLayer2); + }); + }); diff --git a/examples/point/text/demo/simpleCoordinate.js b/examples/point/text/demo/simpleCoordinate.js index c236f030ea..0fcafe66ff 100644 --- a/examples/point/text/demo/simpleCoordinate.js +++ b/examples/point/text/demo/simpleCoordinate.js @@ -29,38 +29,38 @@ const imagelayer = new ImageLayer({}).source( scene.on('loaded', () => { fetch('https://gw.alipayobjects.com/os/bmw-prod/7dc0d454-fabc-4461-a5d5-d404dadb49a9.json') - .then(res => res.json()) - .then(data => { - const textlayer = new PointLayer({ zIndex: 2 }) - .source( - data, - { - parser: { - type: 'json', - x: 'x', - y: 'y' - } - } - ) - .shape('t', 'text') - .size(12) - .active({ - color: '#00f', - mix: 0.9 - }) - .color('rgb(86, 156, 214)') - .style({ - textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left - spacing: 2, // 字符间距 - fontWeight: '800', - padding: [ 1, 1 ], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 - stroke: '#ffffff', // 描边颜色 - strokeWidth: 2, // 描边宽度 - textAllowOverlap: true + .then(res => res.json()) + .then(data => { + const textlayer = new PointLayer({ zIndex: 2 }) + .source( + data, + { + parser: { + type: 'json', + x: 'x', + y: 'y' + } + } + ) + .shape('t', 'text') + .size(12) + .active({ + color: '#00f', + mix: 0.9 + }) + .color('rgb(86, 156, 214)') + .style({ + textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left + spacing: 2, // 字符间距 + fontWeight: '800', + padding: [ 1, 1 ], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 + stroke: '#ffffff', // 描边颜色 + strokeWidth: 2, // 描边宽度 + textAllowOverlap: true + }); + scene.addLayer(textlayer); }); - scene.addLayer(textlayer); - }) scene.addLayer(imagelayer); - + }); diff --git a/examples/point/text/demo/styleMap.js b/examples/point/text/demo/styleMap.js index 0a3df5f677..c048767770 100644 --- a/examples/point/text/demo/styleMap.js +++ b/examples/point/text/demo/styleMap.js @@ -26,48 +26,48 @@ scene.addFontFace(fontFamily, fontPath); scene.on('loaded', () => { fetch('https://gw.alipayobjects.com/os/bmw-prod/f7d083e2-ad55-44fd-b324-15e1b549948a.json') - .then(res => res.json()) - .then(data => { - const pointIconFontLayer = new PointLayer({}) - .source(data, { - parser: { - type: 'json', - x: 'lng', - y: 'lat' - } - }) - .shape('iconType', 'text') - .size(30) - .color('iconColor') - .style({ - textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left - textOffset: 'textOffset', // 文本相对锚点的偏移量 [水平, 垂直] - fontFamily, - iconfont: true, - textAllowOverlap: true - }); - scene.addLayer(pointIconFontLayer); + .then(res => res.json()) + .then(data => { + const pointIconFontLayer = new PointLayer({}) + .source(data, { + parser: { + type: 'json', + x: 'lng', + y: 'lat' + } + }) + .shape('iconType', 'text') + .size(30) + .color('iconColor') + .style({ + textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left + textOffset: 'textOffset', // 文本相对锚点的偏移量 [水平, 垂直] + fontFamily, + iconfont: true, + textAllowOverlap: true + }); + scene.addLayer(pointIconFontLayer); - const textLayer = new PointLayer({}) - .source(data, { - parser: { - type: 'json', - x: 'lng', - y: 'lat' - } - }) - .shape('weather', 'text') - .size(16) - .color('#fff') - .style({ - textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left - textOffset: [ 0, 0 ], // 文本相对锚点的偏移量 [水平, 垂直] - spacing: 2, // 字符间距 - padding: [ 1, 1 ], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 - fontFamily: 'Times New Roman', - textAllowOverlap: true + const textLayer = new PointLayer({}) + .source(data, { + parser: { + type: 'json', + x: 'lng', + y: 'lat' + } + }) + .shape('weather', 'text') + .size(16) + .color('#fff') + .style({ + textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left + textOffset: [ 0, 0 ], // 文本相对锚点的偏移量 [水平, 垂直] + spacing: 2, // 字符间距 + padding: [ 1, 1 ], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 + fontFamily: 'Times New Roman', + textAllowOverlap: true + }); + scene.addLayer(textLayer); }); - scene.addLayer(textLayer); - }) - + });