Skip to content

Release#2861

Open
lzxue wants to merge 21 commits into
masterfrom
release
Open

Release#2861
lzxue wants to merge 21 commits into
masterfrom
release

Conversation

@lzxue

@lzxue lzxue commented May 28, 2026

Copy link
Copy Markdown
Contributor

[English Template / 英文模板]

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

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

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

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

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

lzxue added 11 commits May 11, 2026 21:39
- 统一 Zoom 偏移机制,支持 bmap/tmap/gmap 不同偏移量
- 补全 tdtmap/earth/amap-next 缺失方法
- 修复 gmap setMapStyle 调用错误
- 删除 tmap/gmap 错误 getMapStyleConfig 方法
- 添加多底图切换 demo
- 修复 fill/fillImage/radar/earthFill shader 中 applyAnchor 垂直方向偏移
- 修复 symbol-layout.ts 中 bottom/top 的 verticalAlign 方向
- 添加 bottom-center anchor 支持(anchorType=9)
- 修复 Marker/Popup 的 anchor 工具函数,补齐 BOTTOM-RIGHT
- 更新 demo 和测试用例
- top: 补偿 yOffset 使文字顶部正确对齐坐标点
- bottom: 补偿 yOffset 使文字底部正确对齐坐标点
- center: 保持 yOffset 偏移,文字视觉中心对齐坐标点
- 移除多余空行
- 统一代码风格
- 使用 OverlayView + MapCanvasProjection 实现每帧同步(参考 deck.gl)
- 通过 fromLatLngToDivPixel 计算 fractional zoom,解决整数跳变
- 用 fromContainerPixelToLatLng 获取动画帧真实视口中心
- containerToLngLat/lngLatToContainer 优先使用 MapCanvasProjection
- disableDefaultUI 隐藏所有默认控件
- 修复百度/腾讯/天地图 viewport 空值保护和缩放同步
- 添加 Google/百度/腾讯地图 demo 配置
# Conflicts:
#	packages/component/package.json
#	packages/core/package.json
#	packages/l7/package.json
#	packages/layers/package.json
#	packages/map/package.json
#	packages/maps/package.json
#	packages/maps/src/gmap/map.ts
#	packages/maps/src/tmap/map.ts
#	packages/renderer/package.json
#	packages/scene/package.json
#	packages/source/package.json
#	packages/test-utils/package.json
#	packages/three/package.json
#	packages/utils/package.json
@changeset-bot

changeset-bot Bot commented May 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 443bbbe

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 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 introduces the anchor style property for 2D shapes in PointLayer to control alignment relative to coordinate points, complete with documentation and new demos. It also refactors the Google Maps integration (GMapService) to use OverlayView for accurate camera synchronization and adds default API tokens for map providers in examples. The review feedback highlights several critical issues: using Unicode escape sequences instead of HTML entities in the iconfont demo, adding defensive checks for potential null values returned by Google Maps projection methods to prevent runtime crashes, avoiding hardcoded API keys in example utilities, and resolving a potential memory leak in the Tencent Map service caused by an un-cleared anonymous DOM event listener.

Comment on lines +23 to +29
scene.addIconFonts([
['smallRain', ''],
['middleRain', ''],
['hugeRain', ''],
['sun', ''],
['cloud', ''],
]);

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

The iconfont demo uses HTML entities (e.g., '') which are not parsed correctly in JS/TS strings. They should be replaced with Unicode escape sequences (e.g., '\ue6f7'), matching the fix applied in site/examples/point/text/demo/iconfonts.js.

Suggested change
scene.addIconFonts([
['smallRain', ''],
['middleRain', ''],
['hugeRain', ''],
['sun', ''],
['cloud', ''],
]);
scene.addIconFonts([
['smallRain', '\ue6f7'],
['middleRain', '\ue61c'],
['hugeRain', '\ue6a6'],
['sun', '\ue6da'],
['cloud', '\ue8da'],
]);

Comment thread packages/maps/src/gmap/map.ts
Comment on lines +569 to +577
const topRight = projection.fromLatLngToPoint(ne);
const bottomLeft = projection.fromLatLngToPoint(sw);
const { width, height } = this.getMapSize();
let worldWidth = topRight.x - bottomLeft.x;
if (worldWidth <= 0) worldWidth += 256;
const worldX = bottomLeft.x + (x / width) * worldWidth;
const worldY = topRight.y + (y / height) * (bottomLeft.y - topRight.y);
const latLng = projection.fromPointToLatLng(new google.maps.Point(worldX, worldY));
return { lng: latLng.lng(), lat: latLng.lat() };

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

Both projection.fromLatLngToPoint and projection.fromPointToLatLng can return null. We should add defensive checks for topRight, bottomLeft, and latLng to prevent potential runtime crashes.

    const topRight = projection.fromLatLngToPoint(ne);
    const bottomLeft = projection.fromLatLngToPoint(sw);
    if (!topRight || !bottomLeft) {
      return { lng: 0, lat: 0 };
    }
    const { width, height } = this.getMapSize();
    let worldWidth = topRight.x - bottomLeft.x;
    if (worldWidth <= 0) worldWidth += 256;
    const worldX = bottomLeft.x + (x / width) * worldWidth;
    const worldY = topRight.y + (y / height) * (bottomLeft.y - topRight.y);
    const latLng = projection.fromPointToLatLng(new google.maps.Point(worldX, worldY));
    if (!latLng) {
      return { lng: 0, lat: 0 };
    }
    return { lng: latLng.lng(), lat: latLng.lat() };

Comment thread packages/maps/src/gmap/map.ts
Comment thread examples/utils/scene.ts
Comment on lines +23 to +28
const DEFAULT_TOKENS: Record<string, string> = {
GoogleMap: 'AIzaSyA6U7oKLKbPVUicuCaGQ25_zIMep-zGBcU',
BaiduMap: 'ShSrOHgrilK8rvaXV6kHC8vwxgnvF3CV',
TencentMap: 'VZ2BZ-EZ7KZ-D4RXM-TZQDP-Q3PQH-TVF5L',
TMap: 'b15e548080c79819617367d3f6095c69',
};

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.

security-medium medium

Exposing hardcoded API keys/tokens in the repository is a security risk. Even if these are public/demo tokens, it is highly recommended to load them from environment variables or configuration files to prevent abuse and unauthorized usage.

Comment on lines 220 to 224
if (eventName === 'mouseover') {
this.map.getContainer().addEventListener('mouseover', (e) => {
this.map.emit(e.type, new MapMouseEvent(e.type, this.map, e));
handleProxy({ type: e.type, originalEvent: e });
});
}

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

Adding a DOM event listener using an anonymous function (e) => { handleProxy(...) } inside on() will cause a memory leak because there is no way to remove it in off() or destroy(). Consider storing a reference to the DOM listener so it can be properly cleaned up.

lzxue and others added 10 commits May 30, 2026 00:07
- 新增各地图独立入口文件(gaode/baidu/google/mapbox/maplibre/tencent/tianditu/earth/simple)
- 更新 package.json 添加 exports 字段,支持 @antv/l7-maps/gaode 等子路径导入
- 修复各地图目录 index.ts 的导出命名一致性
- 向后兼容:原有全量导入方式不受影响

使用方式:
import { GaodeMap } from '@antv/l7-maps/gaode'  // 按需加载
import { GaodeMap } from '@antv/l7-maps'        // 全量导入(向后兼容)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant