diff --git a/.env.example b/.env.example index 8f446acbf..329eacea7 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,3 @@ endpoint=https://api.ente.io/ +urltemplate=YOUR_URL_TEMPLATE +apikey=YOUR_API_KEY diff --git a/lib/core/configuration.dart b/lib/core/configuration.dart index cccc1ecf8..ba7dcf2b9 100644 --- a/lib/core/configuration.dart +++ b/lib/core/configuration.dart @@ -43,6 +43,9 @@ class Configuration { "endpoint", defaultValue: kDefaultProductionEndpoint, ); + static const urltemplate = String.fromEnvironment("urltemplate"); + static const apikey = String.fromEnvironment("apikey"); + static const emailKey = "email"; static const foldersToBackUpKey = "folders_to_back_up"; static const keyAttributesKey = "key_attributes"; diff --git a/lib/ui/map/map_screen.dart b/lib/ui/map/map_screen.dart index 6d38659f8..3f995db92 100644 --- a/lib/ui/map/map_screen.dart +++ b/lib/ui/map/map_screen.dart @@ -9,7 +9,6 @@ import "package:logging/logging.dart"; import "package:photos/models/file.dart"; import "package:photos/ui/map/image_marker.dart"; import 'package:photos/ui/map/image_tile.dart'; -import "package:photos/ui/map/map_credits.dart"; import "package:photos/ui/map/map_view.dart"; class MapScreen extends StatefulWidget { @@ -61,7 +60,7 @@ class _MapScreenState extends State { final List tempMarkers = []; bool hasAnyLocation = false; for (var file in files) { - if (file.location != null) { + if (file.location != null && file.hasLocation) { if (!hasAnyLocation) { minLat = file.location!.latitude!; minLon = file.location!.longitude!; @@ -155,9 +154,6 @@ class _MapScreenState extends State { debounceDuration: debounceDuration, ), ), - const SizedBox( - child: MapCredits(), - ), SizedBox( height: 120, child: Center( diff --git a/lib/ui/map/map_view.dart b/lib/ui/map/map_view.dart index 72dee0516..067c7925e 100644 --- a/lib/ui/map/map_view.dart +++ b/lib/ui/map/map_view.dart @@ -4,6 +4,7 @@ import "package:flutter/material.dart"; import "package:flutter_map/flutter_map.dart"; import "package:flutter_map_marker_cluster/flutter_map_marker_cluster.dart"; import "package:latlong2/latlong.dart"; +import "package:photos/core/configuration.dart"; import "package:photos/ui/map/image_marker.dart"; import "package:photos/ui/map/map_button.dart"; import 'package:photos/ui/map/map_gallery_tile.dart'; @@ -75,8 +76,11 @@ class _MapViewState extends State { ), layers: [ TileLayerOptions( - urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - subdomains: ['a', 'b', 'c'], + urlTemplate: Configuration.urltemplate, + additionalOptions: { + "accessToken": Configuration.apikey, + "id": "mapbox.mapbox-streets-v7", + }, ), MarkerClusterLayerOptions( maxClusterRadius: 100,