0

I am trying to get elevation of clicked location via fetching elevation values from MapQuest elevation profile API

https://developer.mapquest.com/documentation/open/elevation-api/elevation-profile/get/

But I can't find the parameter of getting elevation of only one point not for a route; I mean latLng not latLngCollection.

Here is my code:

var myLocation = e.latlng;
      console.log(myLocation);
      fetch('http://open.mapquestapi.com/elevation/v1/profile?key=tHXSNAGXRx6LAoBNdgjjLycOhGqJalg7&shapeFormat=raw&latLngCollection='+myLocation)
      .then(r => r.json()) 
        .then(data => {
          var elevation = data;
          console.log(data);
    })

Is there is any way to get elevation for only one point?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.