Google Maps in React - Building interactive maps

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ธ.ค. 2024

ความคิดเห็น • 448

  • @apurvthakur7
    @apurvthakur7 5 ปีที่แล้ว +13

    Awesome tutorial man. This really helps the beginners.

  • @thecutedreamkostasp.4449
    @thecutedreamkostasp.4449 3 ปีที่แล้ว

    How more aweeesoome u can be ???? Tyyy so much for this!!! Much appreciated !!

  • @samuelsicard1029
    @samuelsicard1029 ปีที่แล้ว

    Thank you! This couldn’t be more straightforward. I’m definitely refactoring my implementation to match your code!

  • @leighhalliday
    @leighhalliday  4 ปีที่แล้ว +18

    I made a brand new version showing both Google Maps and Google Places in React together for 2020... new packages, using hooks and modern react. Check it out! th-cam.com/video/WZcxJGmLbSo/w-d-xo.html
    Check out my new course called Next Level Next.js! A full stack course covering GraphQL, TypeScript, Apollo, Prisma, auth and lots more! next.leighhalliday.com

    • @video12417
      @video12417 4 ปีที่แล้ว

      Leigh una pregunta hay forma de filtrar lugares especiales, por ejemplo hospitales con Google place, es que necesito terminado un proyecto y no encuentro la forma de filtrar hospitales y trazar una ruta

  • @1235niki
    @1235niki 4 ปีที่แล้ว

    Thanks, Leigh Halliday. All your video tutorials are very clear, easy to follow and helpful.

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Thank you so much Nikhilesh! I have a never version of this video which covers a different library and also google places if you're interested! th-cam.com/video/WZcxJGmLbSo/w-d-xo.html

    • @1235niki
      @1235niki 4 ปีที่แล้ว

      Leigh Halliday 👍

  • @nikhilrw
    @nikhilrw 5 ปีที่แล้ว +13

    This is exactly what I was looking for! I'm working on a Street Trees project with Vancouver's Open Data. Thank you so much! Explained very well. Keep up the good work.

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Nice! That's awesome! :) Thank you for watching!!

  • @Fatboxe
    @Fatboxe 5 ปีที่แล้ว +1

    THANK you SO much for this video, I completed my first personal project thanks to you!

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Awesome!!! You did the hard work though, not me. Keep it up!!

  • @lekkerslackers5874
    @lekkerslackers5874 3 ปีที่แล้ว +3

    Great tutorial! Thanks for sharing! I’ve been struggling with this all day, and here you made it look so easy, and did it all in 25 minutes. 😂 Wish I’d have found this earlier. Look forward to watching your other tutorials.

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว

      Thanks Lekker! Hope you enjoy some of the other ones... there are lots now!

  • @naveenv7553
    @naveenv7553 ปีที่แล้ว

    Great !!! Super explaination Leigh 🙌

  • @humayun_habib
    @humayun_habib 4 ปีที่แล้ว

    literally you made my day. I go through this and succeed in showing the map and sweeping through different props.. I will soon get used to it. Thanks a lot Sir.

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey Humayun, I actually have a newer video covering react and google maps as well if you're interested :) th-cam.com/video/WZcxJGmLbSo/w-d-xo.html

  • @pianokidfromcolombia
    @pianokidfromcolombia 2 ปีที่แล้ว

    Incredibly helpful! This was exactly what I was looking for

    • @leighhalliday
      @leighhalliday  2 ปีที่แล้ว

      Awesome! I have a newer video about google maps too, it's linked to in this one, check it out!

  • @danielelgressy
    @danielelgressy 3 ปีที่แล้ว

    What a great video! explain clearly and calmly, to the point ! this is exactly what I was looking for. you are better then the docs. I hope you will have a great year!

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว

      Thanks Daniel! 2021 is going to be great! I have a newer version of this video linked to from description if you're interested.

  • @jasonchan7147
    @jasonchan7147 3 ปีที่แล้ว +1

    Very detailed and well explained, really impressed!

  • @meetrupani6889
    @meetrupani6889 3 ปีที่แล้ว

    Exactly what I was looking for. Loved the tutorial. Thanks a lot:)

  • @siobhanx3525
    @siobhanx3525 4 ปีที่แล้ว

    Thanks so much for this Leigh, I really found it helpful. You're a pleasure to watch!:)

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Thanks Jeanne! I have a newer/updated video showing Google Maps if you'd like to check that out :) th-cam.com/video/WZcxJGmLbSo/w-d-xo.html

  • @arsa3903
    @arsa3903 4 ปีที่แล้ว

    dude ... literally u explained all i wanted :))

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey ar! I have something even better for you... an updated 2020 version of this video! th-cam.com/video/WZcxJGmLbSo/w-d-xo.html
      And also how to add a backend and database to the map! th-cam.com/video/Bqacj0iOL68/w-d-xo.html

    • @arsa3903
      @arsa3903 4 ปีที่แล้ว

      @@leighhalliday 😍😍😍😍

  • @tarunjain2025
    @tarunjain2025 4 ปีที่แล้ว

    Thank you soo much... this was exactly what I needed. Keep the great work going.

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Thanks Tarun! I have a newer video about Google maps I think in the description there is a link :)

    • @tarunjain2025
      @tarunjain2025 4 ปีที่แล้ว

      @@leighhalliday thank I'll have a look

  • @crisuar1989
    @crisuar1989 3 ปีที่แล้ว

    Oh dude you're simply a genius..!! Thanks for teach us that 💙💙

  • @Sergio-ij7pw
    @Sergio-ij7pw 5 ปีที่แล้ว +1

    Awesome. The best tutorial. You saved my time. Good library

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว +1

      Thank you Сергей! Glad you are enjoying the videos!

  • @roycheung9662
    @roycheung9662 3 ปีที่แล้ว

    This video is very good. It explained the concepts behind the code. And it helps a lot for my project. Thank you!

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว +1

      Thanks Roy!! I have a newer Google Maps video (linked to in description) if you'd like to check it out.

  • @jjtripode
    @jjtripode 5 ปีที่แล้ว +1

    Thank you so much! Explained very well. Keep up the good work. Capo!!

  • @ASPCook
    @ASPCook 5 ปีที่แล้ว +1

    Super awesome buddy! Thanks for the great tutorial!

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      :D Thanks Sepehr! Glad you enjoyed it.

  • @marinasafwat5940
    @marinasafwat5940 3 ปีที่แล้ว

    Oh Man!!!!!! i really love you ,great job

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว

      Thank you Marina! I have a newer Google Maps video if you check the description :D

  • @Liplopcorp
    @Liplopcorp 4 ปีที่แล้ว

    Thank you so much! You are a wonderful teacher. You just got another subscriber.

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Thanks Lip!! I appreciate the support! By the way, there is a new/updated google maps in react video linked to in the description of this one, check it out!

  • @deborah-weiss
    @deborah-weiss 4 ปีที่แล้ว +1

    This is brilliant, thank you so much! Literally the first tutorial that made me ACTUALLY understand React! You are awesome, I really learnt a lot!

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Woohoo!! Thanks for watching, Deborah! You may like this newer Google Maps in React video as well! It covers some different topics and is a bit more modern: th-cam.com/video/WZcxJGmLbSo/w-d-xo.html

  • @olukayodeshokunbi3815
    @olukayodeshokunbi3815 3 ปีที่แล้ว

    Thanks for the awesome tutorial Larry.

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว

      Hehe, first time I've been called Larry :D

  • @DenisMikhalev
    @DenisMikhalev 4 ปีที่แล้ว

    This is very useful! Thanks, buddy!

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      You're very welcome! There is a newer version of this video linked to in description if interested.

  • @hendriagustino7845
    @hendriagustino7845 5 ปีที่แล้ว +1

    Thank you Hero for the well explained video

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว +1

      I can be your hero, baby
      I can kiss away the pain
      I will stand by you forever
      You can take my breath away 😂

  • @alynesuzanagrieger999
    @alynesuzanagrieger999 5 ปีที่แล้ว +1

    Thank you so, so much! It helps me a lot. I'm from Brazil :)

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว +1

      Hey Alyne! I'm from Canada :) Thanks for watching! I've been to Brazil 3 times... love it! (Iguazu, Ilha Grande, Tabatinga - Amazonas)

  • @emersonaraujo406
    @emersonaraujo406 4 ปีที่แล้ว

    Fantastic teaching! Congratulations for the awesome job.

  • @Lodalailai
    @Lodalailai 2 ปีที่แล้ว

    Please make more videos on maps,
    This was super useful and informative

    • @leighhalliday
      @leighhalliday  2 ปีที่แล้ว +1

      Thank you!! More maps videos coming!

  • @BasuR008
    @BasuR008 4 ปีที่แล้ว

    amazing building blocks when you teach !!!thank you very much

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Thanks Basu! I have a newer version of this available as well if you'd like to check it out th-cam.com/video/WZcxJGmLbSo/w-d-xo.html

    • @BasuR008
      @BasuR008 4 ปีที่แล้ว

      Leigh Halliday yes watching that next. Thanks a ton for clear step by step addition of features

  • @SridTech
    @SridTech 4 ปีที่แล้ว

    Absolutely amazing!

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey Sridhar! There is a newer video you'll probably want to check out: th-cam.com/video/WZcxJGmLbSo/w-d-xo.html

    • @SridTech
      @SridTech 4 ปีที่แล้ว

      @@leighhalliday Yeah added to my playlist already. Thanks for the Video.

  • @gautamlohar
    @gautamlohar 4 ปีที่แล้ว

    It was really helpul. Thanks a lot Leigh.

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      You're welcome, Gautam! Glad you enjoyed it :)

  • @jamesoboyle9588
    @jamesoboyle9588 3 ปีที่แล้ว +2

    When I click on the marker two info windows show up. One with the information and one that's blank, any idea how to fix that?

    • @ricardochvs23
      @ricardochvs23 3 ปีที่แล้ว

      Same happening to me. Maybe it's a bug

    • @ThomasGUILLAUXprofile
      @ThomasGUILLAUXprofile 3 ปีที่แล้ว

      Hi James, i get the same error too! Did you find a solution?

    • @jamesoboyle9588
      @jamesoboyle9588 3 ปีที่แล้ว

      @@ThomasGUILLAUXprofile Unfortunately I did not

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว

      Hey guys! Sorry! Off the top of my head I don't know the reason...

    • @ThomasGUILLAUXprofile
      @ThomasGUILLAUXprofile 3 ปีที่แล้ว

      @@leighhalliday it's actually because of the strictmode. When passing it to fragments, the issue disappears :)

  • @SHolmes9
    @SHolmes9 5 ปีที่แล้ว +1

    Hi Leigh, even after generating an API key, I am unable to populate the map - it shows Oops somthing went wromg after a second of display of the map. Can you help me figure out why is that happening?

    • @Borsi2010
      @Borsi2010 5 ปีที่แล้ว +1

      I came across the same problem. If I used the key right in my googleMapURL it worked but as soon as I used the .env.local version by adding the ${process.env etc.} it gave me the oops error. I found in the create-react-app.dev/docs/adding-custom-environment-variables/ that you need to restart you dev server if it's running. That fixed the error for me. Good Luck!

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Thanks for lending a hand Borsi2010!

    • @vinnnnnny12345
      @vinnnnnny12345 4 ปีที่แล้ว

      @@Borsi2010 how do you restart dev server? Im still getting same error when I ctrl + c then running dev server again

    • @Borsi2010
      @Borsi2010 4 ปีที่แล้ว

      @@vinnnnnny12345 on my Mac I press control and letter C while in the terminal to stop the server and then type npm start again and that should take care of it. I don't know the commands for windows... sorry

  • @oktayaliyev9404
    @oktayaliyev9404 3 ปีที่แล้ว

    13:08
    it says
    TypeError: Cannot read properties of undefined (reading '1')
    Can some one help?

  • @rodrigocornidez1917
    @rodrigocornidez1917 3 ปีที่แล้ว

    Great Tutorial! Very well written

  • @Venom-ne4ox
    @Venom-ne4ox 3 ปีที่แล้ว

    What a great explanation, thank you!

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว +1

      Glad I could help! I have a newer version of this video if you're interested... linked to in description.

  • @chinhluannguyen6964
    @chinhluannguyen6964 4 ปีที่แล้ว

    Thanks Leigh Halliday . ^^

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      You're very welcome! I actually have a newer Google Maps video as well if you'd like to check it out: th-cam.com/video/WZcxJGmLbSo/w-d-xo.html

  • @jonlaboy7209
    @jonlaboy7209 4 ปีที่แล้ว +1

    Hi Leigh. Thanks so much for the awesome video. I have one issue though. When I click a marker the first time an empty infoWindow appears over the corresponding infoWindow with the information. The other infoWindows open correctly when clicked and clear the intial infoWindow with the information but the empty infoWindow remains and needs to be manually exited.

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey Jon! That's a very good question :D Maybe you can share your code so we can take a look. Off the top of my head I am not sure though.

    • @jonlaboy7209
      @jonlaboy7209 4 ปีที่แล้ว +1

      @@leighhalliday Thanks for the response! This stack overflow post helped me solve it (in case someone else is stuck) stackoverflow.com/questions/62124512/react-google-maps-calls-empty-infowindow
      I implemented what i learned from it and then removed the position property from infowindow and it worked ! Thanks again

    • @gautamlohar
      @gautamlohar 4 ปีที่แล้ว

      @@jonlaboy7209 Thanks Jon for sharing the link. The same issue was coming to me. Now it's fixed.

  • @pavankumargvs5693
    @pavankumargvs5693 4 ปีที่แล้ว +1

    Hi , can I add number positioning in the markers...i mean numbers on markers? I tried passing child component inside marker component...but that did not work. could you please help.

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      I can't see how to do it with this google maps in react library, you may want to try this one: google-map-react, which seems to allow this a lot easier. Here's an article/video which uses numbers as the marker: www.leighhalliday.com/google-maps-clustering

    • @pavankumargvs5693
      @pavankumargvs5693 4 ปีที่แล้ว

      Sure I ll try this !!

  • @mixboX7
    @mixboX7 4 ปีที่แล้ว

    Just awesome. Keep it up

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      You got it! I won't let you down.

  • @rajkumart08
    @rajkumart08 3 ปีที่แล้ว

    Hi, in google maps how to zoom based on markers if one is in California and if another is in newyork. So that both the markers are visible

  • @case_tips
    @case_tips 3 ปีที่แล้ว

    Very Easy To understand thank you very much

  • @TheAlexisThink
    @TheAlexisThink 4 ปีที่แล้ว

    Thank you so much for this amazing video. Great tutorial, its exactly what i need :D

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Happy I could help, Alexis! Thanks for saying hi :)

  • @Y_hass
    @Y_hass 3 ปีที่แล้ว

    Nice stuff and Go Sens Go

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว

      I think you mean Go Leafs Go!

  • @harshshokeen7076
    @harshshokeen7076 3 ปีที่แล้ว

    Hey if you could make a video about adding triggers in Google maps, as in while our location is moving(vehicle) and as soon as we come near to that specific location it will get triggered and give us an alert.

  • @mornemarais4198
    @mornemarais4198 3 ปีที่แล้ว

    nice one Dmitry

  • @vova1767
    @vova1767 3 ปีที่แล้ว

    Thank you so much for the tutorial!!! 🏆One question do you know how to trigger InfoWindow from separate element? Like I have these markers on map and on separate component like "list of parks" and when I click on park's name it should show (open InfoWindow) it on the map.

  • @ssshwanth
    @ssshwanth 2 ปีที่แล้ว

    Why map component (child)is unstable and flickering while typing anything in parent component and also while we auto drag and please can u resolve

  • @atherparveezmir1686
    @atherparveezmir1686 3 ปีที่แล้ว

    can you please suggest me how can i add css to infoWindow tag??
    suppose i want to bring that infoWindow at the top of the Icon.

  • @dhruvilpatel856
    @dhruvilpatel856 4 ปีที่แล้ว

    Great job. Keep it up!

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Thanks Dhruvil, I'm glad you enjoyed the video!

  • @muhammadsaadjaved7444
    @muhammadsaadjaved7444 4 ปีที่แล้ว

    Great Video, But I face an issue. After putting the 'API Key' in 'googleMapURL', "For Development Purpose Only" watermark is still showing on Map.

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      You may have to enable this API within your API console settings and/or you may have to enter your credit card info (even if you won't be charged).

  • @ejif2
    @ejif2 3 ปีที่แล้ว

    Спасибо! Очень понравился стиль изложения, все шаг за шагом с подробным объяснением. Жалко не наткнулся на это видео 1,5 года назад, как раз было пару прототипов с Google Maps.

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว

      Had to Google Translate this hehe... but thank you! Glad you enjoyed the video! There is a newer/updated one pinned to the top of this video if you'd like to check that out.

    • @ejif2
      @ejif2 3 ปีที่แล้ว

      @@leighhalliday Еще раз СПАСИБО! Почитал tomchentw.github.io/react-google-maps/#documentation, вполне понятно стало (по крайней мере начало;) накидал пример padavan-itbeard.github.io/react_google_map/. Добавил ссылки на Вас и Ваш канал в readme %) p.s. Google Translate наше все!

    • @ejif2
      @ejif2 3 ปีที่แล้ว

      @@leighhalliday It remains to rate the new version%) Success!

  • @AnuragHakeem
    @AnuragHakeem 5 ปีที่แล้ว +1

    Thanks for this great video. Wanted to know if there is away add directions functionality to it too?

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว +1

      Hey Anurag! The truth is that I'm not sure! It's not something I've worked with before. If you check it out, let me know what you find! If not, maybe that's a great idea for something I could dive into in the future.

  • @camillepelletier7851
    @camillepelletier7851 4 ปีที่แล้ว

    Super helpful video! Very well taught ! (I am also from Ottawa!! Its nice to get a shoutout!)

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Niiice! Hello fellow Canadian!

  • @PankajSharma-vl6pg
    @PankajSharma-vl6pg 3 ปีที่แล้ว

    Awesome bro .....your voice are so smooth

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว

      Haha, thanks Pankaj! Hopefully it didn't put you to sleep.

  • @bartekswistak3378
    @bartekswistak3378 4 ปีที่แล้ว

    I did not see where you got your skatepark data from, I am building a similar app where I plan on showing nearby basketball courts, I am having trouble with the nearbySearch function of the Google Places API

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Hey Bartek! I got it from the city of Ottawa (Canada)... they had a website that listed it all as JSON data. Hmm... off the top of my head I'm not sure what the issue would be, but I didn't use the google places api in this vid, unless I am remembering incorrectly haha which is totally possible.

  • @hafidznugroho520
    @hafidznugroho520 4 ปีที่แล้ว +1

    why do my map still get greyed out with those message "development purpose only" even i put a key inside the gmap url?

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Have you enabled billing and the correct APIs for that key?

    • @hafidznugroho520
      @hafidznugroho520 4 ปีที่แล้ว

      @@leighhalliday ah i see. the api is right but i've not enabled the bill. Tq

    • @alexitoyt1130
      @alexitoyt1130 4 ปีที่แล้ว

      @@hafidznugroho520 how much should be paid

  • @amiratif2828
    @amiratif2828 4 ปีที่แล้ว

    Hey Leigh! Hope your fine, I followed your toturial i have problem to access map object to add custom controls in map. This map object exist in withGoogleMap state but not in Map component

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey Amir! Try using the ref prop on GoogleMap, it should give you access to the map. Search for the phrase "onMapMounted" on this page and you'll see some examples: tomchentw.github.io/react-google-maps

  • @borateti
    @borateti 5 ปีที่แล้ว +1

    i added an svg file on public folder but i cant get it rendered on the map, please assist

    • @borateti
      @borateti 5 ปีที่แล้ว

      managed to get it, had to set the scaledSize value

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Nice :)

  • @slow_fk8
    @slow_fk8 3 ปีที่แล้ว

    u deserve my like and subscribe. great jobs thanks

  • @priyankamalhotra2474
    @priyankamalhotra2474 5 ปีที่แล้ว +1

    On creating the const WrappedMap = withScriptjs(withGoogleMap(Map)) i get an error "TypeError: Object(...) is not a function" What should I do?

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Hey Priyanka! Can you share me a gist of the entire file? It might be something else that is causing the issue!

    • @priyankamalhotra2474
      @priyankamalhotra2474 5 ปีที่แล้ว

      @@leighhalliday I created a new file on my project to add the maps. However here is a test setup codesandbox.io/embed/optimistic-rhodes-8nwbw

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Perrrrfect, thank you! The issue is that the package should be "react-google-maps" instead of "google-maps-react" lol... hard one to find!!

    • @priyankamalhotra2474
      @priyankamalhotra2474 5 ปีที่แล้ว

      @@leighhalliday Oh! Ok. Will update that. Thanks for your help!

  • @gersonricardotoribioossio9720
    @gersonricardotoribioossio9720 4 ปีที่แล้ว +1

    one question, is there a possibility to render the infoWindow above the marker???

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Her Gerson! Were you able to find any options in the documentation on changing the position of the info window?

    • @gersonricardotoribioossio9720
      @gersonricardotoribioossio9720 4 ปีที่แล้ว

      @@leighhalliday no :/ . But, I used google maps API for javascript and added it to my react project. You can handle whatever you want there. I think it is more customizable but you have to add more lines of code and understand hooks and react lifecycle if you want to manage infowindow, markers, etc. :)

  • @cobianzo79
    @cobianzo79 4 ปีที่แล้ว

    Nice one. After creating my app, I didn't find a way to access to the original 'map' object, in order to call such methods like panTo. Do you have any idea of how to do that? Coudlnt find the right post in the net.

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey Alvaro! Try to save the map to a ref using the useRef hook, then you can access it later.

  • @Siddharth-yi7pg
    @Siddharth-yi7pg 3 ปีที่แล้ว

    Hi thanks for tutorial , how to rotate the marker icon to specific angle? please tell me I need in project urgently

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว

      Hey Siddharth! I am not sure! You'll have to look at the docs.

  • @BobbyBundlez
    @BobbyBundlez 3 ปีที่แล้ว

    i can't customize my map styles at all. is that because i do not have billing set up?

  • @diegopereyra8545
    @diegopereyra8545 2 ปีที่แล้ว

    Woah, subscribed

  • @amiratif2828
    @amiratif2828 4 ปีที่แล้ว

    Hey Leigh! can u please make another video for further processing like route directions and alternative route,optimized route, just like route direction in UBER... using react-google-maps

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Great idea, I'll add it to my list!

  • @allisonv.2738
    @allisonv.2738 3 ปีที่แล้ว

    Thank you so much! You are a life saver

  • @vallisweekes9826
    @vallisweekes9826 5 ปีที่แล้ว +1

    Hi Leigh Halliday can you use google places with this as well

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Yup! For sure. It's just in React, and I have another video about Google Places, it's just a matter of combining them... maybe easier said than done but it is possible for sure.

    • @vallisweekes9826
      @vallisweekes9826 5 ปีที่แล้ว

      @@leighhalliday Ok nice.. I am working on this project that requires me to fetch data from google places but looking for any tips or guidance how to get it done.

  • @hobbsidian1756
    @hobbsidian1756 2 ปีที่แล้ว

    Thanks Leigh this is exactly what I needed, this has been invaluable for my uni project.
    One only thing I'm struggling with now is getting users to place their own marker on the map. How would I go about letting a user for instance add their own skatepark marker in an onClick event?
    I have the lat and lng posting to console onClick okay, but I can't seem to get a fresh marker to show.

  • @webdev5244
    @webdev5244 4 ปีที่แล้ว

    Hi Halliday. Thanks for your awesome job. Here I have a question when using the update version @react-google-maps/api that how can I set the icon size of Marker because didn't find propery 'google' on window.(:

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Hey Web Dev! Sorry... I'm not really sure off the top of my head

  • @alessandrosassi6709
    @alessandrosassi6709 3 ปีที่แล้ว +2

    Did someone else found problem installing the library ?

  • @WishowMetal
    @WishowMetal 4 ปีที่แล้ว

    Hepful!!!! Do you have an example with the Directions Renderer?

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey Wishow, thanks! Sorry, I haven't worked with that before.

  • @wisereveryday7137
    @wisereveryday7137 4 ปีที่แล้ว +1

    It didn't work for me, I don't know why it skipped many packages when installing react-google-map some said not supported

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey there! I actually have an updated video with updated packages if you'd like to take a look th-cam.com/video/WZcxJGmLbSo/w-d-xo.html

  • @TheDarkKnightBass
    @TheDarkKnightBass 3 ปีที่แล้ว

    Great video, thank you very much!

    • @leighhalliday
      @leighhalliday  3 ปีที่แล้ว

      Thanks Aleksandar! If you search my channel you'll find an updated Google Maps in React video too!

  • @siddharthpaiya3989
    @siddharthpaiya3989 4 ปีที่แล้ว

    Hello Leigh,
    Very great tutorial. Actually, I was trying to build a Search bar to lookup the location names and render the pins conditionally only when the search matches. Could you please tell me how I go about that given your logic.Many thanks

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey Siddharth! You might want to check out this video and take a stab at combining the places input and its results with how to render markers as shown in this video: th-cam.com/video/uJYqQdnw8LE/w-d-xo.html

  • @darray.
    @darray. 5 ปีที่แล้ว +1

    Very helpful tutorial. Can i ask if its possible to also use the googlemaps feature to for example collect all the skatepark locations from the map to be put into say a database or object/store in order to list each of the skateparks on my website rather than showing the map (kinda like how information is taken from an API stored into a redux store or context api store and then dispatched onto the page in a list). Sorry if this makes zero sense lol

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว +1

      Hey Daré! Thanks for your comment. If I understand, I think you could tackle it a few ways. Instead of importing and using the file locally, you could fetch the JSON from its URL (link to data is in video description), and then once you have the data you could put it into a Redux store or however you want to store it. Once you have the data in your store, you could choose to list out the data rather than displaying it on a map. Orrrr... you might want to load the data into a database and fetch it from a Node server or something like that... it depends I guess what you want to do with the data in the list, if you want to be able to edit/manage the data, etc...

    • @darray.
      @darray. 5 ปีที่แล้ว

      Leigh Halliday thanks for the response. I’ll be sure to try this out

  • @orioldemo5380
    @orioldemo5380 2 ปีที่แล้ว

    how to colour states of a country using this library ? Please help !

  • @og-polecatsky
    @og-polecatsky 5 ปีที่แล้ว +2

    Hey, Leigh! It would be fantastic if you find the time to record a tutorial where you go over adding a search bar and filtering results on the map through specific queries!

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว +1

      Good idea, Alex! I'll try to do something around that them in the future :)

  • @76Freeman
    @76Freeman 5 ปีที่แล้ว +1

    Hi Leigh,
    Great video. I love your videos and how you explain things. I've watched a couple of other videos you've done and I like your style. By the way, do you know if Montreal has anything similar to what Ottawa is doing? I've been searching for something similar to what Ottawa is doing but no luck.

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว +1

      Hey Helio! I'm honestly not sure! If you find anything for Montreal or Toronto (where I live near), let me know :D Thanks for watching! I'm glad you are enjoying/learning from them.

  • @ebonayres
    @ebonayres 5 ปีที่แล้ว

    Where could I find the same data for say Basketball courts? I was looking for notes on how you found the skatepark data but couldnt find it.

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Hi Iby! This is something specific to the city of Ottawa, Canada... but if you want basketball courts in Ottawa, here is the data: data.ottawa.ca/dataset/basketball-courts

  • @sumairakram7485
    @sumairakram7485 5 ปีที่แล้ว +1

    Great Video. And I've question. Did I've to enable billing account to use the API key??

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Hmmm... good question. If you try it without entering billing info, what happens?

    • @sumairakram7485
      @sumairakram7485 5 ปีที่แล้ว

      @@leighhalliday It show the map first correctly and then the message show allover the sceen and the screen is black and they just say This is for developer Mode.

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Hey Fatima! Did you get it working? Did you enable the "Maps JavaScript API"?

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Sumair, did you get it working? Did you enable the "Maps JavaScript API"? Can you show me how you are embedding the key in your app? Does it give any other details in the browser console?

  • @daisyqin7543
    @daisyqin7543 2 ปีที่แล้ว

    Thanks . Can we use this method in react native web?

  • @lazyloafs
    @lazyloafs 4 ปีที่แล้ว +1

    the syntax for google api key is not working for me

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Hey lazy loafs! What is the problem? If you put a console.log, can you see it? Did you put it in your .env file with the right prefix?

    • @Aetalkura
      @Aetalkura 4 ปีที่แล้ว

      Leigh Halliday yes my .env file has the code inside with white text showing it’s not working properly, and when I wrote &key=REACT_APP_GOOGLE_KEY, it shows the entire thing In brown.

  • @fxx3702
    @fxx3702 4 ปีที่แล้ว

    Hey Leigh, I posted a little while ago here but I had another question for you. I am running into an odd error where, if I load the map up in a thin screen, say a mobile phone view, and I expand it, there are blank white spaces where the map should be but does not go to. This does not happen when I refresh the page with the map open at the largest width and height. I can shrink it, expand it and those unrendered spaces do not appear. Any ideas? Please let me know! Thank you!

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey Jake! Hmm... I went back and looked at the code, and I saw some funky things where I set the divs to have a height of 100% which doesn't make a ton of sense :D but I don't think that would be related to changing the width. I'm honestly not sure! Sorry...

    • @fxx3702
      @fxx3702 4 ปีที่แล้ว

      Leigh Halliday thanks Leigh no problem. I actually was able to solve it. I had to create an event listener for a resize of the window, and then when it was trigged I called map.resize(). Question for you though: what’s the difference between ReactMapGL and ReactMapboxGl? Also, I can’t remember if this was for ReactMapGL or ReactMapboxGl or what, but I see a lot of mapboxs being instatiated as object first. Like: const mapbox = ReactMapGl({ ...params }), do you know the differences between that and the method you did in your video? Sorry for the long response, but I appreciate your videos! They are really great! :) keep it up!

  • @szn0007
    @szn0007 4 ปีที่แล้ว

    I am getting two info window on clicking one marker. What is the reason behind that?? @Leigh

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      Hey Sujan! Can you share your code? Maybe I can spot why.

    • @zefirthefear9490
      @zefirthefear9490 4 ปีที่แล้ว

      @@leighhalliday same problem. just copy-pasted your code from github. dropmefiles.com/77RYf p.s. thanks a lot for your lessons

  • @SvNVdOz
    @SvNVdOz 5 ปีที่แล้ว +1

    Thanks for this wonderful tutorial. :)

  • @JCUProduction
    @JCUProduction 5 ปีที่แล้ว +1

    Is it possible to pass props/state into the default center? In case I have data coming from an other component so I can render the map dynamically

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Hey Jesper! If I'm being honest I would check out MapBox - th-cam.com/video/JJatzkPcmoI/w-d-xo.html if you're looking to dynamically control map with props/state... the Mapbox implementation is much more declarative where the state/props dictate the map... not so much with the google maps implementation. With google maps in React you're stuck with imperative methods like "panTo", so you have to watch for changes to your state/props and then call that method yourself rather than letting the state dictate the map directly.

    • @JCUProduction
      @JCUProduction 5 ปีที่แล้ว

      @@leighhalliday Thanks for a quick reply, will definetly check out MapBox, i the meantime I got my own code running :D I used the google-maps-react package which had a center prop to its map view. That renders the new position.

  • @muhammadzaakirmungrue3146
    @muhammadzaakirmungrue3146 3 ปีที่แล้ว

    Nice video thanks I used some of your code but it does not work its depreciated and I needed to add the "selectedPark" variable into the array argument of the useEffect hook so that the useEffect only gets called when the "selectedPark" variable changes.

  • @davidbarrar5968
    @davidbarrar5968 5 ปีที่แล้ว +1

    Great video! I recently used this same google maps library on a project and I’m tired of seeing the warning about renaming componentWillMount. So I tried to update the code in node_modules but still getting this warning. Also, I can’t get the ref to the map to work, which I need for the getBound() function thanks!

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Hey David! Thank you :) You may want to try a different maps/react library. This one has less downloads but gives you a ref to the map: www.npmjs.com/package/@react-google-maps/api and this one seems to give you access as well via a callback: www.npmjs.com/package/google-map-react

  • @code_motion
    @code_motion 4 ปีที่แล้ว +1

    Awesome tutorial.

  • @naveenrawat6071
    @naveenrawat6071 3 ปีที่แล้ว

    can we make marker selectable like checkbox onClick ?

  • @donkwaQ
    @donkwaQ 4 ปีที่แล้ว

    error:
    Legacy context API has been detected within a strict-mode tree.
    The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
    Please update the following components: withGoogleMap(Map)
    What can I do ?

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Hey! I have a newer video linked to in the description and pinned comment which uses a different Google Maps library that doesn't have this issue.

    • @donkwaQ
      @donkwaQ 4 ปีที่แล้ว

      @@leighhalliday thanks for your answer, that's to nice you write reply yet :)

  • @BeginningProgrammer
    @BeginningProgrammer 5 ปีที่แล้ว +1

    Hey Leigh. It would be pretty cool if you demonstrated how to use the search to populate the map with markers. For example let's say that I want to show a map with all the local churches but I don't necessarily have the jason file to fill the information

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว

      Great idea! I just launched a Google Places autosuggest video, but it just found a single location. It would be cool to combine that with the map.

  • @kennedy202
    @kennedy202 5 ปีที่แล้ว +1

    this package is not maintained anymore, its ok use it?

    • @leighhalliday
      @leighhalliday  5 ปีที่แล้ว +1

      Yes! Fine to use. Google maps hasn't changed that much recently. There are newer packages, but with much fewer downloads... feel free to try 'em out though :D Let me know if they work better than the one we covered. I wanted to cover the most popular one out there today even if it isn't the newest.

    • @kennedy202
      @kennedy202 5 ปีที่แล้ว +1

      @@leighhalliday I Found this one www.npmjs.com/package/@react-google-maps/api, but the old one is a little bit more easy to use :)

  • @brandonwilliams6553
    @brandonwilliams6553 4 ปีที่แล้ว

    Thanks for the video.
    My application won't read the variable from the .env.local file without adding the line "require('dotenv').config()" to the App.js file. Do you know why this might be?

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว

      What is your ENV var called? Create React App only looks for ENV vars starting with REACT_APP_

    • @brandonwilliams6553
      @brandonwilliams6553 4 ปีที่แล้ว

      ​@@leighhalliday I've matched your naming convention.
      I had to run the "npm install env" command to get to that point.
      Sorry if this is elementary - if there are prerequisites not explicitly stated in the video, I'm not aware of them.

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Hey Brandon! Nope, it's not elementary... I'm not sure why it isn't working :D Maybe take a look at this page and see if you pick up on something we didn't think of yet: create-react-app.dev/docs/adding-custom-environment-variables/

  • @DarkSideChess
    @DarkSideChess 4 ปีที่แล้ว

    Do you have any suggestions for automatic zoom to make sure all markers are in bounds?

    • @leighhalliday
      @leighhalliday  4 ปีที่แล้ว +1

      Sorry, I don't :D It'd be cool if something already exists, but if not, I would try to find out the bounding box of all the markers, and then see if there is a google maps function for zooming/panning for a certain bounding box.