Shihui dev (#851)

feat: 修复 map 地图类型 zoom > 16 层级时精度丢失问题
This commit is contained in:
YiQianYao 2021-11-25 17:51:39 +08:00 committed by GitHub
parent eecada672e
commit f5fc6c7cc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -710,6 +710,7 @@ export default class Camera extends EventEmitter {
if (this.easeId && easeId && this.easeId === easeId) {
return;
}
// @ts-ignore
delete this.easeId;
const wasZooming = this.zooming;

View File

@ -565,10 +565,12 @@ export default class Transform {
// unproject two points to get a line and then find the point on that
// line with z=0
const coord0 = new Float32Array([p.x, p.y, 0, 1]);
const coord1 = new Float32Array([p.x, p.y, 1, 1]);
const coord0 = new Float64Array([p.x, p.y, 0, 1]);
const coord1 = new Float64Array([p.x, p.y, 1, 1]);
// @ts-ignore
vec4.transformMat4(coord0, coord0, this.pixelMatrixInverse);
// @ts-ignore
vec4.transformMat4(coord1, coord1, this.pixelMatrixInverse);
const w0 = coord0[3];

View File

@ -32,9 +32,9 @@ export default class ScaleComponent extends React.Component {
// canvas: this.el,
map: new Map({
hash: true,
center: [110.19382669582967, 30.258134],
center: [122.2215, 29.8325],
pitch: 0,
zoom: 2,
zoom: 22,
}),
});
scene.addImage(