0% found this document useful (0 votes)
17 views8 pages

GoogleMap

Uploaded by

fogok93828
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views8 pages

GoogleMap

Uploaded by

fogok93828
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Google Maps

Satish Mulgi
smulgi7@gmail.com
satishkumarmulgi@dypvp.edu.in
Google Maps

 Android allows us to integrate Google Maps in our application. For this Google
provides us a library via Google Play Services for using maps.
 In order to use the Google Maps API, you must register your application on
the Google Developer Console and enable the API.
Steps For Getting The Google Maps Api Key:
 An API key is needed to access the Google Maps servers. This key is free and
you can use it with any of your applications.
 Step 1: Open Google developer console and signin with your gmail account:
https://console.developers.google.com/project
 Now create new project. You can create new project by clicking on the Create
Project button and give name to your project.

 Step 3: Now click on APIs & Services and open Dashboard from it.
Google Maps

 Step 4: In this open Enable APIS AND SERVICES.

 Step 5: Now open Google Map Android API.

 Step 6: Now enable the Google Maps Android API.


Google Maps

 Step 6: Now go to Credentials

 Step 7: Here click on Create credentials and choose API key

 Step 8: Now API your API key will be generated. Copy it and save it somewhere as we
Google Maps Demo

 Step 1: Create a New Android Project and name it GoogleMaps.


 Step 2: Now select Google Maps Activity and then click Next and finish.

 Step 3: Now open google_maps_api.xml (debug) in values folder


 Step 4: Here enter your Google Maps API key in place of YOUR_KEY_HERE

<string name="google_maps_key" templateMergeStrategy="preserve"


translatable="false">AIzaSyDV2_xy58r15K6TskZy4KWMuhUDVq67jqM</string>
Setting Google Map Type
 Using the google map object we can change the map type too. There are four different
types of map and each give different view of the map.
 These types are Normal, Hybrid, Satellite and Terrain. We can use them as given below.

Map Type Description


Normal Typical road map. Shows roads, some features built by humans, and important natural
features like rivers. Road and feature labels are also visible.
Hybrid Satellite photograph data with road maps added. Road and feature labels are also
visible.
Satellite Satellite photograph data. Road and feature labels are not visible.

Terrian Topographic data. The map includes colors, contour lines and labels, and perspective
shading. Some roads and labels are also visible.
None No tiles. The map will be rendered as an empty grid with no tiles loaded.

googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
googleMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
Google Map Zoom, Rotation
 We can enable/disable map zoom and rotations using the following lines of
codes:
 googleMap.getUiSettings().setZoomGesturesEnabled(true);
googleMap.getUiSettings().setRotateGesturesEnabled(true);

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy