mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 20:59:03 +00:00
Make mapbox map more reusable + add coordinates to exif
This commit is contained in:
@@ -15,6 +15,13 @@ type AuthorizeResult struct {
|
||||
Token *string `json:"token"`
|
||||
}
|
||||
|
||||
type Coordinates struct {
|
||||
// GPS latitude in degrees
|
||||
Latitude float64 `json:"latitude"`
|
||||
// GPS longitude in degrees
|
||||
Longitude float64 `json:"longitude"`
|
||||
}
|
||||
|
||||
type MediaDownload struct {
|
||||
Title string `json:"title"`
|
||||
MediaURL *MediaURL `json:"mediaUrl"`
|
||||
|
||||
@@ -28,3 +28,14 @@ func (MediaEXIF) TableName() string {
|
||||
func (exif *MediaEXIF) Media() *Media {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func (exif *MediaEXIF) Coordinates() *Coordinates {
|
||||
if exif.GPSLatitude == nil || exif.GPSLongitude == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return &Coordinates{
|
||||
Latitude: *exif.GPSLatitude,
|
||||
Longitude: *exif.GPSLongitude,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user