From 6ad69a415a97af91d42f9581e8957ab7c594ebe2 Mon Sep 17 00:00:00 2001 From: shihui Date: Thu, 13 Jan 2022 21:12:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?docs:=20=E5=AE=8C=E5=96=84=E5=AE=98?= =?UTF-8?q?=E7=BD=91=20demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/wind.zh.md | 3 +- examples/amapPlugin/bus/demo/meta.json | 2 +- examples/draw/UI/demo/meta.json | 4 +- examples/earth/arc3d/demo/meta.json | 2 +- examples/earth/point/demo/meta.json | 4 +- examples/engine/three/demo/meta.json | 6 +- examples/engine/three/demo/space_click.js | 4 +- examples/gallery/animate/demo/cylinder.js | 320 ------------------ examples/gallery/animate/demo/meta.json | 6 +- examples/gallery/animate/demo/route_line.js | 188 ++++++++++ examples/line/animate/API.en.md | 2 +- examples/line/animate/API.zh.md | 3 +- examples/line/animate/demo/meta.json | 16 +- examples/line/arc/API.en.md | 2 +- examples/line/arc/API.zh.md | 3 +- examples/line/isoline/API.en.md | 2 +- examples/line/isoline/API.zh.md | 3 +- examples/line/path/demo/bus_dark.js | 2 +- examples/line/path/demo/bus_light.js | 2 +- examples/line/path/demo/meta.json | 17 +- examples/line/path/demo/road_dark.js | 18 +- examples/line/path/demo/road_light.js | 2 +- examples/line/path/demo/route_line.js | 212 ++++++++---- examples/line/wall/demo/meta.json | 4 +- examples/point/marker/demo/clustermarker.js | 4 +- examples/point/marker/demo/meta.json | 6 +- examples/raster/basic/API.en.md | 2 +- examples/raster/basic/API.zh.md | 3 +- examples/raster/basic/demo/dem.js | 2 +- examples/raster/basic/demo/image.js | 2 +- examples/raster/basic/demo/light.js | 2 +- examples/raster/basic/demo/meta.json | 10 +- examples/raster/basic/demo/ndvi.js | 2 +- examples/react/control/demo/meta.json | 4 +- examples/react/layer/demo/Point_image.tsx | 2 +- examples/react/layer/demo/meta.json | 6 +- examples/react/scene/demo/meta.json | 4 +- examples/tutorial/control/demo/meta.json | 4 +- examples/tutorial/layer/demo/meta.json | 2 +- .../map/demo/{amap.js => gaodemap.js} | 3 +- examples/tutorial/map/demo/meta.json | 10 +- examples/tutorial/marker/demo/meta.json | 4 +- examples/wind/basic/demo/meta.json | 2 +- examples/wind/basic/demo/wind.js | 8 +- 44 files changed, 414 insertions(+), 495 deletions(-) delete mode 100644 examples/gallery/animate/demo/cylinder.js create mode 100644 examples/gallery/animate/demo/route_line.js rename examples/tutorial/map/demo/{amap.js => gaodemap.js} (81%) diff --git a/docs/api/wind.zh.md b/docs/api/wind.zh.md index 78fea4fda4..edc744f368 100644 --- a/docs/api/wind.zh.md +++ b/docs/api/wind.zh.md @@ -11,9 +11,8 @@ WindLayer 用于将存储风场信息的图片,设置其风速线采样相关 import { WindLayer } from '@antv/l7'; ``` -案例 +案例 -## API ### source diff --git a/examples/amapPlugin/bus/demo/meta.json b/examples/amapPlugin/bus/demo/meta.json index 4260d3cae5..f11c564185 100644 --- a/examples/amapPlugin/bus/demo/meta.json +++ b/examples/amapPlugin/bus/demo/meta.json @@ -7,7 +7,7 @@ { "filename": "busStop.js", "title": "公交线路插件", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*BPJiQKLxYwMAAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*9MHrRZTvaiAAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/draw/UI/demo/meta.json b/examples/draw/UI/demo/meta.json index bc57e9f59e..aa7a128bf7 100644 --- a/examples/draw/UI/demo/meta.json +++ b/examples/draw/UI/demo/meta.json @@ -8,12 +8,12 @@ { "filename": "amap.js", "title": "高德地图绘制", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*nMVTRY3xCuoAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*-5KDT6d7pLcAAAAAAAAAAAAAARQnAQ" }, { "filename": "mapbox.js", "title": "Mapbox 地图绘制", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*oX9uTpfcIJ4AAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*bdDFS4ytOhYAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/earth/arc3d/demo/meta.json b/examples/earth/arc3d/demo/meta.json index d968c4288a..84b46b0782 100644 --- a/examples/earth/arc3d/demo/meta.json +++ b/examples/earth/arc3d/demo/meta.json @@ -7,7 +7,7 @@ { "filename": "flyline.js", "title": "飞线", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*ZrpHTKS1_FsAAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*hak1RaMjp1MAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/earth/point/demo/meta.json b/examples/earth/point/demo/meta.json index 3fb6c01221..b8b1364975 100644 --- a/examples/earth/point/demo/meta.json +++ b/examples/earth/point/demo/meta.json @@ -7,12 +7,12 @@ { "filename": "point.js", "title": "点图层", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*R5uPS4SIMi0AAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*-kG0TIHBfvgAAAAAAAAAAAAAARQnAQ" }, { "filename": "cylinder.js", "title": "圆柱图层", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*u2iWTrhJnL0AAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*v26ESpAZd1AAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/engine/three/demo/meta.json b/examples/engine/three/demo/meta.json index 6c0f3d79a9..23be5812b0 100644 --- a/examples/engine/three/demo/meta.json +++ b/examples/engine/three/demo/meta.json @@ -7,17 +7,17 @@ { "filename": "amap_ant.js", "title": "高德地图", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*1_W2SIR8swwAAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*mjmxT7DaVQgAAAAAAAAAAAAAARQnAQ" }, { "filename": "mapbox_ant.js", "title": "mapbox 地图", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*kflKRJvm3hYAAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*dsbURZ87Rv8AAAAAAAAAAAAAARQnAQ" }, { "filename": "space_click.js", "title": "点击建筑", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*AY5vSIMeLy8AAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*ilK5R4SidkMAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/engine/three/demo/space_click.js b/examples/engine/three/demo/space_click.js index 9f20ece2a0..94a61bc858 100644 --- a/examples/engine/three/demo/space_click.js +++ b/examples/engine/three/demo/space_click.js @@ -364,14 +364,14 @@ scene.on('loaded', () => { lat: 30.251529, pitch: 83, rotation: 225, - zoom: 16 + zoom: 15 }; const ZSpaceView = { lng: 120.112026, lat: 30.256881, pitch: 80, rotation: 220, - zoom: 16 + zoom: 15 }; scene.on('click', ev => { diff --git a/examples/gallery/animate/demo/cylinder.js b/examples/gallery/animate/demo/cylinder.js deleted file mode 100644 index 1d5a9d0ef0..0000000000 --- a/examples/gallery/animate/demo/cylinder.js +++ /dev/null @@ -1,320 +0,0 @@ -import { Scene, PointLayer, EarthLayer } from '@antv/l7'; -import { Earth } from '@antv/l7-maps'; -const scene = new Scene({ - id: 'map', - map: new Earth({}) -}); - -const d = [ - { lng: 121.61865234375, lat: 25.29437116258816 }, - { lng: 121.058349609375, lat: 25.015928763367857 }, - { lng: 120.7177734375, lat: 24.587090339209634 }, - { lng: 120.28930664062499, lat: 23.936054914599815 }, - { lng: 120.12451171875, lat: 23.553916518321625 }, - { lng: 120.08056640625, lat: 23.120153621695614 }, - { lng: 120.234375, lat: 22.867317960075614 }, - { lng: 120.43212890625, lat: 22.52270570348246 }, - { lng: 120.65185546875, lat: 22.370396344320053 }, - { lng: 120.750732421875, lat: 21.922663209325922 }, - { lng: 120.948486328125, lat: 22.268764039073968 }, - { lng: 121.124267578125, lat: 22.806567100271522 }, - { lng: 121.56372070312499, lat: 23.915970370510227 }, - { lng: 121.88232421875, lat: 24.557116164309626 }, - { lng: 121.95922851562501, lat: 25.075648445630527 }, - { lng: 109.97314453125, lat: 20.076570104545173 }, - { lng: 108.896484375, lat: 19.663280219987662 }, - { lng: 108.61083984375, lat: 18.979025953255267 }, - { lng: 108.80859375, lat: 18.47960905583197 }, - { lng: 109.599609375, lat: 18.35452552912664 }, - { lng: 110.32470703125, lat: 18.771115062337024 }, - { lng: 111.005859375, lat: 19.78738018198621 }, - { lng: 127.657407, lat: 49.76027 }, - { lng: 129.397818, lat: 49.4406 }, - { lng: 130.582293, lat: 48.729687 }, - { lng: 130.987282, lat: 47.790132 }, - { lng: 132.506672, lat: 47.78897 }, - { lng: 133.373596, lat: 48.183442 }, - { lng: 135.026311, lat: 48.47823 }, - { lng: 134.500814, lat: 47.57844 }, - { lng: 134.112362, lat: 47.212467 }, - { lng: 133.769644, lat: 46.116927 }, - { lng: 133.097127, lat: 45.144066 }, - { lng: 131.883454, lat: 45.321162 }, - { lng: 131.025212, lat: 44.967953 }, - { lng: 131.288555, lat: 44.11152 }, - { lng: 131.144688, lat: 42.92999 }, - { lng: 130.633866, lat: 42.903015 }, - { lng: 130.640016, lat: 42.395009 }, - { lng: 129.994267, lat: 42.985387 }, - { lng: 129.596669, lat: 42.424982 }, - { lng: 128.052215, lat: 41.994285 }, - { lng: 128.208433, lat: 41.466772 }, - { lng: 127.343783, lat: 41.503152 }, - { lng: 126.869083, lat: 41.816569 }, - { lng: 126.182045, lat: 41.107336 }, - { lng: 125.079942, lat: 40.569824 }, - { lng: 124.265625, lat: 39.928493 }, - { lng: 122.86757, lat: 39.637788 }, - { lng: 122.131388, lat: 39.170452 }, - { lng: 121.054554, lat: 38.897471 }, - { lng: 121.585995, lat: 39.360854 }, - { lng: 121.376757, lat: 39.750261 }, - { lng: 122.168595, lat: 40.422443 }, - { lng: 121.640359, lat: 40.94639 }, - { lng: 120.768629, lat: 40.593388 }, - { lng: 119.639602, lat: 39.898056 }, - { lng: 119.023464, lat: 39.252333 }, - { lng: 118.042749, lat: 39.204274 }, - { lng: 117.532702, lat: 38.737636 }, - { lng: 118.059699, lat: 38.061476 }, - { lng: 118.87815, lat: 37.897325 }, - { lng: 118.911636, lat: 37.448464 }, - { lng: 119.702802, lat: 37.156389 }, - { lng: 120.823457, lat: 37.870428 }, - { lng: 121.711259, lat: 37.481123 }, - { lng: 122.357937, lat: 37.454484 }, - { lng: 122.519995, lat: 36.930614 }, - { lng: 121.104164, lat: 36.651329 }, - { lng: 120.637009, lat: 36.11144 }, - { lng: 119.664562, lat: 35.609791 }, - { lng: 119.151208, lat: 34.909859 }, - { lng: 120.227525, lat: 34.360332 }, - { lng: 120.620369, lat: 33.376723 }, - { lng: 121.229014, lat: 32.460319 }, - { lng: 121.908146, lat: 31.692174 }, - { lng: 121.891919, lat: 30.949352 }, - { lng: 121.264257, lat: 30.676267 }, - { lng: 121.503519, lat: 30.142915 }, - { lng: 122.092114, lat: 29.83252 }, - { lng: 121.938428, lat: 29.018022 }, - { lng: 121.684439, lat: 28.225513 }, - { lng: 121.125661, lat: 28.135673 }, - { lng: 120.395473, lat: 27.053207 }, - { lng: 119.585497, lat: 25.740781 }, - { lng: 118.656871, lat: 24.547391 }, - { lng: 117.281606, lat: 23.624501 }, - { lng: 115.890735, lat: 22.782873 }, - { lng: 114.763827, lat: 22.668074 }, - { lng: 114.152547, lat: 22.22376 }, - { lng: 113.80678, lat: 22.54834 }, - { lng: 113.241078, lat: 22.051367 }, - { lng: 111.843592, lat: 21.550494 }, - { lng: 110.785466, lat: 21.397144 }, - { lng: 110.444039, lat: 20.341033 }, - { lng: 109.889861, lat: 20.282457 }, - { lng: 109.627655, lat: 21.008227 }, - { lng: 109.864488, lat: 21.395051 }, - { lng: 108.522813, lat: 21.715212 }, - { lng: 108.05018, lat: 21.55238 }, - { lng: 107.04342, lat: 21.811899 }, - { lng: 106.567273, lat: 22.218205 }, - { lng: 106.725403, lat: 22.794268 }, - { lng: 105.811247, lat: 22.976892 }, - { lng: 105.329209, lat: 23.352063 }, - { lng: 104.476858, lat: 22.81915 }, - { lng: 103.504515, lat: 22.703757 }, - { lng: 102.706992, lat: 22.708795 }, - { lng: 102.170436, lat: 22.464753 }, - { lng: 101.652018, lat: 22.318199 }, - { lng: 101.80312, lat: 21.174367 }, - { lng: 101.270026, lat: 21.201652 }, - { lng: 101.180005, lat: 21.436573 }, - { lng: 101.150033, lat: 21.849984 }, - { lng: 100.416538, lat: 21.558839 }, - { lng: 99.983489, lat: 21.742937 }, - { lng: 99.240899, lat: 22.118314 }, - { lng: 99.531992, lat: 22.949039 }, - { lng: 98.898749, lat: 23.142722 }, - { lng: 98.660262, lat: 24.063286 }, - { lng: 97.60472, lat: 23.897405 }, - { lng: 97.724609, lat: 25.083637 }, - { lng: 98.671838, lat: 25.918703 }, - { lng: 98.712094, lat: 26.743536 }, - { lng: 98.68269, lat: 27.508812 }, - { lng: 98.246231, lat: 27.747221 }, - { lng: 97.911988, lat: 28.335945 }, - { lng: 97.327114, lat: 28.261583 }, - { lng: 96.248833, lat: 28.411031 }, - { lng: 96.586591, lat: 28.83098 }, - { lng: 96.117679, lat: 29.452802 }, - { lng: 95.404802, lat: 29.031717 }, - { lng: 94.56599, lat: 29.277438 }, - { lng: 93.413348, lat: 28.640629 }, - { lng: 92.503119, lat: 27.896876 }, - { lng: 91.696657, lat: 27.771742 }, - { lng: 91.258854, lat: 28.040614 }, - { lng: 90.730514, lat: 28.064954 }, - { lng: 90.015829, lat: 28.296439 }, - { lng: 89.47581, lat: 28.042759 }, - { lng: 88.814248, lat: 27.299316 }, - { lng: 88.730326, lat: 28.086865 }, - { lng: 88.120441, lat: 27.876542 }, - { lng: 86.954517, lat: 27.974262 }, - { lng: 85.82332, lat: 28.203576 }, - { lng: 85.011638, lat: 28.642774 }, - { lng: 84.23458, lat: 28.839894 }, - { lng: 83.898993, lat: 29.320226 }, - { lng: 83.337115, lat: 29.463732 }, - { lng: 82.327513, lat: 30.115268 }, - { lng: 81.525804, lat: 30.422717 }, - { lng: 81.111256, lat: 30.183481 }, - { lng: 79.721367, lat: 30.882715 }, - { lng: 78.738894, lat: 31.515906 }, - { lng: 78.458446, lat: 32.618164 }, - { lng: 79.176129, lat: 32.48378 }, - { lng: 79.208892, lat: 32.994395 }, - { lng: 78.811086, lat: 33.506198 }, - { lng: 78.912269, lat: 34.321936 }, - { lng: 77.837451, lat: 35.49401 }, - { lng: 76.192848, lat: 35.898403 }, - { lng: 75.896897, lat: 36.666806 }, - { lng: 75.158028, lat: 37.133031 }, - { lng: 74.980002, lat: 37.41999 }, - { lng: 74.829986, lat: 37.990007 }, - { lng: 74.864816, lat: 38.378846 }, - { lng: 74.257514, lat: 38.606507 }, - { lng: 73.928852, lat: 38.505815 }, - { lng: 73.675379, lat: 39.431237 }, - { lng: 73.960013, lat: 39.660008 }, - { lng: 73.822244, lat: 39.893973 }, - { lng: 74.776862, lat: 40.366425 }, - { lng: 75.467828, lat: 40.562072 }, - { lng: 76.526368, lat: 40.427946 }, - { lng: 76.904484, lat: 41.066486 }, - { lng: 78.187197, lat: 41.185316 }, - { lng: 78.543661, lat: 41.582243 }, - { lng: 80.11943, lat: 42.123941 }, - { lng: 80.25999, lat: 42.349999 }, - { lng: 80.18015, lat: 42.920068 }, - { lng: 80.866206, lat: 43.180362 }, - { lng: 79.966106, lat: 44.917517 }, - { lng: 81.947071, lat: 45.317027 }, - { lng: 82.458926, lat: 45.53965 }, - { lng: 83.180484, lat: 47.330031 }, - { lng: 85.16429, lat: 47.000956 }, - { lng: 85.720484, lat: 47.452969 }, - { lng: 85.768233, lat: 48.455751 }, - { lng: 86.598776, lat: 48.549182 }, - { lng: 87.35997, lat: 49.214981 }, - { lng: 87.751264, lat: 49.297198 }, - { lng: 88.013832, lat: 48.599463 }, - { lng: 88.854298, lat: 48.069082 }, - { lng: 90.280826, lat: 47.693549 }, - { lng: 90.970809, lat: 46.888146 }, - { lng: 90.585768, lat: 45.719716 }, - { lng: 90.94554, lat: 45.286073 }, - { lng: 92.133891, lat: 45.115076 }, - { lng: 93.480734, lat: 44.975472 }, - { lng: 94.688929, lat: 44.352332 }, - { lng: 95.306875, lat: 44.241331 }, - { lng: 95.762455, lat: 43.319449 }, - { lng: 96.349396, lat: 42.725635 }, - { lng: 97.451757, lat: 42.74889 }, - { lng: 99.515817, lat: 42.524691 }, - { lng: 100.845866, lat: 42.663804 }, - { lng: 101.83304, lat: 42.514873 }, - { lng: 103.312278, lat: 41.907468 }, - { lng: 104.522282, lat: 41.908347 }, - { lng: 104.964994, lat: 41.59741 }, - { lng: 106.129316, lat: 42.134328 }, - { lng: 107.744773, lat: 42.481516 }, - { lng: 109.243596, lat: 42.519446 }, - { lng: 110.412103, lat: 42.871234 }, - { lng: 111.129682, lat: 43.406834 }, - { lng: 111.829588, lat: 43.743118 }, - { lng: 111.667737, lat: 44.073176 }, - { lng: 111.348377, lat: 44.457442 }, - { lng: 111.873306, lat: 45.102079 }, - { lng: 112.436062, lat: 45.011646 }, - { lng: 113.463907, lat: 44.808893 }, - { lng: 114.460332, lat: 45.339817 }, - { lng: 115.985096, lat: 45.727235 }, - { lng: 116.717868, lat: 46.388202 }, - { lng: 117.421701, lat: 46.672733 }, - { lng: 118.874326, lat: 46.805412 }, - { lng: 119.66327, lat: 46.69268 }, - { lng: 119.772824, lat: 47.048059 }, - { lng: 118.866574, lat: 47.74706 }, - { lng: 118.064143, lat: 48.06673 }, - { lng: 117.295507, lat: 47.697709 }, - { lng: 116.308953, lat: 47.85341 }, - { lng: 115.742837, lat: 47.726545 }, - { lng: 115.485282, lat: 48.135383 }, - { lng: 116.191802, lat: 49.134598 }, - { lng: 116.678801, lat: 49.888531 }, - { lng: 117.879244, lat: 49.510983 }, - { lng: 119.288461, lat: 50.142883 }, - { lng: 119.279366, lat: 50.582908 }, - { lng: 120.18205, lat: 51.643566 }, - { lng: 120.738191, lat: 51.964115 }, - { lng: 120.725789, lat: 52.516226 }, - { lng: 120.177089, lat: 52.753886 }, - { lng: 121.003085, lat: 53.251401 }, - { lng: 122.245748, lat: 53.431726 }, - { lng: 123.571507, lat: 53.458804 }, - { lng: 125.068211, lat: 53.161045 }, - { lng: 125.946349, lat: 52.792799 }, - { lng: 126.564399, lat: 51.784255 }, - { lng: 126.939157, lat: 51.353894 }, - { lng: 127.287456, lat: 50.739797 }, - { lng: 127.657407, lat: 49.76027 } -]; - -const pointlayer = new PointLayer() - .source( - d, - { - parser: { - type: 'json', - x: 'lng', - y: 'lat' - } - } - ) - .shape('cylinder') - .color('#f00') - .size('', () => [ 1, 1, 10 ]) - .active(true); - -const earthlayer = new EarthLayer() - .source( - 'https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*3-3NSpqRqUoAAAAAAAAAAAAAARQnAQ', - { - parser: { - type: 'image' - } - } - ) - .shape('fill') - .style({ - opacity: 1.0, - radius: 40, - globelOtions: { - ambientRatio: 0.6, // 环境光 - diffuseRatio: 0.4, // 漫反射 - specularRatio: 0.1 // 高光反射 - } - }) - .animate(true); - -const atomLayer = new EarthLayer() - .color('#2E8AE6') - .shape('atomSphere') - .style({ - opacity: 1 - }); - -const bloomLayer = new EarthLayer().color('#fff').shape('bloomSphere') - .style({ - opacity: 0.6 - }); - -scene.on('loaded', () => { - scene.addLayer(earthlayer); - scene.addLayer(pointlayer); - - scene.addLayer(atomLayer); - scene.addLayer(bloomLayer); - - earthlayer.setEarthTime(4.0); -}); diff --git a/examples/gallery/animate/demo/meta.json b/examples/gallery/animate/demo/meta.json index 67d5de2849..fc371868a4 100644 --- a/examples/gallery/animate/demo/meta.json +++ b/examples/gallery/animate/demo/meta.json @@ -40,9 +40,9 @@ "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*mo_7Q6sTqOIAAAAAAAAAAAAAARQnAQ" }, { - "filename": "cylinder.js", - "title": "地球圆柱", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*xjRPRJU5CKUAAAAAAAAAAAAAARQnAQ" + "filename": "route_line.js", + "title": "航线图", + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*qRFaR7Ko274AAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/gallery/animate/demo/route_line.js b/examples/gallery/animate/demo/route_line.js new file mode 100644 index 0000000000..27114a30d3 --- /dev/null +++ b/examples/gallery/animate/demo/route_line.js @@ -0,0 +1,188 @@ +/* eslint-disable no-eval */ +import { Scene, LineLayer, PointLayer, PolygonLayer } from '@antv/l7';// +import { GaodeMap } from '@antv/l7-maps'; + + +const scene = new Scene({ + id: 'map', + map: new GaodeMap({ + center: [ 110, 30 ], + zoom: 2.5, + style: 'dark' + }) +}); +const originData = { // BJ -> CQ + lng1: 116.5883553580003, + lat1: 40.07680509701226, + lng2: 106.06201171875, + lat2: 30.164126343161097 +}; +const originData2 = { // BJ -> HK + lng1: 116.5883553580003, + lat1: 40.07680509701226, + lng2: 114.3072509765625, + lat2: 22.228090416784486 +}; +const originData3 = { // BJ -> HerBin + lng1: 116.5883553580003, + lat1: 40.07680509701226, + lng2: 126.62841796875, + lat2: 45.75219336063106 +}; +const originData4 = { // BJ -> Wulumuqi + lng1: 116.5883553580003, + lat1: 40.07680509701226, + lng2: 87.57202148437499, + lat2: 43.82660134505382 +}; +const originData5 = { // BJ -> 上海 + lng1: 116.5883553580003, + lat1: 40.07680509701226, + lng2: 121.26708984374999, + lat2: 31.259769987394286 +}; + +scene.on('loaded', () => { + scene.addImage( + 'plane', + 'https://gw.alipayobjects.com/zos/bmw-prod/bea041d7-d6d4-4027-b422-a0bc321fbf14.svg' + ); + + Promise.all([ + fetch( + 'https://gw.alipayobjects.com/os/basement_prod/dbd008f1-9189-461c-88aa-569357ffc07d.json' + ).then(d => d.json()) + ]).then(function onLoad([ world ]) { + + const data = [] + + for (let i = 0; i < 99; i++) { + data.push({ + thetaOffset: -1/2 + i * (1/99), // 设置曲线的偏移量 + ...originData + }); + } + + for (let i = 0; i < 30; i++) { + data.push({ + thetaOffset: -1/2 + i * (1/30), // 设置曲线的偏移量 + ...originData2 + }); + } + + for (let i = 0; i < 15; i++) { + data.push({ + thetaOffset: -1/2 + i * (1/15), // 设置曲线的偏移量 + ...originData3 + }); + } + + for (let i = 0; i < 11; i++) { + data.push({ + thetaOffset: -1/2 + i * (1/11), // 设置曲线的偏移量 + ...originData4 + }); + } + + for (let i = 0; i < 60; i++) { + data.push({ + thetaOffset: -1/2 + i * (1/60), // 设置曲线的偏移量 + ...originData5 + }); + } + + const worldLine = new LineLayer() + .source(world) + .color('#1E90FF') + .size(0.5) + .style({ + opacity: 0.4 + }); + scene.addLayer(worldLine); + + const worldFill = new PolygonLayer({ blend: 'normal' }) + .source(world) + .size('name', [ 0, 10000, 50000, 30000, 100000 ]) + .color('#1E90FF') + .shape('fill') + .active(true) + + .style({ + opacity: 0.2, + opacityLinear: { + enable: true, + dir: 'out' // in - out + } + }); + scene.addLayer(worldFill); + + const jsonParserOotion = { + parser: { + type: 'json', + x: 'lng', + y: 'lat' + } + } + + const jsonLineParserOotion = { + parser: { + type: 'json', + x: 'lng1', + y: 'lat1', + x1: 'lng2', + y1: 'lat2' + } + } + + const dotData = [ + { // CQ + lng: 106.06201171875, + lat: 30.164126343161097 + }, + { // BJ + lng: 116.5883553580003, + lat: 40.07680509701226, + }, + { // HK + lng: 114.3072509765625, + lat: 22.228090416784486 + }, + { // Herbin + lng: 126.62841796875, + lat: 45.75219336063106 + }, + { // shanghai + lng: 121.26708984374999, + lat: 31.259769987394286 + }, + { // Wulumuqi + lng: 87.57202148437499, + lat: 43.82660134505382 + } + ] + + const dotPoint = new PointLayer({zIndex: 2}) + .source(dotData, jsonParserOotion) + .shape('circle') + .color('#00FFFF') + .animate(true) + .size(30) + scene.addLayer(dotPoint); + + const layerPlaneLine = new LineLayer({ blend: 'normal' }) + .source(data, jsonLineParserOotion) + .size(1) + .shape('arc') + .color('#87CEFA') + .animate({ + interval: 1, // 间隔 + duration: 1, // 持续时间,延时 + trailLength: 2 // 流线长度 + }) + .style({ + opacity: 0.4, + thetaOffset: 'thetaOffset' + }); + scene.addLayer(layerPlaneLine); + }); +}); diff --git a/examples/line/animate/API.en.md b/examples/line/animate/API.en.md index deec723ffa..bc7dce7e17 100644 --- a/examples/line/animate/API.en.md +++ b/examples/line/animate/API.en.md @@ -1 +1 @@ -`markdown:docs/api/layer/line_layer/arc.en.md` +`markdown:docs/api/line_layer/linelayer.en.md` diff --git a/examples/line/animate/API.zh.md b/examples/line/animate/API.zh.md index 2a46a487bd..3da92b8fb2 100644 --- a/examples/line/animate/API.zh.md +++ b/examples/line/animate/API.zh.md @@ -1,2 +1 @@ -`markdown:docs/api/layer/line_layer/arc.zh.md` - +`markdown:docs/api/line_layer/linelayer.zh.md` \ No newline at end of file diff --git a/examples/line/animate/demo/meta.json b/examples/line/animate/demo/meta.json index c214103f59..96d86c7e81 100644 --- a/examples/line/animate/demo/meta.json +++ b/examples/line/animate/demo/meta.json @@ -7,42 +7,42 @@ { "filename": "wind_animate.js", "title": "风场动画", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*LpcBTKiazZcAAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*wH50SZfOywcAAAAAAAAAAAAAARQnAQ" }, { "filename": "line_animate.js", "title": "直线动画", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*z5sLS4Tpl3kAAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*eckNS70gTfwAAAAAAAAAAAAAARQnAQ" }, { "filename": "plane_animate2.js", "title": "航向图(平面)", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*OGcHSYSbDz4AAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*2wDIS5hXKYwAAAAAAAAAAAAAARQnAQ" }, { "filename": "trip_animate.js", "title": "3D 弧线动画-亮", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*p8k2R5GpyQoAAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*cmB1SLuyB1cAAAAAAAAAAAAAARQnAQ" }, { "filename": "trip_animate_dark.js", "title": "3D 弧线动画-暗", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*w-gDQra4KGMAAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*r0bPQKrJfJkAAAAAAAAAAAAAARQnAQ" }, { "filename": "animate_line.js", "title": "轨迹动画", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*jLo0RY0sDG4AAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*d7PjSo0izNAAAAAAAAAAAAAAARQnAQ" }, { "filename": "world.js", "title": "流向图", - "screenshot":"https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*Sbx4S4w7nL8AAAAAAAAAAABkARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*LKKcRY1G-bcAAAAAAAAAAAAAARQnAQ" }, { "filename": "world2.js", "title": "流向图", - "screenshot":"https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*u5BsQbn30pkAAAAAAAAAAABkARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*MD7nRYqG5joAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/line/arc/API.en.md b/examples/line/arc/API.en.md index deec723ffa..bc7dce7e17 100644 --- a/examples/line/arc/API.en.md +++ b/examples/line/arc/API.en.md @@ -1 +1 @@ -`markdown:docs/api/layer/line_layer/arc.en.md` +`markdown:docs/api/line_layer/linelayer.en.md` diff --git a/examples/line/arc/API.zh.md b/examples/line/arc/API.zh.md index 2a46a487bd..3da92b8fb2 100644 --- a/examples/line/arc/API.zh.md +++ b/examples/line/arc/API.zh.md @@ -1,2 +1 @@ -`markdown:docs/api/layer/line_layer/arc.zh.md` - +`markdown:docs/api/line_layer/linelayer.zh.md` \ No newline at end of file diff --git a/examples/line/isoline/API.en.md b/examples/line/isoline/API.en.md index 37885ce237..bc7dce7e17 100644 --- a/examples/line/isoline/API.en.md +++ b/examples/line/isoline/API.en.md @@ -1 +1 @@ -`markdown:docs/api/layer/line_layer/path.en.md` +`markdown:docs/api/line_layer/linelayer.en.md` diff --git a/examples/line/isoline/API.zh.md b/examples/line/isoline/API.zh.md index 6fdec3f273..3da92b8fb2 100644 --- a/examples/line/isoline/API.zh.md +++ b/examples/line/isoline/API.zh.md @@ -1,2 +1 @@ -`markdown:docs/api/layer/line_layer/path.zh.md` - +`markdown:docs/api/line_layer/linelayer.zh.md` \ No newline at end of file diff --git a/examples/line/path/demo/bus_dark.js b/examples/line/path/demo/bus_dark.js index 7c353609ee..896db63251 100644 --- a/examples/line/path/demo/bus_dark.js +++ b/examples/line/path/demo/bus_dark.js @@ -8,7 +8,7 @@ const scene = new Scene({ map: new Mapbox({ center: [ 103.83735, 1.3602538 ], zoom: 9.4678190476727, - pitch: 1.9999999999999982, + pitch: 20, style: 'dark' }) }); diff --git a/examples/line/path/demo/bus_light.js b/examples/line/path/demo/bus_light.js index 280699dfa5..7cbe29cd5c 100644 --- a/examples/line/path/demo/bus_light.js +++ b/examples/line/path/demo/bus_light.js @@ -8,7 +8,7 @@ const scene = new Scene({ map: new Mapbox({ center: [ 103.83735604457024, 1.360253881403068 ], zoom: 9.4678190476727, - pitch: 1.9999999999999982, + pitch: 20, style: 'light' }) }); diff --git a/examples/line/path/demo/meta.json b/examples/line/path/demo/meta.json index aac9d9eb03..5f7581649b 100644 --- a/examples/line/path/demo/meta.json +++ b/examples/line/path/demo/meta.json @@ -7,37 +7,32 @@ { "filename": "shanghai_bus.js", "title": "上海公交", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*xFJ5Q5gztY0AAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EkhYRbNGkswAAAAAAAAAAAAAARQnAQ" }, { "filename": "bus_light.js", "title": "3D 公交线路-亮", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*YAv-TJYX6j8AAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*sSx9TIOthmkAAAAAAAAAAAAAARQnAQ" }, { "filename": "bus_dark.js", "title": "3D 公交线路-暗", - "screenshot":"https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*j-P8RaJMEvAAAAAAAAAAAABkARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*92cnRJiUIf4AAAAAAAAAAAAAARQnAQ" }, { "filename": "road_light.js", "title": "路径light", - "screenshot":"https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*LuXiTZAq_84AAAAAAAAAAABkARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*oJdZR5mnocwAAAAAAAAAAAAAARQnAQ" }, { "filename": "road_dark.js", "title": "路径边框", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*Fo6hQYuxV3wAAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*Zq3ORrdexZwAAAAAAAAAAAAAARQnAQ" }, { "filename": "road_dark_dash.js", "title": "路径虚线", - "screenshot":"https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*cGw3T4LPx7YAAAAAAAAAAABkARQnAQ" - }, - { - "filename": "route_line.js", - "title": "航线图", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*i6d6SqQgjAwAAAAAAAAAAAAAARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*vZFUTaBCGoEAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/line/path/demo/road_dark.js b/examples/line/path/demo/road_dark.js index 3adb5a941a..c68923ffcb 100644 --- a/examples/line/path/demo/road_dark.js +++ b/examples/line/path/demo/road_dark.js @@ -5,7 +5,7 @@ const scene = new Scene({ id: 'map', map: new Mapbox({ center: [ 116.3956, 39.9392 ], - pitch: 0, + pitch: 20, zoom: 10, rotation: 0, style: 'dark' @@ -18,14 +18,14 @@ scene.on('loaded', () => { .then(res => res.json()) .then(data => { const layer = new LineLayer({}) - .source(data) - .size(6) - .shape('line') - .color('标准名称', [ '#5B8FF9', '#5CCEA1', '#F6BD16' ]) - .style({ - borderWidth: 1, - borderColor: '#fff' - }); + .source(data) + .size(4) + .shape('line') + .color('标准名称', [ '#5B8FF9', '#5CCEA1', '#F6BD16' ]) + .style({ + borderWidth: 0.4, + borderColor: '#fff' + }); scene.addLayer(layer); }); }); diff --git a/examples/line/path/demo/road_light.js b/examples/line/path/demo/road_light.js index 743ce809b4..02986b29b9 100644 --- a/examples/line/path/demo/road_light.js +++ b/examples/line/path/demo/road_light.js @@ -10,7 +10,7 @@ const scene = new Scene({ id: 'map', map: new Mapbox({ center: [ 116.3956, 39.9392 ], - pitch: 0, + pitch: 20, zoom: 10, rotation: 0, style: 'light' diff --git a/examples/line/path/demo/route_line.js b/examples/line/path/demo/route_line.js index 172048d4de..27114a30d3 100644 --- a/examples/line/path/demo/route_line.js +++ b/examples/line/path/demo/route_line.js @@ -1,124 +1,188 @@ /* eslint-disable no-eval */ -import { Scene, LineLayer, PointLayer } from '@antv/l7'; +import { Scene, LineLayer, PointLayer, PolygonLayer } from '@antv/l7';// import { GaodeMap } from '@antv/l7-maps'; const scene = new Scene({ id: 'map', map: new GaodeMap({ - pitch: 40, - center: [ 86, 35.443 ], + center: [ 110, 30 ], zoom: 2.5, - viewMode: '3D', style: 'dark' }) }); -const originData = { // 设置经纬度起点和终点数据 +const originData = { // BJ -> CQ lng1: 116.5883553580003, lat1: 40.07680509701226, - lng2: 55.7508, // 2.663131,12.304181 - lat2: 37.617255 + lng2: 106.06201171875, + lat2: 30.164126343161097 +}; +const originData2 = { // BJ -> HK + lng1: 116.5883553580003, + lat1: 40.07680509701226, + lng2: 114.3072509765625, + lat2: 22.228090416784486 +}; +const originData3 = { // BJ -> HerBin + lng1: 116.5883553580003, + lat1: 40.07680509701226, + lng2: 126.62841796875, + lat2: 45.75219336063106 +}; +const originData4 = { // BJ -> Wulumuqi + lng1: 116.5883553580003, + lat1: 40.07680509701226, + lng2: 87.57202148437499, + lat2: 43.82660134505382 +}; +const originData5 = { // BJ -> 上海 + lng1: 116.5883553580003, + lat1: 40.07680509701226, + lng2: 121.26708984374999, + lat2: 31.259769987394286 }; scene.on('loaded', () => { scene.addImage( 'plane', - 'https://gw.alipayobjects.com/zos/bmw-prod/0ca1668e-38c2-4010-8568-b57cb33839b9.svg' + 'https://gw.alipayobjects.com/zos/bmw-prod/bea041d7-d6d4-4027-b422-a0bc321fbf14.svg' ); Promise.all([ fetch( 'https://gw.alipayobjects.com/os/basement_prod/dbd008f1-9189-461c-88aa-569357ffc07d.json' ).then(d => d.json()) - ]).then(function onLoad([ world ]) { - const data = []; + const data = [] + + for (let i = 0; i < 99; i++) { + data.push({ + thetaOffset: -1/2 + i * (1/99), // 设置曲线的偏移量 + ...originData + }); + } + + for (let i = 0; i < 30; i++) { + data.push({ + thetaOffset: -1/2 + i * (1/30), // 设置曲线的偏移量 + ...originData2 + }); + } + + for (let i = 0; i < 15; i++) { + data.push({ + thetaOffset: -1/2 + i * (1/15), // 设置曲线的偏移量 + ...originData3 + }); + } + for (let i = 0; i < 11; i++) { data.push({ - thetaOffset: -0.5 + i * 0.1, // 设置曲线的偏移量 - ...originData + thetaOffset: -1/2 + i * (1/11), // 设置曲线的偏移量 + ...originData4 + }); + } + + for (let i = 0; i < 60; i++) { + data.push({ + thetaOffset: -1/2 + i * (1/60), // 设置曲线的偏移量 + ...originData5 }); } const worldLine = new LineLayer() .source(world) - .color('#41fc9d') + .color('#1E90FF') .size(0.5) .style({ opacity: 0.4 }); scene.addLayer(worldLine); - const dotPoint = new PointLayer() - .source(data, { - parser: { - type: 'json', - x: 'lng2', - y: 'lat2' - } - }) + const worldFill = new PolygonLayer({ blend: 'normal' }) + .source(world) + .size('name', [ 0, 10000, 50000, 30000, 100000 ]) + .color('#1E90FF') + .shape('fill') + .active(true) + + .style({ + opacity: 0.2, + opacityLinear: { + enable: true, + dir: 'out' // in - out + } + }); + scene.addLayer(worldFill); + + const jsonParserOotion = { + parser: { + type: 'json', + x: 'lng', + y: 'lat' + } + } + + const jsonLineParserOotion = { + parser: { + type: 'json', + x: 'lng1', + y: 'lat1', + x1: 'lng2', + y1: 'lat2' + } + } + + const dotData = [ + { // CQ + lng: 106.06201171875, + lat: 30.164126343161097 + }, + { // BJ + lng: 116.5883553580003, + lat: 40.07680509701226, + }, + { // HK + lng: 114.3072509765625, + lat: 22.228090416784486 + }, + { // Herbin + lng: 126.62841796875, + lat: 45.75219336063106 + }, + { // shanghai + lng: 121.26708984374999, + lat: 31.259769987394286 + }, + { // Wulumuqi + lng: 87.57202148437499, + lat: 43.82660134505382 + } + ] + + const dotPoint = new PointLayer({zIndex: 2}) + .source(dotData, jsonParserOotion) .shape('circle') - .color('#ffed11') + .color('#00FFFF') .animate(true) - .size(40) - .style({ - opacity: 1.0 - }); + .size(30) scene.addLayer(dotPoint); - - const layer = new LineLayer({ - blend: 'normal' - }) - .source(data, { - parser: { - type: 'json', - x: 'lng1', - y: 'lat1', - x1: 'lng2', - y1: 'lat2' - } - }) + const layerPlaneLine = new LineLayer({ blend: 'normal' }) + .source(data, jsonLineParserOotion) .size(1) .shape('arc') - .color('#ff6b34') + .color('#87CEFA') + .animate({ + interval: 1, // 间隔 + duration: 1, // 持续时间,延时 + trailLength: 2 // 流线长度 + }) .style({ - opacity: 1, + opacity: 0.4, thetaOffset: 'thetaOffset' }); - scene.addLayer(layer); - - - const layer2 = new LineLayer({ - blend: 'normal' - }) - .source(data, { - parser: { - type: 'json', - x: 'lng1', - y: 'lat1', - x1: 'lng2', - y1: 'lat2' - } - }) - .size(15) - .texture('plane') - .shape('arc') - .color('#8C1EB2') - .style({ - opacity: 1, - thetaOffset: 'thetaOffset', - lineTexture: true, // 开启线的贴图功能 - iconStep: 10, // 设置贴图纹理的间距 - textureBlend: 'replace' - }) - .animate({ - duration: 1, - interval: 0.4, - trailLength: 0.05 - }); - - scene.addLayer(layer2); + scene.addLayer(layerPlaneLine); }); }); diff --git a/examples/line/wall/demo/meta.json b/examples/line/wall/demo/meta.json index 0df978def1..3a4870989f 100644 --- a/examples/line/wall/demo/meta.json +++ b/examples/line/wall/demo/meta.json @@ -7,12 +7,12 @@ { "filename": "hangzhou_wall.js", "title": "杭州区县围墙", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*mLfxTb4mI6AAAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*aIKDQaTiGkkAAAAAAAAAAAAAARQnAQ" }, { "filename": "bus_wall.js", "title": "公交线路围墙", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*biL5TpaZxd4AAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*BmYdS7zoKvYAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/point/marker/demo/clustermarker.js b/examples/point/marker/demo/clustermarker.js index 99d37b54f8..1a624d1345 100644 --- a/examples/point/marker/demo/clustermarker.js +++ b/examples/point/marker/demo/clustermarker.js @@ -5,9 +5,9 @@ const scene = new Scene({ id: 'map', map: new GaodeMap({ style: 'light', - center: [ 105.790327, 36.495636 ], + center: [ 105.790327, 30 ], pitch: 0, - zoom: 4 + zoom: 2 }) }); scene.on('loaded', () => { diff --git a/examples/point/marker/demo/meta.json b/examples/point/marker/demo/meta.json index f2840aed05..526b1930ef 100644 --- a/examples/point/marker/demo/meta.json +++ b/examples/point/marker/demo/meta.json @@ -7,19 +7,19 @@ { "filename": "markerlayer.js", "title": "MarkerLayer 统一管理Marker", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*ng-FSqu67kYAAAAAAAAAAABkARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*RC80R7x7aV0AAAAAAAAAAAAAARQnAQ" }, { "filename": "clustermarker.js", "title": "MarkerLayer 聚合Marker", - "screenshot":"https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*2vBbRYT2bgIAAAAAAAAAAABkARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*YbNZRZP69IcAAAAAAAAAAAAAARQnAQ" }, { "filename": "marker.js", "title": "温度", - "screenshot":"https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*aTDtTL1qls0AAAAAAAAAAABkARQnAQ" + "screenshot":"https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*2MTARZusZmwAAAAAAAAAAAAAARQnAQ" } ] diff --git a/examples/raster/basic/API.en.md b/examples/raster/basic/API.en.md index 9ca02f358a..2cf02ee9d4 100644 --- a/examples/raster/basic/API.en.md +++ b/examples/raster/basic/API.en.md @@ -1 +1 @@ -`markdown:docs/api/layer/raster_layer.en.md` +`markdown:docs/api/raster/raster_layer.en.md` \ No newline at end of file diff --git a/examples/raster/basic/API.zh.md b/examples/raster/basic/API.zh.md index 14f7ed6efb..7661c1e280 100644 --- a/examples/raster/basic/API.zh.md +++ b/examples/raster/basic/API.zh.md @@ -1,2 +1 @@ -`markdown:docs/api/layer/raster_layer.zh.md` - +`markdown:docs/api/raster/raster_layer.zh.md` \ No newline at end of file diff --git a/examples/raster/basic/demo/dem.js b/examples/raster/basic/demo/dem.js index 73f306002b..797ef89727 100644 --- a/examples/raster/basic/demo/dem.js +++ b/examples/raster/basic/demo/dem.js @@ -6,7 +6,7 @@ const scene = new Scene({ map: new GaodeMap({ pitch: 0, style: 'dark', - center: [ 115.5268, 34.3628 ], + center: [ 110, 37.5 ], zoom: 3 }) }); diff --git a/examples/raster/basic/demo/image.js b/examples/raster/basic/demo/image.js index 9ac40e966c..2c7d15040e 100644 --- a/examples/raster/basic/demo/image.js +++ b/examples/raster/basic/demo/image.js @@ -7,7 +7,7 @@ const scene = new Scene({ pitch: 0, style: 'light', center: [ 121.268, 30.3628 ], - zoom: 13 + zoom: 10 }) }); scene.on('loaded', () => { diff --git a/examples/raster/basic/demo/light.js b/examples/raster/basic/demo/light.js index 7497b37a7a..0a8e117a05 100644 --- a/examples/raster/basic/demo/light.js +++ b/examples/raster/basic/demo/light.js @@ -7,7 +7,7 @@ const scene = new Scene({ map: new GaodeMap({ pitch: 0, style: 'dark', - center: [ 115.5268, 34.3628 ], + center: [ 110, 37.5 ], zoom: 3 }) }); diff --git a/examples/raster/basic/demo/meta.json b/examples/raster/basic/demo/meta.json index bcd9c792f3..d3be374160 100644 --- a/examples/raster/basic/demo/meta.json +++ b/examples/raster/basic/demo/meta.json @@ -8,27 +8,27 @@ { "filename": "radar.js", "title": "雷达图", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*ZiMnSZlmblIAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*JDO-R5XU7xwAAAAAAAAAAAAAARQnAQ" }, { "filename": "dem.js", "title": "地形图", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*oinmTJIlmbMAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*muFhRZlUgaIAAAAAAAAAAAAAARQnAQ" }, { "filename": "light.js", "title": "夜光图", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*bUYqRb5esH4AAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*xznhSJFEAXYAAAAAAAAAAAAAARQnAQ" }, { "filename": "ndvi.js", "title": "NDVI", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*6BQSTI51T_UAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*lpWZQKaCu6cAAAAAAAAAAAAAARQnAQ" }, { "filename": "image.js", "title": "图片", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*ZrCaR53185IAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*8MtWSIGTN8UAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/raster/basic/demo/ndvi.js b/examples/raster/basic/demo/ndvi.js index 76b857c147..305dce66d6 100644 --- a/examples/raster/basic/demo/ndvi.js +++ b/examples/raster/basic/demo/ndvi.js @@ -7,7 +7,7 @@ const scene = new Scene({ map: new GaodeMap({ pitch: 0, style: 'dark', - center: [ 115.5268, 34.3628 ], + center: [ 110, 37.5 ], zoom: 3 }) }); diff --git a/examples/react/control/demo/meta.json b/examples/react/control/demo/meta.json index 666536a85f..690f1370b8 100644 --- a/examples/react/control/demo/meta.json +++ b/examples/react/control/demo/meta.json @@ -8,12 +8,12 @@ { "filename": "Marker.tsx", "title": "Marker 组件", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*ocOWSKz2peAAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*a2aXQqtzsiAAAAAAAAAAAAAAARQnAQ" }, { "filename": "control.tsx", "title": "Control组件", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*_65gSYgf1DoAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*bYsqSKyZDU0AAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/react/layer/demo/Point_image.tsx b/examples/react/layer/demo/Point_image.tsx index 790281bedb..f5c6a436de 100644 --- a/examples/react/layer/demo/Point_image.tsx +++ b/examples/react/layer/demo/Point_image.tsx @@ -57,7 +57,7 @@ const World = React.memo(function Map() { values: ['00', '01', '02'], }} size={{ - values: 10, + values: 20, }} style={{ opacity: 1, diff --git a/examples/react/layer/demo/meta.json b/examples/react/layer/demo/meta.json index 0a37f027cf..3c332e8333 100644 --- a/examples/react/layer/demo/meta.json +++ b/examples/react/layer/demo/meta.json @@ -7,17 +7,17 @@ { "filename": "Point_image.tsx", "title": "图片标注图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*w-8iQpR1NEQAAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*w8c5Tbu7HPIAAAAAAAAAAAAAARQnAQ" }, { "filename": "marker.tsx", "title": "点标注图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*9sibTJP-FIMAAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*CtjuQpCwuUEAAAAAAAAAAAAAARQnAQ" }, { "filename": "popup.tsx", "title": "信息窗", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*RWngRL7rZKQAAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*Sh8pQLLYfoIAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/react/scene/demo/meta.json b/examples/react/scene/demo/meta.json index e7b96a6d2b..f9d96eba5a 100644 --- a/examples/react/scene/demo/meta.json +++ b/examples/react/scene/demo/meta.json @@ -8,12 +8,12 @@ { "filename": "amap.jsx", "title": "高德地图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*QrQkRKHte0YAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*TmYmT7t5fmQAAAAAAAAAAAAAARQnAQ" }, { "filename": "mapbox.jsx", "title": "Mapbox 地图", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*_65gSYgf1DoAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*po3TSKc4SUMAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/tutorial/control/demo/meta.json b/examples/tutorial/control/demo/meta.json index 7e0fad15f0..3e5fb229f2 100644 --- a/examples/tutorial/control/demo/meta.json +++ b/examples/tutorial/control/demo/meta.json @@ -7,12 +7,12 @@ { "filename": "amap.js", "title": "高德底图组件", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*yXzQRYcGTyoAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*4Jj2RJQIQTAAAAAAAAAAAAAAARQnAQ" }, { "filename": "mapbox.js", "title": "MapBox底图组件", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*_SIYR50bbcoAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*npkTSLPCtvwAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/tutorial/layer/demo/meta.json b/examples/tutorial/layer/demo/meta.json index cffc15ca37..5865f9fd63 100644 --- a/examples/tutorial/layer/demo/meta.json +++ b/examples/tutorial/layer/demo/meta.json @@ -7,7 +7,7 @@ { "filename": "layer_highlight.js", "title": "交互高亮图层", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*jBzZRp_umUoAAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*CnSaSaPwyX8AAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/tutorial/map/demo/amap.js b/examples/tutorial/map/demo/gaodemap.js similarity index 81% rename from examples/tutorial/map/demo/amap.js rename to examples/tutorial/map/demo/gaodemap.js index 5a832d3c22..de86a0fa73 100644 --- a/examples/tutorial/map/demo/amap.js +++ b/examples/tutorial/map/demo/gaodemap.js @@ -6,7 +6,6 @@ new Scene({ style: 'light', pitch: 0, center: [ 107.054293, 35.246265 ], - zoom: 4.056, - plugin: [ 'AMap.ToolBar' ] + zoom: 4.056 }) }); diff --git a/examples/tutorial/map/demo/meta.json b/examples/tutorial/map/demo/meta.json index 0d07e1c120..9160aeb8d7 100644 --- a/examples/tutorial/map/demo/meta.json +++ b/examples/tutorial/map/demo/meta.json @@ -5,19 +5,19 @@ }, "demos": [ { - "filename": "amap.js", + "filename": "gaodemap.js", "title": "高德底图", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*F0JPSoLcSesAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*C4BvT5gcclMAAAAAAAAAAAAAARQnAQ" }, { "filename": "mapbox.js", "title": "MapBox底图", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*_SIYR50bbcoAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*jALRQaDoT-0AAAAAAAAAAAAAARQnAQ" }, { "filename": "amapInstance.js", - "title": "通过高德地图实例化", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*C5d2RJ08hOkAAAAAAAAAAAAAARQnAQ" + "title": "高德地图实例化", + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*A4BOR4hBNcUAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/tutorial/marker/demo/meta.json b/examples/tutorial/marker/demo/meta.json index 87f95e2b00..b44d3425c5 100644 --- a/examples/tutorial/marker/demo/meta.json +++ b/examples/tutorial/marker/demo/meta.json @@ -7,12 +7,12 @@ { "filename": "amap.js", "title": "添加默认Marker", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*Gzj7SYk-vdEAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*VEy6S6UrAV8AAAAAAAAAAAAAARQnAQ" }, { "filename": "mapbox.js", "title": "MapBox底图组件", - "screenshot": "https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*_SIYR50bbcoAAAAAAAAAAABkARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*npkTSLPCtvwAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/wind/basic/demo/meta.json b/examples/wind/basic/demo/meta.json index 1f62b3ff6a..0f686b9a1b 100644 --- a/examples/wind/basic/demo/meta.json +++ b/examples/wind/basic/demo/meta.json @@ -7,7 +7,7 @@ { "filename": "wind.js", "title": "风场图层", - "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*CPveRqBxBwkAAAAAAAAAAAAAARQnAQ" + "screenshot": "https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*ADr-SIxhM9AAAAAAAAAAAAAAARQnAQ" } ] } diff --git a/examples/wind/basic/demo/wind.js b/examples/wind/basic/demo/wind.js index a62a8eb7e0..3f13c1dce4 100644 --- a/examples/wind/basic/demo/wind.js +++ b/examples/wind/basic/demo/wind.js @@ -4,11 +4,9 @@ import { GaodeMap } from '@antv/l7-maps'; const scene = new Scene({ id: 'map', map: new GaodeMap({ - center: [ 105.732421875, 32.24997445586331 ], - pitch: 0, + center: [ 90, 32.24997445586331 ], style: 'dark', - zoom: 2, - viewMode: '3D' + zoom: 2 }) }); @@ -40,7 +38,7 @@ scene.on('loaded', () => { 0.3: '#e6f598', 0.4: '#fee08b', 0.5: '#fdae61', - 0.6: '#f46d43', // f46d43 + 0.6: '#f46d43', 1.0: '#d53e4f' } }); From 815d0aff197fdb375a058ed8f0c080afa20c47fd Mon Sep 17 00:00:00 2001 From: shihui Date: Thu, 13 Jan 2022 21:12:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?docs:=20=E5=AE=8C=E5=96=84=E5=AE=98?= =?UTF-8?q?=E7=BD=91=20demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/wind.zh.md | 1 - examples/gallery/animate/demo/route_line.js | 56 +++--- examples/line/path/demo/road_dark.js | 16 +- examples/line/path/demo/route_line.js | 188 -------------------- 4 files changed, 36 insertions(+), 225 deletions(-) delete mode 100644 examples/line/path/demo/route_line.js diff --git a/docs/api/wind.zh.md b/docs/api/wind.zh.md index edc744f368..d676ac4c80 100644 --- a/docs/api/wind.zh.md +++ b/docs/api/wind.zh.md @@ -13,7 +13,6 @@ import { WindLayer } from '@antv/l7'; 案例 - ### source (data, options) => WindLayer, 设置风场相关信息的函数 diff --git a/examples/gallery/animate/demo/route_line.js b/examples/gallery/animate/demo/route_line.js index 27114a30d3..643ff1d9d8 100644 --- a/examples/gallery/animate/demo/route_line.js +++ b/examples/gallery/animate/demo/route_line.js @@ -1,5 +1,5 @@ /* eslint-disable no-eval */ -import { Scene, LineLayer, PointLayer, PolygonLayer } from '@antv/l7';// +import { Scene, LineLayer, PointLayer, PolygonLayer } from '@antv/l7';// import { GaodeMap } from '@antv/l7-maps'; @@ -54,39 +54,39 @@ scene.on('loaded', () => { ).then(d => d.json()) ]).then(function onLoad([ world ]) { - const data = [] + const data = []; for (let i = 0; i < 99; i++) { data.push({ - thetaOffset: -1/2 + i * (1/99), // 设置曲线的偏移量 + thetaOffset: -1 / 2 + i * (1 / 99), // 设置曲线的偏移量 ...originData }); } for (let i = 0; i < 30; i++) { data.push({ - thetaOffset: -1/2 + i * (1/30), // 设置曲线的偏移量 + thetaOffset: -1 / 2 + i * (1 / 30), // 设置曲线的偏移量 ...originData2 }); } - + for (let i = 0; i < 15; i++) { data.push({ - thetaOffset: -1/2 + i * (1/15), // 设置曲线的偏移量 + thetaOffset: -1 / 2 + i * (1 / 15), // 设置曲线的偏移量 ...originData3 }); } for (let i = 0; i < 11; i++) { data.push({ - thetaOffset: -1/2 + i * (1/11), // 设置曲线的偏移量 + thetaOffset: -1 / 2 + i * (1 / 11), // 设置曲线的偏移量 ...originData4 }); } for (let i = 0; i < 60; i++) { data.push({ - thetaOffset: -1/2 + i * (1/60), // 设置曲线的偏移量 + thetaOffset: -1 / 2 + i * (1 / 60), // 设置曲线的偏移量 ...originData5 }); } @@ -101,20 +101,20 @@ scene.on('loaded', () => { scene.addLayer(worldLine); const worldFill = new PolygonLayer({ blend: 'normal' }) - .source(world) - .size('name', [ 0, 10000, 50000, 30000, 100000 ]) - .color('#1E90FF') - .shape('fill') - .active(true) + .source(world) + .size('name', [ 0, 10000, 50000, 30000, 100000 ]) + .color('#1E90FF') + .shape('fill') + .active(true) - .style({ - opacity: 0.2, - opacityLinear: { - enable: true, - dir: 'out' // in - out - } - }); - scene.addLayer(worldFill); + .style({ + opacity: 0.2, + opacityLinear: { + enable: true, + dir: 'out' // in - out + } + }); + scene.addLayer(worldFill); const jsonParserOotion = { parser: { @@ -122,7 +122,7 @@ scene.on('loaded', () => { x: 'lng', y: 'lat' } - } + }; const jsonLineParserOotion = { parser: { @@ -132,7 +132,7 @@ scene.on('loaded', () => { x1: 'lng2', y1: 'lat2' } - } + }; const dotData = [ { // CQ @@ -141,10 +141,10 @@ scene.on('loaded', () => { }, { // BJ lng: 116.5883553580003, - lat: 40.07680509701226, + lat: 40.07680509701226 }, { // HK - lng: 114.3072509765625, + lng: 114.3072509765625, lat: 22.228090416784486 }, { // Herbin @@ -159,14 +159,14 @@ scene.on('loaded', () => { lng: 87.57202148437499, lat: 43.82660134505382 } - ] + ]; - const dotPoint = new PointLayer({zIndex: 2}) + const dotPoint = new PointLayer({ zIndex: 2 }) .source(dotData, jsonParserOotion) .shape('circle') .color('#00FFFF') .animate(true) - .size(30) + .size(30); scene.addLayer(dotPoint); const layerPlaneLine = new LineLayer({ blend: 'normal' }) diff --git a/examples/line/path/demo/road_dark.js b/examples/line/path/demo/road_dark.js index c68923ffcb..38ba793243 100644 --- a/examples/line/path/demo/road_dark.js +++ b/examples/line/path/demo/road_dark.js @@ -18,14 +18,14 @@ scene.on('loaded', () => { .then(res => res.json()) .then(data => { const layer = new LineLayer({}) - .source(data) - .size(4) - .shape('line') - .color('标准名称', [ '#5B8FF9', '#5CCEA1', '#F6BD16' ]) - .style({ - borderWidth: 0.4, - borderColor: '#fff' - }); + .source(data) + .size(4) + .shape('line') + .color('标准名称', [ '#5B8FF9', '#5CCEA1', '#F6BD16' ]) + .style({ + borderWidth: 0.4, + borderColor: '#fff' + }); scene.addLayer(layer); }); }); diff --git a/examples/line/path/demo/route_line.js b/examples/line/path/demo/route_line.js deleted file mode 100644 index 27114a30d3..0000000000 --- a/examples/line/path/demo/route_line.js +++ /dev/null @@ -1,188 +0,0 @@ -/* eslint-disable no-eval */ -import { Scene, LineLayer, PointLayer, PolygonLayer } from '@antv/l7';// -import { GaodeMap } from '@antv/l7-maps'; - - -const scene = new Scene({ - id: 'map', - map: new GaodeMap({ - center: [ 110, 30 ], - zoom: 2.5, - style: 'dark' - }) -}); -const originData = { // BJ -> CQ - lng1: 116.5883553580003, - lat1: 40.07680509701226, - lng2: 106.06201171875, - lat2: 30.164126343161097 -}; -const originData2 = { // BJ -> HK - lng1: 116.5883553580003, - lat1: 40.07680509701226, - lng2: 114.3072509765625, - lat2: 22.228090416784486 -}; -const originData3 = { // BJ -> HerBin - lng1: 116.5883553580003, - lat1: 40.07680509701226, - lng2: 126.62841796875, - lat2: 45.75219336063106 -}; -const originData4 = { // BJ -> Wulumuqi - lng1: 116.5883553580003, - lat1: 40.07680509701226, - lng2: 87.57202148437499, - lat2: 43.82660134505382 -}; -const originData5 = { // BJ -> 上海 - lng1: 116.5883553580003, - lat1: 40.07680509701226, - lng2: 121.26708984374999, - lat2: 31.259769987394286 -}; - -scene.on('loaded', () => { - scene.addImage( - 'plane', - 'https://gw.alipayobjects.com/zos/bmw-prod/bea041d7-d6d4-4027-b422-a0bc321fbf14.svg' - ); - - Promise.all([ - fetch( - 'https://gw.alipayobjects.com/os/basement_prod/dbd008f1-9189-461c-88aa-569357ffc07d.json' - ).then(d => d.json()) - ]).then(function onLoad([ world ]) { - - const data = [] - - for (let i = 0; i < 99; i++) { - data.push({ - thetaOffset: -1/2 + i * (1/99), // 设置曲线的偏移量 - ...originData - }); - } - - for (let i = 0; i < 30; i++) { - data.push({ - thetaOffset: -1/2 + i * (1/30), // 设置曲线的偏移量 - ...originData2 - }); - } - - for (let i = 0; i < 15; i++) { - data.push({ - thetaOffset: -1/2 + i * (1/15), // 设置曲线的偏移量 - ...originData3 - }); - } - - for (let i = 0; i < 11; i++) { - data.push({ - thetaOffset: -1/2 + i * (1/11), // 设置曲线的偏移量 - ...originData4 - }); - } - - for (let i = 0; i < 60; i++) { - data.push({ - thetaOffset: -1/2 + i * (1/60), // 设置曲线的偏移量 - ...originData5 - }); - } - - const worldLine = new LineLayer() - .source(world) - .color('#1E90FF') - .size(0.5) - .style({ - opacity: 0.4 - }); - scene.addLayer(worldLine); - - const worldFill = new PolygonLayer({ blend: 'normal' }) - .source(world) - .size('name', [ 0, 10000, 50000, 30000, 100000 ]) - .color('#1E90FF') - .shape('fill') - .active(true) - - .style({ - opacity: 0.2, - opacityLinear: { - enable: true, - dir: 'out' // in - out - } - }); - scene.addLayer(worldFill); - - const jsonParserOotion = { - parser: { - type: 'json', - x: 'lng', - y: 'lat' - } - } - - const jsonLineParserOotion = { - parser: { - type: 'json', - x: 'lng1', - y: 'lat1', - x1: 'lng2', - y1: 'lat2' - } - } - - const dotData = [ - { // CQ - lng: 106.06201171875, - lat: 30.164126343161097 - }, - { // BJ - lng: 116.5883553580003, - lat: 40.07680509701226, - }, - { // HK - lng: 114.3072509765625, - lat: 22.228090416784486 - }, - { // Herbin - lng: 126.62841796875, - lat: 45.75219336063106 - }, - { // shanghai - lng: 121.26708984374999, - lat: 31.259769987394286 - }, - { // Wulumuqi - lng: 87.57202148437499, - lat: 43.82660134505382 - } - ] - - const dotPoint = new PointLayer({zIndex: 2}) - .source(dotData, jsonParserOotion) - .shape('circle') - .color('#00FFFF') - .animate(true) - .size(30) - scene.addLayer(dotPoint); - - const layerPlaneLine = new LineLayer({ blend: 'normal' }) - .source(data, jsonLineParserOotion) - .size(1) - .shape('arc') - .color('#87CEFA') - .animate({ - interval: 1, // 间隔 - duration: 1, // 持续时间,延时 - trailLength: 2 // 流线长度 - }) - .style({ - opacity: 0.4, - thetaOffset: 'thetaOffset' - }); - scene.addLayer(layerPlaneLine); - }); -}); From 3325c55f15c92ce8757af0f259de73d77fac5a3a Mon Sep 17 00:00:00 2001 From: YiQianYao <42212176+2912401452@users.noreply.github.com> Date: Fri, 14 Jan 2022 00:37:10 +0800 Subject: [PATCH 3/3] Shihuidev (#933) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 修改简单线体层的 shape 参数 * feat: change simple lint type --- examples/gallery/animate/demo/grid.js | 2 +- packages/layers/src/line/index.ts | 2 +- packages/layers/src/line/models/index.ts | 4 ++-- packages/layers/src/line/models/simpleLine.ts | 2 +- stories/Map/components/gridTile.tsx | 2 +- stories/Map/components/gridTile2.tsx | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/gallery/animate/demo/grid.js b/examples/gallery/animate/demo/grid.js index 9347470224..abc5d3efa1 100644 --- a/examples/gallery/animate/demo/grid.js +++ b/examples/gallery/animate/demo/grid.js @@ -338,7 +338,7 @@ img.onload = function() { const layer = new LineLayer({}) .source(geoData) .size(1) - .shape('simpleline') + .shape('simple') .color('rgb(22, 119, 255)') .style({ vertexHeightScale: 2000, diff --git a/packages/layers/src/line/index.ts b/packages/layers/src/line/index.ts index 35e7beeddb..10df574d4f 100644 --- a/packages/layers/src/line/index.ts +++ b/packages/layers/src/line/index.ts @@ -29,7 +29,7 @@ export default class LineLayer extends BaseLayer { const type = this.getModelType(); const defaultConfig = { line: {}, - simpleline: {}, + simple: {}, wall: {}, arc3d: { blend: 'additive' }, arc: { blend: 'additive' }, diff --git a/packages/layers/src/line/models/index.ts b/packages/layers/src/line/models/index.ts index 0db55a2ee1..dbf1c2e4e1 100644 --- a/packages/layers/src/line/models/index.ts +++ b/packages/layers/src/line/models/index.ts @@ -12,7 +12,7 @@ export type LineModelType = | 'arc3d' | 'greatcircle' | 'wall' - | 'simpleline' + | 'simple' | 'line'; const LineModels: { [key in LineModelType]: any } = { @@ -22,7 +22,7 @@ const LineModels: { [key in LineModelType]: any } = { greatcircle: GreatCircleModel, wall: LineWallModel, line: LineModel, - simpleline: SimpleLineModel, + simple: SimpleLineModel, }; export default LineModels; diff --git a/packages/layers/src/line/models/simpleLine.ts b/packages/layers/src/line/models/simpleLine.ts index e3641e31de..93a6e2f6eb 100644 --- a/packages/layers/src/line/models/simpleLine.ts +++ b/packages/layers/src/line/models/simpleLine.ts @@ -97,7 +97,7 @@ export default class SimpleLineModel extends BaseModel { public buildModels(): IModel[] { return [ this.layer.buildLayerModel({ - moduleName: 'line', + moduleName: 'simpleline', vertexShader: line_vert, fragmentShader: line_frag, triangulation: SimpleLineTriangulation, diff --git a/stories/Map/components/gridTile.tsx b/stories/Map/components/gridTile.tsx index 9b05b409f5..a7c80676a3 100644 --- a/stories/Map/components/gridTile.tsx +++ b/stories/Map/components/gridTile.tsx @@ -343,7 +343,7 @@ export default class GridTile extends React.Component { const layer = new LineLayer({}) .source(geoData) .size(1) - .shape('simpleline') + .shape('simple') .color('rgb(22, 119, 255)') .style({ vertexHeightScale: 2000, diff --git a/stories/Map/components/gridTile2.tsx b/stories/Map/components/gridTile2.tsx index 98ad5a2129..4550ab6252 100644 --- a/stories/Map/components/gridTile2.tsx +++ b/stories/Map/components/gridTile2.tsx @@ -295,7 +295,7 @@ export default class GridTile2 extends React.Component { const layer = new LineLayer({}) .source(geoData) .size(1) - .shape('simpleline') + .shape('simple') .color('rgb(22, 119, 255)') .style({ vertexHeightScale: 2000,