IN 30 Minutes! Add Google Address Autocomplete to Next JS

Поделиться
HTML-код
  • Опубликовано: 22 дек 2024

Комментарии • 32

  • @codernerd7076
    @codernerd7076 8 месяцев назад +2

    Just in time! Was looking for this thanks!

    • @Grepsoft
      @Grepsoft  8 месяцев назад +1

      From one developer to another 👍

  • @natalie9486
    @natalie9486 2 месяца назад

    awesome video!! this was exactly what i needed

    • @Grepsoft
      @Grepsoft  2 месяца назад

      I am glad it helped.

  • @tenersnet
    @tenersnet 4 месяца назад

    Thank you for making this well detailed

  • @azumahjoshuazilmayee6704
    @azumahjoshuazilmayee6704 7 месяцев назад +1

    Thank you this video. At 13:18 where is the coordinates coming from?

    • @azumahjoshuazilmayee6704
      @azumahjoshuazilmayee6704 7 месяцев назад +1

      @@TopDoorInstall Thanks you for the quick response. So when you call the map component in the parent component you pass the default lat and lng like this

    • @Grepsoft
      @Grepsoft  7 месяцев назад

      They are being passed in by the parent company.

    • @Grepsoft
      @Grepsoft  7 месяцев назад +1

      @@azumahjoshuazilmayee6704 I defined LatLong as a type like this:
      export type LatLong = {
      type?: string,
      coordinates: number[]
      }
      and then pass like this:

    • @Grepsoft
      @Grepsoft  7 месяцев назад

      you can watch the PetRescue tutorial where I explained in detail how to pass. ruclips.net/video/lfHOAzFAul0/видео.htmlsi=4cE7CJ9Che0Q7GOT

    • @azumahjoshuazilmayee6704
      @azumahjoshuazilmayee6704 7 месяцев назад +1

      @@Grepsoft Thank you.

  • @ChrisMonnat
    @ChrisMonnat 8 месяцев назад +1

    This did come at just the right time. I've been wrestling with this for a few days now.
    I got your example to work when using a page within Next JS but my use case is to put the address field in a Shad CN Dialog bog. Whenever I do that I get the following error "InvalidValueError: not an instance of HTMLInputElement". I've played around a bit with onOpenChange and such but no success.
    Any thoughts would be greatly appreciated.
    Thanks again!

    • @Grepsoft
      @Grepsoft  8 месяцев назад

      you need to do a simple trick. Simply do this:
      {open && }
      The issue is Input is not loaded yet js is trying to bind to it.

    • @ChrisMonnat
      @ChrisMonnat 8 месяцев назад

      @@Grepsoft Yup, spot on. I ended up referencing the field using useCallback instead of useRef and that did the trick. Thanks for the quick response!

    • @Grepsoft
      @Grepsoft  8 месяцев назад

      @@ChrisMonnat Thanks that works too.

  • @freelancerbadshah9555
    @freelancerbadshah9555 7 месяцев назад

    thanks man, Awesome very helpful appreciate you for this video

    • @Grepsoft
      @Grepsoft  7 месяцев назад

      My pleasure

  • @coffeebean8583
    @coffeebean8583 3 месяца назад

    What is the code for the Input field? When I go to search a location, mine says 'This page can't load Google Maps Correctly', however the map displays under it, but the search doesn't show a drop down of locations, I have enabled billing but this did not seem to fix it

    • @Grepsoft
      @Grepsoft  3 месяца назад

      Have you enabled places API?

  • @theophilusfrimpong8431
    @theophilusfrimpong8431 5 месяцев назад

    Amazing video sir. But please tell me, how I can add manual location picking with the marker instead of just using just the search bar

    • @Grepsoft
      @Grepsoft  5 месяцев назад

      Sorry what do you mean manual location?

  • @merikii
    @merikii 5 месяцев назад

    Thanks, man!!

    • @Grepsoft
      @Grepsoft  5 месяцев назад

      You are welcome 🤗

  • @karthikpandi4132
    @karthikpandi4132 5 месяцев назад

    when i am change the address before marker not remove how to handle this ?

    • @Grepsoft
      @Grepsoft  5 месяцев назад

      sorry I don't understand. Can you please explain a bit?

  • @garrettogrady4138
    @garrettogrady4138 5 месяцев назад

    Great video! do you have the code for this anywhere? Would love to implement that map view/list view toggle you have

    • @Grepsoft
      @Grepsoft  5 месяцев назад

      Please see the parking management app series. The video will be released this week.

    • @Grepsoft
      @Grepsoft  5 месяцев назад

      Please see the new video: ruclips.net/video/yWy7_-MwulY/видео.htmlsi=30oGsX3TfVR4jX9F. You can skip to 1:18:42 to see the layout switcher.

  • @SiamAhmed-t8n
    @SiamAhmed-t8n 2 месяца назад

    why dont you add a github repo here?

    • @Grepsoft
      @Grepsoft  2 месяца назад

      My other videos has link to my GitHub repo.