mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 08:46:18 +01:00
Fix OSM map not opening the Map app when tapped
This commit is contained in:
parent
c13e023d87
commit
e643f898d3
2 changed files with 1 additions and 8 deletions
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_map/flutter_map.dart';
|
import 'package:flutter_map/flutter_map.dart';
|
||||||
import 'package:latlong2/latlong.dart';
|
import 'package:latlong2/latlong.dart';
|
||||||
import 'package:np_gps_map/src/type.dart';
|
import 'package:np_gps_map/src/type.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
|
||||||
|
|
||||||
class OsmGpsMap extends StatelessWidget {
|
class OsmGpsMap extends StatelessWidget {
|
||||||
const OsmGpsMap({
|
const OsmGpsMap({
|
||||||
|
@ -17,12 +16,7 @@ class OsmGpsMap extends StatelessWidget {
|
||||||
const double pinSize = 48;
|
const double pinSize = 48;
|
||||||
final centerLl = LatLng(center.latitude, center.longitude);
|
final centerLl = LatLng(center.latitude, center.longitude);
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: onTap,
|
||||||
launchUrlString(
|
|
||||||
"https://www.openstreetmap.org/?mlat=${center.latitude}&mlon=${center.longitude}#map=${zoom.toInt()}/${center.latitude}/${center.longitude}",
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
// IgnorePointer is needed to prevent FlutterMap absorbing all pointer
|
// IgnorePointer is needed to prevent FlutterMap absorbing all pointer
|
||||||
// events
|
// events
|
||||||
|
|
|
@ -26,7 +26,6 @@ dependencies:
|
||||||
np_platform_util:
|
np_platform_util:
|
||||||
path: ../np_platform_util
|
path: ../np_platform_util
|
||||||
rxdart: ^0.27.7
|
rxdart: ^0.27.7
|
||||||
url_launcher: ^6.1.11
|
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
google_maps_flutter_android: 2.7.0
|
google_maps_flutter_android: 2.7.0
|
||||||
|
|
Loading…
Reference in a new issue