简体   繁体   中英

How to get directions from node-googlemaps for node.js

I am trying to get this Google Maps directions on Node.js example to work for the last 24 hours, without any luck. I keep getting ·· √ OK » 2 honored (0.848s) .

I posted similar question before at Using node-googlemaps to get direction from google maps , trying my luck again hopefully I'll get some answers now that i have narrowed down my question.

After reading up on Node.js i have realized that Vows is a behavior driven development framework for Node.js.

Now i feel so stupid trying to run the test codes and thinking vow was just a fancy library the author has used to implement Google Map's Api.

Anyways here's the code to get directions between two coordinates:

var gm = require('googlemaps');
var util = require('util');

gm.config('key', '<insert your api key here>');
gm.directions('31.470656,74.412929', '31.470789,74.408619' , 
function(err, data){util.puts(JSON.stringify(data));});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM