moshen / node-googlemaps

A simple way to query the Google Maps API from Node.js
MIT License
559 stars 148 forks source link

'REQUEST_DENIED' when using places method #12

Closed rahul closed 12 years ago

rahul commented 12 years ago

I created a server api key 'MY_KEY' with no server ip restriction for now. My code is as follows,

if(req.query['lat'] != undefined && req.query['lng'] != undefined) {
    var GoogleMaps = require('googlemaps')
    var util = require('util')

    GoogleMaps.places(req.query['lat'] + ',' + req.query['lng'], 1, MY_KEY, function(err, response) {
      console.log('here is the response')
      console.log(response) //{ html_attributions: [], results: [], status: 'REQUEST_DENIED' }
    }) 

Is this correct? Is there any other configuration that needs to be added?

moshen commented 12 years ago

That should be right. Have you double checked your configuration in: https://code.google.com/apis/console/ ?

The Places API has a separate switch to enable it:

Google being confusing

rahul commented 12 years ago

That did it. Thank you @moshen

moshen commented 12 years ago

Np. It's a little confusing that Maps v2, v3, Places, Static Maps and Street View are all enabled separately.