Fix OSM map not opening the Map app when tapped

This commit is contained in:
Ming Ming 2024-10-30 22:21:34 +08:00
parent c13e023d87
commit e643f898d3
2 changed files with 1 additions and 8 deletions

View file

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';
import 'package:np_gps_map/src/type.dart';
import 'package:url_launcher/url_launcher_string.dart';
class OsmGpsMap extends StatelessWidget {
const OsmGpsMap({
@ -17,12 +16,7 @@ class OsmGpsMap extends StatelessWidget {
const double pinSize = 48;
final centerLl = LatLng(center.latitude, center.longitude);
return GestureDetector(
onTap: () {
launchUrlString(
"https://www.openstreetmap.org/?mlat=${center.latitude}&mlon=${center.longitude}#map=${zoom.toInt()}/${center.latitude}/${center.longitude}",
mode: LaunchMode.externalApplication,
);
},
onTap: onTap,
behavior: HitTestBehavior.opaque,
// IgnorePointer is needed to prevent FlutterMap absorbing all pointer
// events

View file

@ -26,7 +26,6 @@ dependencies:
np_platform_util:
path: ../np_platform_util
rxdart: ^0.27.7
url_launcher: ^6.1.11
dependency_overrides:
google_maps_flutter_android: 2.7.0