Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

google geocode nodejs

// npm install request --save
var request = require("request");

exports.FindByKeyWord = function (req, res, next) {

    var API_KEY = "SOMEDATA";
    var BASE_URL = "https://maps.googleapis.com/maps/api/geocode/json?address=";

    var address = "1600 Amphitheatre Parkway, Mountain View, CA";

    var url = BASE_URL + address + "&key=" + API_KEY;

    request(url, function (error, response, body) {
        if (!error && response.statusCode == 200) {
            res.json(body);
        }
        else {
            // The request failed, handle it
        }
    });
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #google #geocode #nodejs
ADD COMMENT
Topic
Name
7+5 =