Skip to content

Commit 2b951da

Browse files
authored
Merge pull request #1 from antvis/feat/typhoon-map-demo
Feat/typhoon map demo
2 parents a6ea2ab + d5bd83c commit 2b951da

103 files changed

Lines changed: 12497 additions & 1980 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@ dist-site/
3939

4040
.codefuse/
4141

42-
.codefuseone/
42+
.codefuseone/
43+
# pnpm 本地 store(不应入库)
44+
.pnpm-store/

CHANGELOG.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,91 @@
11
# Changelog
22

3+
## 0.4.4 (2026-07-15)
4+
5+
### Bug Fixes
6+
7+
- **MapScene:** 底图引擎改从 `@antv/l7` 统一导入,避免把 `@antv/l7-maps` 各引擎适配层(mapbox-gl / maplibre-gl / AMap Loader 等)及 GLSL 着色器打包进产物
8+
- **cli:** `aimapui --version` 改为从 `package.json` 动态读取,修复版本号长期显示 `0.1.0` 的问题
9+
10+
### Documentation
11+
12+
- aimapui skill 版本说明同步至 0.4.4
13+
14+
## 0.4.3 (2026-07-14)
15+
16+
### Bug Fixes
17+
18+
- **SchemaLayer:** 修复 `sortValue` 递归遍历对象时遇到循环引用导致 `Maximum call stack size exceeded` 的问题,通过 `WeakSet` 检测已访问对象
19+
20+
### Features
21+
22+
- **ChinaDistrict:** 下钻模式支持双击上卷(dblclick 触发 drillUp)
23+
- **SchemaLayer/PolygonLayer:** 新增 `onDblclick`/`onUndblclick` 事件,与 click 互斥
24+
25+
## 0.4.2 (2026-07-13)
26+
27+
### Documentation
28+
29+
- 走查修复文档与 skill 同步:补充 H3Layer、RouteLayer、AnnotationControl、ResetViewControl、LogoControl、LegendControl、SatelliteLayerControl 站点文档
30+
- 删除 RouteLayer 已废弃属性文档(glow/animate/animateSpeed)
31+
- controls.md skill reference 补齐所有控件
32+
- CHANGELOG.md 补录 0.3.2~0.4.1 变更记录
33+
- SKILL.md 补充 @antv/aimapui-plot 包说明
34+
- CLI 版本对齐至 0.4.2
35+
36+
## 0.4.1 (2026-07-13)
37+
38+
### Features
39+
40+
- **台风地图:** 新增台风路径地图 Demo,支持降雨/云图/雷达/风场/卫星图层切换(浙江水利气象 API)
41+
- **台风预报:** 台风预报路径改用实线渲染,修复虚线像素级退化成点串问题;历史轨迹使用实线
42+
- **台风地图移动端:** 台风地图移动端适配 + BlockPage 设备切换
43+
- **map-app-builder skill:** 新增 map-app-builder skill,覆盖布局架构、图层层级、DOM z-index、主题系统等
44+
- **Canvas 风场图层:** 添加 Canvas 风场图层及 PC 端 UI 布局优化
45+
- **Apple/Google Maps 演示:** 优化 AppleMaps/GoogleMaps 演示与台风默认图层
46+
47+
### Breaking Changes
48+
49+
- **RouteLayer:** 移除 `glow``animate``animateSpeed` 属性,发光与流动动画能力不再支持
50+
51+
### Bug Fixes
52+
53+
- **RouteLayer:** 修复文字与图标/圆点重叠问题,优化默认参数(`lineWidth` 3→4,`stopSize` 14→8)
54+
- **RouteLayer:** 修复 `rest` 未定义错误、NaN 坐标校验及优化标注布局
55+
- **GoogleMaps:** 修复 GoogleMapsMobileDemo 地图无法交互的问题
56+
57+
## 0.3.5 (2026-06-20)
58+
59+
### Bug Fixes
60+
61+
- **ImageCalibrationControl:** 清理冗余判断逻辑
62+
- 添加 `@types/geojson` 依赖
63+
- 更新依赖锁文件及 plot 包配置
64+
65+
## 0.3.4 (2026-06-19)
66+
67+
### Features
68+
69+
- **SatelliteLayerControl:** 新增卫星影像图层控件,支持提供商切换(高德/天地图/Google)、可见性开关、透明度调节
70+
- 补齐复合图层设计规范
71+
72+
### Bug Fixes
73+
74+
- **ImageCalibrationControl:** 修复多图切换时图层消失的问题
75+
76+
## 0.3.3 (2026-06-19)
77+
78+
### Refactoring
79+
80+
- 地图引擎从动态 `import` 改为静态 `import`,避免 chunk 加载失败
81+
82+
## 0.3.2 (2026-06-19)
83+
84+
### Bug Fixes
85+
86+
- **ChinaDistrict:** 修复中国行政区划直辖市下钻时 adcode 前缀匹配不生效的问题
87+
- 标注 L7 版本要求 ≥ 2.28.14
88+
389
## 0.3.1 (2026-06-18)
490

