mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(mobile): drift map page
This commit is contained in:
parent
da5deffd03
commit
d308d023c2
15 changed files with 783 additions and 0 deletions
21
mobile/lib/presentation/widgets/map/marker_build.dart
Normal file
21
mobile/lib/presentation/widgets/map/marker_build.dart
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import 'package:immich_mobile/domain/models/map.model.dart';
|
||||
|
||||
class MarkerBuilder {
|
||||
final List<Marker> markers;
|
||||
|
||||
const MarkerBuilder({required this.markers});
|
||||
|
||||
static Map<String, dynamic> addFeature(Marker marker) => {
|
||||
'type': 'Feature',
|
||||
'id': marker.assetId,
|
||||
'geometry': {
|
||||
'type': 'Point',
|
||||
'coordinates': [marker.location.longitude, marker.location.latitude],
|
||||
},
|
||||
};
|
||||
|
||||
Map<String, dynamic> generate() => {
|
||||
'type': 'FeatureCollection',
|
||||
'features': markers.map(addFeature).toList(),
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue