Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Switch to openstreetmap.org for tile server

Neeraj Guptadfc6baa56291
diff --git a/mobile/apps/photos/lib/ui/map/map_view.dart b/mobile/apps/photos/lib/ui/map/map_view.dart
index 65b3967573..85711ddd3a 100644
--- a/mobile/apps/photos/lib/ui/map/map_view.dart
+++ b/mobile/apps/photos/lib/ui/map/map_view.dart
@@ -101,7 +101,7 @@ class _MapViewState extends State<MapView> {
},
),
children: [
- const OSMFranceTileLayer(),
+ const OSMTileLayer(),
MarkerClusterLayerWidget(
options: MarkerClusterLayerOptions(
alignment: Alignment.topCenter,
@@ -136,7 +136,7 @@ class _MapViewState extends State<MapView> {
padding: EdgeInsets.only(
bottom: widget.bottomSheetDraggableAreaHeight,
),
- child: OSMFranceTileAttributes(
+ child: OSMTileAttributes(
options: widget.mapAttributionOptions,
),
),
diff --git a/mobile/apps/photos/lib/ui/map/tile/layers.dart b/mobile/apps/photos/lib/ui/map/tile/layers.dart
index 0cd885b1dc..f67d02daff 100644
--- a/mobile/apps/photos/lib/ui/map/tile/layers.dart
+++ b/mobile/apps/photos/lib/ui/map/tile/layers.dart
@@ -7,7 +7,8 @@ import "package:photos/ui/map/tile/cache.dart";
import "package:url_launcher/url_launcher.dart";
import "package:url_launcher/url_launcher_string.dart";
-const String _userAgent = "io.ente.photos";
+const String _userAgent =
+ "Ente Photos/1.2 (+https://ente.io; contact: [email protected])";
class MapAttributionOptions {
final double permanentHeight;
@@ -51,6 +52,39 @@ class OSMFranceTileLayer extends StatelessWidget {
}
}
+class OSMTileAttributes extends StatelessWidget {
+ final MapAttributionOptions options;
+ const OSMTileAttributes({
+ this.options = const MapAttributionOptions(),
+ super.key,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final textTheme = getEnteTextTheme(context).tinyBold;
+ return MapAttributionWidget(
+ alignment: AttributionAlignment.bottomLeft,
+ showFlutterMapAttribution: false,
+ permanentHeight: options.permanentHeight,
+ popupBackgroundColor: getEnteColorScheme(context).backgroundElevated,
+ popupBorderRadius: options.popupBorderRadius,
+ iconSize: options.iconSize,
+ attributions: [
+ TextSourceAttribution(
+ AppLocalizations.of(context).openstreetmapContributors,
+ textStyle: textTheme,
+ onTap: () => launchUrlString('https://openstreetmap.org/copyright'),
+ ),
+ TextSourceAttribution(
+ 'HOT Tiles',
+ textStyle: textTheme,
+ onTap: () => launchUrl(Uri.parse('https://www.hotosm.org/')),
+ ),
+ ],
+ );
+ }
+}
+
class OSMFranceTileAttributes extends StatelessWidget {
final MapAttributionOptions options;
const OSMFranceTileAttributes({
diff --git a/mobile/apps/photos/lib/ui/viewer/location/update_location_data_widget.dart b/mobile/apps/photos/lib/ui/viewer/location/update_location_data_widget.dart
index fd6ae4bdf0..af70f2b16a 100644
--- a/mobile/apps/photos/lib/ui/viewer/location/update_location_data_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/location/update_location_data_widget.dart
@@ -78,8 +78,8 @@ class _UpdateLocationDataWidgetState extends State<UpdateLocationDataWidget> {
},
),
children: const [
- OSMFranceTileLayer(),
- OSMFranceTileAttributes(),
+ OSMTileLayer(),
+ OSMTileAttributes(),
],
),
Positioned(