migrate(map): osm to mapbox
This commit is contained in:
parent
b4b60d5719
commit
7033d3a233
4 changed files with 12 additions and 7 deletions
|
@ -1 +1,3 @@
|
|||
endpoint=https://api.ente.io/
|
||||
urltemplate=YOUR_URL_TEMPLATE
|
||||
apikey=YOUR_API_KEY
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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<MapScreen> {
|
|||
final List<ImageMarker> 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<MapScreen> {
|
|||
debounceDuration: debounceDuration,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
child: MapCredits(),
|
||||
),
|
||||
SizedBox(
|
||||
height: 120,
|
||||
child: Center(
|
||||
|
|
|
@ -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<MapView> {
|
|||
),
|
||||
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,
|
||||
|
|
Loading…
Add table
Reference in a new issue