Adding Geolocation and Google Maps to a Vue Application

Sdílet
Vložit
  • čas přidán 29. 07. 2024
  • In this video, I'll show you how to use two simple packages to introduce geolocation and embedded Google Maps to your new or existing Vue apps.
    Follow-up video showing how to populate a Google Map with pins: • Populating Google Maps...
    Join my weekly newsletter for tips on Laravel + more: aschmelyun.substack.com
    You'll learn how to:
    - Get the users latitude and longitude if they allow your app to use location
    - Handle a rejection if your user does not approve location services
    - Embed customizable Google Maps, accessing its zoom and center
    - Obtain a Google Maps JavaScript API key for use with your map
    Follow me on Twitter! / aschmelyun
    Thanks Patreon supporters!
    - Sam Ross
    Directly support these videos @ / aschmelyun
  • Věda a technologie

Komentáře • 70

  • @aschmelyun
    @aschmelyun  Před 4 lety +16

    If you'd like to see the finished source code for the demo in this video, check it out here: github.com/aschmelyun/geolocation-google-maps-vue

    • @souravkaran6497
      @souravkaran6497 Před 3 lety

      Awesome work. Can you give some suggestions or small example by using apple mapkit instead of google map?

  • @dimokabdullaev6646
    @dimokabdullaev6646 Před 4 lety +2

    Thank you man! Highly apprecited! That is what I need

  • @cyrillamirand3745
    @cyrillamirand3745 Před 4 lety +2

    Great tutorial, thank you Andrew !

  • @radovankrizalkovic9084

    Really smooth and clear. Thanks man.

  • @bradmccord8895
    @bradmccord8895 Před 3 lety

    Hello Andrew, amazing video, thank you!
    Just one question, does this allow you to drop pins at specific locations on the map?

  • @LongJourneys
    @LongJourneys Před 3 lety

    Great tutorial. Exactly what I needed!

  • @lars-sorensen
    @lars-sorensen Před 4 lety

    Very useful and excellent video. Thanks!

  • @milou0104
    @milou0104 Před 4 lety +1

    Perfect! your explanations are always clear and straight forward.
    Can you cover using firebase databases within a Laravel project

  • @yarincepadilla6126
    @yarincepadilla6126 Před 4 lety +4

    what about the billing for google cloud platform
    ?

  • @santiagograviano9064
    @santiagograviano9064 Před 4 lety

    Great material, keep it up!

  • @matteogll84
    @matteogll84 Před 3 lety

    Nice tutorial, thanks!

  • @tomdigimon02
    @tomdigimon02 Před 3 lety

    Thanks you sooo much!
    Apprecited!

  • @hetulpatel3649
    @hetulpatel3649 Před 3 lety

    in that map integration in Vue google map billing account is required or not ?

  • @alexandros-markovits
    @alexandros-markovits Před 3 lety

    Great video! Thank you

  • @seyedmohammadhosseini1310

    Perfect, Thanks

  • @gurmukhsingh-uh5qo
    @gurmukhsingh-uh5qo Před rokem

    thank you for sharing

  • @digicoder
    @digicoder Před rokem

    Great tutorial. Also thumbs up for keyboard ASMR 😃

  • @swibay
    @swibay Před 2 lety

    Bro you are awesome... Thank you so much!

  • @jdm9033
    @jdm9033 Před 4 lety +1

    thanks, this is a great help. But how about the location pin, were it points were you are exactly, that is most common in google maps?

    • @tuanchu8022
      @tuanchu8022 Před 4 lety

      you're gonna need to use the Marker method, the documentation has a very clear explanation of it

  • @ssahillppatell
    @ssahillppatell Před 3 lety

    Thanks mate.

  • @josuebarros-desenvolvedorw2490

    To use this in NuxtJS, do you think its too hard to implement?
    I'm trying to decide whether to include the VueJS or the Laravel version on my Real Estate project I'm developing for a client right now

  • @citrace
    @citrace Před 4 lety

    Thank you Andrew. Two questions, which editor are you using? and do you have autocomplete address using google api tutorial?

    • @aschmelyun
      @aschmelyun  Před 4 lety

      You're welcome, I'm glad you liked it! I'm using PHPStorm with the Material Theme UI and Atom One Dark color scheme.
      I don't have a tutorial like that yet, but I'll add it to my list!

  • @anokkibet3514
    @anokkibet3514 Před 4 lety

    It doesn't seem to work with type script.. any advice or solution...
    I am working on geolocation in vue pwa... it completely doesn't work.. help please!!! 😪

  • @lexelgaming
    @lexelgaming Před 4 lety +2

    Hi I need an explanation or a video using that same package and the gmap-marker please

    • @aschmelyun
      @aschmelyun  Před 4 lety +2

      You got it! I'll add it to my list.

  • @miguelruizad
    @miguelruizad Před 4 lety

    Thank you for your video tutor. It helps me a lot. Could you continue the video indicating how to place marks on the map, read from a mysql table?

    • @aschmelyun
      @aschmelyun  Před 4 lety +3

      I definitely will! I'll add it to my list, watch for future videos.

  • @RezaSeedin
    @RezaSeedin Před 4 lety

    Very nice tutorial, Also whats the keyboard you are using its sounds mechanical but very silent?

    • @aschmelyun
      @aschmelyun  Před 4 lety +1

      Thanks! It's a Cooler Master Masterkeys S with Cherry MX Blue switches! I record the sound of it separately and tone it done, it's a little louder in person.

  • @envygamer
    @envygamer Před 3 lety

    I am trying to use this along with Ionic, and I keep getting *"Uncaught TypeError: Cannot set property '$getLocation' of undefined"*, Any Pointers

  • @pharyyady
    @pharyyady Před 3 lety

    thanks andrew.... #ask
    how to calculate the distance between two locations

  • @harshitthakore5149
    @harshitthakore5149 Před 3 lety

    Thanks man.
    +1 subscribed

  • @imranlashari6578
    @imranlashari6578 Před 3 lety

    What about the Marker on the map?

  • @jakubmonikowski4871
    @jakubmonikowski4871 Před 3 lety

    Great, subscribed ! ... one thing I had to do is :
    replace :
    localStorage.center = JSON.stringify(center);
    with below :
    localStorage.center = JSON.stringify(this.map.getCenter());

  • @PrashantPanditDigiSarathi

    if this were to be made a mobile app with cordova would the geolocation still work? thanks!

  • @bilich7651
    @bilich7651 Před 3 lety

    someone help :C, install browser geolocation and throw me those errors on
    ->main.js when import shows 'Could not find a declaration file for module...' it exist and its well mounted
    -> in vue component when use this.$getLocation({}) shows this.$getLocation is not a function on console
    anyone who knows whats going on?

  • @MarcelloPato
    @MarcelloPato Před 3 lety

    Fantastic!

  • @larrevick
    @larrevick Před 3 lety +1

    If anyone like me is wondering why the Google Maps is not loading, I think it might have something to do with a somewhat recent change in Vue to force non-camel-case elements (e.g. GmapMap is auto lowercased to gmapmap).
    To solve this go back to your main.js file and add following line after the import and use.
    Vue.component('google-map', VueGoogleMaps.Map);
    Now go back to your Map.vue and use instead of as HTML tags.

  • @oladapodaniel6372
    @oladapodaniel6372 Před 3 lety +2

    Thanks for the tutorial, but you didn't indicate that i have to create billing account before my api key can be activated which will eventually display my map. Just adding the key is not working for me until i create a billing account. i dont want to create the billing account is there any other method?

    • @rajatchauhann
      @rajatchauhann Před 2 lety

      Unfortunately, I haven't been able to find a method without the billing, it could be done before but Google changed it so the billing is mandatory to access Google map APIs

  • @Troy-ol5fk
    @Troy-ol5fk Před 2 lety

    Please make a tutorial on vue transition/transition-group component

  • @marovsalexey
    @marovsalexey Před 5 měsíci

    What is this ide?

  • @anisdlakic8697
    @anisdlakic8697 Před 4 lety

    Hi, Unknown custom element: - did you register the component correctly

    • @aschmelyun
      @aschmelyun  Před 4 lety

      Try using and see if that works!

    • @Raza_9798
      @Raza_9798 Před 4 lety

      @@aschmelyun Unknown custom element: . i found a solution github.com/xkjyeah/vue-google-maps/issues/437#issuecomment-663937617

    • @miauw8762
      @miauw8762 Před 3 lety

      installComponents: true

  • @heyyy4987
    @heyyy4987 Před 4 lety

    how add restaurants from my db in map?

    • @aschmelyun
      @aschmelyun  Před 4 lety

      I'm creating a tutorial for this now, and it should be live within the next week or two!

  • @basharalmasri7919
    @basharalmasri7919 Před 4 lety

    I would like to thank you for this great work.
    How can we click on the map to add a marker and get the marker lat lng, if user clicks again, we will change marker to the new location.
    If we refresh we will centre the map and show marker to the centre of the map.
    Moreover, how can we add textbox to search location and choose from drop down menu and reflect on the map
    Please advice...

  • @romulonavas5863
    @romulonavas5863 Před 2 lety +1

    In me mitute 5:29 you declared vue2-google-maps in the main.js file, and you wrote installComponents: false. It should be TRUE, otherwise you will not see see the map (In my case).

    • @ivanc.6064
      @ivanc.6064 Před rokem

      I was thinking the exact same thing. How anyone followed this video with that error is anyones guess.

  • @payflipteam9983
    @payflipteam9983 Před 2 lety

    "Florida Man creates awesome app in under 17 mins!"

  • @CodingMadeEasy
    @CodingMadeEasy Před 4 lety

    Hey Andrew. I came across your video while randomly browsing Reddit. I have a random question, what font are you using? I really like it haha

  • @jacaratu2586
    @jacaratu2586 Před 3 lety

    Yessss...that was nice as a Sunday morning and smooth as a puppy-fench-bulldogs' ass Andrew! :) more on vue/nuxt - gmaps please

  • @MULTICODE
    @MULTICODE Před 4 lety

    Please can you make a Laravel API and Angular. Let's say an authentication system with laravel and Angular. Please

  • @shekhsaifuddin1353
    @shekhsaifuddin1353 Před rokem

    map api keys are not free anymore 😪

  • @kid_rz
    @kid_rz Před 3 lety

    is free? using google maps

  • @ivanc.6064
    @ivanc.6064 Před rokem

    i think this is more correct? installComponents: true,

  • @jahongirbektemirov6516

    don't work

  • @carlossfuentess
    @carlossfuentess Před 2 lety

    Where didnt you fu@# mention that a billing account needed to be created? I do not see the purpose of the video if a payment is required.