Skip to content

chore: release v2.24.1 - #2827

Merged
lzxue merged 2 commits into
masterfrom
chore_three_version
Mar 11, 2026
Merged

chore: release v2.24.1#2827
lzxue merged 2 commits into
masterfrom
chore_three_version

Conversation

@lzxue

@lzxue lzxue commented Mar 11, 2026

Copy link
Copy Markdown
Contributor
  • fix: 修复气泡图 (PointLayer fill) 默认动画参数开启导致动画异常的 bug
  • feat: 升级 @antv/l7-three 集成,优化 ThreeRenderService 和 BaseLayer
  • docs: 补充 L7-Three 相关文档说明
  • examples: 新增 three 相关示例 (animation/buildings/earthquake/particles/shader)

[English Template / 英文模板]

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

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

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

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

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

- fix: 修复气泡图 (PointLayer fill) 默认动画参数开启导致动画异常的 bug
- feat: 升级 @antv/l7-three 集成,优化 ThreeRenderService 和 BaseLayer
- docs: 补充 L7-Three 相关文档说明
- examples: 新增 three 相关示例 (animation/buildings/earthquake/particles/shader)
@changeset-bot

changeset-bot Bot commented Mar 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 259ffb5

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

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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!

This pull request prepares for the v2.24.1 release, primarily focusing on enhancing the L7-Three integration. It addresses a critical animation bug in PointLayer fill and significantly upgrades the underlying Three.js library, bringing improved rendering capabilities and compatibility with modern WebGL standards. The update also includes a suite of new examples to showcase the advanced 3D visualization features, alongside necessary documentation updates to guide users on the new Three.js integration requirements.

Highlights

  • Bug Fix: Fixed an animation anomaly in the PointLayer fill when default animation parameters were enabled.
  • Three.js Integration Upgrade: Upgraded the @antv/l7-three integration to Three.js 0.182.0, which includes optimizations to ThreeRenderService and BaseLayer for enhanced compatibility and performance. This upgrade also introduces checks and warnings for WebGL2 context requirements.
  • New Examples: Added five new Three.js-related examples showcasing animation, 3D buildings, earthquake data visualization, particle systems, and custom shader effects.
  • Documentation Update: Updated the L7-Three documentation (both English and Chinese) to reflect the new Three.js version (r163+) and the requirement to configure renderer: 'device' for WebGL2 contexts.
Changelog
  • docs
    • 补充 L7-Three 相关文档说明
  • examples
    • 新增 three 相关示例 (animation/buildings/earthquake/particles/shader)
  • feat
    • 升级 @antv/l7-three 集成,优化 ThreeRenderService 和 BaseLayer
  • fix
    • 修复气泡图 (PointLayer fill) 默认动画参数开启导致动画异常的 bug
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

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.

Code Review

This pull request is a version release focused on integrating and upgrading @antv/l7-three, primarily involving a significant upgrade of the Three.js dependency from 0.115.0 to 0.182.0 and adapting core code for WebGL2 context and new Three.js APIs. New three related examples have been added, and documentation has been updated to reflect the new renderer: 'device' requirement. A security audit was conducted, and no vulnerabilities meeting Medium, High, or Critical severity were detected. The overall quality of the upgrade is high, with a minor suggestion for improving the animation loop in a new example by using layer.setUpdate() for better integration with L7's rendering cycle.

Comment on lines +165 to +197
const clock = new THREE.Clock();

const animate = () => {
const time = clock.getElapsedTime();

animatedObjects.forEach((obj) => {
if (obj.type === 'rotate') {
obj.mesh.rotation.z += obj.speed;
obj.mesh.rotation.x += obj.speed * 0.5;
} else if (obj.type === 'pulse') {
const scale = obj.initialScale + Math.sin(time * 3 + obj.speed * 100) * 0.3;
obj.mesh.scale.set(scale, scale, scale);
} else if (obj.type === 'wave') {
const positions = (obj.mesh.geometry as THREE.PlaneGeometry).attributes.position
.array as Float32Array;
const originals = obj.mesh.userData.originalPositions as Float32Array;

for (let i = 0; i < positions.length; i += 3) {
const x = originals[i];
const y = originals[i + 1];
positions[i + 2] =
Math.sin(x * 0.001 + time) * 500 + Math.cos(y * 0.001 + time) * 500;
}

(obj.mesh.geometry as THREE.PlaneGeometry).attributes.position.needsUpdate = true;
obj.mesh.geometry.computeVertexNormals();
}
});

requestAnimationFrame(animate);
};

