Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-location

Package Overview
Dependencies
Maintainers
7
Versions
361
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-location

AWS SDK for JavaScript Location Client for Node.js, Browser and React Native

  • 3.41.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
327K
decreased by-16.42%
Maintainers
7
Weekly downloads
 
Created

What is @aws-sdk/client-location?

@aws-sdk/client-location is an AWS SDK for JavaScript package that allows developers to interact with the Amazon Location Service. This service provides capabilities for adding location-based features to applications, such as geocoding, reverse geocoding, tracking, and routing.

What are @aws-sdk/client-location's main functionalities?

Geocoding

This feature allows you to convert addresses or place names into geographic coordinates. The code sample demonstrates how to search for a place index using a text query.

const { LocationClient, SearchPlaceIndexForTextCommand } = require('@aws-sdk/client-location');

const client = new LocationClient({ region: 'us-west-2' });
const command = new SearchPlaceIndexForTextCommand({
  IndexName: 'ExamplePlaceIndex',
  Text: 'Seattle'
});

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

Reverse Geocoding

This feature allows you to convert geographic coordinates into addresses or place names. The code sample demonstrates how to search for a place index using geographic coordinates.

const { LocationClient, SearchPlaceIndexForPositionCommand } = require('@aws-sdk/client-location');

const client = new LocationClient({ region: 'us-west-2' });
const command = new SearchPlaceIndexForPositionCommand({
  IndexName: 'ExamplePlaceIndex',
  Position: [-122.335167, 47.608013]
});

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

Tracking

This feature allows you to track the position of devices in real-time. The code sample demonstrates how to update the position of a device in a tracker.

const { LocationClient, BatchUpdateDevicePositionCommand } = require('@aws-sdk/client-location');

const client = new LocationClient({ region: 'us-west-2' });
const command = new BatchUpdateDevicePositionCommand({
  TrackerName: 'ExampleTracker',
  Updates: [
    {
      DeviceId: 'Device1',
      Position: [-122.335167, 47.608013],
      SampleTime: new Date().toISOString()
    }
  ]
});

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

Routing

This feature allows you to calculate routes between two geographic locations. The code sample demonstrates how to calculate a route between a departure position and a destination position.

const { LocationClient, CalculateRouteCommand } = require('@aws-sdk/client-location');

const client = new LocationClient({ region: 'us-west-2' });
const command = new CalculateRouteCommand({
  CalculatorName: 'ExampleRouteCalculator',
  DeparturePosition: [-122.335167, 47.608013],
  DestinationPosition: [-122.3321, 47.6062]
});

client.send(command).then(
  (data) => console.log(data),
  (error) => console.error(error)
);

Other packages similar to @aws-sdk/client-location

FAQs

Package last updated on 11 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc