Тёмный
No video :(

Google Places - Autocomplete in React 

Leigh Halliday
Подписаться 33 тыс.
Просмотров 55 тыс.
50% 1

Code referenced in video: github.com/lei...
Artwork by James Gilleard - www.artstation...

Опубликовано:

 

28 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 216   
@itzvaleska9657
@itzvaleska9657 7 месяцев назад
Man you a life saver.. thanks 4 yrs later
@durbslife
@durbslife 4 года назад
LOL the disappointment when you found the error to be an extra '#' sign. That is real life programming right there! Great vid!
@leighhalliday
@leighhalliday 4 года назад
Haha thanks! The sad part is that I usually do this once before actually recording... Still tons of errors even on the second go :D
@nils8752
@nils8752 3 года назад
@@leighhalliday I wrote a state and context file the other day without checking for errors until after I was finished. And as expected webloader threw a couple of errors after I was done but none of them were in the code I wrote. I searched for hours until I realized that somehow autocomplete and a bunch of unlucky keystrokes put a import express from 'express' at the beginning of my state file and I never thought of checking the top for errors. I was so disappointed with myself that I called it a day and went to bed :D
@moonstanley2320
@moonstanley2320 4 года назад
That was dope. This was the most simple and 'get-to-the-point' tutorial I've seen regarding maps. Thanks!
@leighhalliday
@leighhalliday 4 года назад
Thanks Moon, glad you enjoyed the video :)
@dhs0113
@dhs0113 4 года назад
I'm quite newbie to javascript and react. Currently I'm working on a project, and this helped me a lot and saved massive time for developing. Really appreciated! :)
@leighhalliday
@leighhalliday 4 года назад
Sweet, welcome to the JS/React community :) Glad the video was able to help!
@ryan.connaughton
@ryan.connaughton 3 года назад
Thanks for the vid! I spotted the hash mistake soon as you written it and I was playing pantomime at my screen cheering you on to find it!
@leighhalliday
@leighhalliday 3 года назад
Haha... I try to keep the development "real"... mistakes and all.
@TheYakMaster408
@TheYakMaster408 3 года назад
Respect brotha. Thanks for taking the time to make this easy and painless by removing the pain points for initial setup!
@leighhalliday
@leighhalliday 3 года назад
Thanks so much Tim!
@emersonaraujo406
@emersonaraujo406 4 года назад
Amazing community job. It is awesome how you teach and the degree of knowledge you certainly have. Thanks a lot!!!
@leighhalliday
@leighhalliday 4 года назад
Muchas gracias Emerson!!
@AbirBinAyubKhan
@AbirBinAyubKhan 4 года назад
Thanks. Helped me integrate the Places Api to my project. Keep posting the great stuff.
@leighhalliday
@leighhalliday 4 года назад
Nice!! Happy I could help, Abir. Thanks for saying hi!
@ThreeMTG
@ThreeMTG 3 года назад
Thanks for the vids, man! I just watched the Maps API video of yours and it was really helpful.
@leighhalliday
@leighhalliday 3 года назад
Nice, glad you enjoyed it Ivani, thank you!
@let_go429
@let_go429 4 года назад
new sub and bell button smasher here. Your videos are pure gold! Thank you, Mr. Halliday
@leighhalliday
@leighhalliday 4 года назад
Excellent! Thanks for watching let_go let's_code!
@axhaferllari2882
@axhaferllari2882 4 года назад
This library is great! Thank you for the walk through.
@leighhalliday
@leighhalliday 4 года назад
Thank you A Xhaferllari! Glad you liked it!
@cesaralexanderarevalo6647
@cesaralexanderarevalo6647 3 года назад
Thanks Bro. You saved me. New subscriber from Colombia.
@leighhalliday
@leighhalliday 3 года назад
Gracias Cesar! Un saludo desde Canadá! Cuidate mucho porque en este momento la situacion en Colombia esta brava!
@cesaralexanderarevalo6647
@cesaralexanderarevalo6647 3 года назад
@@leighhalliday Que buen Español Hermano. Gracias, aquí seguiremos luchando de la mejor forma posible por conseguir un mejor país.
@dettieee
@dettieee 4 года назад
Thankyou, this was great! short and straight to the point!
@leighhalliday
@leighhalliday 4 года назад
Thanks dettieee! Glad you enjoyed it!
@aanex2005
@aanex2005 4 года назад
Very detailed and straightforward! Thanks!!!
@leighhalliday
@leighhalliday 4 года назад
Thank you aanu!! Glad you enjoyed it!
@deckerdsgaming8751
@deckerdsgaming8751 3 года назад
Thanks mate. you just saved my day. Perfect step by step explanation
@leighhalliday
@leighhalliday 3 года назад
Nice! Happy to help :)
@yashjain9863
@yashjain9863 3 года назад
thanks, bro!!!!! Really helped a lot It was the OPT explanation for The Problem Perfect Video for React Integration with Google Places API
@mohamedkalid8713
@mohamedkalid8713 2 года назад
thank you leigh halliday
@leighhalliday
@leighhalliday 2 года назад
You’re very welcome Mohamed!
@mehulgawhale5255
@mehulgawhale5255 3 года назад
Clean teaching skills and you bring rare contents👍✨
@leighhalliday
@leighhalliday 3 года назад
Thank you Mehul, glad you enjoyed it!
@anuraghazra4772
@anuraghazra4772 5 лет назад
Keep them coming.. I love your videos. 😊
@leighhalliday
@leighhalliday 5 лет назад
You got it, Anurag :)
@neurogenesiss
@neurogenesiss 2 года назад
Man, you saved me!!
@leighhalliday
@leighhalliday 2 года назад
Woohoo! What are you building?
@khoilam7569
@khoilam7569 2 года назад
thanks sir
@vinaykanth7453
@vinaykanth7453 4 года назад
That's a great help. I was able to implement this feature in my project. Thank you.
@leighhalliday
@leighhalliday 4 года назад
Awesome!! Check out this video if you'd like to see how to integrate it into a map: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-WZcxJGmLbSo.html
@edwardandresmoronquintana4852
@edwardandresmoronquintana4852 3 года назад
very very very nice bro, greetings from medellin, Colombia
@leighhalliday
@leighhalliday 3 года назад
Mucho gusto, Edward! Tengo ganas de ir a Medellin... iba a ir este año pero no se pudo por lo de COVID. Ojala en 2021!
@snowhite414
@snowhite414 Год назад
Hi. Thank you for this video. Very clear and helpful. If you have time can you teach us how to add additional suggestions like the first one inside the suggestion is "use your current location" and follow the API suggestions? I don't know how and have no idea if its possible. Thanks
@JannibalForKing
@JannibalForKing 3 года назад
This is wonderful info!! Thanks Leigh it really helped me out
@leighhalliday
@leighhalliday 3 года назад
Thanks Jan! Glad the video was able to help :)
@alizalakhani7300
@alizalakhani7300 4 года назад
Thanks for the tutorial. Helped me with my work.
@leighhalliday
@leighhalliday 4 года назад
Excellent!! Glad it could help :)
@stephenhackett-delaney9401
@stephenhackett-delaney9401 3 года назад
Amazing tutorial! Thank you very much
@leighhalliday
@leighhalliday 3 года назад
Thanks Stephen! Glad you enjoyed it :)
@hienlong9873
@hienlong9873 2 года назад
Awesome tutorial!
@KingCommerce
@KingCommerce 2 года назад
Awesome! Thanks Leigh :)
@leighhalliday
@leighhalliday 2 года назад
Thanks King! Glad you enjoyed it.
@nikhilgupta2569
@nikhilgupta2569 3 года назад
Thanks a lot for the video. Can I restrict suggestions from a specific country?
@ellisdee2013
@ellisdee2013 3 года назад
Thank you for the video! It really helped me out. Liked and subscribed.
@leighhalliday
@leighhalliday 3 года назад
You're welcome, Stephen! If you're interested, here's a video I made with google places and google maps together: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-WZcxJGmLbSo.html
@Y_hass
@Y_hass 3 года назад
Great work! saved me lots of time!
@leighhalliday
@leighhalliday 3 года назад
Nice! Happy to help!
@boskameel
@boskameel 3 года назад
I’m building a road trip react webapp. Where you can manage different road trips. I can use this!
@islamicinterestofficial
@islamicinterestofficial 3 года назад
I followed exact same steps but it keeps "...loading". My API key is also correct. I am very worried. plz help me sir
@MultiShami007
@MultiShami007 4 года назад
Great video!!! helped me a lot. Thumbs up!
@leighhalliday
@leighhalliday 4 года назад
Excellent! Glad it could help :)
@denniskjin
@denniskjin 2 года назад
Super helpful tutorial! If i had several different fields i.e Street Address, City, State etc how would I be able to parse the autocomplete result to fill those fields?
@JustinThegamerBR
@JustinThegamerBR 3 года назад
me ajudou demais , te amo
@c4973
@c4973 2 года назад
On the client side, the return ( ) outputs latitude and longitude. Can you please tell me how to update the latitude and longitude on the server and how to output the current latitude and longitude geodata to the console from the server? I need to use this data in my project.
@olhamazurenko4152
@olhamazurenko4152 4 года назад
Thank you very much for the video!
@leighhalliday
@leighhalliday 4 года назад
Thanks for watching, Olha!
@saurabrakshit405
@saurabrakshit405 Год назад
It is more easy to understand If you have showed how & from where you have got the script tag which you integrated in index.html & how you generated the map API . Now struggling in getting the script tag if you dont mind please share the above request .
@karaokeyoga2868
@karaokeyoga2868 3 года назад
Thanks! Any advice on how to use react-select instead of a generic input?
@chinwewatkins2808
@chinwewatkins2808 3 года назад
you are a life saver!! thank you!! great tutorial!!
@leighhalliday
@leighhalliday 3 года назад
:D Glad you enjoyed it!
@edwardvakhovsky891
@edwardvakhovsky891 3 года назад
Love it!
@bayabeltes69
@bayabeltes69 2 года назад
How can you load api key in next.js?
@shawyarshah231
@shawyarshah231 3 года назад
hi, it's amazing video, but why I get "...has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header..." error, how can I fix it? please
@hyetigran
@hyetigran 4 года назад
Thank you for the video. Is it possible to get autocomplete search to show businesses? i.e. McDonald's, City Bank, etc? Or would you recommend using a different api for that
@leighhalliday
@leighhalliday 4 года назад
Hey Tigran! Yup, you can... look into the searchOptions prop: github.com/hibiken/react-places-autocomplete#searchoptions And then you can pass in the `types` option to bring back businesses: developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletionRequest.types
@TrungNguyen-bz7nh
@TrungNguyen-bz7nh 4 года назад
Many thanks , bro .
@leighhalliday
@leighhalliday 4 года назад
Thank you very much, Trung!
@craftmoon-vas
@craftmoon-vas 4 года назад
Hey Leigh! Thx for the tutorial. One question. I'm using react-google-maps that you used in your other video, and in that WrappedMap component we put googleMapURL as a prop. In this one, it needs to be as a script. When I do both I get "You have included the Google Maps JavaScript API multiple times on this page". Is there a way to include this google maps url script just once while using both libs ?
@leighhalliday
@leighhalliday 4 года назад
Hey Vitor! That's a really good question. As far as I can tell, you can use react-google-maps with an HOC (high order component) called withGoogleMap that looks like it assumes you already have the google maps script installed on your site elsewhere. That might solve your problem! tomchentw.github.io/react-google-maps/#withgooglemap
@craftmoon-vas
@craftmoon-vas 4 года назад
@@leighhalliday Dude, thanks a lot! I just tried it and it worked perfectly. Thanks! :)
@Hasan-Alsamman
@Hasan-Alsamman 2 года назад
hello, i have a q, i want to display my points first when i search locations , how to add my location to suggestion?
@denysbielkin4471
@denysbielkin4471 3 года назад
Thank you for the video :) Can you tell, please - is there a posibility to recieve more than 5 results?
@leighhalliday
@leighhalliday 3 года назад
Hey! Thank you! I am not sure actually! You'd have to check out the docs :D
@dimitarchukovski9263
@dimitarchukovski9263 3 года назад
tip: For key error add -> key={suggestion.placeId}
@leighhalliday
@leighhalliday 3 года назад
Totally, I messed up :D
@snowhite414
@snowhite414 Год назад
Hello. How can I get the city from the results? Please and thank you!
@gbengaakingbulere6727
@gbengaakingbulere6727 3 года назад
nice one
@leighhalliday
@leighhalliday 3 года назад
Thank you gbenga!!
@marlonpaulodasilva
@marlonpaulodasilva 4 года назад
like from Brazil
@leighhalliday
@leighhalliday 4 года назад
Muito obrigado, Marlon!
@tntfit2614
@tntfit2614 3 года назад
does this library work with react native as well??? seeing how there is no script tag in native?
@axlerodriguez3268
@axlerodriguez3268 3 года назад
thanks mate
@leighhalliday
@leighhalliday 3 года назад
No prob! Glad you enjoyed it, Axle.
@axlerodriguez3268
@axlerodriguez3268 3 года назад
@@leighhalliday yeah i am hehe, you got a new subscriber and thanks again
@perenciolo659
@perenciolo659 4 года назад
Great job thanks. :)
@leighhalliday
@leighhalliday 4 года назад
Thank you, Gustavo!!
@janeiroplacido2817
@janeiroplacido2817 3 года назад
i need enable billing but i have not card, what can i do?
@leighhalliday
@leighhalliday 3 года назад
Honestly that's a problem! You might want to look for free alternatives... unfortunately google wants a Credit Card. Maybe look to get a Visa Debit card if it's available in your country.
@janeiroplacido2817
@janeiroplacido2817 3 года назад
@@leighhalliday thanks! I used my card, google says they will not take my money until i accept they take it automatically , I hope 🤞 it 😅
@paolosmith7268
@paolosmith7268 4 года назад
Tank you very much. It's possible to use that together with 'react-google-maps'/api ? If it's possible, how can we put only one time the url for both ?
@leighhalliday
@leighhalliday 4 года назад
Hey Paolo! I'd probably stick to one or the other, rather than both.
@hendriagustino7845
@hendriagustino7845 4 года назад
Hy Paolo! I think from using this package which return us the object {lat: x, lng: y} , u can easily proceed to use this lat lng coordinates value to render the location/place to your react-google-maps.
@faiqueali
@faiqueali 4 года назад
@@hendriagustino7845 I am updating coordinates to googlemap center property but its not getting update, I also tried useRef but no luck, could you help me how to update center and zoom using this tutorial code..?
@aminigbopaul4021
@aminigbopaul4021 2 года назад
I get error even when i cloned the repo, it loads forever
@saurabrakshit405
@saurabrakshit405 Год назад
Nice vdo ! While converting this code into Stateful component getting the below error :- Error: TypeError: Cannot set properties of undefined (setting ‘prop’) I have converted your Stateless component into Stateful in below manner :- import React, { Component } from "react"; import PlacesAutocomplete,{geocodeByAddress} from "react-places-autocomplete"; export default class App extends Component() { // constructor(props) { // super(props); // this. // } state = { address: "" }; handleChange = (value) => { this.setState({ address: value }); }; async handleSelect(e) { const result = await geocodeByAddress(e.target.value); console.log("Selected Address:- ", result[0].formatted_address); console.log("Address:- ", result[0]); } render() { return ( {({ getInputProps, suggestions, getSuggestionItemProps, loading }) => ( Address {loading ? ...loading : null} {suggestions.map((suggestion) => { const style = suggestion.active ? { backgroundColor: "#42a5f5", cursor: "pointer" } : { backgroundColor: "#ffffff", cursor: "pointer" }; return ( {suggestion.description} ); })} )} ); } } ---------------------------------------------------------------------------------------------------------------------------------------------------------- I have put the state object in the constructor but still got the error then I have took it out of the constructor. So I want to know where I'm going wrong please bother a little to reply me with your fruitful solution.
@AnandSingh-jo6gf
@AnandSingh-jo6gf 2 года назад
Can we fetch City, State and zip code from the address?
@ishaanpuri901
@ishaanpuri901 3 года назад
Hey! Great stuff! If you dont mind replying, I keep getting the ...loading when I input something. Would you mind telling me whats wrong?
@minahilshafique7850
@minahilshafique7850 2 года назад
did you find out the error? i am still struglinf with it
@minahilshafique7850
@minahilshafique7850 2 года назад
my suggestions array is always empty... can someone guide?
@leahjames2791
@leahjames2791 4 года назад
Hi, really nice tutorial. I wanted to save the {coordinates.lat} and {coordinates.lng} in a const variable to be passed into a two dimensional array. But I dont now how to I cant seem to store it within the return itself. Any suugestion? thanks!
@leighhalliday
@leighhalliday 4 года назад
Hey Leah! I think you'd have to do something like this: const coordsPair = [coordinates.lat, coordinates.lng]
@leahjames2791
@leahjames2791 4 года назад
@@leighhalliday Thanks a lot !
@sautante
@sautante 4 года назад
In order to use geocodeByAddress did you have to enable the Geocode API? The problem is that it's not free. Is there any other way to get the lat and lng of what's searched?
@leighhalliday
@leighhalliday 4 года назад
Hey sh2345, I think it's free as long as you don't cross a certain threshold, but you do have to put in your credit card details. I'm not sure... have you found another API that does something similar? Maybe this one? locationiq.com/ or this one? opencagedata.com/api
@sautante
@sautante 4 года назад
@@leighhalliday Ah I see, I took a look at opencagedata and managed to get the lat and lng. Thanks!
@percytataje8763
@percytataje8763 3 года назад
Hello, i have a error in library , Cannot read property 'onBlur' of undefined when i write in input ?
@leighhalliday
@leighhalliday 3 года назад
Sorry percy, I'm not sure!
@cutiefon16
@cutiefon16 4 года назад
Hi! I have a quick question, What if I want to add the latitude and longitude in array everytime i select a place? Any help would be appreciated! Great tutorial btw! :)
@leighhalliday
@leighhalliday 4 года назад
Hey Alfon! Create some state called `places`, and when they select a place, push it onto the state. Thank you!!
@cutiefon16
@cutiefon16 4 года назад
@@leighhalliday I did try. But everytime i push it into state it get null value always. :(
@cutiefon16
@cutiefon16 4 года назад
haha never mind i figured it out.:) I have a question though, what if i have 2 autocomplete how can i edit them separately or change their value separately when selecting a place?
@seymurmammadov3868
@seymurmammadov3868 4 года назад
So the autocomplete function works on my reactjs app but when I select one it does not finish the input field text and throws me an error saying my API does not have access to this. I have geocode, places, maps all enabled. Someone can help me?
@leighhalliday
@leighhalliday 4 года назад
Hey Seymur! Make sure that your API key is being added correctly (via environment variable) in the app. Maybe that is the issue?
@shubhamwaghamore2331
@shubhamwaghamore2331 2 года назад
Hey Leigh I am facing issue while doing this that is REQUEST_DENIED while onchange of the field how do I resolve it I am trying to do in localhost for understanding purpose I created API keys for API geolocation, places, geocoding maps javascript API but still can't resolve it And do I need to enable billing for using localhost too? Please have look on this issue
@leighhalliday
@leighhalliday 2 года назад
Have you enabled both geolocation and places apis?
@grandmaitrediamantducongo8806
@grandmaitrediamantducongo8806 4 года назад
hey thank you for the video , I did exactly everything as you explained in the video , but I can't get it to work. I'm having the OVER_QUERY _LIMIT issue with a new api key . do you have any insights ?
@leighhalliday
@leighhalliday 4 года назад
Hey Turama! Are you using this just for local development or is it on a deployed website? You may need to enter in your credit card details if you're going over the limits.
@grandmaitrediamantducongo8806
@grandmaitrediamantducongo8806 4 года назад
@@leighhalliday thank you for replying, billing information was set up already but error was till showing. how would you go about making this a component instead of using it directly like in your App class.?
@user-cg8hz4mf7z
@user-cg8hz4mf7z 3 года назад
Thanks, Your videos are amazing, I have implemented and everything is ok except when I click with the input empty because an error is triggered with legend ZERO_RESULTS or INVALID_REQUESTS and I can't catch that problem to avoid that app brearks even if I try with onError attribute, this last option is useful when there are no mathces but if I click enter with empty input the error breaks the app. I hope somebody can guide me with this problem. Thanks.
@preetimaurya8687
@preetimaurya8687 3 года назад
Can you please..explain..How to add google review in react js
@leighhalliday
@leighhalliday 3 года назад
Hey Preeti! I don't even know what Google Review is :D
@geraldoagohoue3132
@geraldoagohoue3132 4 года назад
Thanks
@leighhalliday
@leighhalliday 4 года назад
You're welcome, Géraldo!
@veaaltanuwijaya6193
@veaaltanuwijaya6193 4 года назад
Hello Sir Leigh Halliday, thanks for the great video. I'm wondering on how to run the 'npm start' which is suggested, my API key already inputed but stuck on npm thing which still result blank page in index.
@veaaltanuwijaya6193
@veaaltanuwijaya6193 4 года назад
nvm found it :D keep up the vids!
@leighhalliday
@leighhalliday 4 года назад
Nice! Glad you got it figured out Veaal!! :)
@veaaltanuwijaya6193
@veaaltanuwijaya6193 4 года назад
Sir Leigh sorry for asking again!, how to combine the index.html custom with the npm ?
@mohsinalisoomro6336
@mohsinalisoomro6336 3 года назад
Thanks for the video it works fine when run locally but when deploy on the firebase it gives me the error of {cors} if you have a solution please reply me i will appreciate it
@leighhalliday
@leighhalliday 3 года назад
Hey Mohsin! Sorry, I don't have a solution off top of head.
@veaaltanuwijaya6193
@veaaltanuwijaya6193 4 года назад
Sir Leigh how to use twice the app.js ? like i want to display 2 times ( i can input twice different address ) i try using div root twice but its seems doesn't work can u help me ?
@leighhalliday
@leighhalliday 4 года назад
Hey Veaal! Instead of using app.js twice... maybe move the contents of to it's own component, and then include that twice within ... like this: function App() { return ( ); }
@veaaltanuwijaya6193
@veaaltanuwijaya6193 4 года назад
@@leighhalliday thx a lott Sir! have a good day *p.s. : thanks for helping me even i ask a lot hehe
@happysloth91
@happysloth91 4 года назад
I kind of wanna subscribe again
@leighhalliday
@leighhalliday 4 года назад
Do it! I won't stop you!! :D
@joshuad4548
@joshuad4548 3 года назад
Have you used or suggest any libraries for reverse geocoding? client side
@leighhalliday
@leighhalliday 3 года назад
Hey No Kap... hmm, the truth is that I don't think a library can actually do it, you need some sort of API. Google has one you can use: developers.google.com/maps/documentation/javascript/examples/geocoding-reverse But you could also do a search and see if there are any others.
@joshuad4548
@joshuad4548 3 года назад
@@leighhalliday you're right, just a simple request. thank dude. You really simplified the autocomplete functionality for us
@mihirbagchi4171
@mihirbagchi4171 4 года назад
hey is this using Places API only ? because I am getting an error-- "This API project is not authorized to use this API."
@leighhalliday
@leighhalliday 4 года назад
No sorry, it's also using Geolocation API
@joshuad4548
@joshuad4548 3 года назад
Is there a way to limit search to only citys and towns, no exact addresses?
@leighhalliday
@leighhalliday 3 года назад
I believe so! Check out the google places options/documentation to see how you can limit search results.
@joshuad4548
@joshuad4548 3 года назад
@@leighhalliday thank you. searchOptions
@sayansahoo4746
@sayansahoo4746 4 года назад
Hi, I tried to load the API in index.html file within the script tag, provided my google maps javascript API key, and yet I get this ApiNotActivatedMapError error. If you could say why this is happening? My keys are enabled and authorized for this particular project.
@leighhalliday
@leighhalliday 4 года назад
Hey Sayan! Off the top of my head I don't know, but googling this StackOverflow comes up which talks about the exact error you seem to be running into: stackoverflow.com/questions/35700182/apinotactivatedmaperror-for-simple-html-page-using-google-places-api Make sure that "Google Maps JavaScript API" is enabled for your key.
@sayansahoo4746
@sayansahoo4746 4 года назад
@@leighhalliday Thanks! I will check it out, even though I made it sure the api is enabled and activated.
@leighhalliday
@leighhalliday 4 года назад
There might be two APIs you have to enable when using places API... I forget :)
@kalilmagal2733
@kalilmagal2733 3 года назад
I tried it, but it says I must enable billing on the Google.
@leighhalliday
@leighhalliday 3 года назад
Yup, unfortunately it’s true. You’ll be in the free tier most likely but you must have billing enabled.
@brosslightyear9417
@brosslightyear9417 3 года назад
Google place api is need configure billing account?
@leighhalliday
@leighhalliday 3 года назад
Unfortunately, yes... it shouldn't cost you anything though.
@ericliu2325
@ericliu2325 3 года назад
Does this work with addresses? Like typing 123 main street
@leighhalliday
@leighhalliday 3 года назад
Hey Eric! It does indeed.
@smoust912
@smoust912 4 года назад
Thanks pretty
@leighhalliday
@leighhalliday 4 года назад
Hehe... and thanks to you for calling me pretty, Smoust.
@user-jz1my9yo8v
@user-jz1my9yo8v 3 года назад
should we pay for API key? because I'm getting an error that tells me to pay for one! I thought it's free :(
@leighhalliday
@leighhalliday 3 года назад
You have to enter your credit card but you should be more than fine on the free tier.
@user-jz1my9yo8v
@user-jz1my9yo8v 3 года назад
Thank you! I have a student account so it turns out to be free for students! That's awesome! thank you for the strait forward tutorial!
@asekawarnakulasooriya7909
@asekawarnakulasooriya7909 4 года назад
Can you please Intergrate the autocomplete in to a map as well
@leighhalliday
@leighhalliday 4 года назад
Aseka, it's your lucky day! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-WZcxJGmLbSo.html
@muhdkbn6456
@muhdkbn6456 3 года назад
Help me , how can i get API key for google places
@leighhalliday
@leighhalliday 3 года назад
Start here: console.developers.google.com/
@mariiatkachova570
@mariiatkachova570 3 года назад
it looks like I have to Try Google Cloud Platform for free. If I do it, will it charge me anything?
@leighhalliday
@leighhalliday 3 года назад
I think you're OK as long as you fall within the "free tier"... you'd have to look up exactly how much usage that allows you.
@Kenndy16
@Kenndy16 4 года назад
Hi, is "Current Location" part of the selection of choice?
@leighhalliday
@leighhalliday 4 года назад
Unfortunately not, you'd have to add it yourself using the browser's built-in geolocation.
@Kenndy16
@Kenndy16 4 года назад
@@leighhalliday Oh I see, I want to build something like the Yelp address search bar with "Current Location". I was having a hard time finding any tutorial or article related to that. I also google "browser build in geolocation" and see some articles and videos related to React Native, but not for web browsers. If you know any, feel free to refer to me.
@Kenndy16
@Kenndy16 4 года назад
​@@leighhalliday If you plan to create more tutorial videos that use Google API, can you also include the setup procedure with Google Cloud Platform? I tried to follow your video and had to watch a different tutorial video to do the setup procedure. I was able to get past 06:33 of this video, but then 12:36, I get an error "Geocoding Service: This API project is not authorized to use this API." I couldn't move forward because I don't know what part of the setup is incorrect at the moment. In general, thank you for the tutorial though.
@letsplayirishkid
@letsplayirishkid 4 года назад
How do you add the PlacesAutoComplete to your project?
@leighhalliday
@leighhalliday 4 года назад
Check out the installation instructions here: github.com/hibiken/react-places-autocomplete/blob/master/README.md#installation
@novaleighbui3860
@novaleighbui3860 3 года назад
Hi Leigh, I'm having some issues. I have the exact same code, however my app doesn't show any "suggestions". It only shows the inputs, lat, and long. Any ideas on what's wrong?
@leighhalliday
@leighhalliday 3 года назад
Hey Novaleigh! Sorry... nothing pops to mind immediately... keep troubleshooting! Use some console.logs and see what data your app has!
@novaleighbui3860
@novaleighbui3860 3 года назад
Thank you so much for replying! Turned out it was because VSC cannot process the link to Google API. I honestly don't even know why they have this bug, but I wasn't aware of that, so it took me like 3 hours to figure this out. Anyways, GREAT VIDEO! And, thanks again!
@deborah-weiss
@deborah-weiss 3 года назад
@@novaleighbui3860 how did you solve it? I'm working on VSC too and same thing, can't see the suggestions at all...
@novaleighbui3860
@novaleighbui3860 3 года назад
@@deborah-weiss For me, it was the link to Google API that caused the issue. Before my link was split into two lines like in the video. Then, I fixed the issue by making it all connected on one line. For example Before: Link to Google API I fixed it to: Link to Google API
@novaleighbui3860
@novaleighbui3860 3 года назад
Hope that helps!
@martinmajorov5921
@martinmajorov5921 4 года назад
Having an issue with this one. Cannot get the answer with suggestions from google maps. It doesn’t even show ...loading . API key is attached and it seems like an empty array is coming back to suggestions. Maybe you can help?
@leighhalliday
@leighhalliday 4 года назад
Hey Martin! It's hard to help without being able to see the code you're working with. Happy to take a look if you'll share.
@martinmajorov9725
@martinmajorov9725 4 года назад
@@leighhalliday github.com/guitdev86/good-morning/blob/master/app.js
@martinmajorov9725
@martinmajorov9725 4 года назад
I was able to follow until this point. I actually tried initial code from www.npmjs.com/package/react-places-autocomplete and it works. So I don't really get it where is my bug...
@leighhalliday
@leighhalliday 4 года назад
Hey Martin! Unfortunately I don't think this is a public repo so I'm not able to check the code out.
@martinmajorov5921
@martinmajorov5921 4 года назад
Leigh Halliday didn’t notice it was private. It’s open now.
@alextraill1957
@alextraill1957 4 года назад
Any ideas how to sort just by airports?
@leighhalliday
@leighhalliday 4 года назад
Hey Alex! You can limit which "types" the API returns... there is some documentation about that on this page: developers.google.com/places/web-service/autocomplete
@alan_1213
@alan_1213 4 года назад
Hi. Is there any alternative to google places? It is not free and i already exceeded my quota
@leighhalliday
@leighhalliday 4 года назад
I haven't used any... I know they exist though, I think you'll have to do some googling :D
@alan_1213
@alan_1213 4 года назад
Leigh Halliday thanks Leigh. I did google and found couple. My project is non-profit so I can’t pay for any product. But the project will have users and I don’t want to hang people with unreliable service. How do you go about in this type of situations? Do you simply buy or make your own from scratch (autocomplete search in this case) ?
@Kenndy16
@Kenndy16 4 года назад
When I push my codes to Github, am I supposed to remove the Google API key?
@leighhalliday
@leighhalliday 4 года назад
Hey Kenndy! Yup, definitely. Don't want to commit that bad boy. Ideally have it in an environment variable.
@bishnusukla3788
@bishnusukla3788 Год назад
​@@leighhalliday To add api key from env file we have to load the script dynamically instead of static right? Also how can we add session token to optimise the cost?
@olaoluwaanigboro-napoleon6484
@olaoluwaanigboro-napoleon6484 6 месяцев назад
So no one is talking about how the api_key is exposed for the whole world to see or y'all are not working on live projects where things like api_key is supposed to be confidential?
@leighhalliday
@leighhalliday 6 месяцев назад
Hey! I delete the API keys after posting the video. That said, to use google maps on your site, the key must be public, because you'll need to have it in the browser. They key is to restrict its use, tying it to your domain and which services you require.
@olaoluwaanigboro-napoleon6484
@olaoluwaanigboro-napoleon6484 6 месяцев назад
@@leighhalliday oh really? I'm sorry if I sounded harsh. I was working on a live project so I thought it was safer to hide the apikey and so I searched but didn't see a solution so I got frustrated. But thanks for this information, you are the second person who has told me this and now I have confirmed that I can leave it like that in the index.html...thanks and great video btw!
@attamjotsingh4474
@attamjotsingh4474 4 года назад
I have got these errors : You must enable Billing on the Google Cloud Project and error happened when fetching data from Google Maps API. Assist me on this.
@leighhalliday
@leighhalliday 4 года назад
Hey Attamjot! You have to enable billing on your google account that you got the google maps api key from... even if you're in a free tier, you have to enter a credit card for it to work.
@attamjotsinghkhurana4473
@attamjotsinghkhurana4473 4 года назад
@@leighhalliday thank you so much . How to find nearby cities / areas based on city selection of another dropdown ?
@christopherb.223
@christopherb.223 3 года назад
Does it work on next js?
@leighhalliday
@leighhalliday 3 года назад
It does!
@christopherb.223
@christopherb.223 3 года назад
@@leighhalliday Thank you for you help, already done
Далее
React Hooks: useReducer
19:38
Просмотров 7 тыс.
Google Maps & Google Places in React
53:09
Просмотров 140 тыс.
Can You Bend This Bar?
01:00
Просмотров 4,3 млн
New Dyna Skin is OP🥵🔥 | Brawl Stars
00:16
Просмотров 138 тыс.
7 better ways to create a React app
7:08
Просмотров 540 тыс.
Google Maps and Directions API on React Native
28:40
Просмотров 36 тыс.
React Native Maps with Marker & Callout
16:48
Просмотров 32 тыс.
Should you use Ruby on Rails in 2024?
14:43
Просмотров 43 тыс.
TypeScript Origins: The Documentary
1:21:36
Просмотров 284 тыс.