animate();

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

使用 requestAnimationFrame 创建独立的动画循环可能会导致性能问题和潜在的内存泄漏(如果图层被移除,循环不会停止)。

建议使用 layer.setUpdate() 来与 L7 的渲染循环集成。当在图层上启用 .animate(true) 时,传递给 setUpdate 的回调函数将在每一帧执行。这可以确保动画与 L7 的渲染同步,并得到妥善管理。

      const clock = new THREE.Clock();

      layer.setUpdate(() => {
        const time = clock.getElapsedTime();

        animatedObjects.forEach((obj) => {
          if (obj.type === 'rotate') {
            obj.mesh.rotation.z += obj.speed;
            obj.mesh.rotation.x += obj.speed * 0.5;
          } else if (obj.type === 'pulse') {
            const scale = obj.initialScale + Math.sin(time * 3 + obj.speed * 100) * 0.3;
            obj.mesh.scale.set(scale, scale, scale);
          } else if (obj.type === 'wave') {
            const positions = (obj.mesh.geometry as THREE.PlaneGeometry).attributes.position
              .array as Float32Array;
            const originals = obj.mesh.userData.originalPositions as Float32Array;

            for (let i = 0; i < positions.length; i += 3) {
              const x = originals[i];
              const y = originals[i + 1];
              positions[i + 2] =
                Math.sin(x * 0.001 + time) * 500 + Math.cos(y * 0.001 + time) * 500;
            }

            (obj.mesh.geometry as THREE.PlaneGeometry).attributes.position.needsUpdate = true;
            obj.mesh.geometry.computeVertexNormals();
          }
        });
      });

Comment on lines +256 to +283
const clock = new THREE.Clock();

const animate = () => {
const time = clock.getElapsedTime();

// 更新着色器 uniforms
scanShaderMaterial.uniforms.uTime.value = time;
energyShaderMaterial.uniforms.uTime.value = time;
rippleShaderMaterial.uniforms.uTime.value = time;

// 旋转扫描效果
scanMesh.rotation.y = time * 0.5;

// 更新数据流位置
streams.forEach((stream) => {
stream.mesh.position.y += stream.speed;
if (stream.mesh.position.y > 5000) {
stream.mesh.position.y = 0;
}
// 透明度随高度变化
const opacity = 1.0 - stream.mesh.position.y / 5000;
(stream.mesh.material as THREE.MeshBasicMaterial).opacity = opacity * 0.6;
});

requestAnimationFrame(animate);
};

animate();

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

three-animation 示例类似,这里使用 requestAnimationFrame 创建了一个独立的动画循环。为了获得更好的性能并避免潜在的内存泄漏,建议使用 layer.setUpdate() 将动画逻辑集成到 L7 的渲染循环中。

      const clock = new THREE.Clock();

      layer.setUpdate(() => {
        const time = clock.getElapsedTime();

        // 更新着色器 uniforms
        scanShaderMaterial.uniforms.uTime.value = time;
        energyShaderMaterial.uniforms.uTime.value = time;
        rippleShaderMaterial.uniforms.uTime.value = time;

        // 旋转扫描效果
        scanMesh.rotation.y = time * 0.5;

        // 更新数据流位置
        streams.forEach((stream) => {
          stream.mesh.position.y += stream.speed;
          if (stream.mesh.position.y > 5000) {
            stream.mesh.position.y = 0;
          }
          // 透明度随高度变化
          const opacity = 1.0 - stream.mesh.position.y / 5000;
          (stream.mesh.material as THREE.MeshBasicMaterial).opacity = opacity * 0.6;
        });
      });

@lzxue
lzxue merged commit 159d91b into master Mar 11, 2026
5 checks passed
@lzxue
lzxue deleted the chore_three_version branch March 11, 2026 03:40
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