Skip to content

Search destination by name, address, point of interest or coordinates

Notifications You must be signed in to change notification settings

kolegm/search-destination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##search-destination ###General Node.js module for geocoding and reverse geocoding.
Search geographic destination by name or address, by location or point of interest, by coordinates.

###Installation

npm install search-destination [-S]

###Used external modules as communicators for searching

Usage example

// initialize searcher instance
var searcher = require('search-destination');

// request parameters
const ADDRESS = 'Paris';
const LATITUDE = '48.833330';
const LONGITUDE = '2.333330';
const LANGUAGE = 'en';

// you can use Google options to manage result format
var options = {
  language: LANGUAGE
}

// use callback to return result from geocoding process
function callback (error, result) {
  if (error) console.log(error); // on error
  else console.log(result); // on success
}

/**
 * used google by default.
 * available: google, geonames, wiki (alias to geonames), osm (open street map)
 */
//searcher.useProvider('wiki');

// show information about searcher instance
console.log(searcher.toString());

// search deatination by address, place. or poi
searcher.search(ADDRESS, callback, options);
// search deatination by geographical coordinates
searcher.reverse(LATITUDE, LONGITUDE, callback, options);

About

Search destination by name, address, point of interest or coordinates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published