mirror of
https://github.com/immich-app/immich.git
synced 2025-11-07 15:23:04 -05:00
22 lines
573 B
Dart
22 lines
573 B
Dart
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(),
|
|
};
|
|
}
|