user62089
user62089

Reputation: 561

Google API V3: computeOffset function

I would like to know the units of measurement for the ComputeOffset function in the geometry library in Google Maps API V3.

The documentation says

computeOffset(from:LatLng, distance:number, heading:number, radius?:number)

I can see that heading is in degrees. In what units is the distance. What is the use of the optional radius?

Any help is appreciated.

Upvotes: 5

Views: 1209

Answers (1)

geocodezip
geocodezip

Reputation: 161334

The distance is in meters.

radius is defined in the first method listed.

The radius defaults to the Earth's radius in meters

If you change the radius to be in other units (like miles), the answer will be in those units.

Upvotes: 1

Related Questions