mirror of
https://github.com/immich-app/immich.git
synced 2024-12-29 11:24:37 +02:00
a147dee4b6
* maplibre on web, custom styles from server Actually use new vector tile server, custom style.json support multiple style files, light/dark mode cleanup, use new map everywhere send file directly instead of loading first better light/dark mode switching remove leaflet fix mapstyles dto, first draft of map settings delete and add styles fix delete default styles fix tests only allow one light and one dark style url revert config core changes fix server config store fix tests move axios fetches to repo fix package-lock fix tests * open api * add assets to docker container * web: use mapSettings color for style * style: add unique ids to map styles * mobile: use style json for vector / raster * do not use svelte-material-icons * add click events to markers, simplify asset detail map * improve map performance by using asset thumbnails for markers instead of original file * Remove custom attribution (by request) * mobile: update map attribution * style: map dark mode * style: map light mode * zoom level for state * styling * overflow gradient * Limit maxZoom to 14 * mobile: listen for mapStyle changes in MapThumbnail * mobile: update concurrency --------- Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: bo0tzz <git@bo0tzz.me> Co-authored-by: Alex <alex.tran1502@gmail.com>
66 lines
1.8 KiB
Dart
66 lines
1.8 KiB
Dart
import 'package:vector_map_tiles/vector_map_tiles.dart';
|
|
|
|
class MapState {
|
|
final bool isDarkTheme;
|
|
final bool showFavoriteOnly;
|
|
final bool includeArchived;
|
|
final int relativeTime;
|
|
final Style? mapStyle;
|
|
final bool isLoading;
|
|
|
|
MapState({
|
|
this.isDarkTheme = false,
|
|
this.showFavoriteOnly = false,
|
|
this.includeArchived = false,
|
|
this.relativeTime = 0,
|
|
this.mapStyle,
|
|
this.isLoading = false,
|
|
});
|
|
|
|
MapState copyWith({
|
|
bool? isDarkTheme,
|
|
bool? showFavoriteOnly,
|
|
bool? includeArchived,
|
|
int? relativeTime,
|
|
Style? mapStyle,
|
|
bool? isLoading,
|
|
}) {
|
|
return MapState(
|
|
isDarkTheme: isDarkTheme ?? this.isDarkTheme,
|
|
showFavoriteOnly: showFavoriteOnly ?? this.showFavoriteOnly,
|
|
includeArchived: includeArchived ?? this.includeArchived,
|
|
relativeTime: relativeTime ?? this.relativeTime,
|
|
mapStyle: mapStyle ?? this.mapStyle,
|
|
isLoading: isLoading ?? this.isLoading,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'MapSettingsState(isDarkTheme: $isDarkTheme, showFavoriteOnly: $showFavoriteOnly, relativeTime: $relativeTime, includeArchived: $includeArchived, mapStyle: $mapStyle, isLoading: $isLoading)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
if (identical(this, other)) return true;
|
|
|
|
return other is MapState &&
|
|
other.isDarkTheme == isDarkTheme &&
|
|
other.showFavoriteOnly == showFavoriteOnly &&
|
|
other.relativeTime == relativeTime &&
|
|
other.includeArchived == includeArchived &&
|
|
other.mapStyle == mapStyle &&
|
|
other.isLoading == isLoading;
|
|
}
|
|
|
|
@override
|
|
int get hashCode {
|
|
return isDarkTheme.hashCode ^
|
|
showFavoriteOnly.hashCode ^
|
|
relativeTime.hashCode ^
|
|
includeArchived.hashCode ^
|
|
mapStyle.hashCode ^
|
|
isLoading.hashCode;
|
|
}
|
|
}
|