Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The region parameter is not implemented for placeAutocomplete #959

Open
nbouvrette opened this issue Mar 21, 2023 · 1 comment
Open

The region parameter is not implemented for placeAutocomplete #959

nbouvrette opened this issue Mar 21, 2023 · 1 comment
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@nbouvrette
Copy link

Based on the place autocomplete web service documentation, there is an optional parameter called region

If I understood correctly this parameter allows to bias in the search result to be more locally relevant to a given region.

It looks like this parameter was not implemented in this package.

Steps to reproduce

import { Client as GoogleMapsClient } from '@googlemaps/google-maps-services-js'

const autocompleteResponse = await googleMapsClient
  .placeAutocomplete({
    params: {
      input,
      key: process.env.GOOGLE_API_KEY || '',
      language: 'en',
      region: 'CA',
    },
  })
  .catch(() => null)

Typescript error

Type '{ input: string; key: string; language: string; region: string; }' is not assignable to type '{ input: string; sessiontoken?: string | undefined; offset?: number | undefined; origin?: LatLng | undefined; location?: LatLng | undefined; radius?: number | undefined; language?: string | undefined; types?: PlaceAutocompleteType | undefined; components?: string[] | undefined; strictbounds?: boolean | undefined; } ...'.
  Object literal may only specify known properties, and 'region' does not exist in type '{ input: string; sessiontoken?: string | undefined; offset?: number | undefined; origin?: LatLng | undefined; location?: LatLng | undefined; radius?: number | undefined; language?: string | undefined; types?: PlaceAutocompleteType | undefined; components?: string[] | undefined; strictbounds?: boolean | undefined; } ...'.ts(2322)
autocomplete.d.ts(45, 5): The expected type comes from property 'params' which is declared here on type 'PlaceAutocompleteRequest'

Object literal may only specify known properties, and 'region' in type 'PlaceAutocompleteRequest['params']'

Is the region parameter still a valid parameter to use? It looks like the JavaScript client does support the region parameter so I presume it's just missing from this package?

@nbouvrette nbouvrette added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 21, 2023
@wangela
Copy link
Member

wangela commented Mar 21, 2023

If you would like to upvote the priority of this issue, please comment below or react with 👍 so we can see what is popular when we triage.

@nbouvrette Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

@usefulthink usefulthink added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed triage me I really want to be triaged. labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants