Skip to content

Feature Request #977

@leoquintara

Description

@leoquintara

New Places API Support

The implementation needs to be updated for the New Places API, as the current endpoint used in the project is not suitable.

The current url for new Places API is: https://maps.googleapis.com/maps/api
Based on the Google Docs, the correct endpoint is: https://places.googleapis.com

And is necessary add to Header Params:
X-Goog-FieldMask: suggestions.placePrediction.text.text,suggestions.queryPrediction.text.text

Update the DOCS

Additionally, if the New Places API is not used, the documentation must specify the following requirement:

requestUrl={{
    url: 'https://maps.googleapis.com/maps/api',
    useOnPlatform: 'web',
    headers: {
        'X-Goog-Api-Key': API_KEY,
        'Content-Type': 'application/json',
    },
}}

For use the new Places API is this:

```jsx
isNewPlacesAPI={true}
requestUrl={{
    url: 'https://places.googleapis.com',
    useOnPlatform: 'web',
    headers: {
        'X-Goog-Api-Key': API_KEY,
        'X-Goog-FieldMask': 'suggestions.placePrediction.text.text,suggestions.queryPrediction.text.text',
        'Content-Type': 'application/json',
    },
}}

And is required modify the request POST Data with this:

```jsx
{
	"input": "albaredo",
	"languageCode": "es",
	"includedRegionCodes": ["us","mx"],
	"includeQueryPredictions": true
}


This code based on custom endpoint with nodejs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions