-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement renderer service with g-device-api (#1961)
* chore: rebase conflict * chore: rebase conflict * chore: rebase conflict * chore: rebase conflict * fix: render tsc 配置 * chore: rebase conflict * chore: 版本依赖 * chore: 更新 point fill layer * fix: demo * chore: rest fill demo * fix: add picking ubo * chore: add a WebGPU example * chore: g device 依赖 --------- Co-authored-by: lzxue <[email protected]>
- Loading branch information
Showing
54 changed files
with
2,168 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,6 @@ dist/ | |
es/ | ||
|
||
.DS_Store | ||
public | ||
.cache | ||
.idea | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// @ts-ignore | ||
import { PointLayer, Scene } from '@antv/l7'; | ||
// @ts-ignore | ||
import { GaodeMap } from '@antv/l7-maps'; | ||
import React, { useEffect } from 'react'; | ||
|
||
export default () => { | ||
useEffect(() => { | ||
const scene = new Scene({ | ||
id: 'point_circle', | ||
pickBufferScale: 1.0, | ||
renderer: 'device', | ||
enableWebGPU: true, | ||
shaderCompilerPath: '/glsl_wgsl_compiler_bg.wasm', | ||
map: new GaodeMap({ | ||
style: 'light', | ||
center: [-121.24357, 37.58264], | ||
pitch: 0, | ||
zoom: 6.45, | ||
}), | ||
}); | ||
scene.on('loaded', () => { | ||
fetch( | ||
'https://gw.alipayobjects.com/os/basement_prod/6c4bb5f2-850b-419d-afc4-e46032fc9f94.csv', | ||
) | ||
.then((res) => res.text()) | ||
.then((data) => { | ||
const pointLayer = new PointLayer() | ||
.source(data, { | ||
parser: { | ||
type: 'csv', | ||
x: 'Longitude', | ||
y: 'Latitude', | ||
}, | ||
}) | ||
.shape('circle') | ||
.size(16) | ||
.active(true) | ||
.select({ | ||
color: 'red', | ||
}) | ||
.color('Magnitude', [ | ||
'#0A3663', | ||
'#1558AC', | ||
'#3771D9', | ||
'#4D89E5', | ||
'#64A5D3', | ||
'#72BED6', | ||
'#83CED6', | ||
'#A6E1E0', | ||
'#B8EFE2', | ||
'#D7F9F0', | ||
]) | ||
.style({ | ||
opacity: 1, | ||
strokeWidth: 0, | ||
stroke: '#fff', | ||
}); | ||
scene.addLayer(pointLayer); | ||
// let i =0; | ||
// setInterval(() => { | ||
// i++ % 2 === 0 ? pointLayer.setBlend('additive') : pointLayer.setBlend('normal'); | ||
|
||
// },20) | ||
}); | ||
}); | ||
}, []); | ||
return ( | ||
<div | ||
id="point_circle" | ||
style={{ | ||
height: '500px', | ||
position: 'relative', | ||
}} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// @ts-ignore | ||
import { PointLayer, Scene } from '@antv/l7'; | ||
// @ts-ignore | ||
import { GaodeMap } from '@antv/l7-maps'; | ||
import React, { useEffect } from 'react'; | ||
|
||
export default () => { | ||
useEffect(() => { | ||
const scene = new Scene({ | ||
id: 'map', | ||
renderer: 'device', | ||
map: new GaodeMap({ | ||
// style: 'blank', | ||
center: [120.099658370018, 30.263445807542666], | ||
pitch: 0, | ||
zoom: 11, | ||
}), | ||
}); | ||
scene.on('loaded', () => { | ||
// fetch( | ||
// 'https://gw.alipayobjects.com/os/rmsportal/BElVQFEFvpAKzddxFZxJ.txt', | ||
// ) | ||
// .then((res) => res.text()) | ||
// .then((data) => { | ||
const pointLayer = new PointLayer({ blend: 'additive' }) | ||
.source({ | ||
type: "FeatureCollection", | ||
features: [ | ||
{ | ||
type: "Feature", | ||
properties: {}, | ||
geometry: { | ||
type: "Point", | ||
coordinates: [120.099658370018, 30.263445807542666] | ||
} | ||
} | ||
] | ||
}) | ||
.size(40) | ||
.shape('dot') | ||
.color('#f00') | ||
.style({ | ||
sizeScale:0.5, | ||
opacity: 0.6, | ||
stroke:'#00f', | ||
|
||
|
||
}); | ||
|
||
scene.addLayer(pointLayer); | ||
// }); | ||
}); | ||
}, []); | ||
return ( | ||
<div | ||
id="map" | ||
style={{ | ||
height: '500px', | ||
position: 'relative', | ||
}} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
// @ts-ignore | ||
import { PointLayer, Scene } from '@antv/l7'; | ||
// @ts-ignore | ||
import { GaodeMap, Mapbox } from '@antv/l7-maps'; | ||
import { GaodeMap } from '@antv/l7-maps'; | ||
import React, { useEffect } from 'react'; | ||
|
||
export default () => { | ||
useEffect( () => { | ||
const scene = new Scene({ | ||
id: 'map', | ||
map: new GaodeMap({ | ||
style: 'dark', | ||
center: [ 121.417463, 31.215175 ], | ||
pitch: 0, | ||
zoom: 11 | ||
}) | ||
}); | ||
scene.on('loaded', () => { | ||
fetch('https://gw.alipayobjects.com/os/rmsportal/BElVQFEFvpAKzddxFZxJ.txt') | ||
.then(res => res.text()) | ||
.then(data => { | ||
const pointLayer = new PointLayer({blend:'additive'}) | ||
.source(data, { | ||
parser: { | ||
type: 'csv', | ||
y: 'lat', | ||
x: 'lng' | ||
} | ||
}) | ||
.size(0.5) | ||
.color('#080298') | ||
.style({ | ||
opacity: 1 | ||
}); | ||
useEffect(() => { | ||
const scene = new Scene({ | ||
id: 'map', | ||
map: new GaodeMap({ | ||
style: 'dark', | ||
center: [121.417463, 31.215175], | ||
pitch: 0, | ||
zoom: 11, | ||
}), | ||
}); | ||
scene.on('loaded', () => { | ||
fetch( | ||
'https://gw.alipayobjects.com/os/rmsportal/BElVQFEFvpAKzddxFZxJ.txt', | ||
) | ||
.then((res) => res.text()) | ||
.then((data) => { | ||
const pointLayer = new PointLayer({ blend: 'additive' }) | ||
.source(data, { | ||
parser: { | ||
type: 'csv', | ||
y: 'lat', | ||
x: 'lng', | ||
}, | ||
}) | ||
.size(0.5) | ||
.color('#080298') | ||
.style({ | ||
opacity: 1, | ||
}); | ||
|
||
scene.addLayer(pointLayer); | ||
}); | ||
}); | ||
|
||
}, []); | ||
return ( | ||
<div | ||
id="map" | ||
style={{ | ||
height: '500px', | ||
position: 'relative', | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
scene.addLayer(pointLayer); | ||
}); | ||
}); | ||
}, []); | ||
return ( | ||
<div | ||
id="map" | ||
style={{ | ||
height: '500px', | ||
position: 'relative', | ||
}} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### point - circle - WebGPU | ||
|
||
<code src="./demos/circle-webgpu.tsx"></code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Point - normal - Device API | ||
|
||
<code src="./demos/normal-device.tsx"></code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.