From f9b22c4f0c96567a7b186cfa078fa340911817b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Wed, 4 Dec 2019 12:00:47 +0800 Subject: [PATCH 1/3] :lipstick: optimize README code style --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index a9e431f9d1..11d4dff348 100644 --- a/README.md +++ b/README.md @@ -49,34 +49,35 @@ npm install @antv/l7@beta ```javascript import { Scene } from '@antv/l7'; import { Mapbox } from '@antv/l7-maps'; -new Scene({ + +const scene = new Scene({ id: 'map', map: new Mapbox({ style: 'light', pitch: 0, center: [ 107.054293, 35.246265 ], zoom: 4.056 - }) -}) - + }), +}); ``` + ### Add Layer -```javascript +```javascript import { PointLayer } from '@antv/l7'; - const pointLayer = new PointLayer() - .source(data) - .shape('circle') - .size('mag', [ 1, 25 ]) - .color('mag',['#5B8FF9', '#5CCEA1']) - .style({ - opacity: 0.3, - strokeWidth: 1 - }); + +const pointLayer = new PointLayer() + .source(data) + .shape('circle') + .size('mag', [ 1, 25 ]) + .color('mag',['#5B8FF9', '#5CCEA1']) + .style({ + opacity: 0.3, + strokeWidth: 1, + }); scene.addLayer(pointLayer); - ``` ## :memo: Documentation From 0a824e05e349e63e0199d567b736e01dec891c0b Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Thu, 5 Dec 2019 10:40:37 +0800 Subject: [PATCH 2/3] docs: update l7 cdn version --- docs/tutorial/map/amap.en.md | 4 ++-- docs/tutorial/map/amap.zh.md | 4 ++-- docs/tutorial/map/blankmap.zh.md | 0 docs/tutorial/map/mapbox.en.md | 4 ++-- docs/tutorial/map/mapbox.zh.md | 4 ++-- docs/tutorial/quickstart.en.md | 2 +- docs/tutorial/quickstart.zh.md | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 docs/tutorial/map/blankmap.zh.md diff --git a/docs/tutorial/map/amap.en.md b/docs/tutorial/map/amap.en.md index d4be7b109d..bb354f0535 100644 --- a/docs/tutorial/map/amap.en.md +++ b/docs/tutorial/map/amap.en.md @@ -18,7 +18,7 @@ order: 0 2.0版本在L7内部动态引入了高德地图JS API,因此不再需要单独引入高德JS API,只需设置 type 为 ```amap``` 并且传入token ```html - + ``` ### 添加div 标签指定地图容器 @@ -106,7 +106,7 @@ fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
- + + ``` ### 添加div 标签指定地图容器 @@ -106,7 +106,7 @@ fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
- + + ``` @@ -115,7 +115,7 @@ fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
- + + ``` @@ -113,7 +113,7 @@ fetch('https://gw.alipayobjects.com/os/rmsportal/oVTMqfzuuRFKiDwhPSFL.json')
- + ``` diff --git a/docs/tutorial/quickstart.zh.md b/docs/tutorial/quickstart.zh.md index ce86741d7a..382b11b65f 100644 --- a/docs/tutorial/quickstart.zh.md +++ b/docs/tutorial/quickstart.zh.md @@ -17,7 +17,7 @@ Include the L7 JS JavaScript of your HTML file. ```html - ``` From 78dd68aca367cf6609c7058e303a17d6239c8a30 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Thu, 5 Dec 2019 11:35:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?docs:=20add=20blank=20map=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=95=99=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/tutorial/map/blankmap.en.md | 27 +++++++++++++++++++++++++++ docs/tutorial/map/blankmap.zh.md | 27 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 docs/tutorial/map/blankmap.en.md diff --git a/docs/tutorial/map/blankmap.en.md b/docs/tutorial/map/blankmap.en.md new file mode 100644 index 0000000000..efaf49884e --- /dev/null +++ b/docs/tutorial/map/blankmap.en.md @@ -0,0 +1,27 @@ +--- +title: Blank BaseMap With Mapbox +order: 2 +--- + +很多情况下我们只是做些简单的地理可视化,不需要加载地图. +本教程就是告诉大家如果在L7中使用无底图模式。 + +L7 在地图样式层面增加了无底图样式```blank``` 无底图模式 + +😃不需要使用mapbox token 拿来就用,不要注册mapbox账户 + +```javascript +const scene = new Scene({ + id: 'map', + map: new Mapbox({ + style: 'blank', + center: [ 103.83735604457024, 1.360253881403068 ], + pitch: 4.00000000000001, + zoom: 10.210275860702593, + rotation: 19.313180925794313 + }) +}); +``` +如果你只是需要做个中国地图,世界地图这样填充图,建议你采用这样的模式 + +离线,无token使用 ![mapbox demo](https://codesandbox.io/embed/frosty-architecture-tv6uv?fontsize=14&hidenavigation=1&theme=dark) diff --git a/docs/tutorial/map/blankmap.zh.md b/docs/tutorial/map/blankmap.zh.md index e69de29bb2..b4eb85cece 100644 --- a/docs/tutorial/map/blankmap.zh.md +++ b/docs/tutorial/map/blankmap.zh.md @@ -0,0 +1,27 @@ +--- +title: 使用无地图模式 +order: 2 +--- + +很多情况下我们只是做些简单的地理可视化,不需要加载地图. +本教程就是告诉大家如果在L7中使用无底图模式。 + +L7 在地图样式层面增加了无底图样式```blank``` 无底图模式 + +😃不需要使用mapbox token 拿来就用,不要注册mapbox账户 + +```javascript +const scene = new Scene({ + id: 'map', + map: new Mapbox({ + style: 'blank', + center: [ 103.83735604457024, 1.360253881403068 ], + pitch: 4.00000000000001, + zoom: 10.210275860702593, + rotation: 19.313180925794313 + }) +}); +``` +如果你只是需要做个中国地图,世界地图这样填充图,建议你采用这样的模式 + +离线,无token使用 ![mapbox demo](https://codesandbox.io/embed/frosty-architecture-tv6uv?fontsize=14&hidenavigation=1&theme=dark)