31

GeoLocation using Google Maps JavaScript API v3

Embed Size (px)

Citation preview

Page 1: GeoLocation using Google Maps JavaScript API v3
Page 2: GeoLocation using Google Maps JavaScript API v3

GeoLocation using Google Maps

JavaScript API v3

Page 3: GeoLocation using Google Maps JavaScript API v3

Steps

Page 4: GeoLocation using Google Maps JavaScript API v3

Manifest Permission

Page 5: GeoLocation using Google Maps JavaScript API v3

Challenges and Limitation

•Some API is not work in Emulator•Internet connection must need•Complex Coding•Some APIs is not suitable for most of the countries like Bangladesh.

Page 6: GeoLocation using Google Maps JavaScript API v3

Solutions•Use Real Devices•Keep connect internet in your testing device

•Need a good knowledge of JS•Use the other APIs which are very popular

Page 7: GeoLocation using Google Maps JavaScript API v3

Google Maps JavaScript API v3

Page 8: GeoLocation using Google Maps JavaScript API v3

Amuture•Obtaining an API Key•Declaring Your Application as HTML5•Loading the Google Maps API•Map DOM (Document Object Model) Elements•Map Options•The Map Object•Loading the Map

Page 9: GeoLocation using Google Maps JavaScript API v3

Obtaining an API Key

Page 10: GeoLocation using Google Maps JavaScript API v3

Sample Code

Page 11: GeoLocation using Google Maps JavaScript API v3

Map DOM Elements

This This div will show the map.will show the map.

Page 12: GeoLocation using Google Maps JavaScript API v3

Loading the Google Maps API

This This script’s src is the is the Google Map APIGoogle Map API

Page 13: GeoLocation using Google Maps JavaScript API v3

Libraries Call

This This script willwill initialize the map the map

Page 14: GeoLocation using Google Maps JavaScript API v3

Loading the Map

This will load the This will load the mapmap

Page 15: GeoLocation using Google Maps JavaScript API v3

Intermediate

Page 16: GeoLocation using Google Maps JavaScript API v3

Simple Marker

Page 17: GeoLocation using Google Maps JavaScript API v3

Custom Icon

Page 18: GeoLocation using Google Maps JavaScript API v3

Dragging

Page 19: GeoLocation using Google Maps JavaScript API v3

Polylines

Page 20: GeoLocation using Google Maps JavaScript API v3

Polygon

Page 21: GeoLocation using Google Maps JavaScript API v3

Open an info window

Page 22: GeoLocation using Google Maps JavaScript API v3

Open an info window manual Width

Page 23: GeoLocation using Google Maps JavaScript API v3

Advance

Page 24: GeoLocation using Google Maps JavaScript API v3

My GeoLocation

GPS is must for this option.

Page 25: GeoLocation using Google Maps JavaScript API v3

Nearby Search Requests

Page 26: GeoLocation using Google Maps JavaScript API v3

Radar Search Requests

Page 27: GeoLocation using Google Maps JavaScript API v3

Directions API and Distance API

Page 28: GeoLocation using Google Maps JavaScript API v3

Status Codes

• ERROR: There was a problem contacting the Google servers.

• INVALID_REQUEST: This request was invalid.

• OK: The response contains a valid result.• OVER_QUERY_LIMIT: The webpage has

gone over its request quota.• NOT_FOUND The referenced location was

not found in the Places database.• REQUEST_DENIED: The webpage is not

allowed to use the PlacesService.• UNKNOWN_ERROR: The PlacesService

request could not be processed due to a server error. The request may succeed if you try again.

• ZERO_RESULTS: No result was found for this request.

Search Responses

Place Details Responses

• ERROR: There was a problem contacting the Google servers.

• INVALID_REQUEST: This request was invalid.

• OK: The response contains a valid result.• OVER_QUERY_LIMIT: The webpage has

gone over its request quota.• REQUEST_DENIED: The webpage is not

allowed to use the PlacesService.• UNKNOWN_ERROR: The PlacesService

request could not be processed due to a server error. The request may succeed if you try again.

• ZERO_RESULTS: No result was found for this request.

Page 29: GeoLocation using Google Maps JavaScript API v3

References•https://console.developers.google.com/•https://developers.google.com/maps/documentation/javascript/

•https://developer.mozilla.org/en-US/docs/Web/API/Geolocation

Page 30: GeoLocation using Google Maps JavaScript API v3

Any Questions ???

Page 31: GeoLocation using Google Maps JavaScript API v3