I am trying to get the height of the point in the coordinates to perform the calculations. The result is supposed to be placed in the text field. By the way, the server response is not processed, however. Even before sending a request to the server, an error occurs that lat is an unknown attribute. For everyone: the browser is Google Chrome. Please help me understand the reason.
<html> <head> <title>some_title</title> </head> <body> <b>Результат</b><br> <textarea cols="150" rows="50" id="result" value=""></textarea> <br> </body> <script src="https://maps.googleapis.com/maps/api/js?key=apiKey&libraries=geometry,elevation"></script> <script> var requestToServer = new XMLHttpRequest(); requestToServer.onreadystatechange = answerReciever; var elevator = new google.maps.ElevationService; elevator.getElevationForLocations([{lat:63.333, lng:-150.5}]); function answerReciever(response){ var d = new Date(); document.getElementById('result').value += d.toString() + '\n'; } </script> </html>
requestToServer, but do not start sending. 2 - createelevator, not enough brackets, it should be like thisnew google.maps.ElevationService()- Stepan Kasyanenko