You are on page 1of 4

GPS

Introduction

Coordinates are used to express locations in the world. There are several
different coordinate systems.The one being used in Google Maps is the Word
Geodetic System 84 (WGS 84), which is the same system the Global Positioning
System (GPS) uses. The coordinates are expressed using latitude and longitude.
You can think of these as the y and x values in a grid.

The center of the world at latitude 0 and longitude 0 lays somewhere outside the west coast
of Africa

The coordinates are expressed using decimal numbers separated with a comma.
The latitude always precedes the longitude value (latitude, longitude). The
position for New York City, for example, is 40.714,-74.005. The positive value for
the latitude is because it resides north of the equator, and the negative value for
longitude is because it’s positioned west of the prime meridian

http://maps.googleapis.com/maps/api/geocode/xml?address=pondicheery&sensor=false
http://maps.googleapis.com/maps/api/geocode/json?address=Chennai&sensor=false
Directions
http://maps.googleapis.com/maps/api/directions/xml?
origin=chennai&destination=coimbatore&sensor=false

Directions Requests
A Directions API request is an HTTP URL of the following form:

http://maps.googleapis.com/maps/api/directions/output?parameters

where output may be either of the following values:


 json (recommended) indicates output in JavaScript Object Notation (JSON)
 xml indicates output as XML

The Directions API defines a directions request using the following URL parameters:

 origin (required) — The address or textual latitude/longitude value from which


you wish to calculate directions. *
 destination (required) — The address or textual latitude/longitude value from
which you wish to calculate directions.*
 mode (optional, defaults to driving) — specifies what mode of transport to use
when calculating directions. Valid values are specified in Travel Modes.
 waypoints (optional) specifies an array of waypoints. Waypoints alter a route by
routing it through the specified location(s). A waypoint is specified as either a
latitude/longitude coordinate or as an address which will be geocoded. (For more
information on waypoints, see Using Waypoints in Routes below.)

 alternatives (optional), if set to true, specifies that the Directions service may
provide more than one route alternative in the response. Note that providing route
alternatives may increase the response time from the server.
 avoid (optional) indicates that the calculated route(s) should avoid the indicated
features. Currently, this parameter supports the following two arguments:

o tolls indicates that the calculated route should avoid toll roads/bridges.
o highways indicates that the calculated route should avoid highways.

(For more information see Route Restrictions below.)

 units (optional) — specifies what unit system to use when displaying results.
Valid values are specified in Unit Systems below.
 region (optional) — The region code, specified as a ccTLD ("top-level domain")
two-character value. (For more information see Region Biasing below.)
 language (optional) — The language in which to return results. See the
supported list of domain languages. Note that we often update supported
languages so this list may not be exhaustive. If language is not supplied, the
Directions service will attempt to use the native language of the browser wherever
possible. See Region Biasing for more information.
 sensor (required) — Indicates whether or not the directions request comes from
a device with a location sensor. This value must be either true or false.

Travel Modes
When you calculate directions, you may specify which transportation mode to use. By
default, directions are calculated as driving directions. The following travel modes are
currently supported:
 driving (default) indicates standard driving directions using the road network.
 walking requests walking directions via pedestrian paths & sidewalks (where
available).
 bicycling requests bicycling directions via bicycle paths & preferred streets
(currently only available in the US).

Note: Both walking and bicycling directions may sometimes not include clear pedestrian
or bicycling paths, so these directions will return warnings in the returned result which
you must display to the user.

API key=AIzaSyAHpbzMaBUjJ-8ZbAczkH5cFoL4buPpiWU

Positional Elevation

http://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-
104.9847034&sensor=true_or_false

ElevationResponse>
<status>OK</status>

<result>

<location>
<lat>39.7391536</lat>
<lng>-104.9847034</lng>
</location>
<elevation>1608.6379395</elevation>
</result>
</ElevationResponse>

GPS device

You might also like