calculate distance between two points google maps

Поделиться
HTML-код
  • Опубликовано: 28 окт 2024

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

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

    wow! this is a nice video with good explanation. I am working on my final project and it uses google maps APIs, this really helped me. thank you.

  • @jar-channel
    @jar-channel 3 года назад +1

    very good tutorial helps me! i wanted to auto calculate the distance so that easy for me to qoute my customer delivery charge, and this tutorial show the simplest way!

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

      Hey, i am working on same site. Where user have to input two locations and he will get distance and cost. Fo u have any idea about how to implement this code?

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

    Bro ur amazing, I don't speak English very well, but I appreciate your soft and slow voice. I can understand

  • @adwordsandinternetmarketin4024
    @adwordsandinternetmarketin4024 10 месяцев назад

    wow this is great. 2 questions though. i use forminator form builder in wordpress and i want instead of place name use zipcode. how can i do this?Also how can i add the apis and the calculator.php into wordpress?

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

    You helped me with my project.. Thanks a lot

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

    Thankyou for this tutorial. It works.

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

    :( This year you have to use a card?!
    Can you believe it

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

    Hi, thank you for the example. In this example, how can I view the automatic calculation after typing two addresses without the calculate button?

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

    Nice explication 👌

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

    Great video. in 2024 now. I have added my API but it does not find the cities.

  • @luisgoyzueta5788
    @luisgoyzueta5788 5 лет назад +1

    Excellent video , thanks for your knowlegment

  • @homendrapatil7822
    @homendrapatil7822 4 года назад

    I have a question why you use hidden input fields you can pass the data from from_place input also?

  • @kuntaldas2843
    @kuntaldas2843 5 лет назад +1

    u are awesome man was looking for this kinda tutorial for long time

  • @Julio860JVL
    @Julio860JVL 4 года назад +2

    6:35 is after enabling API.

  • @VistritPandey
    @VistritPandey 4 года назад +1

    Hi, is the website mentioned in your description working? I am not able to use it

  • @kareentoh106
    @kareentoh106 6 лет назад

    would like to ask can this code works in visual studio 2017? The calculation part and the displaying of places is not working for me. How can i solve it?

  • @maheshavellakshminarayanan9367
    @maheshavellakshminarayanan9367 5 лет назад

    Is it possible to calculate distance between two points google maps in java programming language i.e)Linking google maps API with java

  • @PrinceArtanis
    @PrinceArtanis 4 года назад

    Hi bro !
    Could you help me please? i have everything working on pc but does not work on my android (chrome) do i have to do somthing ? thanks bro

  • @jayrajz7986
    @jayrajz7986 5 лет назад

    i want a wear OS app, after setting up destination on phone. the app get the destination from phone and then calculate the distance using google api and display that on screen with time remaining, whenever i check. that would be cool.
    is that possible?

  • @Thezizoubear
    @Thezizoubear 6 лет назад +2

    This was an excellent tutorial, thank you for going into detail

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

    I need to calculate the fee for a trip which has two points, in the same way Uber and Didi do. It must be very precise, with the use of time, distance, weather, people using the app at the same time, drivers available, rush hours traffic, base fees, all this variables add some amount to the total price. I don't know exactly which variables they use, either the moment they apply them, I would apply your code to my app. Pls it has to generate formula too
    Can this be possible?

  • @subhamkumarsahoo7075
    @subhamkumarsahoo7075 4 года назад

    It is not working for calculating long distances...for ex: distance from new york to mumbai..why?

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

    Thanks a lot man. I have a question, how can implement the map too? i mean users can input the direction and at the same time see the map on the left of the page.

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

    Amazing, thank you

  • @RomanCzujko
    @RomanCzujko 4 года назад

    helpful content - many likes

  • @davidgonzalez7417
    @davidgonzalez7417 4 года назад

    Hi! I think now the URL it's not working good... :( Also, I have a quick question, the distance is lineal from point A to point B or it's by car/highway? Many thanks!!

  • @abdulqadir4932
    @abdulqadir4932 6 лет назад

    wha sir gee kya bat ha ap ki.. :P

  • @kutschewien2519
    @kutschewien2519 6 лет назад +1

    hey thank a lot. i got one question im trying to print the "in_kilo" value in a textbox how can i do that ?

    • @Webeasystep
      @Webeasystep  6 лет назад

      just comment the line 92 and user code in line 93

  • @RomanCzujko
    @RomanCzujko 4 года назад

    Please tell me why is input fields not working in mobile phone in browser? API not respond

  • @3Audiovisual
    @3Audiovisual 6 лет назад +1

    Thanks for the great tutorial, how could I make something similar but that instead of having places in the inputs I can have coordinates?

    • @Webeasystep
      @Webeasystep  6 лет назад

      Hi Aaron,you are welcome,it is much easier,just remove
      new google.maps.places.Autocomplete()
      from line 66and 67 and only keep the code between ()
      finally add the coordinates to the inputs and submit :)

    • @3Audiovisual
      @3Audiovisual 6 лет назад

      Awesome!

  • @abhisheklal3289
    @abhisheklal3289 4 года назад +1

    there is error in demo page please check

  • @alonzobarnes2683
    @alonzobarnes2683 6 лет назад

    I found the error that is happening with this google distance matrix app you created. It works on every browser except Firefox... Type Error: distance is undefined... IS there a way around this? Thanks in advance.

  • @inayatullah795
    @inayatullah795 5 лет назад

    very good explaination. I want to use it on my website. Sir Google Maps Distance Matrix API is still free??

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

    getting error {Google Maps JavaScript API error: RefererNotAllowedMapError},javascript api is enable ! please help sir

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

    Good Video, I have a console's problem with the callback (Loading the Google Maps JavaScript API without a callback is not supported) someone can help me with that error. I'll appreciate

  • @sergheijingan845
    @sergheijingan845 4 года назад +1

    brilliant stuff, I can see the result in the console but doesn't show on the web page against . could you please advise mate?
    message from console :
    {text: "17.8 mi", value: 28660}
    text: "17.8 mi"
    value: 28660
    __proto__: Object

    • @saachhin
      @saachhin 4 года назад

      Did you end up finding the solution?

  • @Garyeker1
    @Garyeker1 5 лет назад

    Gracias, fue exacto lo que necesitaba, buena contribución.

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

    Hello there, I downloaded this code and tried with my API key but it is not working.
    Is this code still valid?

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

      Me too i think you have to activate your account by entering your credit card information and you will get a free trial, but I still don't know if that's the solution since I don't have a credit card to try.

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

    Hello dear i am still looking forward for your new video which contain info window using sql database

  • @mlitcorner
    @mlitcorner 6 лет назад +2

    it say distance is undefined type error line 85 any help

  • @achrafzitioui880
    @achrafzitioui880 6 лет назад

    excelent !! But is it possible to add a map in which we select two places and this program calculates the distance ?

    • @Webeasystep
      @Webeasystep  6 лет назад

      this is already done with google map itself without needing for any app

  • @gotoeurope9680
    @gotoeurope9680 6 лет назад

    Does not work in browsers on mobile phones. What you need to do to the calculator counted on mobile phones?

  • @suklaahevonen
    @suklaahevonen 4 года назад +5

    It gives error: TypeError: distance is undefined

    • @md.farzan5596
      @md.farzan5596 3 года назад

      You are not getting data in distance variable. Check your code

  • @krishanthadesilva4267
    @krishanthadesilva4267 6 лет назад +1

    i have got your sample code from given location and I try with my own API, it seems not work. it is not load location details when i type in input box. what should i do for fix this problem. pls help me

  • @rahulsdev4405
    @rahulsdev4405 4 года назад

    Thanks..That helped me a lott

  • @at_ecu5982
    @at_ecu5982 6 лет назад

    but it works in the online area. Or including the whole route?

    • @Webeasystep
      @Webeasystep  6 лет назад

      tu sei lo zio what is meaning of online area?

    • @at_ecu5982
      @at_ecu5982 6 лет назад

      @@Webeasystep I mean the distance from one point to another? or includes all the way, curves, etc.

    • @Webeasystep
      @Webeasystep  6 лет назад

      @@at_ecu5982 sure including all the way

  • @aice0927
    @aice0927 5 лет назад

    Great Video

  • @therockconnor
    @therockconnor 5 лет назад

    Good video! however, it would a look easier to read your code if you indented it properly. It's hard to tell where a div starts and where it ends.

  • @酷浣熊
    @酷浣熊 5 лет назад

    Can you use c# to count the distance from point to point coordinate on google map : ) I had to hand in my assignment in a week, plz help me .

    • @web_easy_step
      @web_easy_step 5 лет назад +1

      Sorry I haven't any experience with c#

  • @harishsharma5377
    @harishsharma5377 5 лет назад

    nice one sir!

  • @Tsamara355
    @Tsamara355 5 лет назад

    This is great! just what I was looking for.

  • @nitin1693
    @nitin1693 6 лет назад

    Can you please tell how to run that code on a local server. I'm not able to get what to do.

  • @abdullahquhtani4247
    @abdullahquhtani4247 6 лет назад +1

    It will be great if you can display the rout on the map.

    • @Webeasystep
      @Webeasystep  6 лет назад +1

      maybe in the future i do like such tutorial

    • @anesdevtoday5730
      @anesdevtoday5730 6 лет назад

      Look video at my channel, cheers.

    • @webhivetech
      @webhivetech 6 лет назад

      could please write and give me the link please. i want to show the route map on the right side also along with your this video function.

  • @mohitsingh9416
    @mohitsingh9416 6 лет назад +1

    Console error code -
    InvalidCharacterError: String contains an invalid character ----- rocket-loader.min.js:1 I have integrated the code but when i search the location it does not appears in dropdown list. What is the problem?

    • @Webeasystep
      @Webeasystep  6 лет назад

      if any location not found in the drop-down this means either two thing:
      1-may be you write a wrong characters
      2-may be not updated in google service yet

  • @hamzaberouayel9860
    @hamzaberouayel9860 6 лет назад +1

    sir can u tell me why when i change your api key on the code it s make issue and i cant calc anything

    • @Webeasystep
      @Webeasystep  6 лет назад +1

      Hamza Berouayel this is for sure because you miss a step in this tutorial, repeat the tutorial again and follow step by step

  • @lauradanielabuitragoespiti8166
    @lauradanielabuitragoespiti8166 6 лет назад +1

    Thanks for your explanation! but the jquery version did not solve the autocomplete problem and I already change the key

    • @Webeasystep
      @Webeasystep  6 лет назад

      You are welcome laura , you can fighure out what happen behind the scene by using console and read error messages , this what i ever do when i ran into a problem with javascript code

  • @webhivetech
    @webhivetech 6 лет назад

    Hi, Great tutorial. But i want to show the gogle route with google map along with the the distance calculation. How can i do that?

    • @Webeasystep
      @Webeasystep  6 лет назад

      thanks,but nowadays i am no longer support google maps because it is pricing ,i will make another series for mapbox

  • @bestoffersforyou
    @bestoffersforyou 6 лет назад +1

    Help me, please. How do I open the project on my computer? I'm having this error:
    Uncaught TypeError: Cannot read property 'value' of undefined
    at callback (calculator.html:112)
    And the autocomplete isn't work.

    • @Webeasystep
      @Webeasystep  6 лет назад

      there is no 112 line in my example

    • @bestoffersforyou
      @bestoffersforyou 6 лет назад

      Sorry. The correctly line is 88.
      var distance_in_kilo = distance.value / 1000; // the kilom

    • @bestoffersforyou
      @bestoffersforyou 6 лет назад +1

      I was able to solve the problem. The version of Jquery that I was using in my project ended up conflicting with the example version. Thanks a lot for the help!

    • @Webeasystep
      @Webeasystep  6 лет назад

      good job jao

    • @tariqexclusive4303
      @tariqexclusive4303 6 лет назад

      hi, can i know what you do then? I faced the same thing, huhu, tq

  • @pavanvemuri6352
    @pavanvemuri6352 6 лет назад

    is this on road distance?

  • @nomanalisiraj8217
    @nomanalisiraj8217 5 лет назад

    how should we get best route between two places

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

    in new dashborad how i can create credentials ?

  • @SantoshYadav-lg4lg
    @SantoshYadav-lg4lg 6 лет назад +1

    hello sir i am get your code it is not proper working on live server project please help and i wan to show output on another not same page give me suggestion as soon as possible

    • @Webeasystep
      @Webeasystep  6 лет назад

      i think your problem is to getting your own API KEY ,also to insure the type of the issue use chrome console

  • @mustaphaameen8175
    @mustaphaameen8175 6 лет назад

    how to make it use in smartphone? i have put in server.. smartphone not working.. help please

  • @RahulKumar-tg5zb
    @RahulKumar-tg5zb 5 лет назад

    Thanks a lot . Very interesting tutorial 👌😍

  • @sivatheja5430
    @sivatheja5430 4 года назад

    Can i get with along map showing multiple lines

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

    i have an error ApiNotActivatedMapError. how can solve this error?

  • @kinjalpatel2194
    @kinjalpatel2194 6 лет назад +1

    how to send multiple destinations using Google Distance Matrix API ???

    • @-MinhazulFerdous
      @-MinhazulFerdous 5 лет назад

      i was searching answer for the same question , did you find out the way ???

  • @Eric-vt5hd
    @Eric-vt5hd 6 лет назад

    do we have to pay to use google maps programs?

  • @basdntwo4973
    @basdntwo4973 4 года назад

    Sir
    Can u give me
    For 4 location
    Calculate km and multiplication 5.2

  • @mubin986
    @mubin986 4 года назад

    Hello.
    What is the difference between distance matrix api and directions api?

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

    still works in 2021

  • @davidpeter0101
    @davidpeter0101 4 года назад

    Very nice! Thank you!

  • @agnestyetyik2254
    @agnestyetyik2254 6 лет назад

    Uncaught TypeError: Cannot read property 'value' of undefined
    at callback (calculator.html:83)
    at distance_matrix.js:4
    at hm.m (distance_matrix.js:3)
    at Object.c [as _8jtuq2] (common.js:47)
    at VM77 DistanceMatrixService.GetDistanceMatrix:1

  • @templecitykuttisankar1728
    @templecitykuttisankar1728 4 года назад

    Hai Webeasystep
    Is it possible to show miles calculations by each state passing & and store it in mysql db. using google api or any other api service. I am waiting for your humble reply
    for eg:
    From: Columbus, OH, USA
    To: Miami, FL, USA
    Duration: 17 hours 8 mins
    State Distance (miles)
    OH 113.30
    WV 146.85
    VA 71.25
    NC 107.04
    SC 228.05
    GA 112.76
    FL 376.12
    Total 1155.38
    link source:
    trulos.com/truckload/mileage-by-state.php

  • @vamshikrishna.vk17
    @vamshikrishna.vk17 3 года назад

    Bro should we buy it?

  • @Avinash-fv7vh
    @Avinash-fv7vh 6 лет назад

    can i get the sample code? i dont know where the link is. and is these API's are on paid basis? bcz i am trying to get a API key but it directs me to the billing enable portion.

    • @Webeasystep
      @Webeasystep  6 лет назад

      Avinash Kumar all links in the description, about API key, you should get one from Google that requires billing info,if you need alternatives there is another serise on this channel

    • @Avinash-fv7vh
      @Avinash-fv7vh 6 лет назад

      which video is the alternative? because I don't have any billing information to give as am still a student.

    • @Avinash-fv7vh
      @Avinash-fv7vh 6 лет назад

      I want to use the distance matrix and geolocation of google maps. what alternatives are there for these?

  • @nikethkopparthy73
    @nikethkopparthy73 6 лет назад +1

    How to convert the duration text value to be divided by 2

  • @robsonukpong2435
    @robsonukpong2435 6 лет назад

    How can I add this to my wordpress website

  • @thefreshweb
    @thefreshweb 6 лет назад

    تسلم يا ابو حميد

    • @Webeasystep
      @Webeasystep  6 лет назад

      الله يسلمك :)

    • @thefreshweb
      @thefreshweb 6 лет назад +1

      بس برضو التوقع التلقائي مشتغلش

    • @thefreshweb
      @thefreshweb 6 лет назад +1

      وحتي ف المثال الي ف الوصف برضو

    • @Webeasystep
      @Webeasystep  6 лет назад

      قصدك الديمو ؟...الديمو شغال...لو قصدك المثال فأكيد في خطوة في النص ناقصة..طيب تكتشفها ازاي..بسيطة جدا. اضغط f12 افتح console وشوف ايه الايرور ال بيطلعلك وللعلم بيبقي غالبا معاه رابط كمان لحل المشكلة بالتفصيل..بس حتى لو مفهمتش حاجة ممكن تعمل سيرش بسيط او تكتبها هنا وهتلاقي لها حل..لأنها اكيد خطوة في النص بسيطة...بالتوفيق

  • @gotoeurope9680
    @gotoeurope9680 6 лет назад

    It works only on google chrome, it does not work on other browsers. Does not work in browsers on mobile phones. Help please solve the problem. It would also be good to display the map and intermediate stops.

    • @-MinhazulFerdous
      @-MinhazulFerdous 5 лет назад

      did you install php in your pc ?? maybe thats the issue

  • @crowshark8319
    @crowshark8319 6 лет назад +2

    hei sir, i just try calculate using google distance matrix API on my Chrome but i cann't calculate as you did why ?
    and when i try in Mozilla Firefox the script doesnot work too

    • @Webeasystep
      @Webeasystep  6 лет назад

      try using console this is a good for you ,just press f12 and read the error and understating what log tell you

  • @marioenriquez6405
    @marioenriquez6405 6 лет назад

    Thanks! excelent.

  • @nabeeltahir6013
    @nabeeltahir6013 5 лет назад

    I'm waiting your new videos

  • @neerajprajapati7876
    @neerajprajapati7876 6 лет назад

    sir it will not display autocomplete address and not be calculate distance between two points
    please try to solve my problem

    • @neerajprajapati7876
      @neerajprajapati7876 6 лет назад

      sir, in the video the think . what file and code run that code send quickly to my email

    • @spcialist
      @spcialist 6 лет назад

      the full code in the description

  • @voxymail7989
    @voxymail7989 6 лет назад

    why no air travel distance?

  • @codeitdear1904
    @codeitdear1904 4 года назад

    Will it work without Billing?

  • @shivab4843
    @shivab4843 4 года назад

    Bro please upload Taxi fare calculator.

  • @parwezstore2931
    @parwezstore2931 4 года назад

    Google Api are free for limited use, after it limits it say " This map is not working properly, Do you own this site..."......?

  • @Babak_Ahari
    @Babak_Ahari 5 лет назад

    your code and demo not working Bro. maybe you should change something.

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

    I'm going to show you the demo with me so I can see it

  • @ksuresh3335
    @ksuresh3335 6 лет назад

    Not working map api calls but not working plz help

  • @technoself81
    @technoself81 6 лет назад

    Uncaught ReferenceError: google is not defined

  • @hossamassadallah
    @hossamassadallah 4 года назад

    عايز كورس خاص من فضلك لو امكن

  • @rizalnababan8041
    @rizalnababan8041 5 лет назад

    Where i can find source code calculator.php ? @

  • @MrSamay10
    @MrSamay10 6 лет назад +1

    not working? might be your key is expired or ur code is wrong or

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

    Can We Use Pincodes Here ?

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

    is it free to use

  • @sohailcodeage466
    @sohailcodeage466 5 лет назад

    code is not working,i added the google map api key from my account, but still its not working.

    • @web_easy_step
      @web_easy_step 5 лет назад

      Open console to show the error

    • @sohailcodeage466
      @sohailcodeage466 5 лет назад

      @@web_easy_step Failed to load resource: the server responded with a status of 403 (Forbidden)
      test.php:8 Uncaught ReferenceError: google is not defined
      at test.php:8
      test.php:11 Uncaught ReferenceError: google is not defined
      at initialize (test.php:11)
      at onload (test.php:65) these are the errors in consol, can you help me? come on skype?

  • @hamzaberouayel9860
    @hamzaberouayel9860 6 лет назад

    i save the link but i don t know why don t work when i open my html page ty for the help sir

    • @Webeasystep
      @Webeasystep  6 лет назад +1

      for sure hamza, this the link
      bitbucket.org/webeasystep/calculate-distance-between-two-points-google-maps/downloads/

    • @hamzaberouayel9860
      @hamzaberouayel9860 6 лет назад

      I found no think to download

    • @hamzaberouayel9860
      @hamzaberouayel9860 6 лет назад

      Can u please send me on gmail hamzaberouayel@gmail.com

    • @Webeasystep
      @Webeasystep  6 лет назад +1

      sorry hamza i forget to mak it a public ,now you can download from Download repository

    • @hamzaberouayel9860
      @hamzaberouayel9860 6 лет назад

      Thx so much

  • @jesmerida5046
    @jesmerida5046 6 лет назад

    hi sir i tried your tutorial but when i calculate the distance it's not showing i dunno why :(

    • @Webeasystep
      @Webeasystep  6 лет назад

      jes merida hi jes , press f12 and open the console tab in the browser then copy the error and paste in the Google or if you want more help paste here, the console is the best way to figure out what happened behind the scene

    • @jesmerida5046
      @jesmerida5046 6 лет назад

      yes sir already got it thanks for your reply i've done it using the console log. ^_^

    • @Webeasystep
      @Webeasystep  6 лет назад

      good news jes

    • @jesmerida5046
      @jesmerida5046 6 лет назад

      hi sir i have another question how can i pass the results in php so that i can save all the data to database