mirror of
https://github.com/immich-app/immich.git
synced 2024-12-19 00:32:49 +02:00
e6c0f0e3aa
* chore: maplibre gl pubspec * refactor(wip): maplibre for maps * refactor(wip): dual pane + location button * chore: remove flutter_map and deps * refactor(wip): map zoom to location * refactor: location picker * open gallery_viewer on marker tap * remove detectScaleGesture param * test: debounce and throttle * chore: rename get location method * feat(mobile): Adds gps locator to map prompt for easy geolocation (#6282) * Refactored get gps coords * Use var for linter's sake, should handle errors better * Cleanup * Fix linter issues * chore(dep): update maplibre to official lib --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Joshua Herrera <joshua.herrera227@gmail.com>
40 lines
929 B
Dart
40 lines
929 B
Dart
import 'package:maplibre_gl/maplibre_gl.dart';
|
|
import 'package:openapi/api.dart';
|
|
|
|
class MapMarker {
|
|
final LatLng latLng;
|
|
final String assetRemoteId;
|
|
MapMarker({
|
|
required this.latLng,
|
|
required this.assetRemoteId,
|
|
});
|
|
|
|
MapMarker copyWith({
|
|
LatLng? latLng,
|
|
String? assetRemoteId,
|
|
}) {
|
|
return MapMarker(
|
|
latLng: latLng ?? this.latLng,
|
|
assetRemoteId: assetRemoteId ?? this.assetRemoteId,
|
|
);
|
|
}
|
|
|
|
MapMarker.fromDto(MapMarkerResponseDto dto)
|
|
: latLng = LatLng(dto.lat, dto.lon),
|
|
assetRemoteId = dto.id;
|
|
|
|
@override
|
|
String toString() =>
|
|
'MapMarker(latLng: $latLng, assetRemoteId: $assetRemoteId)';
|
|
|
|
@override
|
|
bool operator ==(covariant MapMarker other) {
|
|
if (identical(this, other)) return true;
|
|
|
|
return other.latLng == latLng && other.assetRemoteId == assetRemoteId;
|
|
}
|
|
|
|
@override
|
|
int get hashCode => latLng.hashCode ^ assetRemoteId.hashCode;
|
|
}
|