# map-distance

> get google maps travel time/distance in browser or node

Latest version **0.1.0** (published 2015-05-07) · 0 weekly downloads

## Install

```sh
npm install map-distance
pnpm add map-distance
yarn add map-distance
bun add map-distance
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-05-07 |
| First published | 2014-12-03 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | kepzorz |

## Links

- npm: https://www.npmjs.com/package/map-distance
- Repository: https://github.com/kepzorz/map-distance
- Homepage: https://github.com/kepzorz/map-distance#readme
- Issues: https://github.com/kepzorz/map-distance/issues
- npm.io page: https://npm.io/package/map-distance

## Dependencies (4)

- [tape](https://npm.io/package/tape.md) ^3.0.3
- [superagent](https://npm.io/package/superagent.md) ^0.21.0
- [load-script](https://npm.io/package/load-script.md) 0.0.5
- [event-emitter](https://npm.io/package/event-emitter.md) ^0.3.1

## Recent versions

- 0.1.0 (latest) — 2015-05-07
- 0.0.0 — 2014-12-03

## README

# map-distance

get the google maps distance between two points from node or the browser.

## example
`npm install map-distance`

```js
var distance = require("map-distance")

distance({
  from: "Seattle, WA",
  to: "San Francisco, CA",
  mode: "driving"
},
function(err, data){
  console.log(data)
  //=> { meters: 1299983, seconds: 44323 }
})
```

or for a more complex distance matrix:
```js
var distance = require("map-distance")

distance({
  from: ['seattle, wa', 'portland, or'],
  to: ['san francisco, ca', 'mukilteo, wa'],
  mode: 'driving'
}, 
function (err, data){   
  console.log(data[2])
  //=>  { meters: 1022915, seconds: 35330, from: 'portland, or', to: 'san francisco, ca' }
})
```


## in the browser

if you're using `map-distance` in the browser with browserify, including the google maps js library is optional. if it's not present when you call `distance()`, this module will load that library first.

## google maps terms of use
if you're into, like, rule-following: remember that google requires you display a map somewhere in your application if you use their distance API.

## license
MIT

---
_Source: https://npm.io/package/map-distance · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