591
### Features

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/aimapui-cli",
3-
"version": "0.3.3",
3+
"version": "0.4.4",
44
"type": "module",
55
"description": "CLI for adding @antv/aimapui components to your project (shadcn/ui style)",
66
"bin": {

packages/cli/registry.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"name": "@antv/aimapui",
44
"baseUrl": "https://raw.githubusercontent.com/antvis/aimapui/main",
55
"peerDependencies": {
6-
"@antv/l7": "^2.28.0",
7-
"@antv/l7-maps": "^2.28.0",
6+
"@antv/l7": "^2.29.1",
87
"react": ">=18.0.0",
98
"react-dom": ">=18.0.0"
109
},

packages/cli/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env node
22

33
import { Command } from 'commander';
4+
import packageJson from '../package.json' with { type: 'json' };
45
import { init } from './commands/init.js';
56
import { add } from './commands/add.js';
67
import { list } from './commands/list.js';
@@ -10,7 +11,7 @@ const program = new Command();
1011
program
1112
.name('aimapui')
1213
.description('CLI for adding @antv/aimapui components to your project')
13-
.version('0.1.0');
14+
.version(packageJson.version);
1415

1516
program
1617
.command('init')

packages/core/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/aimapui",
3-
"version": "0.3.3",
3+
"version": "0.4.4",
44
"type": "module",
55
"description": "Schema/DSL-driven React map visualization component library powered by L7",
66
"main": "dist/index.cjs",
@@ -36,8 +36,7 @@
3636
"prepublishOnly": "npm run build"
3737
},
3838
"dependencies": {
39-
"@antv/l7": "2.28.14",
40-
"@antv/l7-maps": "2.28.14",
39+
"@antv/l7": "2.29.1",
4140
"ahooks": "^3.8.4",
4241
"clsx": "^2.1.1",
4342
"geotiff": "^3.0.5",
@@ -49,7 +48,9 @@
4948
"react-dom": ">=18.0.0"
5049
},
5150
"devDependencies": {
51+
"@tailwindcss/postcss": "^4.3.2",
5252
"@tailwindcss/vite": "^4.0.0",
53+
"@types/geojson": "^7946.0.16",
5354
"@types/react": "^18.3.12",
5455
"@types/react-dom": "^18.3.1",
5556
"@types/supercluster": "^7.1.3",

packages/core/postcss.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
plugins: {
3+
'@tailwindcss/postcss': {},
4+
},
5+
};

