mirror of https://gitee.com/antv-l7/antv-l7
fix: 3D 柱图偏移坐标系坐标转换的问题
This commit is contained in:
parent
863ff53b4a
commit
4f9ccbbd4b
|
@ -104,16 +104,16 @@ vec2 project_pixel_size_to_clipspace(vec2 pixels) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float project_pixel(float pixel) {
|
float project_pixel(float pixel) {
|
||||||
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
||||||
// P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
// P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
||||||
return pixel * pow(2.0, (20.0 - u_Zoom));
|
return pixel * pow(2.0, (19.0 - u_Zoom));
|
||||||
}
|
}
|
||||||
return pixel;
|
return pixel;
|
||||||
}
|
}
|
||||||
vec2 project_pixel(vec2 pixel) {
|
vec2 project_pixel(vec2 pixel) {
|
||||||
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {
|
if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {
|
||||||
// P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
// P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1
|
||||||
return pixel * pow(2.0, (20.0 - u_Zoom));
|
return pixel * pow(2.0, (19.0 - u_Zoom));
|
||||||
}
|
}
|
||||||
return pixel;
|
return pixel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ void main() {
|
||||||
|
|
||||||
vec2 offset = project_pixel(size.xy);
|
vec2 offset = project_pixel(size.xy);
|
||||||
|
|
||||||
vec4 project_pos = project_position(vec4(a_Pos.xy, 0, 1.0));
|
vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));
|
||||||
vec4 pos = vec4(project_pos.xy + offset, project_pixel(size.z), 1.0);
|
vec4 pos = vec4(project_pos.xy + offset, project_pixel(size.z), 1.0);
|
||||||
|
|
||||||
float lightWeight = calc_lighting(pos);
|
float lightWeight = calc_lighting(pos);
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
// @ts-ignore
|
||||||
|
describe('template', () => {
|
||||||
|
const el = document.createElement('div');
|
||||||
|
el.id = 'test-div-id';
|
||||||
|
el.innerHTML = 'hello L7';
|
||||||
|
document.querySelector('body').appendChild(el);
|
||||||
|
|
||||||
|
it('div content', () => {
|
||||||
|
expect(document.querySelector('#test-div-id')?.innerHTML).toBe('hello L7');
|
||||||
|
});
|
||||||
|
});
|
|
@ -43,7 +43,7 @@ export default class Column extends React.Component {
|
||||||
'squareColumn',
|
'squareColumn',
|
||||||
])
|
])
|
||||||
.size('unit_price', (h) => {
|
.size('unit_price', (h) => {
|
||||||
return [6, 6, h / 500];
|
return [6, 6, 100];
|
||||||
})
|
})
|
||||||
.color('name', ['#739DFF', '#61FCBF', '#FFDE74', '#FF896F'])
|
.color('name', ['#739DFF', '#61FCBF', '#FFDE74', '#FF896F'])
|
||||||
.style({
|
.style({
|
||||||
|
|
Loading…
Reference in New Issue