JavaScript Google Maps API Tutorial Updated [2023] - Create Google Map 🗺️

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • Track any phone location by its number :
    track.bzfrs.co...
    -------------------------------------------------------------------------------
    track.bzfrs.co...
    -------------------------------------------------------------------------------
    💻 Exclusive Content 💻
    👥 Patreon: / samcode
    ------------------------------------------------------------------------------
    Google Maps JavaScript API Tutorial 2021 is the latest and updated video in google maps api. In this video we will work a little bit with the Google Maps API by popular demand. We will implement a map with some custom markers, info window, event listeners and we will optimize the code so that we can easily add new markers with new properties to it. We will also go through how to remove the water mark (only for developer purpose) and go through how to make this project your own and add more properties and methods. #googleMapsAPI #GoogleMaps #Tutorial #Javascript
    Get my FREE eBook on Getting started with Google Maps Platform:
    www.samueltrai...
    -------------------------------------------------------------------------------
    Subscribe for more content like this:
    / @samcodes2912
    Thanks you guys are awesome!
    ---------------------------------------------------
    Check Out My Google Map Directions and Places API Video:
    • How to Build a Javascr...
    ---------------------------------------------------
    Source code: / samcode
    ---------------------------------------------------
    ▶ My Discord Server: / discord
    ---------------------------------------------------
    Subscribe for more! 🔔
    ​ / @samcodes2912
    ---------------------------------------------------
    JavaScript Google Maps API Tutorial Updated [2021]:
    • JavaScript Google Maps...
    ---------------------------------------------------
    Javascript Google Map Directions API & Places API Project:
    • How to Build a Javascr...
    ---------------------------------------------------
    Track Location Using IP Address In Python (4 lines):
    • Video
    ---------------------------------------------------
    Track phone number location using python:
    • How to Track any phone...
    ---------------------------------------------------
    💻 Exclusive Content 💻
    👥 Patreon: / samcode
    ---------------------------------------------------
    🌐 Social Media & Contact 🌐
    🌐 Twitter: / samcodes_
    📁 GitHub: github.com/sam...
    🌐 Discord: / discord
    ---------------------------------------------------

