Announcement: New basemap styling is coming soon to Google Maps Platform. This update to map styling includes a new default color palette, modernized pins, and improvements to map experiences and usability. All map styles will be automatically updated in March 2025. For more information on availability and how to opt in earlier, see New map style for Google Maps Platform.
constelevationService=google.maps.ElevationService();constlocations=[{lat:27.986065,lng:86.922623}];constcallback=(results,status)=>{if(status==='OK'){console.log(results);}else{// handle this case}};elevationService.getElevationForLocation({locations},callback);
Currently Promises are only supported in getPlacePredictions(). ↩
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-29 UTC."],[[["Asynchronous methods within the Google Maps JavaScript API predominantly return Promises for efficient handling of operations."],["Numerous Google Maps services, including Directions, Distance Matrix, Elevation, Geocoder, and Streetview, utilize Promises in their methods."],["Developers can employ async/await, then/catch/finally, or traditional callbacks to manage asynchronous operations and responses effectively."],["While Places generally do not utilize Promises, the `getPlacePredictions()` method within the Places AutocompleteService does offer partial Promise support."],["Beginning in 2020, all newly introduced APIs within the Google Maps JavaScript API exclusively support Promises for asynchronous operations."]]],[]]