mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(mobile): maplibre (#6087)
* 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>
This commit is contained in:
parent
aa8c54e248
commit
e6c0f0e3aa
64 changed files with 2858 additions and 2171 deletions
39
mobile/lib/modules/map/models/map_marker.dart
Normal file
39
mobile/lib/modules/map/models/map_marker.dart
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue