Clustering data in Google Maps and React

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

КОМЕНТАРІ • 158

  • @djthul
    @djthul 3 роки тому +2

    This was an incredibly useful tutorial, thanks Leigh! I would have struggled to get this all working on my own!! I wanted to point out that if you have more than a couple thousand points this will struggle if the user zooms in quickly, the map would freeze for 30 seconds or so. I changed the two useStates for bounds and zoom to be updated in a reducer instead and it perfoms much better! I think it was rendering multiple times for each zoom level because each was setting state separately. Just in case anyone else is having the same issue. Thanks again Leigh!

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

      Hey Dan! Yea, sounds like at that point it should probably be debounced.

    • @HolmesPatrick
      @HolmesPatrick 3 роки тому

      May you share your code please with reducer, I am struggling

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

    Thank you...I had to show millions of markers in map in my project..this is helped a lot...thank you

  • @emersonaraujo406
    @emersonaraujo406 4 роки тому

    The best tutorials found on the web come from Mr. Leigh Halliday! Not a single detail left behind. Thank's a lot for bringing us the best material.

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

      Cheers, Emerson! Thanks for watching and showing your support!

  • @ridl27
    @ridl27 3 роки тому +1

    Thank you Leigh! I remember that I saw some tutorials w/ maps on your channel, so I checked and... Boom! Here is exactly tutorial that I needed for my job project!
    Your tutorials are really practical! :)

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

    Thanks for sharing! I found it extremely helpful. Much appreciated from people on the interwebs!

  • @rotimibest8530
    @rotimibest8530 3 роки тому

    Thank you for taking out the time to make the video. I read the article but the video was much easier for me to consume

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

    Thank you Leigh !! It is great video with detailed explanation ❤

  • @IvanGarcia-cm4zo
    @IvanGarcia-cm4zo 3 роки тому

    I can not explain how much this helped me! Thank you very much! I am your number one fan forever!!!!!

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

    Leigh amazing job making this, I am making an app web and mobile version and I just got through modifying this slightly to work on react-native as well! its so great that both versions of my app will be able to make use of this thank you so much for making it !

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

      how did you modify in order to work on React Native? Im having problems assigning the coordinates to the clusters. Any tips ?

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

      @@psymannizback So the missing piece for me from react to react-native was the map zoom level which the superclusters need. So what I did was write a small function that takes in the screen width, northeast longitude and southwest latitude (part of the map boundaries ) and run them through to calculate the zoom level based on that. After i got the zoom level superclsters worked just like on reactjs, does that help?

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

      ​@@ScubaSEAsons I tried to just render the clusters before going into the zoom part, just to see how its working but could not get it done, also the clusters object is always returning a empty array, I don't understand why

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

      @@psymannizback might be the way your boundary coordinates are going in, as Leigh mentioned there is a specific order they have to go into and if i recall i think it actually a different order for mobile than it was web, mine are in this order: southwest lng, southwest lat, northeast lng, northeast lat

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

      @@ScubaSEAsons thanks for the replies, may I add on discord to ask some questions regarding this topic?

  • @siobhanx3525
    @siobhanx3525 4 роки тому

    Thanks for these awesome tutorials, Leigh. I always come away with a clearer understanding, which is so motivating. Greatly appreciated!

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

      You're very welcome, Jeanne! Thank you for the support :)

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

    Great! The BEST tutorial. Thanks a lot for your sharing.

  • @shalinikarkera2387
    @shalinikarkera2387 3 роки тому

    One of the best tutor I would say! so much clear explanation, up to point. Many thanks :)

  • @mortezatourani7772
    @mortezatourani7772 4 роки тому

    Optional chaining is now stage 3. It'd be great if you create a video about it or explain it while using it on one of your resourceful videos. I bet many will love it ;)
    Great job, BTW.
    I watch your channel whenever I have some time.
    Right now playing all your uploads to the very beginig. LoL

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

      Are you saying you don't like doing:
      if (data && data.user && data.user.address && data.user.address.country === 'CA')
      😂

  • @BetuUuUu
    @BetuUuUu 4 роки тому +3

    thanks for the video you've made, it's helping me build a service to help fighting the coronavirus

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

      That's awesome to hear! Share when you're done!!

  • @waterbabalance
    @waterbabalance 3 роки тому

    Amazing! Thank you for sharing.

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

    This was super super helpful, thank you so much!

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

      Thank you Nina, I appreciate the support! :)

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

    Awesome content man! Thank you very much!!

  • @tuananhdo1870
    @tuananhdo1870 3 роки тому

    I like the song at the beginning, and the video tutorial too :)

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

      Hmmm... don't remember having a song :D (it was a while ago) but glad you enjoyed the video!!

    • @mattiasfjellvang
      @mattiasfjellvang 3 роки тому

      @@leighhalliday HELLOOO.. HELLLOOOO.. HREEEELO!?!??

  • @guymandude2774
    @guymandude2774 4 роки тому

    thank you for the video and code sample! Your channel is great!

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

      Thank you guy man dude, I appreciate you and your sweet name.

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

    Thank you very much, bro.

  • @budosra.vagner
    @budosra.vagner 4 роки тому

    Nice! Helped me a lot, thanks.

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

      Glad I could help :) Thanks for saying hi!

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

    Thanks for the awesome tutorials, Leigh.
    Just a question, is there any way we can get which crime is in a cluster? Many thanks!

  • @bilelrahmouni01
    @bilelrahmouni01 3 роки тому

    thank you!!

  • @sigfigronath
    @sigfigronath 3 роки тому

    this is awesome, do you know any api 's to get nearby hospitals so we can make something like this ?

  • @emrehanc4882
    @emrehanc4882 4 роки тому +1

    Thanks Leigh, that was I need it, before moves project to live. You saved my ass bro.

  • @MatheusSantos-qm6iw
    @MatheusSantos-qm6iw 4 роки тому

    You're the best!
    Tks!

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

      Thanks Matheus, glad you enjoyed the video :)

  • @hachij_
    @hachij_ 3 роки тому

    thanks for this!

  • @technicallyparv
    @technicallyparv 4 роки тому

    Niceeeeee. Tres flip massive

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

      Ahhh man, I miss the days of being able to do a 360 flip... I could probably still rock kickflips... might need a bit more practice to get back into tres flips

    • @technicallyparv
      @technicallyparv 4 роки тому

      @@leighhalliday Haha! Same man xD Haven't been on a board in a while, React is the new tres flip :D. Love the videos by the way!

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

    nice tutorial

  • @devmrin
    @devmrin 4 роки тому

    This is amazing. Thank you.

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

      Thank you Mrinmay! Glad you enjoyed it :)

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

    How to solve the problem if there is a markers with the same position in terms of lang and lat? Please I need a help

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

      тебе не помогут

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

      @@arystanaltynbaev8542 ответят по-любому !!!!

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

      Perhaps marker clustering is a solution, I have examples in both google maps and mapbox

  • @scottkatzelnick9705
    @scottkatzelnick9705 3 роки тому

    This is an amazing implementation of clustering. I have it working great based on this tutorial. The google-map-react and your useSuperCluster package makes it so simple. I just have an issue displaying a pop up window above an individual marker with this clustering method implemented. If I don’t use clustering I see tutorials on how to add a pop up window, but when I add clustering, I can’t find any tutorials on how to implement both. Is there a straightforward way to implement pop ups only above individually clicked markers with google-react-map, or is there a certain technique you would suggest. Maybe a custom hook for showing hiding a pop up window perhaps. I’m just having a hard time wrapping my head around this. Thanks everyone!

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

      Hey Scott! Thank you :) I would try to avoid using built-in InfoWindow, and try to control it via state yourself. The goal is to put into state whatever info you need, whether that be an ID, or an array of IDs or whatever, and then show an InfoWindow in React when the state has a value.

    • @scottkatzelnick9705
      @scottkatzelnick9705 3 роки тому

      @@leighhalliday Thanks, Leigh! I did just that and showed a conditional pop-up window when pressing on an individual pin. I did have to create a third outside of the clusters.map() function that gets passed longitude, latitude, and a username as props from the marker that's clicked on, as I am displaying user data in the pop-up. So I set the state of my custom hook to an object with those properties and then passed that through the setter hook so the pop-up "Marker" could have access to those outside of the clusters.map() function. It was a nice challenge, but well worth it. Thanks again!

    • @gurkiransingh1537
      @gurkiransingh1537 3 роки тому

      @@scottkatzelnick9705 Hello Scott, I am struggling with displaying a popup on a marker. If you can share your code that be really helpful. Thanks

    • @scottkatzelnick9705
      @scottkatzelnick9705 3 роки тому

      @@gurkiransingh1537 Are you using the clustering library shown in this video, or do you just need a pop-up in general?

  • @HolmesPatrick
    @HolmesPatrick 3 роки тому

    Thanks great video, i have a need which is combination of bear finder tutorial and cluster and in one place(lat, lng) where millions can click, the cluster should count no of clicks in each lat, Lng and show the aggregate, need your guidance , how to reach you.

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

    Hi Leigh, I was wondering if there is way to add info window on click of each marker in the GoogleMapReact component

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

      Hey Harini! Definitely, what you’ll need to do is store an array of selected locations rather than just one, then map them onto the map like you did with the markers themselves. It adds some complexity but is definitely possible.

  • @pratibhalovesu
    @pratibhalovesu 4 роки тому

    this one is very tuff man....

  • @ray-lee
    @ray-lee 3 роки тому

    1:08 do you recommend google-react-map or @react-google-maps/api?

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

      I honestly can't remember the difference off of the top of my head haha. I'd say pick whichever has better docs, is being actively maintained, and has strong support (downloads).

  • @cempakajanuari5983
    @cempakajanuari5983 3 роки тому +1

    Thanks Leigh, can you make another tutor using @react-google-maps/api. They said that react-google-map sadly unmaintained. @react-google-maps/api provides very simple bindings to the Google Maps JavaScript API v3 and lets you use it in your app as React components.

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

      Hey Cempaka! I thiiiiink I use that library here... ua-cam.com/video/WZcxJGmLbSo/v-deo.html although it doesn't cover clustering.

  • @BrianSmith-xm8zk
    @BrianSmith-xm8zk 4 роки тому

    Hi Leigh thanks for making this video. I have it working well but am trying to migrate it to use the @react-google-maps/api framework to match your article React Google Maps 2020 Update. It does not seem to be picking up the bounds when the Google Map is loaded so no clusters are displayed. Any advice? Thanks in advance

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

      Hmm... are you able to see the bounds within the console, or aren't able to get them at all? You may have to store them in state, and then update them after the map has loaded for the first time, which would give you the ref and the ability to update the state values... that in turn would cause it to re-render and show clusters.

    • @BrianSmith-xm8zk
      @BrianSmith-xm8zk 4 роки тому

      Thanks Leigh I’ll try that

  • @saivipulchakravarthy8853
    @saivipulchakravarthy8853 3 роки тому

    Thanks for the video leigh!
    I have integrated the same thing in my project but getting the empty array from useSuperCluster hook any idea about this?

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

      Hey Sai! Hmm... check to make sure your zoom and bounds set correctly

    • @saivipulchakravarthy8853
      @saivipulchakravarthy8853 3 роки тому

      @@leighhalliday I have checked but same issue

    • @saivipulchakravarthy8853
      @saivipulchakravarthy8853 3 роки тому

      useSuperCluster is returning an empty array. will it take longer time to render?

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

      @@saivipulchakravarthy8853 did you ever get this fixed. I am returning an empty array but can console bounds, ref and zoom ok :(

  • @alexandrecsu
    @alexandrecsu 3 роки тому

    is there a way to access the points in the cluster ( usecase: I want to display a pecific point fron cluster instead of a cluster icon)?

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

      There is! There's a function from supercluster that gets the "leaves" of a cluster: github.com/mapbox/supercluster#getleavesclusterid-limit--10-offset--0

  • @rendomone
    @rendomone 4 роки тому

    Can we clusterize markers ONLY if there is more than n numbers on screen?

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

      I don't think so with supercluster... at least from what I can see in the options, but you could just ignore the supercluster points and show the raw ones if the number is low enough, or even have 2 different components that handle displaying them when the numbers are below a certain number.

  • @mohanreddy4669
    @mohanreddy4669 4 роки тому

    Can you please make a video on popover or infowindow on clicking the marker? Please

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

      Hey Mohan! In this video I don't do clustering but I show infowindow and marker click events: ua-cam.com/video/Pf7g32CwX_s/v-deo.html

  • @kostasspiridakis7626
    @kostasspiridakis7626 4 роки тому

    Great lesson!Thanks ! I'm currently working on making a map with about 8 million markers and their clusters. In a previous video you suggested kepler.gl .As i am working on jupyter and kepler my browser keep crashing when i enter over a million of points. Do you have any further suggestion? Thanks in advance

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

      Hey Kostas! Honestly if kepler.gl can't handle all your markers, I don't think this even stands a chance... sorry, not really sure what to recommend when you're dealing with that much data!

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

      Here's a potentially dumb idea :) What if you stored psuedo markers with less resolution?
      For example... Toronto is: 43.653225, -79.383186
      What if you stored all the markers at 43 and -79 together, and a count of how many there are. So when you are zoomed out far, you will show these high-level "rounded" (less precision) markers... and when you zoom in, you will reach for the real ones.
      The goal I think is to avoid having to show 8 million markers all at once... show less data that visualizes the same thing.

    • @kostasspiridakis7626
      @kostasspiridakis7626 4 роки тому

      @@leighhalliday Thanks for such a quick response! That sounds like a great idea , the thing is that i add_points to kepler map. I don't use an in react implementation. Should i switch in js?

    • @nioneoleineib4237
      @nioneoleineib4237 4 роки тому

      @@kostasspiridakis7626 Hello, I am working with the same amount of data on my project, did you find a solution ? Could we tchat if its the case ? My wire : ant_one

    • @kostasspiridakis7626
      @kostasspiridakis7626 4 роки тому

      @@nioneoleineib4237 Hey, sorry for late response. Check wire

  • @sanker213
    @sanker213 4 роки тому

    Would you make a video/ article walk through for react native on how to do this?

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

      Hey Christian! Sorry, I'm not super familiar with React Native... I don't think I'll be making this any time soon.

    • @sanker213
      @sanker213 4 роки тому

      It’s okay thanks for the reply though if I will share with you when I get it for react native.

  • @The100ra
    @The100ra 3 роки тому

    I'm trying to implement exactly the same thing, but it seems that the onChange event gets triggered only once, and that's when the map gets rendered for the first time.

    • @The100ra
      @The100ra 3 роки тому

      I found the solution. It seems in order to get it working we need to add resetBoundsOnResize={true}

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

      Thanks for following up with the solution Sadra!

  • @poatest1371
    @poatest1371 4 роки тому

    thank you very much for this helpful viedo , may I ask you how to add Polygon ?

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

      Hey Poa! In the react google maps api package used in this video I couldn't easily see how, so you may want to look into this library, which has a Polygon component that can be used. react-google-maps-api-docs.netlify.app/#polygon

    • @poatest1371
      @poatest1371 4 роки тому

      @@leighhalliday thank you for your prompt answer. Well the package used in this video is google-map-react and not react-google-maps that's why when i tried to look at the available documentation and smaples at google-map-react I didn't find how to add polygon .
      So at the end shall I have to import the 2 packages to add a ploygon? if yes this kind of weird.
      my last question to you can we use supercluster hook with react-leaflet?
      Many thanks in advance

  • @sunnywanted05
    @sunnywanted05 3 роки тому

    giving me error that :
    Type '{ children: Element; key: number; lat: any; lng: any; }' is not assignable to type 'IntrinsicAttributes & { children: any; }'.
    Property 'lat' does not exist on type 'IntrinsicAttributes & { children: any; }'.ts(2322)
    (JSX attribute) lat: any
    Please help

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

    I can't display html elements in marker. only icon option works. anyone can help?

  • @MsLaez
    @MsLaez 3 роки тому

    :') Thank you

  • @pratikthacker
    @pratikthacker 4 роки тому

    ./node_modules/use-supercluster/dist/use-supercluster.esm.js
    Module not found: Can't resolve 'supercluster' in
    getting this error after doing "npm i use-supercluster"

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

      Hey Pratik! Install `supercluster` as well, it's a peer dependency of this gem.

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

    Hey guys, I'm struggling to replicate the video using typescript, does anyone know where I can find some examples?

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

      Just throw a bunch of anys and you’re good to go :)

  • @randyxarrigeorge3487
    @randyxarrigeorge3487 4 роки тому

    Can't seem to make CRA see my env variables. Do I need to install dotenv library or something?

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

      Hey Randy! Make sure to name them starting with `REACT_APP_`, otherwise they won't get picked up. create-react-app.dev/docs/adding-custom-environment-variables/

  • @TheTeup
    @TheTeup 4 роки тому

    I tried to see the markers on the street view but they haven’t been shown there. Any suggestions?

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

      Hmm... anything you can share to help troubleshoot?

  • @tranankhang8791
    @tranankhang8791 4 роки тому

    Thanks. Great tutorial !!! Can you make another tutorials about google maps with react native in mobile?

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

      Hey Tran! In the near-term, probably not... because I am not very strong with React Native, but long-term, yea, for sure! I'd love to cover React Native as well. Stay tuned :)

  • @carlosqotsa
    @carlosqotsa 4 роки тому

    I tried many times but i still got the same error, "Cannot read property 'range' of undefined
    at Supercluster.getClusters (index.js:84)"

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

      Hey Carlos! Here is the source from the video... try comparing what I did to the finished solution, remove stuff and add it back in until you get to the point of the error happening. It sounds like make the data isn't in the right format when passed to the hook (which passes the data to supercluster): github.com/leighhalliday/google-maps-clustering

    • @video12417
      @video12417 4 роки тому

      @@leighhalliday Super cluster dependency has problem in production

  • @Patsosound
    @Patsosound 4 роки тому

    When I import the library just like: import useSuperCluster from "use-supercluster";
    It gives me an error "Failed to compile" ./node_modules/use-supercluster/dist/use-supercluster.esm.js
    Module not found: Can't resolve 'supercluster' in '/Users/.....................'

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

      Ah, this package has a peer dependency on supercluster... so just `yarn add supercluster` to your project and it should be fine.

    • @Patsosound
      @Patsosound 4 роки тому

      @@leighhalliday Awesome. This action fixed my issue. I appreciate the help sir!

    • @Patsosound
      @Patsosound 4 роки тому

      @@leighhalliday Thank you for a nice tutorial.

  • @mediocre7199
    @mediocre7199 4 роки тому

    Nice tutorial sir, so how to render about a hundred thousand markers without hang the browser? Actually i use @react-google-maps/api and i'm already clustering the marker too. Thanks by the way

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

      Hey Rizky! I think you should look into kepler.gl which seems to handle this high volume better. It's from Uber and is built on top of MapBox. Also, I would question whether you should be rendering 100k markers?

    • @mediocre7199
      @mediocre7199 4 роки тому

      Hey there sir, yes i would like to rendering around 123k markers, is kepler.gl provide styling maps like google maps? And how to integrate with google api keys? Honestly, i never done before with this. Well thanks for replying my question.

    • @mediocre7199
      @mediocre7199 4 роки тому

      Well thanks for the answer sir, i've just found the solution for this, i'm rendering over 3000 marker by pure google maps API without any library, maybe i could rendering over 100k marker too idk.

  • @vishalgupta-wp2sy
    @vishalgupta-wp2sy 3 роки тому

    hi sir , how can we draw polyline of cart direction using google-map-react library . i didn't find anything about polyline in www.npmjs.com/package/google-map-react .
    please help me

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

      Hey Vishal! I have zero idea :) It's not something I've done before... sorry!

  • @pksasso
    @pksasso 4 роки тому

    thanks , this video helped me a lot, but a miss one thing, how can i handle with the click on the button, i wish a info window in my app but i don't found this in the documentation

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

      Hey Patrick! I don't have a video specifically showing how to make a popup (info window) for a cluster, but I have a video showing how to make one for a marker, so you may be able to translate that to your project... let me know! ua-cam.com/video/Pf7g32CwX_s/v-deo.html

    • @pksasso
      @pksasso 4 роки тому

      @@leighhalliday Oh, thanks , I just watched your video and it worked, but its really hard to pass data from other component.

    • @mengkhornkan5130
      @mengkhornkan5130 4 роки тому

      @@pksasso Can you show me about it. I want info window too.

  • @devendradhayal591
    @devendradhayal591 3 роки тому

    import useSupercluster from "use-supercluster";
    above line is giving error in my project:
    Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
    I am not able to use 'use-supercluster' library

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

      It's literally 1 file long if you'd like to take a look and try to troubleshoot the issue :D github.com/leighhalliday/use-supercluster/blob/master/src/index.tsx

  • @mohanreddy4669
    @mohanreddy4669 4 роки тому

    My cluster count is going out of circle boundary. Any suggestion on how to do css for that?

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

      Hmm... is the number too large? More padding?

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

      Maybe to change the style of the market when you detect it's a larger number vs a small one... Add an extra class to it so you can have a smaller font

  • @TommyMinivan
    @TommyMinivan 4 роки тому

    Having trouble getting my data through mapping. I'm using a different api.

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

      Hey Tomi! Maybe you can share a codepen so we can help! Is the issue in the API call or the processing of that data to convert into points needed for the useSupercluster hook?

  • @rocmarkz6742
    @rocmarkz6742 4 роки тому

    Would You mind to take a look at @react-google-maps/api and make a video demo how to use this? Have try that out and idk what i miss didn't work QQ

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

      Hey RocMark! I am planning to redo the Google Maps in React video this year using @react-google-maps/api... stay tuned, probably within the next few weeks.

    • @rocmarkz6742
      @rocmarkz6742 4 роки тому

      @@leighhalliday thx for reply subbed !!

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

    Can anyone please add a infowindow to this.

  • @mohanreddy4669
    @mohanreddy4669 4 роки тому

    can you make a video on how to render over a million markers on google maps without having performance issue?

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

      Check out kepler.gl from Uber, it's something that can handle massive amounts of markers.

    • @mohanreddy4669
      @mohanreddy4669 4 роки тому

      @@leighhalliday Thanks for the prompt responses.

  • @MrGlevert63
    @MrGlevert63 3 роки тому

    Hello Leigh and all. I really like you teaching Leigh. I am at minute 24:29 and when I run, I get (below). Anyone has any clue what I did wrong? I was able to see the map i an earlier iteration of the code. Note: New at VSCode-React.
    TypeError: Cannot read property 'map' of undefined
    App
    E:/Documents/prolobiz/src/App.js:49
    46 | // 4) render map
    47 | return (
    48 |
    > 49 |

    • @MrGlevert63
      @MrGlevert63 3 роки тому

      This is the code I understood to be correct:
      return (

      {
      mapRef.current = map;
      }}
      onChange={({zoom, bounds}) => {
      setZoom(zoom);
      setBounds([
      bounds.nw.lng,
      bounds.se.lat,
      bounds.se.lng,
      bounds.nw.lat
      ]);
      }}
      >
      {clusters.map(cluster => {
      const [longitude, latitude] = cluster.geometry.coordinates;
      const {
      cluster: isCluster,
      point_count: pointCount
      } = cluster.properties;
      if (isCluster) {
      }
      return(





      );
      }) }


      );

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

      Hey Guy! Hmm... it's a good question! Are you able to join the Discord group and share your source code? Perhaps I or someone else in the group can help! Thanks again for your support!!

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

    is this outdated?

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

    try @react-google-maps/api next time

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

      Hey Alexey! What do you like more about it?

    • @rocmarkz6742
      @rocmarkz6742 4 роки тому

      wanna see functional component demo on @react-google-maps/api

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

    My app is crashing, and I'm getting this error whenever I use the useSupercluster hook with google-map-react "Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at Supercluster.load (index.js:36:1)." Any help would be appreciated