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

reverse-geocoding

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reverse-geocoding

Reverse Geocoding for a Latitude and Longitude by Async.

  • 3.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
285
increased by6.34%
Maintainers
1
Weekly downloads
 
Created
Source

reverse-geocoding

Reverse Geocoding for a Latitude and Longitude by Async.

bitHound Overall Score Inline docs Build Status Coverage Status

Features

  • Custom Params
  • Custom Proxy
  • Google Maps & Baidu Maps Support

Examples

Basic

var geocoding = new require('reverse-geocoding');
var config = {
    'latitude': 40.00403611111111,
    'longitude': 116.48485555555555
};
geocoding(config, function (err, data){
	if(err){
		console.log(err);
	}else{
		console.log(data);
	}
});

Custom Proxy

var geocoding = new require('reverse-geocoding');
var config = {
    'latitude': 40.00403611111111,
    'longitude': 116.48485555555555,
    'options': {
        'host': 'proxy.zhso.net',
        'port': 8080,
        'protocol': 'http:',
        'method': 'GET',
        'headers': {
            'Proxy-Authorization': 'Basic ' + new Buffer('username:password').toString('base64')
        }
    }
};
geocoding(config, function (err, data){
	if(err){
		console.log(err);
	}else{
		console.log(data);
	}
});

Custom Params

var geocoding = new require('reverse-geocoding');
var config = {
    'latitude': 40.00403611111111,
    'longitude': 116.48485555555555,
    'language': 'zh-cn'
};
geocoding(config, (err, data) => {
	console.log(err ? err : data);
});

Callback Data Format Sample (Base By Google Maps or Baidu Maps API)

{
	"formattedAddress": "",
	"streetAddress": "",
	"route": "",
	"intersection": "",
	"political": "",
	"country": "",
	"administrativeAreaLevel1": "",
	"administrativeAreaLevel2": "",
	"administrativeAreaLevel3": "",
	"administrativeAreaLevel4": "",
	"administrativeAreaLevel5": "",
	"colloquialArea": "",
	"locality": "",
	"ward": "",
	"sublocality": "",
	"neighborhood": "",
	"premise": "",
	"subpremise": "",
	"postalCode": "",
	"naturalFeature": "",
	"airport": "",
	"park": "",
	"pointOfInterest": ""
}

Keywords

FAQs

Package last updated on 18 Aug 2019

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