nc-photos/app/lib/gps_map_util.dart

26 lines
718 B
Dart
Raw Normal View History

2024-10-30 17:19:40 +01:00
import 'package:android_intent_plus/android_intent.dart';
2023-09-12 18:29:44 +02:00
import 'package:np_gps_map/np_gps_map.dart';
2024-10-30 17:19:40 +01:00
import 'package:np_platform_util/np_platform_util.dart';
2023-09-12 18:29:44 +02:00
extension GpsMapProviderExtension on GpsMapProvider {
String toUserString() {
switch (this) {
case GpsMapProvider.google:
return "Google Maps";
case GpsMapProvider.osm:
return "OpenStreetMap";
}
}
}
2024-10-30 17:19:40 +01:00
void launchExternalMap(CameraPosition location) {
if (getRawPlatform() == NpPlatform.android) {
final intent = AndroidIntent(
action: "action_view",
data: Uri.encodeFull(
"geo:${location.center.latitude},${location.center.longitude}?z=${location.zoom}"),
);
intent.launch();
}
}