Review comments (#554)
diff --git a/packages/google_maps_flutter/README.md b/packages/google_maps_flutter/README.md
index 01566fe..19eb664 100644
--- a/packages/google_maps_flutter/README.md
+++ b/packages/google_maps_flutter/README.md
@@ -16,7 +16,7 @@
widgets is *inherently limited* and will be replaced by a fully compositional
[Texture](https://docs.flutter.io/flutter/widgets/Texture-class.html)-based
approach before we publish this plugin.
-
+
In detail: the plugin currently relies on placing platform overlays on top of
a bitmap snapshotting widget for creating the illusion of in-line compositing
of GoogleMap views with Flutter widgets. This works only in very limited
@@ -24,7 +24,7 @@
* the widget is stationary
* the widget is drawn on top of all other widgets within bounds
* touch events within widget bounds can be safely ignored by Flutter
-
+
The root problem with platform overlays is that they cannot be freely composed
with other widgets. Many workarounds can be devised to address this shortcoming
in particular situations, but the Flutter team does not intend to support such
@@ -48,7 +48,7 @@
### Android
-Specify your API key in the application manifest `android/src/main/AndroidManifest.xml`:
+Specify your API key in the application manifest `android/app/src/main/AndroidManifest.xml`:
```xml
<manifest ...
@@ -89,29 +89,54 @@
interface will be unaffected by the change away from platform overlays.
```dart
-final GoogleMapOverlayController controller =
- GoogleMapOverlayController.fromSize(width: 300.0, height: 200.0);
+import 'package:flutter/material.dart';
+import 'package:google_maps_flutter/google_maps_flutter.dart';
-@override
-Widget build(BuildContext context) {
- return Column(children: <Widget>[
- Center(child: GoogleMapOverlay(controller: controller)),
- FlatButton(
- child: const Text('Go to London'),
- onPressed: () {
- controller.mapController.animateCamera(
- CameraUpdate.newCameraPosition(
- const CameraPosition(
- bearing: 270.0,
- target: LatLng(51.5160895, -0.1294527),
- tilt: 30.0,
- zoom: 17.0,
- ),
- )
- );
- }
+void main() {
+ GoogleMapController.init();
+ final GoogleMapOverlayController controller =
+ GoogleMapOverlayController.fromSize(width: 300.0, height: 200.0);
+ final Widget mapWidget = GoogleMapOverlay(controller: controller);
+ runApp(MaterialApp(
+ home: new Scaffold(
+ appBar: AppBar(title: const Text('Google Maps demo')),
+ body: MapsDemo(mapWidget, controller.mapController),
),
- ]);
+ navigatorObservers: <NavigatorObserver>[controller.overlayController],
+ ));
+}
+
+class MapsDemo extends StatelessWidget {
+ MapsDemo(this.mapWidget, this.controller);
+
+ final Widget mapWidget;
+ final GoogleMapController controller;
+
+ @override
+ Widget build(BuildContext context) {
+ return Padding(
+ padding: EdgeInsets.all(15.0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: <Widget>[
+ Center(child: mapWidget),
+ RaisedButton(
+ child: const Text('Go to London'),
+ onPressed: () {
+ controller.animateCamera(CameraUpdate.newCameraPosition(
+ const CameraPosition(
+ bearing: 270.0,
+ target: LatLng(51.5160895, -0.1294527),
+ tilt: 30.0,
+ zoom: 17.0,
+ ),
+ ));
+ },
+ ),
+ ],
+ ),
+ );
+ }
}
```
diff --git a/packages/google_maps_flutter/example/android/app/src/main/AndroidManifest.xml b/packages/google_maps_flutter/example/android/app/src/main/AndroidManifest.xml
index 8338864..5105220 100644
--- a/packages/google_maps_flutter/example/android/app/src/main/AndroidManifest.xml
+++ b/packages/google_maps_flutter/example/android/app/src/main/AndroidManifest.xml
@@ -12,7 +12,7 @@
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.geo.API_KEY"
- android:value="AIzaSyA81lRAuYToAhii3Wohpx7KrkoDhW_4XV0" />
+ android:value="YOUR KEY HERE" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
diff --git a/packages/google_maps_flutter/example/ios/Runner/AppDelegate.m b/packages/google_maps_flutter/example/ios/Runner/AppDelegate.m
index 5ed1bc5..28b6216 100644
--- a/packages/google_maps_flutter/example/ios/Runner/AppDelegate.m
+++ b/packages/google_maps_flutter/example/ios/Runner/AppDelegate.m
@@ -7,7 +7,7 @@
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Provide the GoogleMaps API key.
- [GMSServices provideAPIKey:@"AIzaSyBCGQ3UNVvpeJTUr07qcEmtHQmllJs4SV0"];
+ [GMSServices provideAPIKey:@"YOUR KEY HERE"];
// Register Flutter plugins.
[GeneratedPluginRegistrant registerWithRegistry:self];