Giter Club home page Giter Club logo

google-maps-services-js's People

Contributors

amithbs1 avatar amuramoto avatar annahassel avatar arriolac avatar artofspeed avatar avin-kavish avatar daddywarbucks avatar darapsas avatar dependabot-preview[bot] avatar dependabot[bot] avatar googlemaps-bot avatar jpoehnelt avatar kf6kjg avatar mlegy avatar monajafi avatar oscarbarrett avatar r1sim avatar samcb avatar samlythemanly avatar sarahmaddox avatar scimonster avatar semantic-release-bot avatar shahmirn avatar sim642 avatar stephenfarrar avatar stephenmcd avatar sverps avatar tqhoughton avatar usefulthink avatar yfr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-maps-services-js's Issues

Sourcing only required module

Hi all,

Please consider this as a suggestion.

One of our microservices uses only geocoder hence I was trying to see if I could only source the required script.

Something like:

const Geocode = import "@google/maps/geocode"

What do you think?

Memory issue in node application

Hey guys,

I'm using this library v0.3.1 in a node v6.9.5 application. Actually the application runs inside docker container but I'm able to reproduce the problem with following script. The script is

'use strict';

const googleMapsClient = require('@google/maps').createClient({
  key: '...'
});

setInterval(() => {
  googleMapsClient.geocode({
    address: '1600 Amphitheatre Parkway, Mountain View, CA'
  }, function(err, response) {
    if (!err) {
      console.log(response.json.results[0].formatted_address);
    }
  });
}, 2000);

and I see memory increasing as every new address gets geocoded. Is it supposed to increase like this or am I doing something in a wrong way? Memory heap snapshots are here Heap.zip

place/queryautocomplete vs. place/autocomplete

Thank you for this module.

placesAutoComplete seems to work great, but when I was looking for query autocomplete

https://developers.google.com/places/web-service/query

and according to that page, the url to call is "/place/queryautocomplete/"

https://maps.googleapis.com/maps/api/place/queryautocomplete/output?parameters

which appears to be the same as here for "Places"

https://github.com/googlemaps/google-maps-services-js/blob/master/lib/apis/places.js#L191

On this page for place autocomplete

https://developers.google.com/places/web-service/autocomplete

the url called is "/place/autocomplete/"

https://maps.googleapis.com/maps/api/place/autocomplete/output?parameters

Are they mixed up? Are they interchangeable?

Error flow not working as expected

Thanks for providing a formal Node.js Client library for Google Maps Services 👍

