Page MenuHomeSealhub

coords-value.ts
No OneTemporary

Authored By
Unknown
Size
524 B
Referenced Files
None
Subscribers
None

coords-value.ts

import type { FieldValue } from "./field-value.js";
export class CoordsValue implements FieldValue {
constructor(private readonly coordinates: [number, number]) {}
toTuple(): [number, number] {
return [...this.coordinates] as [number, number];
}
toObject(): { lat: number; lon: number } {
const [lat, lon] = this.coordinates;
return { lat, lon };
}
toString(): string {
const [lat, lon] = this.coordinates;
return `${lat},${lon}`;
}
getRestAPIValue(): [number, number] {
return this.toTuple();
}
}

File Metadata

Mime Type
application/javascript
Expires
Fri, Nov 27, 19:48 (8 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1212302
Default Alt Text
coords-value.ts (524 B)

Event Timeline