packages/core/src/components/CompositeLayer/ArcFlowLayer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ export function ArcFlowLayer({
168168
nodeSize = 4,
169169
nodeSizeRange,
170170
nodePulse = false,
171-
showTooltip = true,
172-
showNodePopup = true,
171+
showTooltip = false,
172+
showNodePopup = false,
173173
activeColor = '#FFD93D',
174174
onArcHover,
175175
onArcClick,

packages/core/src/components/CompositeLayer/BubbleLayer.tsx

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useState, useEffect } from 'react';
22
import type { ActiveConfig, LayerSchema, SelectConfig, LayerEventPayload } from '../../schema/types';
33
import { PointLayer } from '../Layer/PointLayer';
4+
import { getColorPalette, type ColorScheme } from '../../constants/colorPalettes';
45

56
export const BUBBLE_SIZE_LEVELS = [8, 16, 32, 48, 64] as const;
67

@@ -36,6 +37,8 @@ export interface BubbleLayerProps extends Omit<LayerSchema, 'type' | 'source' |
3637
labelOffset?: [number, number];
3738
/** sizeField 为离散值时,对应每个 sizeValues 的域值顺序(默认 1..N) */
3839
sizeDomain?: Array<string | number>;
40+
/** 连续数值尺寸范围 [min, max],与 sizeField 配合使用。提供时自动线性映射 */
41+
sizeRange?: [number, number];
3942
/** 气泡锚点,决定标签相对气泡的连接参考点 */
4043
bubbleAnchor?: BubbleAnchor;
4144
/** 文本锚点,映射到 textAnchor */
@@ -55,6 +58,9 @@ export interface BubbleLayerProps extends Omit<LayerSchema, 'type' | 'source' |
5558
/** 语义色板映射字段,例如 status: primary|warning|error|success */
5659
semanticColorField?: string;
5760

61+
/** 色板预设,默认 'categorical'。当无 semanticColorField 且无 colorValues 时使用 */
62+
colorScheme?: ColorScheme;
63+
5864
// ===== 事件回调 =====
5965
/** 点击事件 */
6066
onClick?: (payload: LayerEventPayload) => void;
@@ -88,14 +94,16 @@ export function BubbleLayer({
8894
showLabel = true,
8995
labelOffset,
9096
sizeDomain,
97+
sizeRange,
9198
bubbleAnchor = 'bottom',
9299
labelAnchor = 'top',
93-
hoverEffect = true,
94-
clickEffect = true,
95-
tooltipEffect = true,
100+
hoverEffect = false,
101+
clickEffect = false,
102+
tooltipEffect = false,
96103
tooltipFields,
97104
tooltipTemplate,
98105
semanticColorField,
106+
colorScheme = 'categorical',
99107
color = '#2563eb',
100108
size = 16,
101109
sizeField,
@@ -119,14 +127,16 @@ export function BubbleLayer({
119127
BUBBLE_QUALITATIVE_COLORS.error,
120128
BUBBLE_QUALITATIVE_COLORS.success,
121129
]
122-
: undefined);
130+
: mappedColorField
131+
? [...getColorPalette(colorScheme)]
132+
: undefined);
123133

124134
const mappedSizeValues = sizeField
125-
? (sizeValues ?? [...BUBBLE_SIZE_LEVELS])
135+
? (sizeValues ?? (sizeRange ? undefined : [...BUBBLE_SIZE_LEVELS]))
126136
: sizeValues;
127137

128-
const defaultActive: ActiveConfig = { color: '#60a5fa' };
129-
const defaultSelect: SelectConfig = { color: '#1d4ed8' };
138+
const defaultActive: ActiveConfig = { color: '#60a5fa', duration: 150 };
139+
const defaultSelect: SelectConfig = { color: '#1d4ed8', duration: 150 };
130140

131141
const resolvedEvents = (() => {
132142
const origin = rest.events;
@@ -150,7 +160,7 @@ export function BubbleLayer({
150160

151161
// 气泡圆图层的 size 配置:当有 sizeField 时不传固定 size 避免冲突
152162
const bubbleSizeProps = sizeField
153-
? { sizeField, sizeValues: mappedSizeValues }
163+
? { sizeField, sizeValues: mappedSizeValues, ...(sizeRange ? { sizeRange } : {}) }
154164
: { size };
155165

156166
return (
@@ -195,7 +205,7 @@ export function BubbleLayer({
195205
shapeValues="text"
196206
color={labelColor}
197207
size={labelSize}
198-
zIndex={(rest.zIndex ?? 0) + 1}
208+
zIndex={(rest.zIndex ?? 0) + 10}
199209
style={{
200210
textAnchor: labelAnchor,
201211
textOffset: labelOffset ?? [0, 0],

packages/core/src/components/CompositeLayer/ChinaDistrict.tsx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ export interface ChinaDistrictProps {
8888
/** Tooltip 自定义字段 */
8989
tooltipFields?: string[];
9090

91-
/** 区域点击事件 */
91+
/** 区域单击事件 */
9292
onRegionClick?: (feature: Record<string, unknown>, level: AdministrativeLevel) => void;
93+
/** 区域双击事件(上卷时触发) */
94+
onRegionDblclick?: (feature: Record<string, unknown>, level: AdministrativeLevel) => void;
9395
/** 图层 zIndex */
9496
zIndex?: number;
9597
}
@@ -141,11 +143,12 @@ export const ChinaDistrict = React.forwardRef<ChinaDistrictHandle, ChinaDistrict
141143
showLabel = true,
142144
labelField = 'name',
143145
labelSize = 12,
144-
hoverHighlight = true,
145-
clickSelect = true,
146-
showTooltip = true,
146+
hoverHighlight = false,
147+
clickSelect = false,
148+
showTooltip = false,
147149
tooltipFields,
148150
onRegionClick,
151+
onRegionDblclick,
149152
zIndex = 0,
150153
} = props;
151154
const scene = useScene();
@@ -288,7 +291,7 @@ export const ChinaDistrict = React.forwardRef<ChinaDistrictHandle, ChinaDistrict
288291
}
289292
}, [autoFitOnDrill, scene, displayData, drillPath.length]);
290293

291-
// 事件处理
294+
// 事件处理:单击下钻
292295
const handleClick = useCallback((payload: LayerEventPayload) => {
293296
const feature = payload.feature;
294297
if (!feature) return;
@@ -316,6 +319,13 @@ export const ChinaDistrict = React.forwardRef<ChinaDistrictHandle, ChinaDistrict
316319
}
317320
}, [labelField, currentLevel, clickSelect, drillEnabled, drillPath, controlledDrillPath, onDrill, onRegionClick]);
318321

322+
// 事件处理:undblclick 上卷(确认单击未触发双击时回退一级)
323+
const handleUndblclick = useCallback(() => {
324+
if (drillEnabled) {
325+
drillUp();
326+
}
327+
}, [drillEnabled, drillUp]);
328+
319329
// 所有 hooks 必须在 conditional return 之前
320330
if (!scene || !displayData) return null;
321331

@@ -351,10 +361,11 @@ export const ChinaDistrict = React.forwardRef<ChinaDistrictHandle, ChinaDistrict
351361
? { colorField: valueField, colorValues: colors }
352362
: { color: colors[2] ?? '#3b82f6' }
353363
)}
354-
active={hoverHighlight ? { color: '#ffffff' } : undefined}
355-
select={clickSelect ? { color: '#0f172a' } : undefined}
364+
active={hoverHighlight ? { color: '#ffffff', duration: 150 } : undefined}
365+
select={clickSelect ? { color: '#0f172a', duration: 150 } : undefined}
356366
style={{ opacity: fillOpacity }}
357367
onClick={handleClick}
368+
onDblclick={handleUndblclick}
358369
zIndex={zIndex + 2}
359370
/>
360371

0 commit comments

Comments
 (0)