diff --git a/.umirc.ts b/.umirc.ts index 2fcef031ed..f649fcf5aa 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -95,7 +95,7 @@ export default defineConfig({ 'https://gw.alipayobjects.com/os/lib/antd/4.19.4/dist/antd.js', /** lodash */ 'https://gw.alipayobjects.com/os/lib/lodash/4.17.20/lodash.min.js', - ], + ] // more config: https://d.umijs.org/config }); diff --git a/lerna.json b/lerna.json index 62e6352e9e..8be7d7dc83 100644 --- a/lerna.json +++ b/lerna.json @@ -16,7 +16,7 @@ "registry": "https://registry.npmjs.org" } }, - "version": "2.11.0", + "version": "2.11.1", "npmClient": "yarn", "useWorkspaces": true, "publishConfig": { diff --git a/packages/component/package.json b/packages/component/package.json index 51c4c09f02..70d6f30700 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-component", - "version": "2.11.0", + "version": "2.11.1", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -26,8 +26,8 @@ "author": "lzxue", "license": "ISC", "dependencies": { - "@antv/l7-core": "2.11.0", - "@antv/l7-utils": "2.11.0", + "@antv/l7-core": "2.11.1", + "@antv/l7-utils": "2.11.1", "@babel/runtime": "^7.7.7", "eventemitter3": "^4.0.0", "inversify": "^5.0.1", @@ -36,7 +36,7 @@ "supercluster": "^7.0.0" }, "devDependencies": { - "@antv/l7-test-utils": "2.11.0", + "@antv/l7-test-utils": "2.11.1", "gcoord": "^0.3.2", "less": "^4.1.3" }, diff --git a/packages/core/package.json b/packages/core/package.json index d9d606ef5f..a697465274 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-core", - "version": "2.11.0", + "version": "2.11.1", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -25,7 +25,7 @@ "license": "ISC", "dependencies": { "@antv/async-hook": "^2.2.9", - "@antv/l7-utils": "2.11.0", + "@antv/l7-utils": "2.11.1", "@babel/runtime": "^7.7.7", "@turf/helpers": "^6.1.4", "ajv": "^6.10.2", diff --git a/packages/l7/package.json b/packages/l7/package.json index 3750a7a0c8..bf3b32ace4 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7", - "version": "2.11.0", + "version": "2.11.1", "description": "A Large-scale WebGL-powered Geospatial Data Visualization", "main": "lib/index.js", "module": "es/index.js", @@ -26,13 +26,13 @@ "author": "antv", "license": "MIT", "dependencies": { - "@antv/l7-component": "2.11.0", - "@antv/l7-core": "2.11.0", - "@antv/l7-layers": "2.11.0", - "@antv/l7-maps": "2.11.0", - "@antv/l7-scene": "2.11.0", - "@antv/l7-source": "2.11.0", - "@antv/l7-utils": "2.11.0", + "@antv/l7-component": "2.11.1", + "@antv/l7-core": "2.11.1", + "@antv/l7-layers": "2.11.1", + "@antv/l7-maps": "2.11.1", + "@antv/l7-scene": "2.11.1", + "@antv/l7-source": "2.11.1", + "@antv/l7-utils": "2.11.1", "@babel/runtime": "^7.7.7" }, "gitHead": "684ba4eb806a798713496d3fc0b4d1e17517dc31", diff --git a/packages/l7/src/version.ts b/packages/l7/src/version.ts index 3c918a483e..a4a69aff64 100644 --- a/packages/l7/src/version.ts +++ b/packages/l7/src/version.ts @@ -1,2 +1,2 @@ -const version = '2.11.0'; +const version = '2.11.1'; export { version }; diff --git a/packages/layers/package.json b/packages/layers/package.json index 929dc2eca7..b6fb74d582 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-layers", - "version": "2.11.0", + "version": "2.11.1", "description": "L7's collection of built-in layers", "main": "lib/index.js", "module": "es/index.js", @@ -27,10 +27,10 @@ "license": "ISC", "dependencies": { "@antv/async-hook": "^2.2.9", - "@antv/l7-core": "2.11.0", - "@antv/l7-maps": "2.11.0", - "@antv/l7-source": "2.11.0", - "@antv/l7-utils": "2.11.0", + "@antv/l7-core": "2.11.1", + "@antv/l7-maps": "2.11.1", + "@antv/l7-source": "2.11.1", + "@antv/l7-utils": "2.11.1", "@babel/runtime": "^7.7.7", "@mapbox/martini": "^0.2.0", "@turf/clone": "^6.5.0", diff --git a/packages/map/package.json b/packages/map/package.json index 9f82ef5bf5..6d2835feef 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-map", - "version": "2.11.0", + "version": "2.11.1", "description": "l7 map", "keywords": [], "author": "thinkinggis ", @@ -39,7 +39,7 @@ }, "homepage": "https://github.com/antvis/L7#readme", "dependencies": { - "@antv/l7-utils": "2.11.0", + "@antv/l7-utils": "2.11.1", "@babel/runtime": "^7.7.7", "@mapbox/point-geometry": "^0.1.0", "@mapbox/unitbezier": "^0.0.0", diff --git a/packages/maps/package.json b/packages/maps/package.json index a7aefda2aa..4f0e46f2ab 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-maps", - "version": "2.11.0", + "version": "2.11.1", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -27,9 +27,9 @@ "license": "ISC", "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", - "@antv/l7-core": "2.11.0", - "@antv/l7-map": "2.11.0", - "@antv/l7-utils": "2.11.0", + "@antv/l7-core": "2.11.1", + "@antv/l7-map": "2.11.1", + "@antv/l7-utils": "2.11.1", "@babel/runtime": "^7.7.7", "@types/amap-js-api": "^1.4.6", "@types/mapbox-gl": "^1.11.2", diff --git a/packages/mini/package.json b/packages/mini/package.json index 4bf7b182fb..e6d6e694c0 100644 --- a/packages/mini/package.json +++ b/packages/mini/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-mini", - "version": "2.11.0", + "version": "2.11.1", "description": "A Large-scale WebGL-powered Geospatial Data Visualization", "main": "lib/index.js", "module": "es/index.js", @@ -25,11 +25,11 @@ "author": "antv", "license": "MIT", "dependencies": { - "@antv/l7-core": "2.11.0", - "@antv/l7-layers": "2.11.0", - "@antv/l7-maps": "2.11.0", - "@antv/l7-scene": "2.11.0", - "@antv/l7-utils": "2.11.0", + "@antv/l7-core": "2.11.1", + "@antv/l7-layers": "2.11.1", + "@antv/l7-maps": "2.11.1", + "@antv/l7-scene": "2.11.1", + "@antv/l7-utils": "2.11.1", "@babel/runtime": "^7.7.7" }, "gitHead": "684ba4eb806a798713496d3fc0b4d1e17517dc31", diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 91092217aa..0f29a0baed 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-renderer", - "version": "2.11.0", + "version": "2.11.1", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -25,12 +25,12 @@ "author": "xiaoiver", "license": "ISC", "devDependencies": { - "@antv/l7-test-utils": "2.11.0", + "@antv/l7-test-utils": "2.11.1", "gl": "^5.0.3" }, "dependencies": { - "@antv/l7-core": "2.11.0", - "@antv/l7-utils": "2.11.0", + "@antv/l7-core": "2.11.1", + "@antv/l7-utils": "2.11.1", "@babel/runtime": "^7.7.7", "inversify": "^5.0.1", "l7regl": "^0.0.20", diff --git a/packages/scene/package.json b/packages/scene/package.json index 8c909d9535..f06b10f13b 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-scene", - "version": "2.11.0", + "version": "2.11.1", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -23,12 +23,12 @@ "author": "xiaoiver", "license": "ISC", "dependencies": { - "@antv/l7-component": "2.11.0", - "@antv/l7-core": "2.11.0", - "@antv/l7-layers": "2.11.0", - "@antv/l7-maps": "2.11.0", - "@antv/l7-renderer": "2.11.0", - "@antv/l7-utils": "2.11.0", + "@antv/l7-component": "2.11.1", + "@antv/l7-core": "2.11.1", + "@antv/l7-layers": "2.11.1", + "@antv/l7-maps": "2.11.1", + "@antv/l7-renderer": "2.11.1", + "@antv/l7-utils": "2.11.1", "@babel/runtime": "^7.7.7", "eventemitter3": "^4.0.7", "inversify": "^5.0.1", @@ -36,7 +36,7 @@ "reflect-metadata": "^0.1.13" }, "devDependencies": { - "@antv/l7-test-utils": "2.11.0" + "@antv/l7-test-utils": "2.11.1" }, "gitHead": "684ba4eb806a798713496d3fc0b4d1e17517dc31", "publishConfig": { diff --git a/packages/site/.dumirc.ts b/packages/site/.dumirc.ts index 74f8c7f959..fdebd13072 100644 --- a/packages/site/.dumirc.ts +++ b/packages/site/.dumirc.ts @@ -199,7 +199,7 @@ export default defineConfig({ }, { name: { - zh: 'L7 地理围栏绘制组件库', + zh: 'L7Draw 地理围栏绘制组件库', en: 'L7Draw', }, url: 'http://antv.vision/L7Draw/', @@ -606,6 +606,13 @@ export default defineConfig({ scripts: [ 'https://webapi.amap.com/maps?v=2.0&key=ff533602d57df6f8ab3b0fea226ae52f' ], + internalSite: { + url: 'https://s2.antv.antgroup.com', + name: { + zh: '国内镜像', + en: 'China Mirror', + }, + }, alias: env === 'development'? { '@antv/l7': path.resolve(__dirname, '../l7/src'), '@antv/l7-mini': path.resolve(__dirname, '../mini/src'), diff --git a/packages/site/docs/api/raster_layer/style.zh.md b/packages/site/docs/api/raster_layer/common/style.md similarity index 65% rename from packages/site/docs/api/raster_layer/style.zh.md rename to packages/site/docs/api/raster_layer/common/style.md index d1c38f77cf..dab6507b37 100644 --- a/packages/site/docs/api/raster_layer/style.zh.md +++ b/packages/site/docs/api/raster_layer/common/style.md @@ -1,14 +1,6 @@ ---- -title: Style -order: 4 ---- - - - -`style` 方法用于配制图层的样式,栅格图层在绘制单通道的栅格和多通道的栅格时拥有不同的 `style` 参数。 +`style` 方法用于配制图层的样式, - 单通道 绘制结果由是单一的数值控制,如灰度图,数值对应的颜色可以通过表示配置 `rampColors` 色带控制。 -- 多通道 绘制结果由 `r`、`g`、`b` 三个通道的数值控制,波段计算返回结果直接作为 `sRGB` 的颜色。 ```js layer.style({ @@ -16,7 +8,7 @@ layer.style({ }); ``` -### raster 单通道栅格 +### 配置 | style | 类型 | 描述 | 默认值 | | ----------- | ------------------ | ------------------------------------------- | ------------- | @@ -43,12 +35,4 @@ layer.style({ positions: [0, 0.2, 0.4, 0.6, 0.8, 1.0], }, }); -``` - -### raster 多通道栅格 - -当我们使用栅格图层绘制彩色遥感影像的时候,`style` 支持参数只有 `opacity`。不再根据 `rampColors` 色带取值,而是根据 `rgb` 通道的波段数据作为颜色值。 - -| style | 类型 | 描述 | 默认值 | -| ------- | -------- | ------------ | ------ | -| opacity | `number` | 图形的透明度 | `1` | +``` \ No newline at end of file diff --git a/packages/site/docs/api/raster_layer/options.en.md b/packages/site/docs/api/raster_layer/options.en.md deleted file mode 100644 index 9848ab2654..0000000000 --- a/packages/site/docs/api/raster_layer/options.en.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Options -order: 1 ---- - - diff --git a/packages/site/docs/api/raster_layer/options.zh.md b/packages/site/docs/api/raster_layer/options.zh.md deleted file mode 100644 index de4d2d46a4..0000000000 --- a/packages/site/docs/api/raster_layer/options.zh.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Options -order: 1 ---- - - - - diff --git a/packages/site/docs/api/raster_layer/raster_band_calc.zh.md b/packages/site/docs/api/raster_layer/raster_band_calc.zh.md deleted file mode 100644 index dc3aa549b6..0000000000 --- a/packages/site/docs/api/raster_layer/raster_band_calc.zh.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: RasterLayer 波段计算 -order: 3 ---- diff --git a/packages/site/docs/api/raster_layer/raster_layer.en.md b/packages/site/docs/api/raster_layer/raster_layer.en.md deleted file mode 100644 index 6e0317f72f..0000000000 --- a/packages/site/docs/api/raster_layer/raster_layer.en.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Raster -order: 0 ---- - - diff --git a/packages/site/docs/api/raster_layer/raster_multi_band.zh.md b/packages/site/docs/api/raster_layer/raster_multi_band.zh.md index 91d3604909..a5a08b7c11 100644 --- a/packages/site/docs/api/raster_layer/raster_multi_band.zh.md +++ b/packages/site/docs/api/raster_layer/raster_multi_band.zh.md @@ -2,3 +2,21 @@ title: RasterLayer 多波段计算 order: 2 --- + + + +## 简介 + +多波段数据叠加计算着色。 + +## Option + + + +## source + + + +## style + + diff --git a/packages/site/docs/api/raster_layer/raster_muti_band.en.md b/packages/site/docs/api/raster_layer/raster_muti_band.en.md new file mode 100644 index 0000000000..dfeea99f19 --- /dev/null +++ b/packages/site/docs/api/raster_layer/raster_muti_band.en.md @@ -0,0 +1,6 @@ +--- +title: RasterLayer Multi band +order: 0 +--- + + diff --git a/packages/site/docs/api/raster_layer/raster_rgb.en.md b/packages/site/docs/api/raster_layer/raster_rgb.en.md new file mode 100644 index 0000000000..ef83edf90d --- /dev/null +++ b/packages/site/docs/api/raster_layer/raster_rgb.en.md @@ -0,0 +1,6 @@ +--- +title: RasterLayer Multi band +order: 0 +--- + + diff --git a/packages/site/docs/api/raster_layer/raster_rgb.zh.md b/packages/site/docs/api/raster_layer/raster_rgb.zh.md index aefc7724d5..67d62bcf02 100644 --- a/packages/site/docs/api/raster_layer/raster_rgb.zh.md +++ b/packages/site/docs/api/raster_layer/raster_rgb.zh.md @@ -19,5 +19,10 @@ order: 1 ## style -- opacity - 透明度 +### opacity 透明度 + +```js +layer.style({ + opacity: 0.5, +}); +``` diff --git a/packages/site/docs/api/raster_layer/raster_single_band.en.md b/packages/site/docs/api/raster_layer/raster_single_band.en.md index 80f337ebfd..1d074fdde1 100644 --- a/packages/site/docs/api/raster_layer/raster_single_band.en.md +++ b/packages/site/docs/api/raster_layer/raster_single_band.en.md @@ -3,4 +3,4 @@ title: RasterLayer single band order: 0 --- - + diff --git a/packages/site/docs/api/raster_layer/raster_single_band.zh.md b/packages/site/docs/api/raster_layer/raster_single_band.zh.md index 540d6499fb..e197aa326c 100644 --- a/packages/site/docs/api/raster_layer/raster_single_band.zh.md +++ b/packages/site/docs/api/raster_layer/raster_single_band.zh.md @@ -7,6 +7,12 @@ order: 0 ## 简介 +单波段栅格数据渲染、根据栅格数据进行可视化着色 + +## Option + + + `RasterLayer` 图层主要实现栅格数据的可视化,栅格数据主要来源是卫星遥感数据,如数字高程图,植被分布图,夜光图。 ## source @@ -15,4 +21,4 @@ order: 0 ## style - \ No newline at end of file + diff --git a/packages/site/docs/api/raster_layer/source.en.md b/packages/site/docs/api/raster_layer/source.en.md deleted file mode 100644 index ca079d69d9..0000000000 --- a/packages/site/docs/api/raster_layer/source.en.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Source -order: 2 ---- - - diff --git a/packages/site/docs/api/raster_layer/source.zh.md b/packages/site/docs/api/raster_layer/source.zh.md deleted file mode 100644 index 84a684b0b4..0000000000 --- a/packages/site/docs/api/raster_layer/source.zh.md +++ /dev/null @@ -1,257 +0,0 @@ ---- -title: Source -order: 2 ---- - - - -栅格图层接受的并不是矢量的地理数据(GeoJSON),而是栅格数据。同时支持传入多种数据格式,入 `tiff`、`lerc` 等。 - -```js -const source = new Source(data, { - parser: {...}, -}); -``` - -### 加载未解析的栅格数据 - -我们可以直接将请求到的栅格文件的二进制数据直接传递给栅格图层使用,此时我们不仅仅可以选择加载多波段的数据,同时还可以对栅格数据进行简单的数学计算。 - -- 对多(单)波段的数据进行数学运算。 -- 绘制彩色遥感影像(真、假彩色)。 -- 需要提供解析栅格数据的标准方法。 - -```js -// 对单波段数据进行运算 -async function getTiffData() { - const response = await fetch( - 'https://gw.alipayobjects.com/os/rmsportal/XKgkjjGaAzRyKupCBiYW.dat', - ); - const arrayBuffer = await response.arrayBuffer(); - return arrayBuffer; -} -const tiffdata = await getTiffData(); -const layer = new RasterLayer({}); -layer.source( - [ - { - data: tiffdata, - bands: [0], - }, - ], - { - parser: { - type: 'raster', - format: async (data, bands) => { - const tiff = await GeoTIFF.fromArrayBuffer(data); - const imageCount = await tiff.getImageCount(); - const image = await tiff.getImage(bands[0]); - const width = image.getWidth(); - const height = image.getHeight(); - const values = await image.readRasters(); - return { rasterData: values[0], width, height }; - }, - operation: ['*', ['band', 0], 0.5], - extent: [73.482190241, 3.82501784112, 135.106618732, 57.6300459963], - }, - }, -); -``` - -#### data: IBandsData[] | IBandsData - -用户可以直接传入栅格文件的二进制数据。 - -- 支持传入多文件的数据。 -- 支持指定某个栅格文件要提取的波段。 - -```js -interface IBandsData { - data: ArrayBuffer; // 请求加载的栅格文件的二进制数据 - bands?: number[]; // 指定加载该栅格文件的波段 -} -// 默认加载 0 波段的数据 -const source = new Source({ data: tiffData }); -// 指定加载 tiffData 0 波段的数据 -// 指定加载 tiffData2 0、1 波段的数据 -const source2 = new Source([ - { data: tiffData, bands: [0] }, - { data: tiffData2, bands: [0, 1] }, -]); -``` - -#### parser - - _IParser_ **必选** - -为使用栅格数据的使用提供必要的参数和方法。 - -```js -interface IParser { - type: string; - format: IRasterFormat; - operation: IOperation; - extent: number[]; -} -``` - -##### type - - _string_ **必选** - -- 输出结果为单通道数据的时候值为 raster -- 输出结果为多通道彩色的时候值为 rasterRgb - -##### format: IRasterFormat - - _IFormat_ **必选** - -`format` 方法用于从传入的栅格文件二进制数据中提取波段数据。 - -- 第一个参数是栅格文件二进制数据。 -- 第二个参数是第一个参数指定的栅格文件中应该提取的波段,方法参数是我们通过 `source` 参数传递的 `data` 数值。 -- `format` 是一个 `async` 方法。 - -```js -interface IRasterData { - rasterData: HTMLImageElement | Uint8Array | ImageBitmap | null | undefined; - width: number; - height: number; -} -type IRasterFormat = ( - data: ArrayBuffer, - bands: number[], -) => Promise; - -const source = new Source(data, { - parser: { - format: async (data, bands) => { - ... - return { - rasterData: bandData, - width: 256; - height: 256; - } - } - } -}) -``` - -1. `format` 方法的返回值为栅格数据(`rasterData`)以及表示大小的 `width`、`height` 参数。 -2. `format` 方法可以返回多份数据,表示从当前栅格文件中提取多份波段的数据。 - -##### operation: IOperation - - _IOperation_ **可选** - -在加载多波段数据的时候我们可以通过 `operation` 配置波段数据的运算。 - -🌟 我们可以不配置 `operation`,此时默认使用第一个栅格文件提取的第一个波段数据 - -1. `operation` 可以是一个函数,`allbands` 是我们从所有栅格文件中提取的所有波段数据的集合。 - -```js -const parser = { - operation: (allBands) => { - // operation 可以是一个函数,allbands 是我们从所有栅格文件中提取的所有波段数据的集合, - // 在设立 allbands 就是 [band0] - // 函数的返回值是单纯的波段数据,在这里我们直接返回第一个波段的数据 - return allBands[0].rasterData; - }, -}; -``` - -2. `operation` 可以是以数组形式存在的计算表达式. - -```js -// 下面表达式可以转述为 band1 * 0.5,表示将波段1 的值都乘上 0.5 并返回 -const parser = { - operation: ['*', ['band', 1], 0.5], -}; -``` - -3. `operation` 可以嵌套使用:`['+', ['*', ['band', 0], 0.2], ['band', 1]]]`,返回结果为:`band0 * 0.2 + band1`。 - -4. `operation` 可以直接指定结果:`['band', 0]`。 - -5. `operation` 支持以下的数学运算。 - -```js -/** 数学运算 根据计算表达式进行数学运算 - * * * Math operators: - * `['*', value1, value2]` 返回 `value1 * value2` - * `['/', value1, value2]` 返回 `value1 / value2` - * `['+', value1, value2]` 返回 `value1 + value2` - * `['-', value1, value2]` 返回 `value2 - value1` - * `['%', value1, value2]` 返回 `value1 % value2` - * `['^', value1, value2]` 返回 `value1 ^ value2` - * `['abs', value1]` 返回 `Math.abs(value1)` - * `['floor', value1]` 返回 `Math.floor(value1)` - * `['round', value1]` 返回 `Math.round(value1)` - * `['ceil', value1]` 返回 `Math.ceil(value1)` - * `['sin', value1]` 返回 `Math.sin(value1)` - * `['cos', value1]` 返回 `Math.cos(value1)` - * `['atan', value1, value2]` 返回 `n1===-1?Math.atan(n1): Math.atan2(n1, n2)` - */ -``` - -##### extent - - _number[]_ **必选** - -`extent` 描述的是栅格数据覆盖的地理区间,数值指定的是区域的经纬度区间(左下角和右上角)。 - -### 加载多通道(彩色)影像 - -我们在使用多波段数据的时候支持根据多波段数据绘制彩色遥感影像,如下图的假彩色影像。 - -
-
- 案例 -
-
- -#### data: IBandsData[] | IBandsData - -绘制多通道影像的时候,需要加载多波段数据 - -#### parser - -使用栅格数据的使用提供必要的参数和方法, 具体使用和多波段栅格的 `parser` 保持一致。 - -##### type - - _string_ **必选** - -- 输出结果为多通道彩色的时候值为 `rasterRgb`。 - -##### format: IRasterFormat - - _IFormat_ **必选** - -绘制多通道影像的时候,使用通用的 `format`函数。 - -##### operation: IOperation - - _IOperation_ **必选** - -为了绘制多通道影像,我们必须要提供 `operation` 配置指定多通道数据。 - -1. 在渲染彩色多通道栅格的时候需要额外使用 parser,同时彩色栅格图层不再支持 domain、rampColor 等参数,渲染的结果直接由波段计算出的 r、g、b 通道的数值结果控制。 - -2. 彩色栅格不再兼容旧的数据传值方式(直接传入解析完的栅格数据。 - -```js -const source = new Source(data, { // 彩色栅格和单通道栅格使用相同的规则 - parser: { - type: 'rasterRgb', // 使用独立的 type 类型 - format: async (data, bands) {...}, // 彩色栅格和单通道栅格 format 使用相同 - // operation 为对象,分别为 rgb 三通道指定计算表达式 - // operation 必须要配置 - operation: { - r: ['*', ['band', 1], 0.5], - g: ['band', 1], - b: undefined // 缺省配置表达式的通道会默认取 0 号波段的值 - } - } -``` diff --git a/packages/site/docs/api/raster_layer/style.en.md b/packages/site/docs/api/raster_layer/style.en.md deleted file mode 100644 index 1b15fa3fab..0000000000 --- a/packages/site/docs/api/raster_layer/style.en.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Style -order: 4 ---- - - diff --git a/packages/site/docs/api/source/raster/raster_band_calc.md b/packages/site/docs/api/source/raster/raster_band_calc.md index e69de29bb2..747510d421 100644 --- a/packages/site/docs/api/source/raster/raster_band_calc.md +++ b/packages/site/docs/api/source/raster/raster_band_calc.md @@ -0,0 +1,74 @@ +### data + + +### parser + +#### format + +`format` 方法用于从传入的栅格文件二进制数据中提取波段数据。 + +- 第一个参数是栅格文件二进制数据 + +- 第二个参数是第一个参数指定的栅格文件中应该提取的波段 + +- `format` 是一个 `async` 方法。 + +#### operation 快捷计算 + 归一化指数 + + ```ts + { + type:'nd' + } + ``` + +#### operation 表达式 + +- 示例一 + +```ts +// band1 * 0.5 +{ + operation: ['*', ['band', 1], 0.5], +}; +``` + +- 示例二 嵌套使用 + +```ts +// band0 * 0.2 + band1 +{ + operation:['+', ['*', ['band', 0], 0.2], ['band', 1]]] +}; +``` + +- 示例三 归一化指数 + +```ts +// 植被指数计算 +{ + operation:['/', + ['-', ['band', 1], ['band', 0]], // R > NIR + ['+', ['band', 1], ['band', 0]] + ] +}; +``` + +- operation 表达式类型 + + - *`['*', value1, value2]` 返回 `value1 * value2` + - / `['/', value1, value2]` 返回 `value1 / value2` + - +`['+', value1, value2]` 返回 `value1 + value2` + - -`['-', value1, value2]` 返回 `value2 - value1` + - % `['%', value1, value2]` 返回 `value1 % value2` + - ^ `['^', value1, value2]` 返回 `value1 ^ value2` + - abs`['abs', value1]` 返回 `Math.abs(value1)` + - floor `['floor', value1]` 返回 `Math.floor(value1)` + - round `['round', value1]` 返回 `Math.round(value1)` + - ceil `['ceil', value1]` 返回 `Math.ceil(value1)` + - sin `['sin', value1]` 返回 `Math.sin(value1)` + - cos `['cos', value1]` 返回 `Math.cos(value1)` + - atan `['atan', value1, value2]` 返回 `n1===-1?Math.atan(n1): + + + diff --git a/packages/site/docs/api/source/raster/raster_rgb.md b/packages/site/docs/api/source/raster/raster_rgb.md index 2c909fc8da..e8e1d82360 100644 --- a/packages/site/docs/api/source/raster/raster_rgb.md +++ b/packages/site/docs/api/source/raster/raster_rgb.md @@ -60,17 +60,37 @@ layer.source( }, ) +``` +#### 多文件多波段 + +```ts + +const urls = [ + { + url: 'https://ganos.oss-cn-hangzhou.aliyuncs.com/m2/l7/tiff_jx/{z}/{x}/{y}.tiff', + bands: [0] + }, + { + url: 'https://ganos.oss-cn-hangzhou.aliyuncs.com/m2/l7/tiff_jx/{z}/{x}/{y}.tiff' + }, + ... +] +const tileSource = new Source(urls, {...}); ``` ### parser -- type: `rasterRgb` +#### type: `rasterRgb` 多波段数据影像合成 -- extent: 栅格的经纬度范围 [minlng, minlat,maxLng, maxLat] +#### extent: 栅格的经纬度范围 [minlng, minlat,maxLng, maxLat] + +#### operation 合成方式 + rgb 会自动根据最大值最小值进行拉伸处理 -- operation 合成方式 - type `rgb` -- format 数据处理方法,栅格数据解析方式 + +#### format 数据处理方法,栅格数据解析方式 + - 入参数: - data: source 传入参数 - bands 波段序号 diff --git a/packages/site/docs/api/source/raster/raster_single.md b/packages/site/docs/api/source/raster/raster_single.md index 4ee2196971..a249019a43 100644 --- a/packages/site/docs/api/source/raster/raster_single.md +++ b/packages/site/docs/api/source/raster/raster_single.md @@ -1,4 +1,4 @@ -## data +### data data 解析后的数据,为数组 @@ -39,7 +39,7 @@ layer.source(tiffdata.data, { }); ``` -## parser +### parser - type: raster - extent: 栅格的经纬度范围 [minlng, minlat,maxLng, maxLat] diff --git a/packages/site/docs/api/source/raster_rgb.en.md b/packages/site/docs/api/source/raster_rgb.en.md new file mode 100644 index 0000000000..d36cd4a9df --- /dev/null +++ b/packages/site/docs/api/source/raster_rgb.en.md @@ -0,0 +1,6 @@ +--- +title: Raster RGB +order: 5 +--- + + diff --git a/packages/site/docs/api/source/raster_rgb.zh.md b/packages/site/docs/api/source/raster_rgb.zh.md new file mode 100644 index 0000000000..d36cd4a9df --- /dev/null +++ b/packages/site/docs/api/source/raster_rgb.zh.md @@ -0,0 +1,6 @@ +--- +title: Raster RGB +order: 5 +--- + + diff --git a/packages/site/docs/api/tile/common/options.zh.md b/packages/site/docs/api/tile/common/options.zh.md index 64abc5f2eb..6927b1ccad 100644 --- a/packages/site/docs/api/tile/common/options.zh.md +++ b/packages/site/docs/api/tile/common/options.zh.md @@ -31,6 +31,4 @@ const layer = new PointLayer({ const layer = new PointLayer({ featureId: 'id', }); -``` - - +``` \ No newline at end of file diff --git a/packages/site/docs/api/tile/style.zh.md b/packages/site/docs/api/tile/common/style.zh.md similarity index 100% rename from packages/site/docs/api/tile/style.zh.md rename to packages/site/docs/api/tile/common/style.zh.md diff --git a/packages/site/docs/api/tile/geojsonvt_tile_layer.zh.md b/packages/site/docs/api/tile/geojsonvt_tile_layer.zh.md index ce99890ee3..00811a9d06 100644 --- a/packages/site/docs/api/tile/geojsonvt_tile_layer.zh.md +++ b/packages/site/docs/api/tile/geojsonvt_tile_layer.zh.md @@ -50,7 +50,7 @@ const source = new Source(data, { `geojsonOptions` 支持如下参数: | 参数 | 类型 | 默认值 | 描述 | -| -------------- | ----------- | -------- | -------------------------------------------------------------- | ------------------------------------------------------- | +| -------------- | ----------- | -------- |-------------------------- | | maxZoom | `number` | `14` | max zoom to preserve detail on | | indexMaxZoom | `number` | `5` | max zoom in the tile index | | indexMaxPoints | `number` | `100000` | max number of points per tile in the tile index | diff --git a/packages/site/docs/api/tile/options.zh.md b/packages/site/docs/api/tile/options.zh.md deleted file mode 100644 index 64abc5f2eb..0000000000 --- a/packages/site/docs/api/tile/options.zh.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: Options -order: 1 ---- - - - -### sourceLayer - - _string_ **required** - -只有矢量图层生效,用于设置矢量图层的数据源。 - -🌟 一般矢量服务返回的数据中存在多个图层的数据,我们需要从中进行选取。 - -```javascript -const layer = new PointLayer({ - sourceLayer: 'city', -}); -``` - -### featureId - - _string_ **optional** _default:_ 自动数字编号 - -只有矢量图层生效,用于指定矢量图层的编码 `id`。 - -🌟 编码 `id` 用于在图层高亮时使用。 - -```javascript -const layer = new PointLayer({ - featureId: 'id', -}); -``` - - diff --git a/packages/site/docs/api/tile/raster_tile_layer.zh.md b/packages/site/docs/api/tile/raster_tile_layer.zh.md index b773de0ab0..3c04c03f55 100644 --- a/packages/site/docs/api/tile/raster_tile_layer.zh.md +++ b/packages/site/docs/api/tile/raster_tile_layer.zh.md @@ -13,7 +13,7 @@ order: 0 | 栅格瓦片 | `RasterLayer` | `rasterTile` | `arraybuffer` | 数据栅格 | | 栅格瓦片 | `RasterLayer` | `rasterTile` | `rgb` | 彩色遥感影像栅格 | -🌟 目前只支持 3857坐标系 +🌟 目前只支持 3857 坐标系 ### source(url: string, option: IOption) @@ -205,64 +205,6 @@ const source = new Source(data, { }) ``` -1. `format` 方法的返回值为栅格数据(`rasterData`)以及表示大小的 `width`、`height` 参数。 -2. `format` 方法可以返回多份数据,表示从当前栅格文件中提取多份波段的数据。 - -##### operation: IOperation - - _IOperation_ **可选** - -在加载多波段数据的时候我们可以通过 `operation` 配置波段数据的运算。 - -🌟 我们可以不配置 `operation`,此时默认使用第一个栅格文件提取的第一个波段数据 - -1. `operation` 可以是一个函数,`allbands` 是我们从所有栅格文件中提取的所有波段数据的集合。 - -```js -const parser = { - operation: (allBands) => { - // operation 可以是一个函数,allbands 是我们从所有栅格文件中提取的所有波段数据的集合, - // 在设立 allbands 就是 [band0] - // 函数的返回值是单纯的波段数据,在这里我们直接返回第一个波段的数据 - return allBands[0].rasterData; - }, -}; -``` - -2. `operation` 可以是以数组形式存在的计算表达式. - -```js -// 下面表达式可以转述为 band1 * 0.5,表示将波段1 的值都乘上 0.5 并返回 -const parser = { - operation: ['*', ['band', 1], 0.5], -}; -``` - -3. `operation` 可以嵌套使用:`['+', ['*', ['band', 0], 0.2], ['band', 1]]]`,返回结果为:`band0 * 0.2 + band1`。 - -4. `operation` 可以直接指定结果:`['band', 0]`。 - -5. `operation` 支持以下的数学运算。 - -```js -/** 数学运算 根据计算表达式进行数学运算 - * * * Math operators: - * `['*', value1, value2]` 返回 `value1 * value2` - * `['/', value1, value2]` 返回 `value1 / value2` - * `['+', value1, value2]` 返回 `value1 + value2` - * `['-', value1, value2]` 返回 `value2 - value1` - * `['%', value1, value2]` 返回 `value1 % value2` - * `['^', value1, value2]` 返回 `value1 ^ value2` - * `['abs', value1]` 返回 `Math.abs(value1)` - * `['floor', value1]` 返回 `Math.floor(value1)` - * `['round', value1]` 返回 `Math.round(value1)` - * `['ceil', value1]` 返回 `Math.ceil(value1)` - * `['sin', value1]` 返回 `Math.sin(value1)` - * `['cos', value1]` 返回 `Math.cos(value1)` - * `['atan', value1, value2]` 返回 `n1===-1?Math.atan(n1): Math.atan2(n1, n2)` - */ -``` - ## style - \ No newline at end of file + diff --git a/packages/site/docs/api/tile/style.en.md b/packages/site/docs/api/tile/style.en.md deleted file mode 100644 index e68cb4e9c2..0000000000 --- a/packages/site/docs/api/tile/style.en.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Style -order: 4 ---- - - diff --git a/packages/site/docs/api/tile/vector_tile_layer.zh.md b/packages/site/docs/api/tile/vector_tile_layer.zh.md index 92032282c0..99739b88c3 100644 --- a/packages/site/docs/api/tile/vector_tile_layer.zh.md +++ b/packages/site/docs/api/tile/vector_tile_layer.zh.md @@ -5,6 +5,8 @@ order: 0 +### 简介 + `L7` 的矢量瓦片图层复用了普通图层的数据可视化能力,支持对图层的样式进行数据映射。目前矢量瓦片支持了点、线、面、掩模等图层 | 分类 | Layer | parserType | 描述 | @@ -15,7 +17,10 @@ order: 0 | 矢量瓦片 | `MaskLayer` | parser of MaskLayer、`geojsonvt` | 矢量掩模图层 | | 矢量瓦片 | `TileDebugLayer` | `/` | `TileDebugLayer` 不需要执行 `source` 方法 | -### option +瓦片图层其他配置项和基础图层 PointLayer、Linelayer、PolygonLayer 保持一致 + +### options + ### source(url: string, option: IOption) @@ -63,7 +68,7 @@ const source = new Source(url, { type UpdateTileStrategy = 'realtime' | 'overlap' | 'replace'; ``` -🌟 矢量瓦片推荐复用瓦片服务。 +🌟 矢量瓦片推荐复用 Source ```js const vectorSource = new Source( diff --git a/packages/site/package.json b/packages/site/package.json index 39eaf2f508..52d7d24fd6 100644 --- a/packages/site/package.json +++ b/packages/site/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@antv/l7-site", - "version": "2.11.0", + "version": "2.11.1", "description": "L7 sites deployed on gh-pages", "keywords": [ "antv", @@ -34,12 +34,12 @@ "site:publish": "gh-pages -d public" }, "devDependencies": { - "@antv/dumi-theme-antv": "^0.3.0-beta.24", + "@antv/dumi-theme-antv": "^0.3.0", "@antv/g2": "^4.2.8", - "@antv/l7": "2.11.0", + "@antv/l7": "2.11.1", "@antv/l7-draw": "^3.0.9", - "@antv/l7-maps": "2.11.0", - "@antv/l7-three": "2.11.0", + "@antv/l7-maps": "2.11.1", + "@antv/l7-three": "2.11.1", "@antv/l7plot": "^0.3.3", "@antv/util": "^2.0.9", "@turf/turf": "^6.5.0", diff --git a/packages/source/package.json b/packages/source/package.json index c377970ea4..bc2e0c4bb1 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-source", - "version": "2.11.0", + "version": "2.11.1", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -25,8 +25,8 @@ "license": "ISC", "dependencies": { "@antv/async-hook": "^2.2.9", - "@antv/l7-core": "2.11.0", - "@antv/l7-utils": "2.11.0", + "@antv/l7-core": "2.11.1", + "@antv/l7-utils": "2.11.1", "@babel/runtime": "^7.7.7", "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/vector-tile": "^1.3.1", diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 95b1550ed2..fab40c3456 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@antv/l7-test-utils", - "version": "2.11.0", + "version": "2.11.1", "description": "Now I’m the model of a modern major general / The venerated Virginian veteran whose men are all / Lining up, to put me up on a pedestal / Writin’ letters to relatives / Embellishin’ my elegance and eloquence / But the elephant is in the room / The truth is in ya face when ya hear the British cannons go / BOOM", "keywords": [], "author": "lzxue ", @@ -39,9 +39,9 @@ "url": "https://github.com/antvis/L7/issues" }, "devDependencies": { - "@antv/l7-map": "2.11.0", - "@antv/l7-maps": "2.11.0", - "@antv/l7-scene": "2.11.0", + "@antv/l7-map": "2.11.1", + "@antv/l7-maps": "2.11.1", + "@antv/l7-scene": "2.11.1", "gl": "^5.0.3", "l7regl": "^0.0.20" }, diff --git a/packages/three/package.json b/packages/three/package.json index 1a84cd7caf..ac954eadef 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-three", - "version": "2.11.0", + "version": "2.11.1", "description": "three for L7 ", "keywords": [ "3D", @@ -44,7 +44,7 @@ }, "homepage": "https://github.com/antvis/L7#readme", "dependencies": { - "@antv/l7": "2.11.0", + "@antv/l7": "2.11.1", "@babel/runtime": "^7.7.7", "inversify": "^5.0.1", "reflect-metadata": "^0.1.13", diff --git a/packages/utils/package.json b/packages/utils/package.json index 1eb8a5c383..6810047fdd 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-utils", - "version": "2.11.0", + "version": "2.11.1", "description": "", "main": "lib/index.js", "module": "es/index.js", diff --git a/scripts/site.sh b/scripts/site.sh index b01d95b064..d762d369b9 100644 --- a/scripts/site.sh +++ b/scripts/site.sh @@ -17,7 +17,7 @@ git checkout -b $feat_name cd ../../ echo `pwd` -rsync -av --exclude .dumi/tmp-production --exclude .dumi/tmp --exclude node_modules --exclude public --exclude dist ./packages/site/ ./site_temp/l7-site/ +rsync -av --exclude .cache --exclude .dumi/tmp-production --exclude .dumi/tmp --exclude node_modules --exclude public --exclude dist ./packages/site/ ./site_temp/l7-site/ cd ./site_temp/l7-site