Skip to content

Commit

Permalink
chore: beta sync master (#2529)
Browse files Browse the repository at this point in the history
* refactor: 重构高德地图 V2 以视口进行同步 (#2387)

* refactor: amap next

* fix: getMinZoom

* refactor: base map

* fix: source update 事件访问图层初始化未完成

* fix: 新版高德大于 21  级别抖动问题

* fix: Mapbox/Maplibre 20 层级以上数据偏移问题 (#2416)

* fix: fix line data offset in mapbox

* refactor: 完成点线面图层属性索引重构

* refactor: 完成 citybuliding\earth\geometry\heatmap 图层属性索引重构

* refactor: 完成 image/ raster/wind 图层属性索引重构

* refactor: 标记最大索引

* fix: line layer data shake

* refactor: 自定义开启双精度属性

* fix: map type

* fix: amap support three

* refactor: 移除不必要的剔除逻辑

* fix: 修复面图层光照计算

* fix: type EventEmitter

* fix: mapbox 下部分面数据图层绘制异常 (#2453)

* fix: mapbox 下部分面数据图层绘制异常

* fix: 3d extrude polygon layer

* fix: 修复 WebGPU 模式渲染问题 (#2450)

* fix: mapbox 线图层的贴图变形 (#2474)

* fix: mapbox 线图层的贴图变形

* fix: 修复热力蜂窝图层渲染空白 (#2500)

* fix: 修复热力蜂窝图层渲染空白

* fix: 无地图与 MapLibre 模式移动 Marker 出错 (#2509)

* fix: marker 拖动报错

* fix: 在 WebGL2 拾取事件冒泡延迟问题 (#2511)

* fix: 在 WebGL2 拾取事件冒泡延迟问题

* fix: 天地图 setCenter 方法缺失 (#2513)

* fix: 天地图 setCenter 方法缺失

* fix: 修复在 Map 上使用组件事件穿透到图层上的问题 (#2518)

* fix: 修复在 Map 上使用组件事件穿透到图层上的问题

* fix: 解决 GeometryLayer 在不同底图上的渲染不一致情况 (#2523)

* fix: 解决 GeometryLayer 在不同底图上的渲染不一致情况

* fix: 统一地形高度

* refactor: 升级新版一方地图交互事件机制,解决抖动问题 (#2521)

* refactor: 升级新版地图交互事件机制

* refactor: 默认升级 MapNext 至 maplibre-gl-js@4.3.2

* fix: 顶点着色器与片元着色器 varying 变量顺序不一致 (#2527)

* fix: 修复 bindings 缓存在 WebGPU 的问题 (#2526)

* fix: 修复 bindings 缓存在 WebGPU 的问题

---------

Co-authored-by: lvisei <26923747+lvisei@users.noreply.github.com>
  • Loading branch information
lvisei and lvisei committed Jun 11, 2024
1 parent dcd14fb commit ce90571
Show file tree
Hide file tree
Showing 550 changed files with 32,328 additions and 10,424 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-beers-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-layers': patch
---

fix: mapbox 线图层的贴图变形
5 changes: 5 additions & 0 deletions .changeset/cyan-badgers-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-layers': patch
---

fix: 解决 GeometryLayer 在不同底图上的渲染不一致情况
5 changes: 5 additions & 0 deletions .changeset/famous-geese-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-renderer': patch
---

fix: 修复 bindings 缓存在 WebGPU 的问题
5 changes: 5 additions & 0 deletions .changeset/five-singers-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-component': patch
---

fix: 无地图与 MapLibre 模式移动 Marker 出错
5 changes: 5 additions & 0 deletions .changeset/gold-fans-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-maps': patch
---

fix: 修复在 Map 上使用组件事件穿透到图层上的问题
5 changes: 5 additions & 0 deletions .changeset/honest-schools-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-layers': patch
---

fix: 修复热力蜂窝图层渲染空白
5 changes: 5 additions & 0 deletions .changeset/large-pumas-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-map': patch
---

refactor: 升级新版一方地图交互事件机制,解决抖动问题
5 changes: 5 additions & 0 deletions .changeset/polite-apples-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-core': patch
---

fix: 在 WebGL2 拾取事件冒泡延迟问题
35 changes: 35 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"mode": "exit",
"tag": "beta",
"initialVersions": {
"@antv/l7-component": "2.21.10",
"@antv/l7-core": "2.21.10",
"@antv/l7": "2.21.10",
"@antv/l7-layers": "2.21.10",
"@antv/l7-map": "2.21.10",
"@antv/l7-maps": "2.21.10",
"@antv/l7-renderer": "2.21.10",
"@antv/l7-scene": "2.21.10",
"@antv/l7-source": "2.21.10",
"@antv/l7-test-utils": "2.21.10",
"@antv/l7-three": "2.21.10",
"@antv/l7-utils": "2.21.10",
"@antv/l7-site": "2.21.3"
},
"changesets": [
"clean-beers-try",
"cyan-badgers-argue",
"famous-geese-know",
"five-singers-rush",
"gold-fans-dream",
"honest-schools-relate",
"large-pumas-provide",
"polite-apples-rule",
"proud-flies-change",
"rude-crabs-cheer",
"slimy-starfishes-joke",
"sour-dodos-bake",
"sour-lemons-perform",
"tiny-seas-camp"
]
}
5 changes: 5 additions & 0 deletions .changeset/rude-crabs-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-maps': patch
---

fix: 天地图 setCenter 方法缺失
9 changes: 9 additions & 0 deletions .changeset/slimy-starfishes-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@antv/l7-layers': patch
'@antv/l7-core': patch
'@antv/l7-maps': patch
---

fix: Mapbox/Maplibre 20 层级以上数据偏移问题
fix: 修复点图层部分 shape 中心点计算有误
fix: 修复立体面图层光照计算有误
5 changes: 5 additions & 0 deletions .changeset/sour-dodos-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-scene': patch
---

feat: 设置默认的渲染引擎为 g-device,优先使用 WebGL2
5 changes: 5 additions & 0 deletions .changeset/sour-lemons-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-maps': minor
---

refactor: 高德地图联动升级
5 changes: 5 additions & 0 deletions .changeset/tiny-seas-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-layers': patch
---

fix: mapbox 下部分面数据图层绘制异常
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ jobs:
# use xvfb-run run in ubuntu
run: xvfb-run pnpm test-cover

- name: Upload test coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# - name: Upload test coverage
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}

integration-test:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ site/.dumi/tmp-production/
site/public/
site/public_site/

# examples for data
examples/data/
8 changes: 6 additions & 2 deletions __tests__/integration/gallery.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import { generateCanvasTestCases } from './utils/generator';
const TEST_CASES = [
{
name: 'fujian',
sleepTime: 500,
sleepTime: 1000,
},
{
name: 'variFlight',
sleepTime: 1000,
},
];

describe('Gallery Snapshot', () => {
generateCanvasTestCases('Gallery', TEST_CASES);
generateCanvasTestCases('gallery', TEST_CASES);
});
17 changes: 17 additions & 0 deletions __tests__/integration/heatmap.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { generateCanvasTestCases } from './utils/generator';

const TEST_CASES = [
{
name: 'normal',
},
{
name: 'grid',
},
{
name: 'hexagon',
},
];

describe('Heatmap Snapshot', () => {
generateCanvasTestCases('heatmap', TEST_CASES);
});
25 changes: 15 additions & 10 deletions __tests__/integration/line.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,33 @@ import { generateCanvasTestCases } from './utils/generator';

const TEST_CASES = [
{
name: 'arc',
sleepTime: 500,
name: 'simple',
},
{
name: 'arc_plane',
sleepTime: 500,
name: 'normal',
},

{
name: 'flow',
sleepTime: 800,
name: 'dash',
snapshot: false,
},
{
name: 'wall',
},
{
name: 'arc',
sleepTime: 600,
},
{
name: 'dash',
name: 'arc3D',
},
{
name: 'greatcircle',
},
{
name: 'flow',
sleepTime: 500,
},
];

describe('Line Snapshot', () => {
generateCanvasTestCases('Line', TEST_CASES);
generateCanvasTestCases('line', TEST_CASES);
});
2 changes: 1 addition & 1 deletion __tests__/integration/mask.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ const TEST_CASES = [
];

describe('Mask Snapshot', () => {
generateCanvasTestCases('Mask', TEST_CASES);
generateCanvasTestCases('mask', TEST_CASES);
});
15 changes: 10 additions & 5 deletions __tests__/integration/point.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,24 @@ const TEST_CASES = [
name: 'column',
},
{
name: 'fill_image',
name: 'dot',
snapshot: false,
},
{
name: 'fill',
},
// {
// name: 'image',
// },
{
name: 'fillImage',
},
{
name: 'image',
snapshot: false,
},
{
name: 'text',
},
];

describe('Point Snapshot', () => {
generateCanvasTestCases('Point', TEST_CASES);
generateCanvasTestCases('point', TEST_CASES);
});
13 changes: 9 additions & 4 deletions __tests__/integration/polygon.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,29 @@ import { generateCanvasTestCases } from './utils/generator';
const TEST_CASES = [
{
name: 'extrude',
sleepTime: 500,
},
{
name: 'extrusion',
sleepTime: 500,
},
{
name: 'fill',
},
{
name: 'ocean',
snapshots: false,
snapshot: false,
},
{
name: 'texture',
snapshots: false,
snapshot: false,
},
{
name: 'water',
snapshots: false,
snapshot: false,
},
];

describe('Polygon Snapshot', () => {
generateCanvasTestCases('Polygon', TEST_CASES);
generateCanvasTestCases('polygon', TEST_CASES);
});
Binary file removed __tests__/integration/snapshots/Gallery_fujian.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Line_arc.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Line_arc_plane.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Line_dash.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Line_flow.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Mask_multi.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Mask_single.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Point_billboard.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Point_column.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Point_fill.png
Binary file not shown.
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Point_text.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Polygon_extrude.png
Binary file not shown.
Binary file removed __tests__/integration/snapshots/Polygon_fill.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added __tests__/integration/snapshots/line_arc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added __tests__/integration/snapshots/line_arc3D.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added __tests__/integration/snapshots/line_flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added __tests__/integration/snapshots/line_normal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added __tests__/integration/snapshots/line_simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added __tests__/integration/snapshots/line_wall.png
Binary file added __tests__/integration/snapshots/mask_multi.png
Binary file added __tests__/integration/snapshots/mask_single.png
Binary file added __tests__/integration/snapshots/point_column.png
Binary file added __tests__/integration/snapshots/point_fill.png
Binary file added __tests__/integration/snapshots/point_text.png
Binary file added __tests__/integration/snapshots/polygon_fill.png
28 changes: 20 additions & 8 deletions __tests__/integration/utils/generator.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import type { Browser, BrowserContext, Page } from 'playwright';
import type { Browser, BrowserContext } from 'playwright';
import { chromium, devices } from 'playwright';
import { sleep } from './sleep';
import './useSnapshotMatchers';

export function generateCanvasTestCases(
namespace: string,
tests: { name: string; sleepTime?: number; snapshots?: boolean }[],
tests: { name: string; sleepTime?: number; snapshot?: boolean }[],
) {
const port = (globalThis as any).PORT;
let browser: Browser, context: BrowserContext, page: Page;
let browser: Browser, context: BrowserContext;

beforeAll(async () => {
// Setup
browser = await chromium.launch({
args: ['--headless', '--no-sandbox'],
});
context = await browser.newContext(devices['Desktop Chrome']);
page = await context.newPage();
await context.exposeFunction('screenshot', () => {});
});

afterAll(async () => {
Expand All @@ -26,15 +24,29 @@ export function generateCanvasTestCases(
});

tests
.filter((test) => test.snapshots !== false)
.filter((test) => test.snapshot !== false)
.map((test) => {
const { name, sleepTime = 200 } = test;
const key = `${namespace}_${name}`;

it(key, async () => {
const page = await context.newPage();

let resolveReady: () => void;
const readyPromise = new Promise<void>((resolve) => {
resolveReady = () => {
resolve();
};
});

await page.exposeFunction('screenshot', async () => {
resolveReady();
});

// Go to test page served by vite devServer.
const url = `http://localhost:${port}/?type=${namespace}&name=${name}`;
const url = `http://localhost:${port}/?namespace=${namespace}&name=${name}&snapshot=true`;
await page.goto(url);
await readyPromise;
await sleep(sleepTime);

// Chart already rendered, capture into buffer.
Expand All @@ -45,7 +57,7 @@ export function generateCanvasTestCases(
try {
expect(buffer).toMatchCanvasSnapshot(dir, key, { maxError });
} finally {
//
page.close();
}
});
});
Expand Down
3 changes: 3 additions & 0 deletions __tests__/unit/preset/environment.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
(window as any).URL.createObjectURL = jest.fn;
(window as any).ResizeObserver = jest.fn().mockImplementation(() => ({
observe: jest.fn(),
}));
25 changes: 15 additions & 10 deletions examples/constants.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import type { RenderDemoMap, RenderDemoOptions } from './types';
import type { GUIOptions, TestCaseBasemap } from './types';

export const MAP_TYPES: RenderDemoMap[] = [
export const DEFAULT_GUI_OPTIONS: GUIOptions = {
map: 'Map',
renderer: 'device',
animate: false,
enableWebGPU: false,
};

export const SEARCH_PARAMS_KEYS = ['namespace', 'name', 'snapshot'].concat(
Object.keys(DEFAULT_GUI_OPTIONS),
);

export const MAP_TYPES: TestCaseBasemap[] = [
'Map',
'GaodeMap',
'BaiduMap',
'Mapbox',
'MapLibre',
'BaiduMap',
'TencentMap',
'Mapbox',
'TMap',
'GoogleMap',
] as const;

export const DEFAULT_RENDER_OPTIONS: RenderDemoOptions = {
map: 'Map',
renderer: 'device',
animate: false,
};
Loading

0 comments on commit ce90571

Please sign in to comment.