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);
No momento, as promessas são aceitas apenas em getPlacePredictions(). ↩
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-27 UTC."],[[["\u003cp\u003eAsynchronous methods within the Google Maps JavaScript API predominantly return Promises for efficient handling of operations.\u003c/p\u003e\n"],["\u003cp\u003eNumerous Google Maps services, including Directions, Distance Matrix, Elevation, Geocoder, and Streetview, utilize Promises in their methods.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can employ async/await, then/catch/finally, or traditional callbacks to manage asynchronous operations and responses effectively.\u003c/p\u003e\n"],["\u003cp\u003eWhile Places generally do not utilize Promises, the \u003ccode\u003egetPlacePredictions()\u003c/code\u003e method within the Places AutocompleteService does offer partial Promise support.\u003c/p\u003e\n"],["\u003cp\u003eBeginning in 2020, all newly introduced APIs within the Google Maps JavaScript API exclusively support Promises for asynchronous operations.\u003c/p\u003e\n"]]],[],null,[]]