Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
TypeError: AWS.Location is not a constructor

im writing a code for get a route between two point from "AWS Location". My issue is that AWS does not find "Location", but "Location" is in the documentation.

async function ruteador() {

        await credentials.getPromise();
        var params = {
          "DeparturePosition": [-122.7565,49.0021],
          "DestinationPosition": [-122.3394, 47.6159],
          "DistanceUnit": "Miles",
        }
        var location = new AWS.Location({region: AWS.config.region});
        location.calculateRoute(params, function(err, data) {
          if (err) console.log(err, err.stack); // an error occurred
          else     console.log(data);           // successful response
        });

      }

Also when i get CognitoCredentials, "new AWS.Cognito.." it´s work

const credentials = new AWS.CognitoIdentityCredentials({
        IdentityPoolId: identityPoolId,
      });

documentation of aws: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Location.html https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Location.html#calculateRoute-property

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!