But, I ended up wasting many hours to find out why my geocoding API calls stopped working suddenly with no error :-(

Investigating into it, found that instead of an error, the response had this:

{ error_message: 'Browser API keys cannot have referer restrictions when used with this API.',
results: [],
status: 'REQUEST_DENIED' }

Given there is an error(err) object in the callback function, shouldn't that be set as well for proper error handling instead of sticking the error message just to the response object?

// Geocode an address.
googleMapsClient.geocode({
  address: '1600 Amphitheatre Parkway, Mountain View, CA'
}, function(err, response) {
  if (!err) {
    console.log(response.json.results);
  }
});

.directions not allowing 'traffic_model' param

I am able to make a request and get a response just fine omitting this parameter. However, including 'traffic_model: ''' does not work, and results in the generic 'InvalidValueError'. can be any of the available options (pessimistic, optimistic, best_guess)

"use strict" errors are suppressed

When I use the library in Node and do something like

"use strict";
googleMapsClient.geocode({ address: 'Sesame Street 1' }, function(err, result) {
   raise_ReferenceError = true;
});

the ReferenceError that would normally be raised is caught by the Maps Lib. This is very annoying because it hides errors that are explicitly requested by "use strict". Maybe I get some fundamental point wrong here but right now I think the error handling of the maps module should detect "use strict" errors and throw them.

Places API returns different result when using type

When type: 'restaurant' is added to the query, the result is completely different.

For example

client.places({
        query: 'Helena\'s',
        language: 'en',
        location: [21.4389123,-158.0000565],
        radius: 5000
})

returns (some fields removed for clarity):

{
     formatted_address: '1240 N School St, Honolulu, HI 96817, United States',
     geometry:
      { location: { lat: 21.3309439, lng: -157.8650871 },
     id: 'cd54478b5f6e13b50b181dda17b6201b4c190ba0',
     name: 'Helena\'s Hawaiian Food',
     place_id: 'ChIJ-aNpcIduAHwRlVpxYVxnvxs',
     types: [ 'restaurant', 'food', 'point_of_interest', 'establishment' ]
}

Whereas

client.places({
        query: 'Helena\'s',
        language: 'en',
        location: [21.4389123,-158.0000565],
        radius: 5000,
        type: 'restaurant'
})

returns:

{
      formatted_address: '95-1840 Meheula Pkwy, Mililani, HI 96789, United States',
      geometry:
       { location: { lat: 21.4680956, lng: -158.0023998 },
      id: 'ad5b2180a1119d6be0005f51eb8111116ca03769',
      name: 'Mililani Mauka Chinese Cuisine',
      place_id: 'ChIJVQGveXZnAHwRnvJ_xnrSS5w',
      types: [ 'restaurant', 'food', 'point_of_interest', 'establishment' ]
}

If using type: 'food', it correctly returns "Helena's Hawaiian Food"

Thanks

InvalidValueError('missing property "' + key + '"');

class Places {
    constructor (key) {
        this.client = require('@google/maps').createClient({ key });
    }

    getDetails (placeId) {
        return this.client.place({ placeId }).asPromise();
    }
}

const places = new Places(API_KEY);
places.getDetails('ChIJj0YI_QPj20ARuhrB8tXzHAo')
    .then(console.log)
    .catch(console.error);
throw new InvalidValueError('missing property "' + key + '"');
          ^
Error
    at new InvalidValueError (/home/gureev_cr/repos/matchplayer-backend/node_modules/@google/maps/lib/internal/validate.js:23:17)
    at Object.validator (/home/gureev_cr/repos/matchplayer-backend/node_modules/@google/maps/lib/internal/validate.js:83:17)
    at Object.place (/home/gureev_cr/repos/matchplayer-backend/node_modules/@google/maps/lib/index.js:51:25)
    at Places.getDetails (/home/gureev_cr/repos/matchplayer-backend/server/services/Places.js:48:28)
    at Object.<anonymous> (/home/gureev_cr/repos/matchplayer-backend/server/services/Places.js:54:8)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

Process finished with exit code 1

Add instructions for `asPromise()` to documentation

I could not find in the documentation how to properly use promises after initializing the client with a promise constructor. I, luckily, found a reference in an issue about something else.

It would be helpful to edit this line in the "Making API requests" part of the documentation:
NOTE: Promises are only available if you supply a Promise constructor to the createClient() method.

Something along the lines of:
NOTE: Promises are only available if you supply a Promise constructor to the createClient() method. You must also chain .asPromise() to the method before any .then() or .catch() methods.

I would be happy to make this change. Should I open a PR?

Thanks!

Support for Places Nearby Search

From the documentation there is the ability to perform a nearby search within the Places api:
https://developers.google.com/places/web-service/search

From the code: places.js and tests I was unable to find a way to use nearby search.

Here is what I would like to do:

googleMapsClient.places({
        location: [-33.8670522,151.1957362],
        rankby : 'distance',
        type: 'restaurant',
        name:'cruise'
    },function(err, response) {
        if (!err) {
            console.log(response.json.result);
        }
    });

Is this something you would be willing to add in or is there another way? I can provide a pull request.

Also, I understand this can be done with the text search request. The issue is that the text search has a quota multiplier:
That is, each Text Search request that you make will count as 10 requests against your quota

Additional Reference

The nearby search api url is as follows:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&type=restaurant&name=cruise&key=YOUR_API_KEY

Temp Solution

I have just added the following to places.js, to get my use case working:

exports.places = {
  url: 'https://maps.googleapis.com/maps/api/place/nearbysearch/json',
  validator: v.object({
    location: utils.latLng,
    radius: v.optional(v.number),
    rankby : v.optional(v.string),//prominence, distance,
    type : v.optional(v.string),
    name : v.optional(v.string),
    keyword : v.optional(v.string),
    language: v.optional(v.string),
    minprice: v.optional(v.number),
    maxprice: v.optional(v.number),
    opennow: v.optional(v.boolean),
    pagetoken: v.optional(v.string),
    retryOptions: v.optional(utils.retryOptions),
    timeout: v.optional(v.number)
  })
};

LatLngBounds not supported in geocoder ?

When trying to set bounds to find a street in Hamburg and not the Bering Strait (Sea), I don't get any response from geocoder.

{ address: 'behringstraße',
language: 'de-DE',
region: 'de',
bounds:	{ 
	northeast: { lat: 53.5760189802915, lng: 9.841728980291503 },
	southwest: { lat: 53.5733210197085, lng: 9.839031019708498 }
	} 
}

As I don't use Promises, I can not see what's going wrong inside callback function.

So basically, are LatLngBounds not supported in Node.js client?

Inaccurate timezone offset when using GoogleMapsAPI.timezone

Problem

When making a timezone request with GoogleMapsAPI.timezone, the returned timezone offset is incorrect.

Potential Cause

It seems the provided timestamp is shortened/rounded to 7 digits before hitting the API.

Example

This method call:

googleMapsClient.timezone({
  location: "51.47060013,-0.46194100",
  timestamp: 1481714646
});

Invokes this API request:

GET https://maps.googleapis.com/maps/api/timezone/json?location=51.47060013%2C-0.46194100&timestamp=1481715&key=API_KEY
{
  "dstOffset": 0,
  "rawOffset": 3600, // Incorrect
  "status": "OK",
  "timeZoneId": "Europe/London",
  "timeZoneName": "GMT+01:00"
}

As you can see the timestamp gets rounded and as a result the returned offset is incorrect. If I pass the timezone directly to the API then the correct offset is returned.

GET https://maps.googleapis.com/maps/api/timezone/json?location=51.47060013,-0.46194100&timestamp=1481714646&key=API_KEY
{
    "dstOffset": 0,
    "rawOffset": 0,
    "status": "OK",
    "timeZoneId": "Europe/London",
    "timeZoneName": "Greenwich Mean Time"
}

Keep alive issue

If been using the directions and the geocoding calls to the Maps API and both of them seem to have an issue. after firing a request and handling the response node doesn't exit the script due to the keep alive's in the response. isn't there a way to manipulate the request in a way, that the connection is not kept alive, or a call to actively close the connection (process.exit is not an option)

Retrying on 'OVER_QUERY_LIMIT' obfuscates errors

I had a major issue with our product today when all of our app's requests were timing out and we couldn't figure out why.

After fixing the issue and looking for the root cause, we pinpointed it down to the fact that if the request results in a OVER_QUERY_LIMIT error, this library will keep trying to make a request until it doesn't result in an error or it times out (at 60 seconds). Because our routing mechanism timed out at 30 seconds, this library never showed an error and the request simply timed out silently, even though Google's API was getting blasted with retries.

Given that it is extremely likely that if an OVER_QUERY_LIMIT response is returned it will be most likely returned again within the 60 second timeout window, would it be sensible to not try to make the request again?

This is the line in question.

Can't find module

As you can see, the package is installed to node_modules, yet, require can't find it.

NPM version: 3.8.3

screen shot 2016-10-31 at 1 54 36 pm

Query: Google maps with Typescript

Is there a way to use this library with Typescript? I tried installing the @typings/google-maps but couldn't get it to work. Any direction appreciated. Thank you.

CORS support

Any ideas how to solve CORS restrictions?
Code below throws "No 'Access-Control-Allow-Origin' header is present on the requested resource." Key is correct. Outside of my app I see the correct json-response. It doesn't work with localhost (webpack-dev-server with correct headers settings), and the same issue with production server.

const googleMapsClient = require('@google/maps').createClient({
    key: API_KEY
});

const getTest = () => {
        googleMapsClient.placesNearby({
                radius: 100,
                type: 'city_hall,museum',
                location: '59.922329,30.22241'
        }, function(err, response) {
            if (!err) {
                console.log(response.json());
            }
        });
}

CORS error (No 'Access-Control-Allow-Origin') while using direction api

on cli direction api is working fine but if i call it from a program it doesn't work. it gives me an error on console of browser.

# error:
Fetch API cannot load https://maps.googleapis.com/maps/api/directions/json?destination=12.9766%2C…origin=12.9097695%2C77.6814536&key=AIzaSyCUJND4EXkdBpb0BTE_TURO1dEAb5PPf8. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
TypeError: Failed to fetch

# call-
var googleMapsClient = require('@google/maps').createClient({
key: 'AIzaSyCUJND4EXkdBpb0BTE_TURO1dEAb5PPf8'
});

googleMapsClient.directions({
origin: '12.9097695,77.6814536',
destination: '12.9766,77.5993',

}, function(err, response) {
if (!err) {
console.log(response.json.results);
}
else{
console.log(err);
}
});

How to pass in withCredential?

When using this in angular 2 app, I get this error. How do I pass in withCredential: false?

A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost:4200' is therefore not allowed access. The credentials mode of an XMLHttpRequest is controlled by the withCredentials attribute.

[question] What does `timeout` really mean?

I have a script that makes a lot of google maps API calls (geocoding). Requests are made less than 50 times a second (50 is a Google Maps API limit). After a minute or so, google-maps-services-js starts to returning an error: timeout.

I've dug into sources, and I found that this happens in the make-api-calls.js external module. Does timeout simply mean that a request was sent to the Google Maps API but no response was returned?

I have a poor internet connection. Is it possible that this is the reason and I should simply make less API calls per second and increase the timeout limit (passing a timeout parameter to the client)?

Can't install the npm package

Hello, i currently have the npm version 3.10.9 and as i tried to install the package using the sugested command npm install @google/maps i get the following error:

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.2.1/bin/node" "/usr/local/bin/npm" "install" "@google/maps"
npm ERR! node v6.2.1
npm ERR! npm  v3.10.9
npm ERR! code E404

npm ERR! 404 no such package available : @google/maps
npm ERR! 404
npm ERR! 404  '@google/maps' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Am i missing something? Is the npm version not right?

[fixed, no bug] No response place details

When requesting details for a place using:

`
const googleMapsClient = require('@google/maps').createClient(
{
key: '[my key]'
}
)

`

const googleMapsClientplace = googleMapsClient.place({ placeid: 'fbd360e5d31edc4b889f19daa70cf802f483f0a2' }, function(err, response) { if (!err) { const details = response.json.results; console.log('place details: ' + details) reply.view('location', { details: details }) } });

Whatever the placeid I declare, no response is returned.

Doing a places search however, does return a results list:
const gPlaceslookup = googleMapsClient.places({ query: 'supermarket', location: locatie }, function(err, response) { if (!err) { const locations = response.json.results; console.log(response.json.results); reply.view('index', { locations: locations }) } });

What seems to be going on here?

EDIT: my bad, it was a conflict in hapi.

Edit 2: the keen observer noticed I used this for the place response:
const details = response.json.results;

This shouldn't be plural, but just

const details = response.json.result;

Cannot read property 'latest' of undefined

Hi,

npm install is failing due to https://registry.npmjs.org/google/maps is an empty JSON. This is the stack trace output.

npm http 404 https://registry.npmjs.org/google/maps npm ERR! TypeError: Cannot read property 'latest' of undefined npm ERR! at next (/usr/local/Cellar/node/0.10.21/lib/node_modules/npm/lib/cache.js:687:35) npm ERR! at /usr/local/Cellar/node/0.10.21/lib/node_modules/npm/lib/cache.js:675:5 npm ERR! at saved (/usr/local/Cellar/node/0.10.21/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:142:7) npm ERR! at /usr/local/Cellar/node/0.10.21/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:133:7 npm ERR! at Object.oncomplete (fs.js:107:15) npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <[email protected]>

Access to Google Maps Javascript Geometry Library?

I'm interested in using the containsLocation method of the Google Maps Javascript Geometry Library, but this is more of a general question regarding how to access any of the Google Maps APIs not listed in this project.

I initially tried to use a require statement in my Node,js file, using the source url as is listed on the Javascript libraries Overview page. That didn't work so I then attempted to use node's vm module like so:

var fs = require("fs")
var http = require("http");
var vm = require('vm')

http.get("http://maps.googleapis.com/maps/api/js?key=my-key&libraries=geometry", function(res) {
  var rawData = "";
  res.on('data', function(data) {
    rawData += data;
  });
  res.on('end', function() {
    vm.runInThisContext(rawData);
  });
});

That didn't work either because of window not being defined in Node. My next approach was to try and understand how this Node.js client library makes calls to the APIs supported. I looked in the source code under /lib/apis/road.js as an example and it seems like each function belonging to that API has its own url and configurations used for the makeUrlRequest function inside /lib/interal/make-url-request.js. So I attempted to find an equivalent geometry.googleapis.com url inside the Javascript source file but none existed.

How would I be able to make a get/post request (and what url to use) in order to get the same results as the containsLocation function?

Should we be using promises ?

Promises are the new hotness. They're superior.
And we want our client library to be the new hotness too.

I've just written one test, that uses the client library without promises. 2360d93
It's gross. I really dislike the asymmetry between success (callback) and error (event listener).

Problems:

  • Browser support for Promises is poor.
  • I'm not sure if nodejs is moving in the promises direction.
  • There are many polyfills out there... we would probably need to let the developer choose which one to use.

CORS error

CORS error with a distancematrix request. But geocoder request works fine. What am I missing?

Fetch API cannot load https://maps.googleapis.com/maps/api/distancematrix/json?destinations=New%2…%20Lake%20City%2C%20UT%2084116&key=AIzaSyAaXJs0ZDx3rjhxrsjUO6pT7WU2yNI. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Language codes

Where can I get the language codes ("en", "fr", etc) supported by google maps if I want to use them in direction services api?

Is it possible to change the base url?

I need to replace https://maps.googleapis.com with http://maps.google.cn.
My code:

var geocodeApi = require('@google/maps/lib/apis/geocode');
geocodeApi.geocode.url = geocodeApi.geocode.url.replace('maps.googleapis.com', 'maps.google.cn');
geocodeApi.reverseGeocode.url = geocodeApi.reverseGeocode.url.replace('maps.googleapis.com', 'maps.google.cn');
var googleMapsClient = require('@google/maps').createClient({
key: 'my api key'
});

it works, but looks not an elegant way, is it possible to pass the base url var the options argument?

Place query hangs indefinitely on certain place_id

For some strange reason, the following place_id hang silently and indefinitely for a place query. 32,000 succeeded fine. I don't know how to trap for the error. For me, it is consistently repeatable.

Using version 0.3.1 -- I didn't test an earlier release

const query = {
    placeid: 'EiJNYWdocmViLCA1NSBBZ2FkaXIsIFNhbMOpLCBNb3JvY2Nv' // any of the following place_id
};
googleMapsClient.place(query, (err, res) => {});

using any of the following place_id

const place_id = [
    'EiJNYWdocmViLCA1NSBBZ2FkaXIsIFNhbMOpLCBNb3JvY2Nv',
    'EitNYWdocmViLCA1NCBCb3VsZXZhcmQgQWhmaXIsIE91amRhLCBNb3Jv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FyYW1hbiwgVHVya2V5',
    'EitNYWdocmViLCA1NiBSdWUgQXppbGFsLCBDYXNhYmxhbmNhLCBNb3JvY2Nv',
    'EiZNYWdocmViLCA1NiBSdWUgQXppbGFsLCBOYWRvciwgTW9yb2Njbw',
    'EiVNYWdocmViLCA0OCBSdWUgQXpyb3UsIFJhYmF0LCBNb3JvY2Nv',
    'EipNYWdocmViLCA0OCBSdWUgQXpyb3UsIE91YXJ6YXphdGUsIE1vcm9jY28',
    'ChIJaymoi6H1bEcRvQv_wcAe2bY',
    'ChIJe1BroqX1bEcRgBX_dafouAw',
    'ChIJmemZA_iNp0cRO7ySwbgBtdQ',
    'EkxUcnVuZyDEkMO0bmcsIMOHYXZ1xZ9sdSBNYWhhbGxlc2ksIEFua2FyYSBCYWxhIFlvbHUsIMOHYW5rYXlhL0Fua2FyYSwgVHVya2V5',
    'ElJUcnVuZyDEkMO0bmcsIEJhbGzEsSBNYWhhbGxlc2ksIEJhbGzEsSBLw7Z5w7wgxLDDpyBZb2x1LCBNYWxrYXJhL1Rla2lyZGHEnywgVHVya2V5',
    'EkhUcnVuZyDEkMO0bmcsIEJhbGzEsSBLw7Z5w7wgWW9sdSwgQmFsbMSxIEvDtnnDvC9VbHVkZXJlL8WexLFybmFrLCBUdXJrZXk',
    'ElZUcnVuZyDEkMO0bmcsIEJhbHDEsW5hciBLw7Z5w7wgWW9sdSwgQmFscMSxbmFyIEJlbGVkaXllc2kvQmF0bWFuIE1lcmtlei9CYXRtYW4sIFR1cmtleQ',
    'ChIJr33-GkkmzEAR203ZNme6tjc',
    'EmxUcnVuZyDEkMO0bmcsIEhhdGlwbGVyIE1haGFsbGVzaSwgQmFsdmVyZW4gS8O2ecO8IFlvbHUsIEJhbHZlcmVuIEJlbGVkaXllc2kvxZ7EsXJuYWsgTWVya2V6L8WexLFybmFrLCBUdXJrZXk',
    'ChIJOY2xfjhZIpQR_bkYu2G1acU',
    'ChIJ03fYmaO0GgcRLJ_N_L54dog',
];

Add request URL to response

We use the google maps services to geocode a lot of addresses. To debug failures it is important that we have the original request URL with which the call was made.

I know it is possible and would open a PR for this (currently having issues signing the CLA for our company).

Is it something you would add?

can't show returned routes from this service in my map in html

i used this service in node js app as part of a request sent from my angularjs application. when i tried to render the the route in the map id got an error:
js?libraries=places,geometry&key=AIzaSyCvJtDqLEt7guqj_lDjOn5LYzlB0oC0-Us&language=he:61 Uncaught InvalidValueError: not a LatLngBounds or LatLngBoundsLiteral: unknown property southwest.

i dig deeper and realized that the route i get from node is different from the route i'm getting from the service in js. the bounds object is different and there is a "overview_path" witch do not exist in the route made in nodejs.

this is very strange perhaps i'm missing something?

thank you.

throw InvalidValueError.prepend('in property "' + key + '"', error);

It is sending an Invalidate Error

throw InvalidValueError.prepend('in property "' + key + '"', error); ^ Error at new InvalidValueError (/node_modules/@google/maps/lib/internal/validate.js:23:17) at /node_modules/@google/maps/lib/internal/validate.js:132:11 at /node_modules/@google/maps/lib/internal/validate.js:112:21 at /node_modules/@google/maps/lib/internal/convert.js:40:13 at /node_modules/@google/maps/lib/internal/validate.js:43:43 at /node_modules/@google/maps/lib/internal/validate.js:78:21 at /node_modules/@google/maps/lib/internal/validate.js:163:15 at Array.forEach (native) at Object.validator (/node_modules/@google/maps/lib/internal/validate.js:162:16) at Object.directions (/node_modules/@google/maps/lib/index.js:51:25)

when ever i am setting the key

var googleMapsClient = require('@google/maps').createClient({ key: 'AIzaSyBLAUk9O8q3jmSlPWpoZ3mdqfqMU0vq0yA' });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.