Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22405516
coords-value.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
524 B
Referenced Files
None
Subscribers
None
coords-value.ts
View Options
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
Details
Attached
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)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline