This repository is forked from react-native-google-matrix which as forked from node-google-distance.
A simple wrapper for the Google Distance Matrix API that uses the fetch api and es6 syntax used in modern browsers and react native.
git clone https://github.com/SKalt/react-native-google-matrix.git [path/to/where/you/want/it]
or
git submodule add https://github.com/SKalt/react-native-google-matrix.git [path/to/where/you/want/it]
var distance = require('path/to/google-distance/dist/index.common.js');
or
import distance from 'path/to/google-distance/dist/index.mjs';
distance.get(
{
origin: '-7.841879,110.409193',
destination: '-7.741194,110.342588'
},
function(err, data) {
if (err) return console.log(err);
console.log(data);
});