From aa3589675d965eec5d888b8f1579cbe26cb8a0c8 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Fri, 20 Dec 2019 16:56:06 +0800 Subject: [PATCH] chore: babel useBuiltIns useage --- babel.config.js | 9 ++++++++- docs/api/layer/point_layer/marker.zh.md | 1 - docs/api/layer/point_layer/symbol.zh.md | 3 +-- docs/api/map.en.md | 8 ++++---- docs/api/map.zh.md | 8 ++++---- docs/tutorial/map/blankmap.zh.md | 2 +- examples/gallery/basic/demo/bus_dark.js | 2 ++ examples/line/path/demo/bus_dark.js | 2 ++ examples/line/path/demo/bus_light.js | 2 ++ package.json | 2 ++ packages/component/package.json | 1 + packages/core/package.json | 1 + packages/core/src/services/config/ConfigService.ts | 2 +- packages/layers/package.json | 2 ++ packages/maps/package.json | 1 + packages/maps/src/amap/index.ts | 1 - packages/renderer/package.json | 1 + packages/scene/package.json | 1 + packages/source/package.json | 1 + packages/utils/package.json | 1 + stories/Layers/components/Point.tsx | 3 ++- yarn.lock | 11 +++++++++-- 22 files changed, 47 insertions(+), 18 deletions(-) diff --git a/babel.config.js b/babel.config.js index 28d2246145..1486c08675 100644 --- a/babel.config.js +++ b/babel.config.js @@ -44,9 +44,14 @@ module.exports = api => { { // https://babeljs.io/docs/en/babel-preset-env#usebuiltins useBuiltIns: 'usage', + corejs: '3.0.0', // set `modules: false` when building CDN bundle, let rollup do commonjs works // @see https://github.com/rollup/rollup-plugin-babel#modules - modules: (isCDNBundle || isESModule) ? false : 'auto' + modules: (isCDNBundle || isESModule) ? false : 'auto', + targets: { + chrome: 58, + ie: 11 + } } ], [ @@ -57,10 +62,12 @@ module.exports = api => { ], '@babel/preset-typescript' ], + ignore: [ /[\/\\]core-js/, /@babel[\/\\]runtime/ ], plugins: [ '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-proposal-optional-chaining', '@babel/plugin-proposal-nullish-coalescing-operator', + '@babel/plugin-syntax-async-generators', [ '@babel/plugin-proposal-decorators', { diff --git a/docs/api/layer/point_layer/marker.zh.md b/docs/api/layer/point_layer/marker.zh.md index fd22bcf63f..59af362de6 100644 --- a/docs/api/layer/point_layer/marker.zh.md +++ b/docs/api/layer/point_layer/marker.zh.md @@ -5,5 +5,4 @@ order: 7 可自定义点符号,通过自定义dom实现地图标注,富文本、动态点状符号都可用于地图上信息的标记。 ## 使用 - [Marker 文档](../../component) diff --git a/docs/api/layer/point_layer/symbol.zh.md b/docs/api/layer/point_layer/symbol.zh.md index 5861234beb..c0c8730ab5 100644 --- a/docs/api/layer/point_layer/symbol.zh.md +++ b/docs/api/layer/point_layer/symbol.zh.md @@ -25,9 +25,8 @@ addImage() 'https://gw.alipayobjects.com/zos/basement_prod/604b5e7f-309e-40db-b95b-4fac746c5153.svg' ); -⚠️ 符号图的ID不能与点图层已有shape名称相同,比如不能设置 circle - ``` +⚠️ 符号图的ID不能与点图层已有shape名称相同,比如不能设置 circle 符号图需要把shape设置成图片的id,同样符号图shape也支持数据映射 diff --git a/docs/api/map.en.md b/docs/api/map.en.md index 678c72209a..fcc8748431 100644 --- a/docs/api/map.en.md +++ b/docs/api/map.en.md @@ -42,12 +42,12 @@ const scene = new Scene({ id: 'map', map: new Mapbox({ style: 'dark', - center: [ 103.83735604457024, 1.360253881403068 ], + center: [103.83735604457024, 1.360253881403068], pitch: 4.00000000000001, zoom: 10.210275860702593, - rotation: 19.313180925794313 - token:'xxxx - token' - }) + rotation: 19.313180925794313, + token: 'xxxx - token', + }), }); ``` diff --git a/docs/api/map.zh.md b/docs/api/map.zh.md index 9e09896f0a..26a06120e7 100644 --- a/docs/api/map.zh.md +++ b/docs/api/map.zh.md @@ -42,12 +42,12 @@ const scene = new Scene({ id: 'map', map: new Mapbox({ style: 'dark', - center: [ 103.83735604457024, 1.360253881403068 ], + center: [103.83735604457024, 1.360253881403068], pitch: 4.00000000000001, zoom: 10.210275860702593, - rotation: 19.313180925794313 - token:'xxxx - token' - }) + rotation: 19.313180925794313, + token: 'xxxx - token', + }), }); ``` diff --git a/docs/tutorial/map/blankmap.zh.md b/docs/tutorial/map/blankmap.zh.md index cab56dccc9..f87c7cf8c7 100644 --- a/docs/tutorial/map/blankmap.zh.md +++ b/docs/tutorial/map/blankmap.zh.md @@ -8,7 +8,7 @@ order: 2 L7 在地图样式层面增加了无底图样式```blank``` 无底图模式 -😃不需要使用mapbox token 拿来就用,不要注册mapbox账户 +不需要使用mapbox token 也不需要注册mapbox账户 ```javascript const scene = new Scene({ diff --git a/examples/gallery/basic/demo/bus_dark.js b/examples/gallery/basic/demo/bus_dark.js index f93a386b80..dd04be4a47 100644 --- a/examples/gallery/basic/demo/bus_dark.js +++ b/examples/gallery/basic/demo/bus_dark.js @@ -1,3 +1,5 @@ +// Data Source https://busrouter.sg/visualization/ + import { Scene, LineLayer } from '@antv/l7'; import { Mapbox } from '@antv/l7-maps'; diff --git a/examples/line/path/demo/bus_dark.js b/examples/line/path/demo/bus_dark.js index 95b40e2686..99f18a9e78 100644 --- a/examples/line/path/demo/bus_dark.js +++ b/examples/line/path/demo/bus_dark.js @@ -1,3 +1,5 @@ +// Data Source https://busrouter.sg/visualization/ + import { Scene, LineLayer } from '@antv/l7'; import { Mapbox } from '@antv/l7-maps'; diff --git a/examples/line/path/demo/bus_light.js b/examples/line/path/demo/bus_light.js index 693331944f..4df4774e4c 100644 --- a/examples/line/path/demo/bus_light.js +++ b/examples/line/path/demo/bus_light.js @@ -1,3 +1,5 @@ +// Data Source https://busrouter.sg/visualization/ + import { Scene, LineLayer } from '@antv/l7'; import { Mapbox } from '@antv/l7-maps'; diff --git a/package.json b/package.json index c44f01e9da..69abd06297 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,8 @@ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4", "@babel/plugin-proposal-object-rest-spread": "^7.7.4", "@babel/plugin-proposal-optional-chaining": "^7.6.0", + "@babel/plugin-syntax-async-generators": "^7.7.4", + "@babel/plugin-transform-runtime": "^7.7.6", "@babel/preset-env": "^7.5.5", "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.3.3", diff --git a/packages/component/package.json b/packages/component/package.json index 7a1a0063ba..c6bb016a73 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -26,6 +26,7 @@ "dependencies": { "@antv/l7-core": "^2.0.0-beta.21", "@antv/l7-utils": "^2.0.0-beta.21", + "@babel/runtime": "^7.7.7", "@turf/distance": "^6.0.1", "eventemitter3": "^4.0.0", "inversify": "^5.0.1", diff --git a/packages/core/package.json b/packages/core/package.json index a21540e7f0..5e5141b29e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -23,6 +23,7 @@ "license": "ISC", "dependencies": { "@antv/l7-utils": "^2.0.0-beta.21", + "@babel/runtime": "^7.7.7", "@mapbox/tiny-sdf": "^1.1.1", "ajv": "^6.10.2", "element-resize-event": "^3.0.3", diff --git a/packages/core/src/services/config/ConfigService.ts b/packages/core/src/services/config/ConfigService.ts index 4ff7d497ad..55c3c43a62 100644 --- a/packages/core/src/services/config/ConfigService.ts +++ b/packages/core/src/services/config/ConfigService.ts @@ -60,7 +60,7 @@ const defaultLayerConfig: Partial = { enableSelect: false, highlightColor: 'red', selectColor: 'blue', - enableTAA: true, + enableTAA: false, jitterScale: 1, enableLighting: false, }; diff --git a/packages/layers/package.json b/packages/layers/package.json index 8dfa4d41d4..94707c60cd 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -25,9 +25,11 @@ "@antv/l7-core": "^2.0.0-beta.21", "@antv/l7-source": "^2.0.0-beta.21", "@antv/l7-utils": "^2.0.0-beta.21", + "@babel/runtime": "^7.7.7", "@mapbox/martini": "^0.1.0", "@turf/meta": "^6.0.2", "@types/d3-color": "^1.2.2", + "core-js": "3", "d3-array": "^2.3.1", "d3-color": "^1.4.0", "d3-scale": "^3.1.0", diff --git a/packages/maps/package.json b/packages/maps/package.json index 688716cde1..9b9ae86a42 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -25,6 +25,7 @@ "dependencies": { "@antv/l7-core": "^2.0.0-beta.21", "@antv/l7-utils": "^2.0.0-beta.21", + "@babel/runtime": "^7.7.7", "gl-matrix": "^3.1.0", "inversify": "^5.0.1", "mapbox-gl": "^1.2.1", diff --git a/packages/maps/src/amap/index.ts b/packages/maps/src/amap/index.ts index a88a5eadc3..fd26e3731e 100644 --- a/packages/maps/src/amap/index.ts +++ b/packages/maps/src/amap/index.ts @@ -232,7 +232,6 @@ export default class AMapService ...rest } = this.config; // 高德地图创建独立的container; - // tslint:disable-next-line:typedef await new Promise((resolve) => { const resolveMap = () => { diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 44c45dc81f..5dcaac0e68 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -26,6 +26,7 @@ }, "dependencies": { "@antv/l7-core": "^2.0.0-beta.21", + "@babel/runtime": "^7.7.7", "inversify": "^5.0.1", "inversify-logging": "^0.2.1", "lodash": "^4.17.15", diff --git a/packages/scene/package.json b/packages/scene/package.json index 7d1e8e861c..c7d76e538c 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -27,6 +27,7 @@ "@antv/l7-maps": "^2.0.0-beta.21", "@antv/l7-renderer": "^2.0.0-beta.21", "@antv/l7-utils": "^2.0.0-beta.21", + "@babel/runtime": "^7.7.7", "inversify": "^5.0.1", "inversify-inject-decorators": "^3.1.0", "mapbox-gl": "^1.2.1", diff --git a/packages/source/package.json b/packages/source/package.json index 710e1af1b3..23545ff7cb 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -26,6 +26,7 @@ "dependencies": { "@antv/l7-core": "^2.0.0-beta.21", "@antv/l7-utils": "^2.0.0-beta.21", + "@babel/runtime": "^7.7.7", "@mapbox/geojson-rewind": "^0.4.0", "@turf/helpers": "^6.1.4", "@turf/invariant": "^6.1.2", diff --git a/packages/utils/package.json b/packages/utils/package.json index c82d39d4cf..ba1fdeaf4d 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -22,6 +22,7 @@ "author": "lzxue", "license": "ISC", "dependencies": { + "@babel/runtime": "^7.7.7", "@turf/helpers": "^6.1.4", "eventemitter3": "^4.0.0", "gl-matrix": "^3.1.0", diff --git a/stories/Layers/components/Point.tsx b/stories/Layers/components/Point.tsx index d8404f77ca..23642bcb1b 100644 --- a/stories/Layers/components/Point.tsx +++ b/stories/Layers/components/Point.tsx @@ -19,11 +19,12 @@ export default class Point3D extends React.Component { const scene = new Scene({ id: 'map', - map: new Mapbox({ + map: new GaodeMap({ center: [120.19382669582967, 30.258134], pitch: 0, style: 'dark', zoom: 3, + token: 'test', }), }); scene.on('loaded', () => { diff --git a/yarn.lock b/yarn.lock index 2047a42fbc..c2e326c6e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -649,8 +649,8 @@ "@babel/plugin-syntax-async-generators@^7.2.0", "@babel/plugin-syntax-async-generators@^7.7.4": version "7.7.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.7.4.tgz#331aaf310a10c80c44a66b238b6e49132bd3c889" - integrity sha512-Li4+EjSpBgxcsmeEF8IFcfV/+yJGxHXDirDkEoyFjumuwbmfCVHUt0HuowD/iGM7OhIRyXJH9YXxqiH6N815+g== + resolved "https://registry.npm.alibaba-inc.com/@babel/plugin-syntax-async-generators/download/@babel/plugin-syntax-async-generators-7.7.4.tgz#331aaf310a10c80c44a66b238b6e49132bd3c889" + integrity sha1-MxqvMQoQyAxEpmsji25JEyvTyIk= dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -1295,6 +1295,13 @@ dependencies: regenerator-runtime "^0.13.2" +"@babel/runtime@^7.7.7": + version "7.7.7" + resolved "https://registry.npm.alibaba-inc.com/@babel/runtime/download/@babel/runtime-7.7.7.tgz#194769ca8d6d7790ec23605af9ee3e42a0aa79cf" + integrity sha1-GUdpyo1td5DsI2Ba+e4+QqCqec8= + dependencies: + regenerator-runtime "^0.13.2" + "@babel/standalone@^7.6.4": version "7.7.4" resolved "https://registry.npmjs.org/@babel/standalone/-/standalone-7.7.4.tgz#9adcda4b7c33627c65eacf87f5c1f950987294c2"