-
-
Notifications
You must be signed in to change notification settings - Fork 890
Closed
Labels
general[DEPRECATED] This issue is better suited for Discussions or Discord[DEPRECATED] This issue is better suited for Discussions or Discord
Description
Hi
Just had some time to play with google_maps_flutter package.
I would like to share a code that worked for me to use GoogleMap Widget as a tile layer on flutter_map
gist: google_tile_layer_widget.dart
usage:
Widget build(BuildContext context) {
return Scaffold(
body: FlutterMap(
options: MapOptions(
center: LatLng(51.5, -0.09),
maxZoom: 21,
interactiveFlags:
InteractiveFlag.pinchZoom | InteractiveFlag.doubleTapZoom | InteractiveFlag.drag | InteractiveFlag.flingAnimation | InteractiveFlag.pinchMove,
zoom: 13.0,
),
children: [
GoogleMapTileLayerWidget(options: GoogleMapTileLayerOptions(useAndroidViewSurface: true)),
MarkerLayerWidget(
options: MarkerLayerOptions(
markers: [
Marker(width: 80.0, height: 80.0, point: LatLng(51.5, -0.09), builder: (ctx) => const FlutterLogo()),
],
)),
],
));
}There is a slight delay while panning, but it can be reduced greatly with useAndroidViewSurface: true
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
general[DEPRECATED] This issue is better suited for Discussions or Discord[DEPRECATED] This issue is better suited for Discussions or Discord