Skip to content

docs: 完善 API 文档内容#2854

Open
lzxue wants to merge 1 commit intomasterfrom
doc_upate
Open

docs: 完善 API 文档内容#2854
lzxue wants to merge 1 commit intomasterfrom
doc_upate

Conversation

@lzxue
Copy link
Copy Markdown
Contributor

@lzxue lzxue commented May 7, 2026

  • 修复 layer_ctr: setMaxZoom 示例代码错误,补充 getMinZoom/getMaxZoom/destroy 方法
  • 修复 mask_method: enableMask 示例代码错误
  • 修复 mouse_event: 补充 mouseenter 事件,去除重复 dblclick
  • 补充 layer_encode: 新增 rotate() 和 label() 方法文档
  • 补充 common/map.zh: 新增 bearing/pitch/interactive 等 13 个地图配置项
  • 补充 source.en: 新增 map/filter transforms、getClusters、updateClusterData 等方法
  • 补充 marker.zh/en: 完善所有方法文档,添加参数签名和示例
  • 完善 pointlayer.zh: 修复 new 关键字缺失,嵌入所有子文档
  • 完善 linelayer.zh: 嵌入所有子文档(含 texture)
  • 完善 polygonlayer.zh: 嵌入所有子文档
  • 完善 heatmap.zh: 补充 shape 类型表格,嵌入所有子文档
  • 完善 heatmap/shape.zh: 补充各聚合形状详细说明
  • 完善 imagelayer.zh: 嵌入所有子文档
  • 完善 raster.zh: 重写简介,嵌入三种栅格模式子文档
  • site/.dumirc.ts: 新增 /api -> /api/scene 路由重定向

[English Template / 英文模板]

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 工作流程
  • 版本更新
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

语言 更新描述
🇺🇸 英文
🇨🇳 中文

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

- 修复 layer_ctr: setMaxZoom 示例代码错误,补充 getMinZoom/getMaxZoom/destroy 方法
- 修复 mask_method: enableMask 示例代码错误
- 修复 mouse_event: 补充 mouseenter 事件,去除重复 dblclick
- 补充 layer_encode: 新增 rotate() 和 label() 方法文档
- 补充 common/map.zh: 新增 bearing/pitch/interactive 等 13 个地图配置项
- 补充 source.en: 新增 map/filter transforms、getClusters、updateClusterData 等方法
- 补充 marker.zh/en: 完善所有方法文档,添加参数签名和示例
- 完善 pointlayer.zh: 修复 new 关键字缺失,嵌入所有子文档
- 完善 linelayer.zh: 嵌入所有子文档(含 texture)
- 完善 polygonlayer.zh: 嵌入所有子文档
- 完善 heatmap.zh: 补充 shape 类型表格,嵌入所有子文档
- 完善 heatmap/shape.zh: 补充各聚合形状详细说明
- 完善 imagelayer.zh: 嵌入所有子文档
- 完善 raster.zh: 重写简介,嵌入三种栅格模式子文档
- site/.dumirc.ts: 新增 /api -> /api/scene 路由重定向
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: 7828ead

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly improves the L7 library documentation by adding a comprehensive API reference file and updating existing module documentation for Scene, Source, Map, Layers, and Components. The changes include fixing typos, adding missing method and event descriptions, and improving consistency between Chinese and English versions. Review feedback correctly identifies minor issues in the new reference document, such as duplicate property entries, typos, and missing mode options for the RasterLayer.

Comment thread L7_API_Reference.md
| `getLayers` | `(): ILayer[]` | 获取所有图层 |
| `getLayer` | `(id: string): ILayer \| undefined` | 根据 id 获取图层 |
| `getLayerByName` | `(name: string): ILayer \| undefined` | 根据名称获取图层 |
| `getPickedLayer` | `(): any` | 获取拾取的图层 |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

根据 Scene 模块的详细文档(如 site/docs/api/scene.zh.md),getPickedLayer 方法返回的是拾取到的图层 ID(字符串类型)。建议将返回类型从 any 修正为 string

Comment thread L7_API_Reference.md
| **Raster** | `'raster'` | `number[] \| IRasterFileData \| IRasterFileData[]` | `{ type: 'raster', extent?: [number,number,number,number], coordinates?: [...], width: number, height: number, min?: number, max?: number, format?: IRasterFormat, operation?: IBandsOperation }` |
| **RasterTile** | `'rasterTile'` | `string \| string[] \| ITileBand[]` | `{ type: 'rasterTile', dataType?: RasterTileType, extent?: [...], zoomOffset?: number, minZoom?: number, maxZoom?: number, tileSize?: number, format?: IRasterFormat, operation?: IBandsOperation }` |
| **MVT** | `'mvt'` | Vector Tile URL | `{ type: 'mvt', extent?: [...], zoomOffset?: number, minZoom?: number, maxZoom?: number, tileSize?: number, sourceLayer?: string }` |
| **GeoJSONVT** | `'geojsonvt'` | GeoJSON FeatureCollection | `{ type: 'geojsonvt', extent?: [...], zoomOffset?: number, minZoom?: number, maxZoom?: number, tileSize?: number, maxZoom?: number, indexMaxZoom?: number, indexMaxPoints?: number, tolerance?: number, buffer?: number }` |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

geojsonvt 解析器的配置项说明中,maxZoom?: number 属性重复出现了两次。建议移除重复项以保持文档简洁性。

Comment thread L7_API_Reference.md

**type**: `'PointLayer'`
**默认数据解析**: `{ type: 'json', x: 'lng', y: 'lat' }`
**shape**: `'circle'` | `'square'` | `'triangle'` | `'pentagon'` | `'hexagon'` | `'octagon'` | `'diamond'` | `'hexagon'` | `'image'` | `'text'` | `'cylinder'` | ...
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

PointLayershape 枚举值列表中,'hexagon' 重复出现了两次,建议移除其中一个。

Comment thread L7_API_Reference.md
| `borderWidth` | `number` | 线边框宽度 |
| `borderColor` | `string` | 线边框颜色 |
| `strokeWidth` | `number` | 描边宽度 |
| `storke` | `string` | 描边颜色 |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

这里存在拼写错误,storke 应修正为 stroke

Comment thread L7_API_Reference.md

**type**: `'RasterLayer'`

根据 parser 类型自动选择模型: `'raster'` / `'rasterRgb'` / `'rasterTerrainRgb'`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

根据 site/docs/api/raster_layer/raster.zh.md 中的更新,RasterLayer 现在支持 rasterNdi 模式。建议在此处的模型选择说明中补充 'rasterNdi'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant