How to add Place Autocomplete input to a map in React

Поділитися
Вставка
  • Опубліковано 19 сер 2024

КОМЕНТАРІ • 54

  • @user-dn7hl2jj8g
    @user-dn7hl2jj8g 6 місяців тому

    This is truly a top-tier tutorial!

  • @likeabird5942
    @likeabird5942 Рік тому +14

    Reach combobox not supported with React 18 :/

    • @chinonsoojoechem
      @chinonsoojoechem Рік тому

      Any alternative to this?

    • @yasserhy
      @yasserhy 11 місяців тому +1

      Did you find any alternative? I am also stuck here

    • @carrymesenpai3276
      @carrymesenpai3276 3 місяці тому

      @@yasserhy I suggest MaterialUI Autocomplete.

    • @jordanhunnicutt710
      @jordanhunnicutt710 12 днів тому

      I would give Shadcn/ui's combobox a try.

  • @igorkushnir4966
    @igorkushnir4966 2 роки тому +1

    Thank you! Video helped a lot!

  • @pratikmahendra6552
    @pratikmahendra6552 19 днів тому

    Thank you so much

  • @khajamoddin
    @khajamoddin 9 місяців тому

    Thanks for the code it helped.

  • @UCI3VzXLNW9qW7IexEn
    @UCI3VzXLNW9qW7IexEn 2 роки тому +2

    Do you have video how to get auto relocation for address that is typed in search field?

  • @MrEmgeomap
    @MrEmgeomap 3 місяці тому

    Hello. Could you please provide guidance on how to implement regional restriction for autocomplete suggestions in the Google Places API within the context of this React application?

  • @asta_dev
    @asta_dev Рік тому +2

    hi guys. I have a question about google_api_key it is a public key and we can use it on SPA, correct?

  • @jamesong2012
    @jamesong2012 Рік тому

    love it !

  • @kaluhathabrew9184
    @kaluhathabrew9184 Рік тому

    thank you

  • @g43s
    @g43s 8 місяців тому

    why do i need to add the initMaps function? i came across this video because i needed to implement the autocomplete for an adress field. but i have no use for google maps. it seems like such a waste of resources to enforce you to add it.

  • @tuttubabukarna
    @tuttubabukarna 2 роки тому

    Amazing

  • @ZamirMubashir
    @ZamirMubashir 2 роки тому +1

    KINGGG

  • @yasserhy
    @yasserhy 11 місяців тому +2

    I am getting this errir while trying to install the combobox: Could not resolve dependency:
    peer react@"^16.8.0 || 17.x" from @reach/combobox@0.18.0

  • @mariajosecastria5757
    @mariajosecastria5757 Рік тому

    I followed the steps and it works fine. BUT when I select a place, the input is cleared, and it is required in my form....

  • @rajdeepjadav6263
    @rajdeepjadav6263 9 місяців тому

    can we make google map move on the location which we type

  • @birukmengistu3653
    @birukmengistu3653 10 місяців тому +1

    @reach/combobox --react18 does't support --😪

  • @geraldoagohoue3132
    @geraldoagohoue3132 Рік тому

    Why in my case combobox is appearing disabled?

  • @FargKlee
    @FargKlee 2 роки тому +1

    Nice video, is there a way to add the Autocomplete component a restriction to only suggest address within US for example?

    • @GoogleMapsPlatform
      @GoogleMapsPlatform  2 роки тому +6

      Yes, you can use componentRestrictions to restrict to a country. Documentation: developers.google.com/maps/documentation/javascript/places-autocomplete#restrict-predictions-to-a-specific-country You'll need to check the documentation of the React component used here to see what the corresponding syntax is for setting componentRestrictions in that component.

  • @zamanEhsani
    @zamanEhsani 2 роки тому +1

    react/combobox does not install with npm. problem with that.

    • @saibamir2211
      @saibamir2211 Рік тому +2

      npm i @reach/combobox --legacy-peer-deps

    • @javandocalvin
      @javandocalvin Рік тому

      ​@@saibamir2211 its works but when deploy to vercel, its become error when npm install without legacy-peer-deeps. any suggestion?

  • @ushelloworld
    @ushelloworld 11 місяців тому

    Instead of Places, is it possible to make them cities?

  • @safwan9bbb
    @safwan9bbb 9 місяців тому

    how to add session token here

  • @abhishes
    @abhishes Рік тому

    When I go to google credentials dashboard it's asking me to enter billing details .. credit card etc. why is this? I thought the google maps api was free? any way to follow the instructions of this tutorial without entering the credit card details?

    • @GoogleMapsPlatform
      @GoogleMapsPlatform  Рік тому

      Using Google Maps Platform requires a billing account. Learn more about how billing works and the monthly credit here: developers.google.com/maps/billing-and-pricing/billing

    • @abhishes
      @abhishes Рік тому

      @@GoogleMapsPlatform I hate this. Why should I create a "billing" account for a free API?

  • @adrianfernandez6038
    @adrianfernandez6038 2 роки тому

    `This API project is not authorized to use this API. Places API error: ApiNotActivatedMapError`, help me!!!!

    • @GoogleMapsPlatform
      @GoogleMapsPlatform  2 роки тому +1

      Be sure to enable Places API for your project in the Console.

  • @epigie8369
    @epigie8369 Рік тому

    @Google Maps Platform, whats the name of the extension that shows the last change time please

    • @GoogleMapsPlatform
      @GoogleMapsPlatform  Рік тому

      Could you share the timestamp of the moment in the video when you are seeing a last change time?

    • @Sam-bo6nj
      @Sam-bo6nj Рік тому

      Hi, I think its the GitLens extension

  • @user-vp9bw1zo8u
    @user-vp9bw1zo8u 7 місяців тому

    Nice viedio, but I have a question, isn't the api key public, and also you can't restrict the api key for geolocation api and places api so how do you protect yourself, because you also have to pay for every use.

  • @richardbentil4070
    @richardbentil4070 Рік тому

    Dropdown not working of places not working

  • @AmeerHamza-cy6km
    @AmeerHamza-cy6km 2 роки тому

    Places API error: BillingNotEnabledMapError

    • @GoogleMapsPlatform
      @GoogleMapsPlatform  2 роки тому +1

      Be sure to enable billing in your account with the instructions at developers.google.com/maps/documentation/javascript/cloud-setup. After that, if you get an ApiNotActivatedError you might also need to enable Maps JavaScript API and Places API for your project.

    • @AmeerHamza-cy6km
      @AmeerHamza-cy6km 2 роки тому

      @@GoogleMapsPlatform thanks

  • @chienhoangquyet812
    @chienhoangquyet812 7 місяців тому

    Nice video ha

  • @LearnITify
    @LearnITify Рік тому

    I try to enable Javascript API but Google said me that give me money)) Do you have free something??

    • @GoogleMapsPlatform
      @GoogleMapsPlatform  Рік тому

      Please see information about monthly credits that offset the cost of Maps JavaScript API for low usage volumes at developers.google.com/maps/billing-and-pricing/billing#assistance-from-google

    • @UhhhhHi2
      @UhhhhHi2 Рік тому

      You get $200 worth of API calls per month for free before it will charge you anything

  • @webtpoint8009
    @webtpoint8009 9 місяців тому

    please don't do this please don't make this type of video you don't need to teach how to code, just show how you enabled google api? that's the issue,

  • @kantcat
    @kantcat 2 роки тому

    I got these errors. ERROR in ./node_modules/@reach/auto-id/dist/reach-auto-id.esm.js 86:13-20
    export 'useId' (imported as 'useId$1') was not found in 'react' (possible exports: Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useDebugValue, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, version)