lc

location-client

Location service client ☁️

Showing:

Popularity

Downloads/wk

1

GitHub Stars

5

Maintenance

Last Commit

5mos ago

Contributors

2

Package

Dependencies

1

Size (min+gzip)

18.7KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Location Service Client ☁️

Install

# Even you can use npm: npm i -S location-client
yarn add location-client

Usage

Require client

const Service = require('location-client');

Create new service instance

You can get credentials click!

let service = new Service({name:'exceptional-lucky', token: 't6UoUezpcUaaXTx5AAAD'});

Add location

service.addLocation({
  key: `ownId`, // That param is for end developer uniq identifier.
  lat: 37.75153915304526,
  lon: 29.101365375671318
}, msg => {
  console.log(msg);
})
/*
  Out:
  {
    status: true,
    location: { lat: 37.75153915304526, lon: 29.101365375671318 }
   }
*/

Get nearby locations

service.nearby({
  lat: 37.75153915304526,
  lon: 29.101365375671318,
  depth: 1, // Default 1
  limit: 20 // Default 20
}, msg => {
  console.log(msg);
})
/*
  Out:
  { status: true,
    locations:
     [ { id: 2,
         latitude: 37.75153915304526,
         longitude: 29.10136537567132,
         distance: 0,
         token: 'ownId' } ],
    desired: { lat: 37.75153915304526, lon: 29.101365375671318 } }
*/

Delete location

service.deleteLocation({
  key: 'ownId',
}, msg => {
  console.log(msg);
})
/*
  Out:
  { status: true, message: 'Deleted location' }
*/

Delete user

service.deleteUser({}, msg => {
  console.log(msg);
})
/*
  Out:
  { status: true, message: 'Deleted user' }
*/

License

Çağatay Çalı

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100