The document discusses the Google Maps API which provides over 150 features for adding maps and mapping capabilities to web and mobile applications. It covers core map components like controls, overlays, and layers as well as services for geocoding, directions, elevation, street view and places. It also discusses customizing maps with styles, icons and tilt/heading controls as well as using the API across different languages and platforms. The document provides examples of common API tasks like placing markers, handling user input and clustering large datasets.
18. var input = document.getElementById('input');
var autocomplete = new google.maps.places.Autocomplete(input);
autocomplete.bindTo('bounds', map);
google.maps.event.addListener(
autocomplete,
'place_changed',
function() {
var place = autocomplete.getPlace();
...
}
);
24. var service = new google.maps.DirectionsService();
var request = {
origin: from,
destination: to,
travelMode: google.maps.TravelMode.DRIVING
};
service.route(request, function(response, status) {
...
});
32. var service = new google.maps.ElevationService();
var options = {
path: latLngs,
samples: 256
};
service.getElevationAlongPath(
options,
plotElevation
);
function plotElevation(results) {
...
});
67. var units = google.maps.weather.TemperatureUnit.FAHRENHEIT;
new google.maps.weather.WeatherLayer({
temperatureUnits: units,
map: map
});
new google.maps.weather.CloudLayer({
map: map
});
77. var data = [
new google.maps.LatLng(37.782551, -122.445368),
new google.maps.LatLng(37.782745, -122.444586),
new google.maps.LatLng(37.782842, -122.443688),
...
];
new google.maps.visualization.HeatmapLayer({
data: data
});