Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: split tripartite map #2503

Merged
merged 72 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
9f03717
refactor: 重构高德地图 V2 以视口进行同步 (#2387)
lvisei Apr 17, 2024
6a1d703
Merge branch 'master' into beta
lvisei Apr 17, 2024
6ffc717
wip: data shake case
lvisei Apr 19, 2024
5c82d3a
Merge branch 'master' into fix/data-shake
lvisei Apr 24, 2024
6166750
Merge branch 'master' into beta
lvisei Apr 24, 2024
33f505d
fix: 新版高德大于 21 级别抖动问题
lvisei Apr 28, 2024
a44d34e
Merge branch 'fix/amap-data-shake' into beta
lvisei Apr 28, 2024
0913661
fix: Mapbox/Maplibre 20 层级以上数据偏移问题 (#2416)
lvisei Apr 30, 2024
21ec03a
Merge branch 'master' into beta
lvisei Apr 30, 2024
46efdc5
chore: set to beta version
lvisei Apr 30, 2024
969b533
refactor: remove old amap v1 and v2 (#2435)
lvisei May 6, 2024
048c203
chore: add changeset
lvisei May 6, 2024
3f508ff
fix: type EventEmitter
lvisei May 6, 2024
18db6f7
chore: set changeset
lvisei May 6, 2024
4a73001
chore: version (beta) (#2442)
github-actions[bot] May 6, 2024
d408bdb
fix: mapbox 下部分面数据图层绘制异常 (#2453)
lvisei May 15, 2024
e9b9583
Merge branch 'master' into beta
lvisei May 16, 2024
ed86b03
Merge branch 'master' into beta
lvisei May 16, 2024
7e3b672
fix: 修复 WebGPU 模式渲染问题 (#2450)
lvisei May 16, 2024
3e33888
fix: mapbox 线图层的贴图变形 (#2474)
lvisei May 16, 2024
05dd5cc
refactor: set default renderer to device (#2477)
lvisei May 16, 2024
37b72bd
chore: set changeset
lvisei May 16, 2024
c4c6004
chore: version (beta) (#2480)
github-actions[bot] May 16, 2024
f68e1be
revert: use cache for createInputLayout
lvisei May 17, 2024
87a7e8b
chore: set changesets
lvisei May 17, 2024
5e4a474
chore: type throttle
lvisei May 17, 2024
34aaaf1
chore: version (beta) (#2482)
github-actions[bot] May 17, 2024
ef91217
test: 应用调试工程 (#2494)
lvisei May 24, 2024
49c1b7e
Merge branch 'master' into beta
lvisei May 24, 2024
356a956
test: raster layer
lvisei May 24, 2024
a7bbef5
test: line dash
lvisei May 24, 2024
0754eeb
fix: 修复热力蜂窝图层渲染空白 (#2500)
lvisei May 24, 2024
9060f49
chore: version (beta) (#2502)
github-actions[bot] May 24, 2024
995fc79
wip: refactor split tripartite map
lvisei May 26, 2024
0530be9
wip: mapbox and maplibre
lvisei May 26, 2024
74900b0
wip: bmap
lvisei May 26, 2024
2050651
wip: all map split
lvisei May 27, 2024
afaa51a
docs: update maps from extension
lvisei May 27, 2024
5e0a102
chore: split depends on `@antv/l7-map`
lvisei May 27, 2024
4eff1e0
test: mapTheme
lvisei May 27, 2024
52f6a1d
docs: update examples
lvisei May 27, 2024
dd043c4
chore: map theme style
lvisei May 27, 2024
b9eb65f
docs: map GaodeMap from extension
lvisei May 27, 2024
a7430bf
fix: type error
lvisei May 28, 2024
aca779d
fix: 无地图与 MapLibre 模式移动 Marker 出错 (#2509)
lvisei May 29, 2024
cd14d57
Merge branch 'beta' into refactor/split-tripartite-map
lvisei May 29, 2024
a5f57ed
fix: 在 WebGL2 拾取事件冒泡延迟问题 (#2511)
lvisei May 29, 2024
f5f24d3
chore: version (beta) (#2512)
github-actions[bot] May 29, 2024
8d6f9fd
Merge branch 'beta' into refactor/split-tripartite-map
lvisei May 29, 2024
53b9932
chore: remove methd
lvisei May 30, 2024
cca16a3
fix: 天地图 setCenter 方法缺失 (#2513)
lvisei May 31, 2024
1f72a14
Merge branch 'beta' into refactor/split-tripartite-map
lvisei May 31, 2024
c0fd333
chore: merge from beta
lvisei May 31, 2024
100fd87
chore: version (beta) (#2514)
github-actions[bot] May 31, 2024
eed9710
refactor: remove regl render mode (#2507)
lvisei May 31, 2024
286e153
fix: fix: 修复在 Map 上使用组件事件穿透到图层上的问题
lvisei Jun 3, 2024
8939e9b
fix: 修复在 Map 上使用组件事件穿透到图层上的问题 (#2518)
lvisei Jun 4, 2024
958f5d1
chore: version (beta) (#2519)
github-actions[bot] Jun 4, 2024
67647e9
fix: 解决 GeometryLayer 在不同底图上的渲染不一致情况 (#2523)
lvisei Jun 5, 2024
7e38a83
refactor: 升级新版一方地图交互事件机制,解决抖动问题 (#2521)
lvisei Jun 5, 2024
a3cbd49
chore: type
lvisei Jun 5, 2024
7ca84b8
chore: change MapNext to Map
lvisei Jun 5, 2024
663667c
chore: import right map type
lvisei Jun 5, 2024
7c78b4a
chore: version (beta) (#2524)
github-actions[bot] Jun 5, 2024
9779b47
Merge branch 'beta' into refactor/split-tripartite-map
lvisei Jun 5, 2024
b443a94
chore: delete legacy map
lvisei Jun 5, 2024
45466e1
chore: move to extensions
lvisei Jun 5, 2024
7f19909
fix: u_globel in arc3d
lvisei Jun 5, 2024
36266c2
Merge branch 'next' into refactor/split-tripartite-map
lvisei Jun 11, 2024
7cdacb0
chore: update changset
lvisei Jun 11, 2024
8da2303
chore: add changeset
lvisei Jun 11, 2024
bdc9267
chore: update changset mode
lvisei Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 0 additions & 8 deletions .changeset/README.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/hot-bikes-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@antv/l7-maps': major
---

refactor: split tripartite map
21 changes: 21 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"@antv/l7-extension-maps": "2.22.0",
"@antv/l7-component": "2.22.0",
"@antv/l7-core": "2.22.0",
"@antv/l7": "2.22.0",
"@antv/l7-layers": "2.22.0",
"@antv/l7-map": "2.22.0",
"@antv/l7-maps": "2.22.0",
"@antv/l7-renderer": "2.22.0",
"@antv/l7-scene": "2.22.0",
"@antv/l7-source": "2.22.0",
"@antv/l7-test-utils": "2.22.0",
"@antv/l7-three": "2.22.0",
"@antv/l7-utils": "2.22.0",
"@antv/l7-site": "2.21.4"
},
"changesets": []
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ LICENSE
packages/*/es/**
packages/*/lib/**
packages/*/dist/**
extensions/*/es/**
extensions/*/lib/**
extensions/*/dist/**

# legacy
legacy/
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export default tseslint.config(
'packages/*/es/*',
'packages/*/lib/*',
'packages/*/dist/*',
'extensions/*/es/*',
'extensions/*/lib/*',
'extensions/*/dist/*',

// Website static files
'site/public/*',
Expand Down
3 changes: 1 addition & 2 deletions examples/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { GUIOptions, TestCaseBasemap } from './types';

export const DEFAULT_GUI_OPTIONS: GUIOptions = {
map: 'Map',
renderer: 'device',
animate: false,
enableWebGPU: false,
};
Expand All @@ -18,6 +17,6 @@ export const MAP_TYPES: TestCaseBasemap[] = [
'MapLibre',
'BaiduMap',
'TencentMap',
'TMap',
'TdtMap',
'GoogleMap',
] as const;
3 changes: 0 additions & 3 deletions examples/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ export const Main = () => {
guiRef.current
.add(inintGuiOptions, 'map', MAP_TYPES)
.onChange((map: GUIOptions['map']) => onChange({ map }));
guiRef.current
.add(inintGuiOptions, 'renderer', ['regl', 'device'])
.onChange((renderer: GUIOptions['renderer']) => onChange({ renderer }));
guiRef.current
.add(inintGuiOptions, 'enableWebGPU')
.onChange((enableWebGPU: GUIOptions['enableWebGPU']) => onChange({ enableWebGPU }));
Expand Down
4 changes: 1 addition & 3 deletions examples/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import type { Scene } from '@antv/l7';
import type { ISceneConfig } from '@antv/l7-core';
import type { Controller, GUI } from 'lil-gui';

export type GUIOptions = {
map: TestCaseBasemap;
renderer: ISceneConfig['renderer'];
animate: boolean;
enableWebGPU: boolean;
[keys: string]: any;
Expand All @@ -17,7 +15,7 @@ export type TestCaseBasemap =
| 'MapLibre'
| 'TencentMap'
| 'Mapbox'
| 'TMap'
| 'TdtMap'
| 'GoogleMap';

export type TestCaseOptions = GUIOptions & {
Expand Down
22 changes: 21 additions & 1 deletion examples/utils/scene.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
import { Scene } from '@antv/l7';
import type { IMapConfig } from '@antv/l7-core';
import * as Maps from '@antv/l7-maps';
import {
BaiduMap,
GaodeMap,
GoogleMap,
MapLibre,
Mapbox,
TdtMap,
TencentMap,
} from '@antv/l7-extension-maps';
import { Map } from '@antv/l7-maps';
import type { TestCaseOptions } from '../types';

const Maps = {
Map,
BaiduMap,
GaodeMap,
GoogleMap,
MapLibre,
Mapbox,
TdtMap,
TencentMap,
};

type CaseSceneOptions = TestCaseOptions & {
mapConfig?: Partial<IMapConfig>;
};
Expand Down
48 changes: 48 additions & 0 deletions extensions/extension-maps/.fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import type { IFatherConfig } from 'father';
import { defineConfig } from 'father';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';

const isProduction = process.env.NODE_ENV === 'production';

const umdConfig: IFatherConfig['umd'] = {
name: 'L7ExtensionMaps',
output: {
path: './dist',
filename: 'l7-extension-maps.min.js',
},
platform: 'browser',
targets: { ie: 11 },
externals: {
'mapbox-gl': {
root: 'mapboxgl',
commonjs: 'mapbox-gl',
commonjs2: 'mapbox-gl',
amd: 'mapbox-gl',
},
'maplibre-gl': {
root: 'maplibregl',
commonjs: 'maplibre-gl',
commonjs2: 'maplibre-gl',
amd: 'maplibre-gl',
},
},
chainWebpack(memo) {
// 关闭压缩方便调试,默认开启
// memo.optimization.minimize(false);

// 打包体积分析
memo
.plugin('webpack-bundle-analyzer')
.use(BundleAnalyzerPlugin, [{ analyzerMode: 'static', openAnalyzer: false }]);

return memo;
},
};

export default defineConfig({
extends: '../../.fatherrc.base.ts',
// 使用 babel 编译 esm/cjs 产物,启用 transform-import-css-l7 插件完成 CSS 内联打包
esm: { transformer: 'babel' },
cjs: isProduction ? { transformer: 'babel' } : undefined,
umd: isProduction ? umdConfig : undefined,
});
3 changes: 3 additions & 0 deletions extensions/extension-maps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/lib
/es
/dist
1 change: 1 addition & 0 deletions extensions/extension-maps/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Change Log
51 changes: 51 additions & 0 deletions extensions/extension-maps/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@antv/l7-extension-maps",
"version": "2.22.0",
"description": "Extension Maps for L7",
"license": "MIT",
"author": "https://github.com/orgs/antvis/people",
"sideEffects": [
"**/*.css"
],
"main": "lib/index.js",
"unpkg": "dist/l7-extension-maps.min.js",
"module": "es/index.js",
"types": "es/index.d.ts",
"files": [
"dist",
"lib",
"es",
"!dist/report.html"
],
"scripts": {
"dev": "father dev",
"build": "npm run clean && father build",
"check-deps": "father doctor",
"lint": "eslint src",
"clean": "rimraf dist es lib"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@antv/l7-core": "workspace:*",
"@antv/l7-utils": "workspace:*",
"@babel/runtime": "^7.7.7",
"gl-matrix": "^3.1.0",
"mapbox-gl": "^1.2.1",
"maplibre-gl": "^3.5.2",
"viewport-mercator-project": "^6.2.1"
},
"devDependencies": {
"@map-component/tmap-types": "^0.1.3",
"@types/amap-js-api": "^1.4.6",
"@types/bmapgl": "^0.0.7",
"@types/gl-matrix": "^2.4.5",
"@types/google.maps": "^3.54.10",
"@types/mapbox-gl": "^1.11.2",
"@types/viewport-mercator-project": "^6.1.0"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
},
"repository": "[email protected]:antvis/L7.git"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BaseMapWrapper from '../utils/BaseMapWrapper';
import { BaseMapWrapper } from '@antv/l7-core';
import MapService from './map';

export default class AMap2Wrapper extends BaseMapWrapper<AMap.Map> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,26 @@ import type {
MapStyleConfig,
MapStyleName,
} from '@antv/l7-core';
import { MapServiceEvent } from '@antv/l7-core';
import { DOM, amap2Project, lodashUtil } from '@antv/l7-utils';
import { BaseMapService, MapServiceEvent, WebMercatorViewport } from '@antv/l7-core';
import { DOM, amap2Project } from '@antv/l7-utils';
import { mat4, vec3 } from 'gl-matrix';
import BaseMap from '../lib/base-map';
import Viewport from '../lib/web-mercator-viewport';
import { MapType } from '../types';
import { toPaddingOptions } from '../utils/utils';
import { toPaddingOptions } from '../utils';
import './logo.css';
import { MapTheme } from './theme';

const AMAP_VERSION = '2.0';
const AMAP_API_KEY = 'f59bcf249433f8b05caaee19f349b3d7';
const ZOOM_OFFSET = 1;

const AMapEventMapV2: Record<string, string> = {
const AMapEvent: Record<string, string> = {
contextmenu: 'rightclick',
camerachange: 'viewchange',
};

export default class BMapService extends BaseMap<AMap.Map> {
protected viewport = new Viewport();
export default class AMapService extends BaseMapService<AMap.Map> {
protected viewport = new WebMercatorViewport();

public version = MapType.GAODE;

public getType() {
return 'amap';
}
public type = 'AMap';

public async init() {
const {
Expand Down Expand Up @@ -144,7 +137,7 @@ export default class BMapService extends BaseMap<AMap.Map> {
height: 100%;
width: 100%;
`;
amapdiv.id = lodashUtil.uniqueId('l7_amap_div');
amapdiv.id = 'l7_amap_div';
wrapper.appendChild(amapdiv);
return amapdiv;
}
Expand All @@ -153,6 +146,10 @@ export default class BMapService extends BaseMap<AMap.Map> {
return this.map.getContainer();
}

public getMapCanvasContainer(): HTMLElement {
return this.map.getContainer()?.getElementsByClassName('amap-maps')[0] as HTMLElement;
}

public addMarkerContainer(): void {
if (!this.map) return;

Expand All @@ -165,28 +162,24 @@ export default class BMapService extends BaseMap<AMap.Map> {
}
}

public getMarkerContainer(): HTMLElement {
return this.markerContainer;
}

public getCanvasOverlays() {
return this.mapContainer?.querySelector('.amap-overlays') as HTMLElement;
}

// MapEvent // 定义事件类型
// MapEvent定义事件类型
public on(type: string, handler: (...args: any[]) => void): void {
if (MapServiceEvent.indexOf(type) !== -1) {
this.eventEmitter.on(type, handler);
} else {
this.map.on(AMapEventMapV2[type] || type, handler);
this.map.on(AMapEvent[type] || type, handler);
}
}

public off(type: string, handler: (...args: any[]) => void): void {
if (MapServiceEvent.indexOf(type) !== -1) {
this.eventEmitter.off(type, handler);
} else {
this.map.off(AMapEventMapV2[type] || type, handler);
this.map.off(AMapEvent[type] || type, handler);
}
}

Expand Down Expand Up @@ -252,14 +245,6 @@ export default class BMapService extends BaseMap<AMap.Map> {
];
}

public getMapContainer() {
return this.mapContainer;
}

public getMapCanvasContainer(): HTMLElement {
return this.map.getContainer()?.getElementsByClassName('amap-maps')[0] as HTMLElement;
}

public getMapStyleConfig(): MapStyleConfig {
return MapTheme;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import BaseMapWrapper from '../utils/BaseMapWrapper';
import { BaseMapWrapper } from '@antv/l7-core';
import MapService from './map';

export default class MapboxWrapper extends BaseMapWrapper<BMapGL.Map> {
protected getServiceConstructor() {
return MapService;
Expand Down
Loading
Loading