@@ -7,7 +7,8 @@ import "package:photos/ui/map/tile/cache.dart";
77import "package:url_launcher/url_launcher.dart" ;
88import "package:url_launcher/url_launcher_string.dart" ;
99
10- const String _userAgent = "io.ente.photos" ;
10+ const String _userAgent =
11+ "Ente Photos/1.2 (+https://ente.io; contact: [email protected] )" ;
1112
1213class MapAttributionOptions {
1314 final double permanentHeight;
@@ -51,6 +52,39 @@ class OSMFranceTileLayer extends StatelessWidget {
5152 }
5253}
5354
55+ class OSMTileAttributes extends StatelessWidget {
56+ final MapAttributionOptions options;
57+ const OSMTileAttributes ({
58+ this .options = const MapAttributionOptions (),
59+ super .key,
60+ });
61+
62+ @override
63+ Widget build (BuildContext context) {
64+ final textTheme = getEnteTextTheme (context).tinyBold;
65+ return MapAttributionWidget (
66+ alignment: AttributionAlignment .bottomLeft,
67+ showFlutterMapAttribution: false ,
68+ permanentHeight: options.permanentHeight,
69+ popupBackgroundColor: getEnteColorScheme (context).backgroundElevated,
70+ popupBorderRadius: options.popupBorderRadius,
71+ iconSize: options.iconSize,
72+ attributions: [
73+ TextSourceAttribution (
74+ AppLocalizations .of (context).openstreetmapContributors,
75+ textStyle: textTheme,
76+ onTap: () => launchUrlString ('https://openstreetmap.org/copyright' ),
77+ ),
78+ TextSourceAttribution (
79+ 'HOT Tiles' ,
80+ textStyle: textTheme,
81+ onTap: () => launchUrl (Uri .parse ('https://www.hotosm.org/' )),
82+ ),
83+ ],
84+ );
85+ }
86+ }
87+
5488class OSMFranceTileAttributes extends StatelessWidget {
5589 final MapAttributionOptions options;
5690 const OSMFranceTileAttributes ({
0 commit comments