From 937c331bdd742f2a5f5ed513095cdea73ef43f44 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Mon, 2 Dec 2019 11:12:30 +0800 Subject: [PATCH] docs(docs): add tutorial how to start demo locally --- .github/PULL_REQUEST_TEMPLATE.md | 4 +- .gitignore | 3 +- README.md | 5 +- docs/tutorial/data.en.md | 2 +- docs/tutorial/data.zh.md | 2 +- docs/tutorial/demo.en.md | 62 +++++++++++++++++++++++++ docs/tutorial/demo.zh.md | 66 +++++++++++++++++++++++++++ examples/gallery/basic/demo/normal.js | 1 + gatsby-node.js | 15 +++--- yarn.lock | 10 +--- 10 files changed, 144 insertions(+), 26 deletions(-) create mode 100644 docs/tutorial/demo.en.md create mode 100644 docs/tutorial/demo.zh.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fd86cfc330..0dbea1f725 100755 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,11 +1,11 @@ ##### Checklist diff --git a/.gitignore b/.gitignore index 761575a702..aa41290f87 100644 --- a/.gitignore +++ b/.gitignore @@ -77,4 +77,5 @@ yarn.lock package-lock.json git_log.sh node_modules/ -packages/l7/package_bak.json \ No newline at end of file +packages/l7/package_bak.json + diff --git a/README.md b/README.md index 4c7fad7d74..cda2081671 100644 --- a/README.md +++ b/README.md @@ -85,10 +85,7 @@ scene.addLayer(pointLayer); - [Tutorials](https://l7.antv.vision/en/docs/tutorial/quickstart) - [API documentation](https://l7.antv.vision/en/docs/api/l7) - [Examples](https://l7.antv.vision/en/examples/gallery/basic) - -## 🔨 Development - -We wrote a [contribution guide](./.github/CONTRIBUTING.md) to help you get started. +- [Contributor documentation](./.github/CONTRIBUTING.md) ## ✅ License diff --git a/docs/tutorial/data.en.md b/docs/tutorial/data.en.md index 680029b41f..d694cd9f60 100644 --- a/docs/tutorial/data.en.md +++ b/docs/tutorial/data.en.md @@ -1,6 +1,6 @@ --- title: Data -order: 1 +order: 2 --- ## 数据 diff --git a/docs/tutorial/data.zh.md b/docs/tutorial/data.zh.md index 781c763b24..ac63abf260 100644 --- a/docs/tutorial/data.zh.md +++ b/docs/tutorial/data.zh.md @@ -1,6 +1,6 @@ --- title: 数据 -order: 1 +order: 2 --- ## 数据 diff --git a/docs/tutorial/demo.en.md b/docs/tutorial/demo.en.md new file mode 100644 index 0000000000..485f913c47 --- /dev/null +++ b/docs/tutorial/demo.en.md @@ -0,0 +1,62 @@ +--- +title: How to start the demo locally +order: 1 +--- + +### 一、打开L7demo页面 + + + 选择一个任意一个你想看的demo + + +L7 地理可视化 + +你可能没有注意,代码区的上方有一排工具按钮,注意了你可能不知道干什么用的。 + + +### 二、打开 codesandbox。 + +点击左侧第三个按钮,你就进入了 codesandbox。 + +![L7 地理可视化](https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*TrpMSJrrSDMAAAAAAAAAAABkARQnAQ) + +L7 地理可视化 + +你发现你进入了一个线代码编辑器比较流行,这个里面你可以修改代码,并且能够随时看到效果 + +你可能想说我就想本地跑起来,不想在线修改。 + +当然是是可以的 + + +### 三、下载demo源码 +  在codesandbox的文件目录工具有下载按钮,参照图中红色部分 + +  点击下载你可以把这个demo的源码下载到本地。 + +### 四、启动项目 +   解压项目,进入项目目录 + + +#### 1.安装环境依赖 + +如果不知道yarn可能需要补充一下前端知识了,如果没有yarn环境你需要安装一下, + +```bash +yarn install +``` + + +####  2. 启动项目 + +```bash +yarn start +``` + + 浏览器就会自动打开 [http://localhost:3000/](http://localhost:3000/),这样demo 就跑起来了 + +L7 地理可视化 + +现在你可以尽情的本地修改代码,添加自己的图层了。 + +L7 所有demo都可以在codesandbox 打开,你可以下载代码。 diff --git a/docs/tutorial/demo.zh.md b/docs/tutorial/demo.zh.md new file mode 100644 index 0000000000..cf13657998 --- /dev/null +++ b/docs/tutorial/demo.zh.md @@ -0,0 +1,66 @@ +--- +title: 如何在本地运行demo +order: 1 +--- + + +### 一、打开L7demo页面 + + + 选择一个任意一个你想看的demo + + +L7 地理可视化 + +你可能没有注意,代码区的上方有一排工具按钮,注意了你可能不知道干什么用的。 + + +### 二、打开 codesandbox。 + +点击左侧第三个按钮,你就进入了 codesandbox。 + +![L7 地理可视化](https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*TrpMSJrrSDMAAAAAAAAAAABkARQnAQ) + +L7 地理可视化 + +你发现你进入了一个线代码编辑器比较流行,这个里面你可以修改代码,并且能够随时看到效果 + +你可能想说我就想本地跑起来,不想在线修改。 + +当然是是可以的 + + +### 三、下载demo源码 +  在codesandbox的文件目录工具有下载按钮,参照图中红色部分 + +  点击下载你可以把这个demo的源码下载到本地。 + +### 四、启动项目 +   解压项目,进入项目目录 + + +#### 1.安装环境依赖 + +如果不知道yarn可能需要补充一下前端知识了,如果没有yarn环境你需要安装一下, + +```bash +yarn install +``` + + +####  2. 启动项目 + +```bash +yarn start +``` + + 浏览器就会自动打开 [http://localhost:3000/](http://localhost:3000/),这样demo 就跑起来了 + +L7 地理可视化 + + +现在你可以尽情的本地修改代码,添加自己的图层了。 + +L7 所有demo都可以在codesandbox 打开,你可以下载代码。 + + diff --git a/examples/gallery/basic/demo/normal.js b/examples/gallery/basic/demo/normal.js index efddb8fd1a..c0a5a1f919 100644 --- a/examples/gallery/basic/demo/normal.js +++ b/examples/gallery/basic/demo/normal.js @@ -5,6 +5,7 @@ const scene = new Scene({ id: 'map', map: new GaodeMap({ center: [ 121.417463, 31.215175 ], + style: 'dark', pitch: 0, zoom: 11 }) diff --git a/gatsby-node.js b/gatsby-node.js index ee21583217..348d91eba7 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1,17 +1,16 @@ const path = require('path'); exports.onCreateWebpackConfig = ({ getConfig }) => { const config = getConfig(); + config.module.rules.push({ + test: /\.glsl$/, + use: { + loader: 'glsl-shaders-loader' + } + }); config.resolve.extensions.push('.glsl'); config.resolve.alias = { ...config.resolve.alias, '@antv/l7': path.resolve(__dirname, 'packages/l7/src'), - '@antv/l7-core': path.resolve(__dirname, 'packages/core/src'), - '@antv/l7-component': path.resolve(__dirname, 'packages/component/src'), - '@antv/l7-layers': path.resolve(__dirname, 'packages/layers/src'), - '@antv/l7-maps': path.resolve(__dirname, 'packages/maps/src'), - '@antv/l7-renderer': path.resolve(__dirname, 'packages/renderer/src'), - '@antv/l7-scene': path.resolve(__dirname, 'packages/scene/src'), - '@antv/l7-source': path.resolve(__dirname, 'packages/source/src'), - '@antv/l7-utils': path.resolve(__dirname, 'packages/utils/src'), + '@antv/l7-maps': path.resolve(__dirname, 'packages/maps/src') }; }; diff --git a/yarn.lock b/yarn.lock index f2d9da05b4..abac8b3549 100644 --- a/yarn.lock +++ b/yarn.lock @@ -613,15 +613,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.2.0" -"@babel/plugin-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.3.2", "@babel/plugin-proposal-object-rest-spread@^7.5.5": - version "7.7.4" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.4.tgz#cc57849894a5c774214178c8ab64f6334ec8af71" - integrity sha512-rnpnZR3/iWKmiQyJ3LKJpSwLDcX/nSXhdLk4Aq/tXOApIvyu7qoabrige0ylsAJffaUC51WiBu209Q0U+86OWQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.7.4" - -"@babel/plugin-proposal-object-rest-spread@^7.7.4": +"@babel/plugin-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.3.2", "@babel/plugin-proposal-object-rest-spread@^7.5.5", "@babel/plugin-proposal-object-rest-spread@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.4.tgz#cc57849894a5c774214178c8ab64f6334ec8af71" integrity sha512-rnpnZR3/iWKmiQyJ3LKJpSwLDcX/nSXhdLk4Aq/tXOApIvyu7qoabrige0ylsAJffaUC51WiBu209Q0U+86OWQ==