mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
47 lines
1.2 KiB
Dart
47 lines
1.2 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
|
import 'package:tuple/tuple.dart';
|
|
|
|
class GoogleGpsMap extends StatelessWidget {
|
|
const GoogleGpsMap({
|
|
Key? key,
|
|
required this.center,
|
|
required this.zoom,
|
|
this.onTap,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
build(BuildContext context) {
|
|
final centerLl = LatLng(center.item1, center.item2);
|
|
return GoogleMap(
|
|
compassEnabled: false,
|
|
mapToolbarEnabled: false,
|
|
rotateGesturesEnabled: false,
|
|
scrollGesturesEnabled: false,
|
|
zoomControlsEnabled: false,
|
|
zoomGesturesEnabled: false,
|
|
tiltGesturesEnabled: false,
|
|
myLocationButtonEnabled: false,
|
|
buildingsEnabled: false,
|
|
// liteModeEnabled: true,
|
|
initialCameraPosition: CameraPosition(
|
|
target: centerLl,
|
|
zoom: zoom,
|
|
),
|
|
markers: {
|
|
Marker(
|
|
markerId: const MarkerId("at"),
|
|
position: centerLl,
|
|
// for some reason, GoogleMap's onTap is not triggered if
|
|
// tapped on top of the marker
|
|
onTap: onTap,
|
|
),
|
|
},
|
|
onTap: (_) => onTap?.call(),
|
|
);
|
|
}
|
|
|
|
final Tuple2<double, double> center;
|
|
final double zoom;
|
|
final VoidCallback? onTap;
|
|
}
|