fix reading and writing lat lon

This commit is contained in:
liamcottle 2025-02-11 22:51:18 +13:00
parent feb149ad35
commit 865ca127ac
3 changed files with 17 additions and 4 deletions

View file

@ -35,6 +35,13 @@ class BufferWriter {
this.writeBytes(bytes);
}
writeInt32LE(num) {
const bytes = new Uint8Array(4);
const view = new DataView(bytes.buffer);
view.setInt32(0, num, true);
this.writeBytes(bytes);
}
writeString(string) {
this.writeBytes(new TextEncoder().encode(string));
}