Giter VIP home page Giter VIP logo

mapquest's Introduction

mapquest

Geocode, reverse geocode, and batch geocode using MapQuests open api.

Installation via component

$ component install trevorgerhardt/mapquest

Installation via npm

$ npm install mapquest

Location Object

All functions return a location object. An example location object for the Google Headquarters is below.

{ 
  latLng: { 
    lng: -122.086672, 
    lat: 37.423581 
  },
  adminArea4: 'Santa Clara County',
  adminArea5Type: 'City',
  adminArea4Type: 'County',
  adminArea5: 'Santa Clara',
  street: '1600 Amphitheatre Parkway',
  adminArea1: 'United States of America',
  adminArea3: 'California',
  type: 's',
  displayLatLng: { 
    lng: -122.086672, 
    lat: 37.423581 
  },
  linkId: 0,
  postalCode: '94043',
  sideOfStreet: 'N',
  dragPoint: false,
  adminArea1Type: 'Country',
  geocodeQuality: 'ADDRESS',
  geocodeQualityCode: 'L1AXA',
  mapUrl: 'http://open.mapquestapi.com/staticmap/v4/getmap?type=map&size=225,160&pois=purple-1,37.423581,-122.086672,0,0|&center=37.423581,-122.086672&zoom=12&key=Kmjtd%7Cluu7n162n1%2C22%3Do5-h61wh&rand=2110607258',
  adminArea3Type: 'State' 
}

API

.geocode(address, callback)

Given an address, passes the callback a location object.

mapquest.geocode('1600 Amphitheatre Parkway, Santa Clara CA 94043', function(err, location) { console.log(location); });

.reverse(coordinates, callback)

Given a coordinates object containing latitude and longitude, passes the callback a location object.

mapquest.reverse({ latitude: 37.423581, longitude: -122.086672 }, function(err, location) { console.log(location); });

.batch(addresses, callback)

Given an array of addresse, passes the callback an array of location objects.

mapquest.batch([ '1600 Amphitheatre Parkway, Santa Clara CA 94043' ], function(err, locations) { console.log(locations); });

License

MIT

mapquest's People

Contributors

adamnengland avatar trevorgerhardt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.