js v3 client: coordinates use e7 fixed-precision encoding

This commit is contained in:
Brandon Liu
2022-09-30 22:11:41 +08:00
parent f23ca5823b
commit 9de085be8b
3 changed files with 6 additions and 6 deletions

View File

@@ -315,13 +315,13 @@ export function bytesToHeader(bytes: ArrayBuffer, etag?: string): Header {
tileType: v.getUint8(94),
minZoom: v.getUint8(95),
maxZoom: v.getUint8(96),
minLon: v.getFloat32(97, true),
minLat: v.getFloat32(101, true),
maxLon: v.getFloat32(105, true),
maxLat: v.getFloat32(109, true),
minLon: v.getInt32(97, true) / 10000000,
minLat: v.getInt32(101, true) / 10000000,
maxLon: v.getInt32(105, true) / 10000000,
maxLat: v.getInt32(109, true) / 10000000,
centerZoom: v.getUint8(113),
centerLon: v.getFloat32(114, true),
centerLat: v.getFloat32(118, true),
centerLon: v.getInt32(114, true) / 10000000,
centerLat: v.getInt32(118, true) / 10000000,
etag: etag,
};
}