Socket
Socket
Sign inDemoInstall

geolocation-360

Package Overview
Dependencies
1
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    geolocation-360

A library for getting coordinates from mobile country code(MCC), mobile network code(MNC), location area code(LAC) and Cell ID(CID)


Version published
Weekly downloads
5
decreased by-37.5%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

geolocation-360

A library for getting coordinates from mobile country code(MCC), mobile network code(MNC), location area code(LAC) and Cell ID(CID).

Node package

Using npm:

$ npm i --save geolocation-360

In Node.js:

var geolocation = require('geolocation-360');

Code examples

Initialization

var init = {
	googleApiKey: 'google api key',
	openCellIdApiKey: 'open cell id token',
	mcc: '515', //supply for default value
	mnc: '03', //supply for default value
};

geolocation.initialize(init);
Requests
var params = {
	lac: '2b0c',
	cid: '7be7',
	mcc: '515', //will use default value on init if not supplied
	mnc: '05', //will use default value on init if not supplied
};

//will use requests available in order of api key provided
geolocation.request(params, (error, result) => {
	if (result) {
		//prints
		//{
		//	provider: 'GooglePrimitive | Google | OpenCellId',
		//	latitude: 14.498896,
		//	longitude: 121.003997
		//}
		console.log(result);
	} else {
		//prints `Provider` error: `Provider`: usageLimits | `error message`
		console.log(error);
	}
});

geolocation.requestGooglePrimitive(params, (error, result));
geolocation.requestGoogle(params, (error, result));
geolocation.requestOpenCellId(params, (error, result));

Keywords

FAQs

Last updated on 31 Oct 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc