immich/mobile/lib/presentation/widgets/map/marker_build.dart
2025-07-30 11:37:38 -04:00

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(),
};
}