Thursday, January 06, 2011

Google Maps Javascript API V3 Geometry LibraryOne of the initial aims of V3 of the Google Maps API was to minimise the time it takes to load and display a Google Map. However if new features are added to the API and it grows in size the load time of the JavaScript grows as well.

The Google Maps team have therefore decided to implement libraries for the API. A library is a set of Maps API features that are only loaded when explicitly requested by the application. This request is added to the call to load the API, e.g.,

http://maps.google.com/maps/api/js?libraries=geometry

The Geometry Library is the first library to be added to the Google Maps API V3. The geometry library provides a set of utility functions for performing distance, heading, and area calculations in a spherical geometry, such as on the surface of the Earth, and also provides functions for handling encoded polylines.