Professional Documents
Culture Documents
Lab#7 Mad
Lab#7 Mad
Lab # 7
Objective:
To give the basic understanding of the following:
Overview
What is the Google Map API? How it is used?
Steps of using Google Map API
Simple Example How to get key of Google Map API
Get your current location From GPS and show it on Google Map
Overview
With the Maps SDK for Android, you can add maps based on Google Maps data to your application. The
API automatically handles access to Google Maps servers, data downloading, map display, and response
to map gestures. You can also use API calls to add markers, polygons, and overlays to a basic map, and
to change the user's view of a particular map area. These objects provide additional information for map
locations, and allow user interaction with the map. The API allows you to add these graphics to a map:
Sets of images which are displayed on top of the base map tiles (Tile Overlays).
The Maps API returns helpful data about places and locations.
It does two major things:
It can cause maps to appear for the user.
It can return data about a latitude/longitude location, or return data about an address.
Google's documentation is strong for this API, so this guide will mostly link to the official
documentation, and discuss how Refuge uses the different API features.
Now it's time to get a map on the screen. Update lib/main.dart as follows:
Run the Flutter app in either iOS or Android to see a single map view, centered on Portland.
Feel free to modify the map center to represent your hometown, or somewhere that is
important to you.
Android App
IOS App
Paste that link into your browser and open the Google map API console
Like that
By Default Sydney coordinates are given in the code you can also change them.
You can put your own current location map in your code.
Open the Google map get current position and after that copy the coordinates.
24.883244,67.160298
Use your GPS to get your current location and show on the Google map.
Run the program and choose the real device to run your app because GPS is
only available in real device.
Exercises:
1) Implement above examples.
2) Challenging task (Bonus marking will be applied but do it by yourself)