Conversation
- Auto create PR when .skills directory changes - File validation (type, size, content check) - Only run on official antvis/L7 repository - Support manual trigger with force option
1. 修复蜂窝热力图 (hexagon): - 调整六边形方向为 pointy-top,与 d3-hexbin 一致 - 翻转 y 坐标方向以匹配屏幕坐标系 2. 修复网格热力图 (grid): - 改用屏幕像素坐标划分网格,与 hexagon 一致 - 修正 xOffset/yOffset 计算:正方形顶点范围是 [-√2/2, √2/2] 3. 修复 count 聚合方法: - 在 statMap 中添加 count 方法 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
主要优化: - TileLayerService: 使用 Map 存储瓦片实例,查找复杂度从 O(n) 降为 O(1) - TileLayerService: 实现分帧销毁机制,避免大量瓦片销毁阻塞渲染 - TileLayerService: 添加渲染列表缓存和脏标记,减少每帧重建 - BaseLayer: 合并多个 filter 操作,减少中间数组创建 - BaseLayer: 优化视图状态比较,使用数值比较替代字符串比较 - TilesetManager: 缓存 tiles getter,避免每次访问都排序 - TilesetManager: 使用 Set 存储当前瓦片 key,加速查找 - TilesetManager: 合并 updateTileVisible 遍历,减少迭代次数 - SourceTile: 缓存 bounds 和 bboxPolygon,避免重复计算 - TilePickService: 优化遍历,跳过未加载的瓦片 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
主要优化: - math.ts: 表达式预编译为函数,避免循环中 JSON 序列化/反序列化 - 对于 256x256 瓦片,从 65536 次序列化操作优化为 1 次编译 - 预分配 Float32Array 结果数组,避免动态扩容 - operationSchema.ts: 使用快速选择算法计算百分位 - 复杂度从 O(n log n) 降到 O(n) - 预分配 Uint8Array 数组存储 RGB 数据 - getRasterData.ts: 多波段数据并行请求 - 使用 Promise.all 并行请求,减少网络等待时间 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
主要修复: 1. 修复 UBO std140 布局问题 - vec3 只占 3 floats,之前的布局导致 u_RelativeOrigin 位置错误 2. 修复 extrude/water/ocean 图层在相对坐标模式下 UV 计算错误 3. 修复 Pipeline 缓存 key 生成不完整导致的状态不一致问题 性能优化: 1. 添加颜色解析缓存 (rgb2arr),避免重复解析相同颜色 2. 优化数据映射插件的过滤流程,减少遍历次数 3. 添加质心计算缓存 其他修复: 1. 移除地图适配器中的硬编码 API Keys 2. 修复 Scene.emit 调用错误 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- fix: 修复 citybuliding 目录名拼写错误 (citybuliding -> citybuilding) - refactor: 用自定义实现替代 lodash 依赖,优化包大小 - refactor: 将 SimpleMapCoord 移到 maps 包本地 utils - fix: 添加 getDefault 方法返回类型 - fix: 修复 merge 函数的类型参数 - fix: 添加 initCfg 方法 option 参数的条件检查 - chore: 更新 build 脚本,添加 clean-dist 步骤 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 新增 packages/source/src/utils/csv.ts 实现 csvParse 函数 - 支持 CSV 基础解析、引号处理、转义引号、各种换行符 - 移除 d3-dsv 和 @types/d3-dsv 依赖 - 添加完整的单元测试覆盖边界情况 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 在 lodash-adapter.ts 中添加 extent 函数实现 - 移除 d3-array 和 @types/d3-array 依赖 - 更新 FeatureScalePlugin 使用 lodashUtil.extent - 添加 lodash-adapter 单元测试 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 新增 packages/utils/src/color-parser.ts 实现颜色解析 - 支持 hex、rgb/rgba、hsl/hsla 和 CSS 颜色名称 - 更新 color.ts 使用自定义 parseColor 函数 - 移除 utils 和 layers 包中的 d3-color 依赖 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 在 color-parser.ts 中添加 interpolateRgbBasis 函数 - 实现分段线性颜色插值功能 - 更新 FeatureScalePlugin 使用自定义 interpolateRgbBasis - 移除 layers 包中的 d3-interpolate 依赖 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 新增 packages/source/src/utils/hexbin.ts 实现六边形分箱算法 - 使用 odd-q offset 坐标系统与 d3-hexbin 兼容 - 更新 hexagon.ts 使用自定义 hexbin 函数 - 移除 d3-hexbin 和 @types/d3-hexbin 依赖 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 将 odd-q 偏移(奇数列偏移)改为 odd-r 偏移(奇数行偏移) - 完全复制 d3-hexbin 的分箱算法逻辑 - 修复中心坐标计算方式: - x = (pi + (pj & 1) / 2) * dx - y = pj * dy - 修复访问器类型签名以支持 3 个参数 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 新增 packages/layers/src/utils/scale.ts 实现 10 种比例尺 - scaleLinear, scalePow, scaleLog: 连续比例尺 - scaleSequential, scaleDiverging: 连续颜色比例尺 - scaleQuantile, scaleQuantize, scaleThreshold: 离散比例尺 - scaleOrdinal: 枚举比例尺 - scaleTime: 时间比例尺 - 更新 FeatureScalePlugin 使用自定义比例尺 - 移除 d3-scale 和 @types/d3-scale 依赖 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 添加 sanitizeDomain 函数处理 domain 中的 undefined、null、NaN 值 - 修复当 extent 返回 [undefined, undefined] 时导致 NaN 计算的问题 - 处理 domain 只有一个值或为空的情况 - 处理 domain[0] === domain[1] 时除以零的问题 - 所有连续比例尺现在都对无效输入有容错处理 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 移除 lodash 依赖(已有自定义 lodash-adapter 实现) - 移除 layers 包中未使用的 extrude-polyline、polyline-miter-util、gl-vec2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 使用现代浏览器原生支持的 ResizeObserver API - 移除 element-resize-detector 和 @types/element-resize-detector 依赖 - 减少第三方依赖,提升稳定性 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
symbol-es6@0.1.2 是较旧的 polyfill,会覆盖原生 Symbol.iterator 实现, 导致 earcut 返回的 Uint32Array 无法被 spread 操作符展开。 现代浏览器已原生支持 Symbol 和迭代器协议,不需要此 polyfill。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- SceneService 增加监听 Hover/Click/DblClick 事件并发射到 scene - IInteractionTarget 添加 pixel 属性兼容 l7-draw 事件格式 - 修复 mousedown 事件发送时机,确保 layer 能正确接收拖拽开始事件 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 初始化 BaseLayer.animateStartTime 为 0,避免动画时间返回 NaN - 添加 std140 uniform block padding 字段,修正内存对齐(108 -> 112 字节) - 修复 removeDuplicateUniforms 函数处理 L7 默认值语法(:) - 确保在 WebGL1/regl 渲染器下着色器正确编译
- 更新高德地图主题 URL 使用标准格式 - 修复 Three.js demo 中 GLTFLoader 的引入方式,改为使用 window.GLTFLoader Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolved conflicts in: - packages/core/package.json - packages/maps/src/amap-next/map.ts - .changeset/pre.json (added) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 本次拉取请求主要旨在解决 L7 库中事件系统因移除 Hammer.js 而引发的兼容性问题,通过回滚到 Hammer.js 实现来恢复事件的正常功能。此外,还对核心服务中的事件监听机制进行了增强,优化了 AMap 地图的集成配置和样式,并对图层着色器和基础配置进行了细微调整,以提升系统的稳定性和开发体验。 Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
- Update all package versions from 2.23.3-beta.3 to 2.24.0 - Clear changeset files for stable release Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This Pull Request primarily revolves around updating and resetting the event module, fixing compatibility issues caused by its previous removal by rolling back to the hammerjs implementation. A security concern was identified regarding a hardcoded AMap API key in the amap-next map service. Additionally, the update includes improvements such as optimizing event listener binding in SceneService for better performance and code style, enhancing robustness by adding default styles to the map container in amap-next/map.ts and using optional chaining in BaseLayer.ts, and fixing uniform extraction logic in shader-module.ts to resolve parsing issues for uniforms with default values.
| // 默认的高德地图 Key,仅用于开发和演示,生产环境请使用自己的 Key | ||
| // 申请地址: https://lbs.amap.com/api/javascript-web-api/guide/abc/prepare | ||
| const DEFAULT_AMAP_KEY = '6c0e16556c6c774e7bb61bc6089483a5'; | ||
| const DEFAULT_AMAP_KEY = 'f59bcf249433f8b05caaee19f349b3d7'; |
There was a problem hiding this comment.
A default AMap API key (DEFAULT_AMAP_KEY) is hardcoded in the library source code. This poses a significant security risk as it can lead to unauthorized use, quota exhaustion, and makes key rotation difficult if compromised. Even if intended for development or demo purposes, hardcoding API keys should be avoided. It is recommended to store the key in environment variables or a version-controlled configuration file, and load it dynamically at runtime.
| const DEFAULT_AMAP_KEY = 'f59bcf249433f8b05caaee19f349b3d7'; | |
| const DEFAULT_AMAP_KEY = process.env.REACT_APP_AMAP_KEY || 'your-fallback-key-if-any'; |
| this.interactionService.on(InteractionEvent.Hover, this.addSceneEvent.bind(this)); | ||
| this.interactionService.on(InteractionEvent.Click, this.addSceneEvent.bind(this)); | ||
| this.interactionService.on(InteractionEvent.DblClick, this.addSceneEvent.bind(this)); |
There was a problem hiding this comment.
为了提升代码性能和可读性,建议避免在多处重复调用 .bind(this)。一个更好的做法是将 addSceneEvent 方法定义为箭头函数属性,这样它会自动绑定 this 上下文。
// 在 SceneService 类中,将方法定义改为箭头函数属性:
private addSceneEvent = (target: IInteractionTarget) => {
this.emit(target.type, target);
}
// ... 然后在 init 方法中,可以直接引用,无需 .bind:
this.interactionService.on(InteractionEvent.Drag, this.addSceneEvent);
this.interactionService.on(InteractionEvent.Hover, this.addSceneEvent);
this.interactionService.on(InteractionEvent.Click, this.addSceneEvent);
this.interactionService.on(InteractionEvent.DblClick, this.addSceneEvent);这样做可以确保只创建一个函数实例,并在所有事件监听器中复用,使代码更简洁高效。
…lt weather assets
[English Template / 英文模板]
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
📝 更新日志
☑️ 请求合并前的自查清单