Building an interactive map with Google Maps Platform and React - Crash Course

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

КОМЕНТАРІ • 172

  • @larryjasontueno9016
    @larryjasontueno9016 4 місяці тому +3

    Why didn't you go just stp by step?😔

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

    Exactly what I was looking for! Just need some minor changes. Thanks a lot

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

    So glad I found you channel man!

  • @zb2747
    @zb2747 2 роки тому +16

    Couldn’t come at a better time as I’m working on a project that uses google api- your previous tutorials are the best google maps api tutorials

    • @leighhalliday
      @leighhalliday  2 роки тому +4

      Amazing!! I tried with this one to touch a couple of different APIs from the last one: Directions, Clustering, MapID... I hope you like it!

  • @ricardomagalhaes6777
    @ricardomagalhaes6777 2 роки тому +11

    What a fantastic tutorial, thank you so much Leigh. I think this may even be my first UA-cam comment in 10 years! Answered so many questions I had about modern usage of some Maps APIs with React, fantastic stuff. The only thing I had to tweak from your code was making the generateHouses() fn take the `office` and not the `center`, since the `center` is never updated apart from the initial page load (so the houses would always be generated away from your office location, if it were different than your initial `center`). Just in case anyone else was struggling with that :) thanks again, phenomenal tutorial!

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

      I was wondering about that very thing!
      Additionally, I set the default value for office to center (after reordering those lines of code, of course).

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

    For those having issues with markers for house not rendering around the work location. Try using the tweaked useMemo below instead
    const houses = useMemo(function(){
    if(office) return generateHouses(office);
    },[office]);

  • @tanvirazhar
    @tanvirazhar Рік тому +3

    So grateful that I have found this tuts. Leigh, you are doing gods work here. Thanks heaps for rescuing us!!!!!

  • @daniel-nagy
    @daniel-nagy 2 роки тому +6

    One of the best videos on your channel. I've learned so much in just 1 hour. Keep up the good work Leigh!

  • @EmanualJade
    @EmanualJade 2 роки тому +4

    If is not working for you due to a type error. Try this
    {clusterer => (
    {houses.map(house => (
    ))}
    )}

  • @121-f7y
    @121-f7y 2 роки тому +1

    I tried to do this as explaining it but all I can see is Commute? and Map on this page
    I don't think so but does it work on only Mac?
    I'm begginer..
    (Anyway this lecture is so clear that I can understand the logic!! I love this!!)

  • @AlexA-hx7du
    @AlexA-hx7du Рік тому

    It useless to .env the variables for client side rendering components? since this .env variables will be used on client browser and can be seen. The code you've provided is not safe if the process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY contains a sensitive API key because this key is exposed directly in the client-side code.

  • @Samuelrajsams
    @Samuelrajsams 4 місяці тому

    Hi Guys,
    I have a requirement in my application, need to show construction zone in Google Maps API. Can you please help me on this

  • @BIN-UG
    @BIN-UG 2 роки тому

    It took 1,5 hours to finish watcNice tutorialng tNice tutorials 18 MINUTES video wNice tutorialle doing all the sa steps on soft soft myself. My brain is fried and

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

    Hi I'm trying to build the starter project (no changes added) and I'm getting the following and can't figure out what to add to the array map() to make it happy. Please help! I'm too noob.
    ./components/map.tsx:96:19
    Type error: No overload matches this call.
    Overload 1 of 2, '(props: MarkerClustererProps | Readonly): ClustererComponent', gave the following error.
    Type 'Element[]' is missing the following properties from type 'ReactElement': type, props, key
    Overload 2 of 2, '(props: MarkerClustererProps, context: any): ClustererComponent', gave the following error.
    Type 'Element[]' is not assignable to type 'Element'.

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

    You sir are a God sent! Thank you for such a great video. I've had so many problems with other tutorials, but your Google Maps series has helped so much! I really appreciate your videos!!!

  • @rezaghifary3653
    @rezaghifary3653 2 місяці тому

    Hi man nice tuto,, Is this map is accessible in china region? or do we need some configurations?

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

    hi sir , i have some doubt in fetch direction , acording your code ui direction is pointing A to B even for me from lat & lang or coming correctly nut ui drection is connenting , can give me solutions for this ...

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

    I'm trying to send coordinates to back-end...

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

    How to get all nearest houses in your office within 1.5km?

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

    which file we've to run to start our project

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

    Great content man and just when i needed it, can one add an option to ask for the users current location?

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

    why did you not do it with javascript - did you forget about us ? that we even existed ?

  • @Gandeon1
    @Gandeon1 5 місяців тому

    Greetings! First of all, thank you for the amazing tutorial. I'm currently working on a project using the Google Maps API and this is really helping.
    However, I'm encountering an error in map.tsx. Namely this line:
    const onLoad = useCallback((map) => (mapRef.current = map),[]);
    The error message says: "Parameter 'map' implicitly has an 'any' type.ts(7006)"
    When I try to specify the type e.g. useCallback((map:google.maps.Map)) or map:GoogleMap, either the later onLoad function or the mapRef.current... breaks. During development in localhost this isn't a big deal, but I can't build the project with this error. Do you have an idea, how to fix this?

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

    How can I delete Circle when user click outside map?

  • @chanzerone0516
    @chanzerone0516 4 місяці тому

    what's your vscode theme?

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

    Are you looking for the best google maps turorials on youtube ? Leigh Haliday , no doubt , Thanks man. would love to see you doing more tutorials.

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

      Thank you Abdelhamid! I appreciate the kind words!

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

    Is it just or does he soft a little bit like Sansa Stark from ga of thrones?

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

    I already know this is gonna be good! Thanks Leigh.

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

      Haha thanks Ryan, did it live up to expectations?

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

      @@leighhalliday Of course Leigh, you never disappoint!

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

    I get error trying to import the Combobox files - [!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript) - ../../node_modules/@reach/combobox/styles.css (1:0) :root {

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

    TNice tutorials was for 2 years

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

    Leigh, help please. Why is the MarkerClusterer not working anymore ?
    No overload matches this call.
    Overload 1 of 2, '(props: MarkerClustererProps | Readonly): ClustererComponent', gave the following error.
    Type 'Element[]' is missing the following properties from type 'Element': type, props, key
    Overload 2 of 2, '(props: MarkerClustererProps, context: any): ClustererComponent', gave the following error.
    Type 'Element[]' is not assignable to type 'Element'.ts(2769)
    index.d.ts(378, 15): The expected type comes from the return type of this signature.
    index.d.ts(378, 15): The expected type comes from the return type of this signature.

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

    and get tNice tutorials soft out.

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

    Sorry for interruption, but then you build your frontend app, your env vars for frontend is packaged by bundler into the code, so there is no issue to use key in place. You should protect your key by limiting domain names per key instead.

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

      You're right, but I think it's a good habit to get in to! Especially for public repos on GitHub, having API keys exposed makes them pretty easy to find, and if you accidentally leave a backend key exposed, you're in big trouble! Better to practice good "key hygiene" all around, which I think means keeping them in ENV vars, and also limiting them to domains like you said.

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

    Leigh Halliday thanks for this great piece work, i just have a question: Can the centre be the original/live position of the user.

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

      Yea! You'll need to use the browser geolocation functionality... that said, the user may not grant you access to it.

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

    Hey Leigh, I really appreciate your tutorial and the work you've done. I just have one problem in my project on which I cant find any workarouds/solutions. I have current user pin and I want it to behave exactly like in google maps ( Follow user, move map position, smooth transition, etc... ) do you have perhaps any tutorial on this subject?

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

    Thankyou for sharing such valuable information... I really needed this! 🤩

  • @MrYyope15555
    @MrYyope15555 Місяць тому

    Genius composition!

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

    There's a video on In The setup's channel about free DAWs, alternatives, and even if you can't afford it you can "get" it. Not quite an

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

    project a lot because I've been working on other stuff (and being lazy lol). Also, I had been facing a recurring problem of content dropouts in

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

    Is it normal for Canadians to pronounce longitude as "LON-git-ood" instead of "LON-ji-tood"?

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

    I need help creating a custom map for my business and I know a website that I want to mimic... Could you please teach me how to this virtually on zoom? Also, what do you charge to teach me?

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

    Facing this error:
    React Hook "useLoadScript" is called in function "map" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use" react-hooks/rules-of-hooks

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

    I've been struggling with using a custom component as a marker. Everywhere I go says just pass in lat lng props to the children and the maps will handle the rest but that's not happening + typescript it throwing an error :(

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

    I recomnd you two to buy the Producer Edition (And if you have got money, buy the Full Bundle)

  • @Kim.5047
    @Kim.5047 2 роки тому

    soft interface support.

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

    can does this include navigation from the user's GPS?

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

    why am i get 'Cannot read properties of undefined (reading 'maps')' ...

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

    it propmted me with open your billing account issue. and map is on development mode with watermarks. this aint free anymore?

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

    hi im trying to follow your code but only with javascript...im stuck at the panTo section. I get an error saying panTo is not a function

  • @JM-og9ph
    @JM-og9ph 2 роки тому

    worked for . On default it was at Agressive TE for but I clicked to the right

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

    Hi Leigh, is there any way for me to use it's API without entering Billing Info? It stressed me out tho to have to deal with it

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

    make fire as soft

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

    How can we add a marker and set the orientation based on the direction. Like uber's car marker moving towards the direction. thanks

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

    in soft rolls?sorry in my English.I hope you can help

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

    Please clarify if the goggle-maps-api package is mandatory for react or not ?

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

    What is the code if you want display in "miles" instead of "km"

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

    Very useful video about using google map in react project. Thank you so much Leigh !

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

    I guarantee tNice tutorials - I am going to pursue soft one way or another. It is my dream to make art that inspires people and shows them so

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

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

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

    TNice tutorials

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

    watcNice tutorialng one or two every night, SUPER helpful, cNice tutorialll and clear. Great content, can't wait to watch them all.

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

    Hey thanks for this tutorial, working with react is kind of amazing when you can create something like this in minutes.
    I have a problem though when using strictmode=true the directionrenderer kinda gets called twice and then renders the old direction (first; if new building selected) and I am not really sure why. I mean with strictmode: false everything works it is just a little confusing to me.

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

    These are the kind of tutorials I love! I'm tired of looking up a new technology and seeing the same tutorial over and over again
    Will definitely switch to this package and follow part of your tutorial
    Love the thumbnail btw 🤣

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

      Thanks for the kind feedback!! Glad you enjoyed it!

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

    Gosh, you're incredible man. Thanks for sharing your knowledge!!!

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

    This is amazing video with a lot of great helpful works very you.

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

    how we can use our distance mapping algorithm in this application ???

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

    Thank you! This tutorial has accelerated my learning curve regarding google maps.

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

    Alguien me puede orientar de como hacer para ubicar autos en el mapa en java. donde me puedo dirigir para investigar eso. Gracias

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

    This is absolutly working for 100% sure.enjoy it.Thank you.

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

    Guttering you don't start from scratch

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

    Lol sa

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

    TNice tutorials was honestly so helpful. I’ve been working around soft, whether it be church, singing in a band, or theatre for most of my life so tNice tutorials

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

    Thanks for everything your the great man, stay healthy bro! You are the best

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

    Thank you very much for making amazing map videos, @Leigh Halliday, I have a question or we can say doubt if you can answer, I am experimenting on a map project, where we will have 15 million markers on the map, we are simplly adding them on the map via array.map function, which is the straightforward thing, but here is the challenge we have a filter UI where we have checkboxes, to hide/show markers based on their category, everytime we want to hide/show some markers, we filter the main array, which causes the state change, and all the 15M marker start rendering again, because of that state change, which causes the freezing issue, what do you think is the way to optimize the performance?

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

    GG finally something that works

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

    hey Leight, your videos are perfect. I recently i have to make a react app what need a map to render. I choose to use google map. But since i am new to the world of map and how maps are made and rendered specially with react and google map, I was wondering if the react-google-map/api is the right package to choose? I have also seen it's documentation, it is not that much and not a big community. Could please state why are you using it? and the pros and cons of it?

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

    Hi, how can I re-render polylines sir ?

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

    Never saw such well explained video thanks you ❤️❤️❤️

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

    Awesome tutorial, love your stuff!
    I am having an issue with the map styles, though. When I run my dev app on my phone, I get a TypeError. I know it has to do with the "mapId" in the options object, because when I comment it out, I get no error, and it works flawlessly. It seems to work on web, no problem, but on my phone, I get the error message. Also, when I pan and zoom to different locations, its also blurry (This does not happen with the default map styles). As I said before, the pan and zoom is flawless on web, the error is on my phone specifically.
    Sorry to ask, but I couldn't find anything helpful online.
    Thanks and great work!!

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

    The best video on ReactJS and Google Maps & Place API. Thank you Sir.

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

    Can you use soft from soft soft to make profit?

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

    Thank you, It was really helpful.

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

    Great videos learned a lot of things through this video. Thanks to you Leigh Halliday. Please make a video on Geofencing

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

    Great video! just a question, can we customize the cluster icon style? How do we do that?

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

    You should be my maths teacher

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

    one and only easy and working method

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

    is this google map API paid ??By the content is GREAT!!! ❣️

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

      Thank you :) They have a generous free plan which typically covers any personal use. It is pod if you go beyond these limits though.

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

    You saved me sir. Thank you.

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

    best starter tutorial for google maps in react . thank you for this valuable content !!!

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

    This was such a good demo and scenario! Thank you Leigh.

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

    MarkerClusterer is not working anymore. Anyone have the same issue ?

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

    Nice tutorial.... Very helpful

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

    Wow nice tutorial sir. Very useful

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

    this is a product in itself. very nice

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

    which vscode theme do you use?

  • @은재-u9k
    @은재-u9k Рік тому

    10:41

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

    The courses no1 makes these days! pure gold!

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

    Good guide for beginners)

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

    Wow.... you are handsome right now.. :) Btw I learned a lot from you regarding to map. But from now on I prefer to use leaflet. It's free and has a lot features close to google map. Try to make tutorial with leaflet and OSM. Thanks

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

      Haha... maybe it's my new lighting :D It's great to have options! They all push each other to improve and in the end the users and developers win.

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

      @@leighhalliday Yes... agree with you. You are great!

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

    Great video! Thank you!