September 2019
Beginner
512 pages
12h 52m
English
We have added a row of buttons which the user can press to focus on a specific place. By tapping on one of these buttons, a new method will be called, _animateMapCameraTo, for Stonehenge, for example:
RaisedButton( child: Text("Stonehenge"), onPressed: () { _animateMapCameraTo(_stonehengePosition); },),
The new method is responsible for requesting the camera update:
void _animateMapCameraTo(LatLng position) { _mapController.animateCamera(CameraUpdate.newLatLng(position)); }
As you can see, through the GoogleMapController instance retrieved before, we can dispatch a camera animation to a new location on the map.
Read now
Unlock full access