Комментарии • 112

  • @samcodes2912
    @samcodes2912  3 года назад +13

    Please like and subscribe it really helps the channel out.
    Timestamps:
    1:00 create Project
    2:43 Create API Key
    4:25 Html
    7:50 Create initMap Function
    12:43 Css
    13:22 Remove water mark on map
    15:50 Create Marker for map
    19:08 Marker Icon
    20:20 InfoWindow
    25:51 Add Multiple Markers
    40:10 Optimize Code.

  • @zb2747
    @zb2747 2 года назад +2

    20 min in and man I can’t thank you enough. You’re the only dev/teacher that explains the basics and like you said no bs just straight to the point without technical jargon and unnecessary abstraction. Thank you brother 🙏🏾

  • @andru5054
    @andru5054 3 года назад +6

    As someone who live in Torrevieja, it was so trippy to run into a video with 5k views only to see you using the exact same map area as I am for my project

    • @samcodes2912
      @samcodes2912  3 года назад +1

      That's great man. I had the same feeling when I saw your comment. 😁

    • @andru5054
      @andru5054 3 года назад

      Are you still around here?

    • @samcodes2912
      @samcodes2912  3 года назад

      @@andru5054 Yes I am. Been here for a year now.

    • @andru5054
      @andru5054 3 года назад

      @@samcodes2912 yo that's sick me too! I'm in Torrevieja, what part you from?

    • @samcodes2912
      @samcodes2912  3 года назад

      @@andru5054 Los Náufragos. what about you?

  • @ThatGuyAnonymous
    @ThatGuyAnonymous 3 года назад +8

    A much-needed tutorial! Besides the audio quality that can use some improvements everything else is fantastic. keep it up 👌

    • @samcodes2912
      @samcodes2912  3 года назад +1

      Thanks for the feedback. I will work on the Audio quality too. Really appreciate it 👍

  • @nylesflagg
    @nylesflagg 8 месяцев назад

    Thank you for explaining JavaScript at the same time... gave me a better understanding.

  • @Satisfyy
    @Satisfyy 2 года назад +1

    This video is literally unique!!! No one had studied this subject in such detail. You are awesome, my bud. I am very grateful ❤️❤️❤️

  • @J90JAM
    @J90JAM 3 года назад +1

    Nice video, good to see a tutorial on this that goes a bit more in-depth. I didn't realize how much you can modify the maps, the docs are pretty good.
    I added the mouseover event to the map instead and also added a mouseout event.

    • @samcodes2912
      @samcodes2912  3 года назад +1

      That's Great. This is the best way to follow a tutorial. Cheers!

  • @jatinderfutura8309
    @jatinderfutura8309 Год назад +1

    its not free. showing watermark message 'for development purpose only". how to remove this?

  • @kyleg6163
    @kyleg6163 Год назад

    really well explained - thanks for the tutorial!

  • @imranketamashay
    @imranketamashay 2 года назад

    This is awesome... You have saved my time.. .Cant thank you enough

  • @naveedurrehman7936
    @naveedurrehman7936 2 года назад

    That was amazing thank you so much and looking to watch more

  • @SuperKafooo
    @SuperKafooo 3 года назад

    Thanks man, I learned a lot from your video. I'll be coming back for more for sure. Liked and subscribed.

  • @jamesmassa1999
    @jamesmassa1999 3 года назад

    Yes, would love to see a part 2!

  • @guadalupetiendalopez9226
    @guadalupetiendalopez9226 3 года назад +1

    Thanks a lot... Keep going... greetings from Mexico.

    • @samcodes2912
      @samcodes2912  3 года назад +1

      Thanks man. really appreciate that👍

  • @pramadito
    @pramadito 3 года назад +2

    good tutorial, subscribed!

  • @BorgoreDrops
    @BorgoreDrops 2 года назад

    how would i add an option to search for something nearby? like example a search bar where i can enter "gas station" or "liquor store" and it would return nearby locations with that keyword?

  • @RajibAhmad
    @RajibAhmad 3 года назад

    Your channel will go massive very soon... keep up the good work

  • @LatinoWebStudio
    @LatinoWebStudio Год назад

    Thanks so much for this video!

  • @xacxdcx
    @xacxdcx 3 года назад

    Good video man! Keep it going!

  • @bhumikakarki9868
    @bhumikakarki9868 3 месяца назад

    i dont have visa or mastercard so what should i do?for cloud platform

  • @sportshub7988
    @sportshub7988 2 года назад

    great tutorials. Thank you

  • @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

  • @jhonrexmapa1947
    @jhonrexmapa1947 2 года назад

    do you know how to add a pin in map then when i press it thers a form at bottom showing its description?

  • @gencsaracaydin2530
    @gencsaracaydin2530 3 года назад

    Thank you for the tutorial, I was just curious if you could make another tutorial storing info of markers to the database as you talked about it in the video. It would really help!

  • @sinaukode
    @sinaukode 6 месяцев назад

    Thanks help me alot

  • @IkromRahimov-sb7sn
    @IkromRahimov-sb7sn 2 года назад

    thanks bro, Im grateful

  • @DonaldFranciszekTusk
    @DonaldFranciszekTusk 3 года назад

    Hey again, would you recommend Google Maps API over Mapbox API for app that uses places and tracks?

  • @yagzyalcntas553
    @yagzyalcntas553 2 года назад

    Hello, can you tell how i can paint around a marker with s specific radius? Thank you.

  • @juanfraxtube
    @juanfraxtube Год назад

    Very good thanks!

  • @lyeschikhi7075
    @lyeschikhi7075 2 года назад

    Hello, thank's for video. can you please tell us how can we execute this program with visuel code studio. because alwayse when i execute my program it shows me localost.

  • @wazirulazzan3686
    @wazirulazzan3686 3 года назад +2

    great videos, can you make tutorial about nearest marker by your marker google map api js ?

    • @samcodes2912
      @samcodes2912  3 года назад

      Great suggestion. will try and make that happen! :)

  • @plantnt489
    @plantnt489 11 месяцев назад

    Do I have to enable billing for my account in order to do this? :(

  • @K.Huynh.
    @K.Huynh. Год назад

    thank for sharing!

  • @TheWinx21
    @TheWinx21 3 года назад +2

    Hi there, firstly, thanks for the tutorial - it's great! I'd like to add marker clustering and have tried adding in the code as supplied by google maps documentation, but no luck.. Could you please give me some tips on how to add this in? Thank you :)

    • @samcodes2912
      @samcodes2912  3 года назад +2

      Thanks! really appreciate it. developers.google.com/maps/documentation/javascript/marker-clustering#maps_marker_clustering-javascript just follow the instructions in this link and change the locations to that of the markers. Hope it help out mate.

    • @TheWinx21
      @TheWinx21 3 года назад

      @@samcodes2912 Thanks Sam. I'm just not sure where to place the new MarkerClusterer snippet...

    • @TheWinx21
      @TheWinx21 3 года назад

      I've tried placing it within both functions.

    • @samcodes2912
      @samcodes2912  3 года назад +1

      yeah it gets a little bit more complicated when you want to add MarkerClusters from your mouse event(meaning when you click on the map the marker gets added to its area's Markerclusterer). We will need to edit the code a little bit more so it doesn't get to messy and make sure there are no bugs. I am a little bit busy right now but very interested in getting it done. I will even create a tutorial about it and the moment I have time to get it done I will send you a link to file immediately.

    • @TheWinx21
      @TheWinx21 3 года назад

      @@samcodes2912 thanks, I'd really appreciate that!

  • @b44rt
    @b44rt 2 года назад

    Good tutorial but the audio mixdown of this video is horrible, it is like you are whispering with full volume.

  • @amazinglife575
    @amazinglife575 Год назад

    Thanks for this video!
    Is this API usage free?

  • @xavier19410
    @xavier19410 2 года назад

    Hi there Sam , hope your well , i have a business idea where users visit the site , add a marker anonymously on the map as well as view other ppls markers . Can that be made possible via this software for instance ? Many thanks , Xavi

  • @thornsonita9049
    @thornsonita9049 3 года назад

    Thanks for your nicely video.

  • @lemolea9571
    @lemolea9571 2 года назад

    Thank you for the tutorial - very helpful! I do hope you restricted the key though, since you're actually showing it in the video haha

  • @hatdughatdug
    @hatdughatdug 3 года назад

    can i generate heatmap from database? im currently building a incident report system and i want to generate heatmap based from the number of incident reported in each area thanks

    • @samcodes2912
      @samcodes2912  3 года назад

      I should be possible. Have you researched about it?

  • @kodistamana6059
    @kodistamana6059 3 года назад

    Very good !!

  • @Maadara_uchiwa
    @Maadara_uchiwa 3 года назад +1

    thank youuuuuuuuuu

  • @preeamkumar6750
    @preeamkumar6750 3 года назад

    Thanku sir for this tutorial , can u make a tutorial on geotracking 🙏🏻🙏🏻

  • @gustavosantos106
    @gustavosantos106 3 года назад +2

    This video plays perfectly at 1.4x speed

  • @windnorth6594
    @windnorth6594 3 года назад

    Hi Sam, thanks for the tutorial. It’s a great help for a beginner like me. I had an issue with running the code on a local machine. I used your code in VS Code and launched it on Firefox. It wouldn’t display the map. But, it worked perfectly fine on a live server. I had no idea what the problem with this. Just wondering if you could help me with this? Thanks in advance.

    • @samcodes2912
      @samcodes2912  3 года назад

      Thanks . happy it's helping you out. Not really sure what you mean by local machine and when it worked was it on chrome or Firefox?

    • @windnorth6594
      @windnorth6594 3 года назад

      @@samcodes2912 Hi Sam, thanks for getting back to me. It didn’t work when I opened the html file in Chrome or Firefox browser from VS code. But it worked when I opened with live server from VS code.

    • @samcodes2912
      @samcodes2912  3 года назад +1

      It doesn't work because google map has to run through http and ip address and that's not the case when you open it directly through chrome or Firefox. You can see the difference in the url when you open it with live server and when you open it through chrome

    • @windnorth6594
      @windnorth6594 3 года назад

      @@samcodes2912 Thank you so much Sam 👍

  • @rajkumart08
    @rajkumart08 3 года назад

    Hi
    Is there any method in google maps where I can get the list of markers which I see in the specific view port and show it in list view

    • @samcodes2912
      @samcodes2912  3 года назад +1

      you would have to create the method. If I get you right you want a list of all the markers you created? Will the list contain the lat and lng of the markers or the name of their location?

    • @rajkumart08
      @rajkumart08 3 года назад

      @@samcodes2912 both

    • @samcodes2912
      @samcodes2912  3 года назад

      The thing is I am quite busy but will try and make it happen just can't say when. but what you need to do is create an empty div . create a storage for the the location and then place the stored location into the empty div.

  • @iceland360vr5
    @iceland360vr5 3 года назад

    Great tutorial Sam! I´m making a map with custom markers and info windows. I´m having some trouble adding an image to the info window though. Do you have any tips on how I could do that?

    • @samcodes2912
      @samcodes2912  3 года назад +3

      Sure thing. Try adding it in the MarkerArray like this {location:{lat: , lng: -},
      content:`Title123 Address City,Country`}. Hope this helps out.

    • @iceland360vr5
      @iceland360vr5 3 года назад +1

      @@samcodes2912 You're a genius, thank, it works :) I've added an image and a link, but now there's always a scrollbar appearing in the info window. Can you think of an easy way to fix that? ps: Thank you so much for taking the time to help, really appreciated!

    • @samcodes2912
      @samcodes2912  3 года назад

      This means your icon is too big. you will have to set the width and height of your content give it class name then in your css you will need to set overflow to hidden so it doesn't show the scroll.

    • @tornet3964
      @tornet3964 3 года назад

      @@samcodes2912 did you teach it before?

  • @cqboy84
    @cqboy84 2 года назад

    so in html every one will know your api key .anyone can use this key ?

  • @tornet3964
    @tornet3964 3 года назад

    Thanks bro

  • @nurulraws4490
    @nurulraws4490 3 года назад

    I still need to activate my billing account, and what are the rates?

    • @samcodes2912
      @samcodes2912  3 года назад

      It is for free

    • @nurulraws4490
      @nurulraws4490 3 года назад

      @@samcodes2912 So, I just need to activate my billing account as a condition? even though the service is still free

    • @samcodes2912
      @samcodes2912  3 года назад

      Yes exactly.

  • @msadekmarwa5934
    @msadekmarwa5934 3 года назад

    I don't have a carte how can I continues this project please ??

    • @samcodes2912
      @samcodes2912  3 года назад +1

      What do you mean by carte?

    • @msadekmarwa5934
      @msadekmarwa5934 3 года назад

      ​@@samcodes2912 I mean card (I write carte with French I'm sorry)
      how can I try for free please

    • @yoll6329
      @yoll6329 Год назад

      ​@@msadekmarwa5934one year later 🎉 how did you fix that, j'ai le même problème actuellement

  • @DonaldFranciszekTusk
    @DonaldFranciszekTusk 3 года назад

    Hi, thank you. Can I legally store data from it?

  • @princebhatia09
    @princebhatia09 3 года назад

    is this api free?

  • @ralphmartynsamaniego7017
    @ralphmartynsamaniego7017 3 года назад

    Is Google Maps API Free?

    • @samcodes2912
      @samcodes2912  3 года назад

      it is free for small scale usage. What are you using it for?

    • @hafsa5611
      @hafsa5611 3 года назад

      @@samcodes2912 Please , I'm working on shortest path on google maps project , is key API free for this?

    • @samcodes2912
      @samcodes2912  3 года назад

      @@hafsa5611 yes it is free for projects like shortest path.

  • @piotrszymanski8325
    @piotrszymanski8325 2 года назад

    M8, sorry but you have to be more prepared! To much taime waisted wandering what next should be said, prepare some script or something... and... speak quicker, this video should last max 10 minutes or even less.

  • @ridharayachi1134
    @ridharayachi1134 3 года назад

    domage you ask me my carte number

    • @samcodes2912
      @samcodes2912  3 года назад

      Yes it's normal to open a billing account you need to add your card details. It is completely free. It is 0.00 $

  • @TertiarySequins
    @TertiarySequins Год назад

    Audio is HORRIBLE!

  • @kelvinace2480
    @kelvinace2480 3 года назад

    hey sam please make a video on how to create like this. see this url (console.cloud.google.com/google/maps-apis/solution-builder/locator_plus?project=high-bee-318305&supportedpurview=project) and on how to connect it from dropdown button. example when u click the text from dropdown the result will shown from the list on the left side. sorry im not quite well speak in english