Sep 14, 2011

Distance between two locations with Google Map API

One can easily calculate distance between two location with the help of Google Map APIs. Google Map APIs comes with a set of classes which helps in doing such tasks.
class GDirection, helps in getting the travel distance between the two different location.
So example shown below targets following features :-

  •  Getting distance between two location. 
  •  Getting duration between two location. 
Here goes the complete java script code for it
-------------------------------------------------------------------------------
    <script type="text/javascript">
    var map;
    var gdir;
    var geocoder null;
    var addressMarker;
    var distance;
    
    function initialize({
      if (GBrowserIsCompatible(){      
        map new GMap2(document.getElementById("map_canvas"));

        gdir new GDirections(mapdocument.getElementById("directions"));
    
        GEvent.addListener(gdir"load"onGDirectionsLoad);
        GEvent.addListener(gdir"error"handleErrors);
    
        setDirections("San Francisco""Mountain View""en_US");
      }
    }
    
    function setDirections(fromAddresstoAddresslocale{
      gdir.load("from: " fromAddress " to: " toAddress,
                "locale"locale });
    }
    
    function onGDirectionsLoad()
        // Use this function to access information about the latest load()
        // results.
        // e.g.
      distance gdir.getDistance().meters;
      
      alert("Distance is : " gdir.getDistance().meters "and Duration Is: " +
            gdir.getDuration().seconds/60);
        
      document.getElementById("fdistance").innerHTML gdir.getDistance().meters;
      document.getElementById("fduration").innerHTML gdir.getDuration().seconds/60;
      
    }
    script>
 -------------------------------------------------------------------------------




Can we call GDirection without creating GMap ?
  So the answer is yes, one can create GDirection without pasing GMap also.
So the output will only contain text format.
sample code
       gdir new GDirections(nulldocument.getElementById("directions"));
so instead of map object null is passed in above code line, it will
display direction information in only text format.
One can also use above logic to design their own Google Gadgets too.



85 comments:

Calculating driving distance between two different location is pretty easy with Google MAP APIs.

This coding is very helpful for developer to calculate Distance Between Two Cities

Repairing of Lenovo laptop are very well done by us as we have experts that are well versed with the technology used in Lenovo laptop to build them. Get in touch with us for swift & skilled help in repairing your Lenovo laptop system. Lenovo service center in Gurgaon. Call us: 7217871051
Lenovo Service Center in Gurgaon

Repairing of Lenovo laptop are very well done by us as we have experts that are well versed with the technology used in Lenovo laptop to build them. Get in touch with us for swift & skilled help in repairing your Lenovo laptop system. Lenovo service center in Delhi. Call us: 7217871051
Lenovo Service Center in Delhi

Hp Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 7217871051
Hp Service Center in Ghaziabad

Lenovo Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 7217871051
Lenovo Service Center in Ghaziabad

Repairing of hp laptop are very well done by us as we have experts that are well versed with the technology used in hp laptop to build them. Get in touch with us for swift & skilled help in repairing your hp laptop system. hp service center in Delhi. Call us: 7217871051
Hp Service Center in Gurgaon

Lenovo Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 7217871051
Lenovo Service Center in Uttam Nagar

Hp Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 7217871051
HP Service Center in Uttam Nagar

Hp Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 7217871051
HP Service Center in Uttam Nagar

Lenovo Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 7217871051
Lenovo Service Center in Neta ji subhash Place

Lenovo Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 7217871051
Lenovo Service Center in Neta ji subhash Place

Hp Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 7217871051
Hp Service Center in Neta ji subhash Place

Hp Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 7217871051
Hp Service Center in Neta ji subhash Place

Lenovo Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 9891868324
Lenovo Service Center in Rajouri Garden

Hp Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 9891868324
Hp Service Center in Rajouri Garden

Dell Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 9891868324
Dell Service Center in Rajouri Garden

Dell Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 9891868324
Dell Service Center in Rajouri Garden

Hp Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 9891868324
Hp Service Center in Rajouri Garden

Lenovo Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 9891868324
Lenovo Service Center in Nehru-Place

Dell Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 9891868324
Dell Service Center in Lajpat-Nagar

Lenovo Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 9891868324
Lenovo Service Center in Nehru-Place

Hp Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 9891868324
Hp Service Center in Pitampura

Lenovo Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 9891868324
Lenovo Service Center in Pitampura

Lenovo Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 9891868324
Lenovo Service Center in Pitampura

Hp Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 9891868324
Hp Service Center in Pitampura

Hp Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 9891868324.
HP Service Center in Uttam Nagar

Lenovo Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 9891868324
Lenovo Service Center in Mangolpuri

Hp Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 9891868324.
Hp Service Center in Mangolpuri

Hp Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 9891868324.
Hp Service Center in Mangolpuri

Lenovo Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 9891868324
Lenovo Service Center in Mangolpuri

Lenovo Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 9891868324.
Lenovo Service in Center in Okhla


Hp Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 9891868324.
Hp Service in Center in Okhla

Hp Laptop Service Center offer fixing for your PC needs, we are experts in PC chip level fix, call us: 9891868324.
Hp Service in Center in Greater Noida



Hp Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 9891868324.
Hp Service Center in Najafgarh

Lenovo Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 9891868324.
Lenovo Service Center in Najafgarh

Lenovo Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 7042640351.
Lenovo Service Center in Chattarpur


Hp Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 7042640351.
Hp Service Center in Chattarpur



Lenovo Laptop Service Center offer fixing for your PC needs, we are specialists in PC chip level fix, call us: 7042640351.
Lenovo Service Center in Chattarpur


The school maintains the authors' obligation to greatness in all fields, with accentuation on its maxim Higher Stronger Brighter. High ethics are an essential of a decent individual. Contact on us: 8130269997.
top 10 schools in rohini

The school keeps up the creators' commitment to significance in all fields, with complement on its saying Higher Stronger Brighter. High morals are a fundamental of a nice person. Contact on us: 8130269997.
cbse school in Rohini

The school keeps up the creators' commitment to significance in all fields, with complement on its saying Higher Stronger Brighter. High morals are a fundamental of a nice person. Contact on us: 8130269997.
Top Schools in Rohini

Arising as a broadly perceived promoting organization in all features of publicizing and marking arrangements centering in outside, on the web and electronic media spaces. Contact on us: 9868946230.
Outdoor advertising

Arising as a broadly perceived promoting organization in all features of publicizing and marking arrangements centering in outside, on the web and electronic media spaces. Contact on us: 9868946230.
Digital wall painting

It is attempt of Mast Banarasi Paan Company to construct a chain of establishment outlets in a large portion of the urban areas of India to guarantee that heavenly Banarasi Paan is made accessible to each client with a similar flavor, taste, quality and cleanliness and we are the best paan supplier in INDIA
Paan Café

It is attempt of Mast Banarasi Paan Company to construct a chain of establishment outlets in a large portion of the urban areas of India to guarantee that heavenly Banarasi Paan is made accessible to each client with a similar flavor, taste, quality and cleanliness and we are the best paan supplier in INDIA
Flavour Paan

Lenovo Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 7838122281.
Dell Service Center in Mumbai

Hp Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 7838122281.
Hp Service Center in BKC-Mumbai

The school maintains the authors' obligation to greatness in all fields, with accentuation on its maxim Higher Stronger Brighter. High ethics are an essential of a decent individual. Contact on us: 8130269997.
GD GOENKA
Top Schools in Rohini
cbse school in Rohini

Dell Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 7838446546.
Dell Service Center in Mumbai

Hp Laptop Service Center offer repairing for your laptop needs, we are experts in laptop chip level repair, call us: 7838446546.
Hp Service Center in Mumbai

The school maintains the authors' obligation to greatness in all fields, with accentuation on its maxim Higher Stronger Brighter. High ethics are an essential of a decent individual. Contact on us: 8130269997.
Nursery Admissions 2021-2022
Best Schools in Delhi
GD GOENKA Rohini

Arising as a broadly perceived promoting organization in all features of publicizing and marking arrangements centering in outside, on the web and electronic media spaces. Contact on us: 9868946230.
Outdoor Advertising Companies in Delhi

The Company eyes the vision of getting one of the India's notable and rumored Ad Agency by satisfying our customer's requirements and giving our significant customers the best quality outcomes utilizing our ability and rich encounters of publicizing area. We have practical experience in vital and inventive Brand Promotion arrangements in OOH.
Hoardings in Delhi
Rural wall painting advertising
Digital wall painting
Transit Media Service

G.D. Goenka Public School Rohini Sector- 9 is a Co-educational Senior Secondary School, recognized and affiliated to the Central Board of Secondary Education (CBSE). It has classes from Preschool till Class 12th. The school upholds the founders' commitment to excellence in all fields, with emphasis on its motto Higher Stronger Brighter. High morals are a prerequisite of a good human being.
top 10 schools in rohini
cbse school in Delhi
Nursery Admissions 2021-2022

Arising as a broadly perceived promoting organization in all features of publicizing and marking arrangements centering in outside, on the web and electronic media spaces. Contact on us: 9868946230.
Hoardings in Delhi
Digital wall painting
Auto Rickshaw advertising

Four Square Media Services is engineered in Delhi NCR. The Company eyes the vision of getting one of the India's striking and assumed Outdoor Advertising Companies in Delhi by fulfilling our client's basics and giving our colossal clients the best quality results using our ability and rich experiences of advancing. Contact on us: 9868946230.
Hoardings in Delhi
Digital wall painting
Advertising wall painting

One thing we make sure that we provide tobacco-free paan and currently we have a paan franchise in INDIA so people who want to eat paan or purchase paan just type of google paan near me and you find your nearest mast banarasi paan shops.
Karva Chauth Suhag Thali
Paan Café
Flavour Paan
Paan Franchise

Four Square Media Services is engineered in Delhi NCR. The Company eyes the vision of getting one of the India's striking and assumed Outdoor Advertising Companies in Delhi by fulfilling our client's basics and giving our colossal clients the best quality results using our ability and rich experiences of advancing. Contact on us: 9868946230.
Hoardings in Delhi
Digital wall painting
Wall painting advertising
Outdoor advertising

Mast Banarasi Paan also Provides home delivery for it all products along with the service of event management. Customers can also order delicious Paan by submitting their requests online. Mast Banarasi Paan is a natural Paan for all paan lovers because it offers the Best Goal where people belonging to all age groups can visit and eat and enjoy 120 + delicious varieties of Paan.
banarasi paan
paan near me
Flavour Paan
family paan café

Four Square Media Services is engineered in Delhi NCR. The Company eyes the vision of getting one of the India's striking and assumed Outdoor Advertising Companies in Delhi by fulfilling our client's basics and giving our colossal clients the best quality results using our ability and rich experiences of advancing. Contact on us: 9868946230.
Digital wall painting
Auto Rickshaw advertising
Advertising wall painting
Auto rickshaw ad in delhi
Rural wall painting advertising

We offer out of Warranty Laptop Repair, removal of Virus, screen change, a wireless network set up, battery removal, motherboard replacement and several others are offered at a budget-friendly price and negotiable. We can provide on-call support and repair your laptop at your home.
Dell Laptop Service Center in Noida
Dell laptop service center in Mumbai
Dell Laptop Service Center in Grugram
Dell laptop service center in Ghaziabad
Dell Laptop Service Center in Faridabad
Dell Laptop Service Center in Chandigarh

Dell Laptop Service Center In Udyogvihar
Dell Laptop Repairing Service Center UdyogVihar phase 1, phase 2, phase 3, Gurgaon.UdyogVihar is the center for Gurgaon development, thousands of companies and factories are situated in UdyogVihar area. If laptops, servers, dell desktops stop working we are in the process to support you we and also offer you same day repair service. There are many major brands in this manufacturing region of the Indian economy. We provide the best service and goods for our warranty, even if we work for the manufacturing industries on weekends, there are two to three technicians for swift answers.contact us 8929181953,8929185096,9891868324

Dell Service Center Faridabad

Computers have become an indispensable part of our society and life. We use it for work, studies, shopping, buying movie tickets, booking shows and many other works. Life has become just at the click, we no more need to travel and get the booking on the train rather we reserve a seat sitting at the comfort of our house. There are few things that need to be regularly checked in your computer which is the maintenance so that we can keep working smoothly and lead a hassle free work. BS System, Delhi is one such name which offers the servicing for Dell laptops.CONTACT US 8929181953,8929185096,9891868324

Asus Service Center In Delhi

Fix Your Hardware And Software Issues By Hiring Asus Laptop Service Center In Delhi, NCR Due to the prolonged usage, your laptop might need a reliable and trustworthy service center that can able to deals with all kinds of software assistance or physical damage. We are offering authorized Asus Laptop Repair in Delhi, NCR, and help you in fixing all kinds of problems related to hardware or software like virus issues, keyboard repairs, motherboard repair, laptop screen replacement, data recovery, touch-pad repair & backup problems.

The professionals at Asus Laptop Service Center in Delhi, NCR, are well-trained and certified to analyze the problems of the laptop in quicker time. The long-term experience on Asus laptop repair service makes us be the professionals in repairing and troubleshooting the faulty laptop in the fast and competent manner thus saving your money and time. The Asus Service Center in Delhi, NCR offer specialist, affordable and quick laptop repairs for both residential and business users.

High-Tech Tools & Affordable Manpower

Asus Laptop Service Center in Delhi, NCR, is qualitative with plenty of technical benefits to provide. Delhi, NCR, being the famous city in Maharashtra, numerous IT professionals, high-profile people and executives of worldwide companies like to move to this location. Therefore, one can easily contact the service center for refurbishing the Asus Laptops. Our technicians at Asus Service Center in Delhi, NCR, perform deeper analysis on laptop & research more before providing a perfect repair solution.

We also offer customized repair solution for our customers depending on their requirements and budget. We make use of affordable manpower and high-tech tools for providing quality repair solution on laptop services. If you do not know how to make your system standalone without any error then our specialists will offer tips and suggestions which seem to be quite useful. Our team of highly dedicated professionals believes in offering high-quality services at reasonable rates. We ensure to provide timely service.CONTACT US 8929181953,8929185096,9891868324

Lenovo Service Center Noida

There are many problems that you might find while using a Lenovo laptop and such problems could not be resolved online resultant you have to search for the best Lenovo Service Center in Noida. The BS System point you all the problems that you face while using the laptop and provide better response through quality guidance and service.CONTACT US 8929181953,8929185096,9891868324

Lenovo Service Center Faridabad

If you are a regular laptop user you might must sure face problem relating to your laptop. Lenovo is a reputed brand but still when a machine functions for many years it becomes very common to find problems like the keypad, touchpad issue, screen problem any internal fault or it can be any. Since the laptop are costly product and valuable too so, no one like to take risk while getting it repaired. We the BS System bring complete care, repair and maintenance service for your laptop and are also known as the best
Lenovo service center in Faridabad.
CONTACT US 8929181953,8929185096,9891868324

Flavour Paan
Mast banarasi paan is a very well-known brand of paan in INDIA. We have many franchises in INDIA and also making many kinds of paan like fire paan, chocolate paan, etc. One thing we make sure that we provide tobacco-free paan and currently we have a paan franchise in INDIA so people who want to eat paan or purchase paan just type of google paan near me and you find your nearest mast banarasi paan shops.CONTACT US +91-9821133481
http://mastbanarasipaan.com/blog/tag/flavour-paan/

It is the attempt of Mast Banarasi Paan Company's to construct a chain of establishment outlets in a large portion of the urban areas of India to guarantee that heavenly Banarasi Paan is made accessible to each client with a similar flavor, taste, quality, and cleanliness and we are the best paan supplier in INDIA.
Paan Cafe
paan near me
Flavour Paan
family paan café

It is the attempt of Mast Banarasi Paan Company's to construct a chain of establishment outlets in a large portion of the urban areas of India to guarantee that heavenly Banarasi Paan is made accessible to each client with a similar flavor, taste, quality, and cleanliness and we are the best paan supplier in INDIA.
Paan Cafe
paan near me
Flavour Paan
family paan café
Karva Chauth Suhag Thali

Bs system solution in Delhi provides the best solution for laptop repair. Our experienced engineers take complete care and responsibility for your device and provide you a high-quality solution. The Lenovo Laptop Technical support is available for all range of customers. IF YOU ARE INTERESTED YOU MAY CALL -9891868324, 9643406897, and 9643409808
laptop repairing center in Delhi
best laptop service center in Delhi

Bs system solution in Delhi provides the best solution for laptop repair. Our experienced engineers take complete care and responsibility for your device and provide you a high-quality solution. The Lenovo Laptop Technical support is available for all range of customers. IF YOU ARE INTERESTED YOU MAY CALL -9891868324, 9643406897, and 9643409808
laptop service in Delhi
laptop reparing center in Mumbai

Bs system solution in Delhi provides the best solution for laptop repair. Our experienced engineers take complete care and responsibility for your device and provide you a high-quality solution. The Lenovo Laptop Technical support is available for a range of customers. IF YOU ARE INTERESTED YOU MAY CALL -9891868324, 9643406897, and 9643409808.
multi brand laptop repairing in Mumbai
Best laptop repairing center in Mumbai

The ventilated external shell protects against electrical hazards, molten substance splash and squeezes. With its eventuality for integration of a Petzl headlamp, hearing protection, and multiple accessories, it's an entirely modular helmet, therefore meeting the specific fresh conditions of professionals.
petzl HELMETS Vertex price in Mumbai
Petzl HARNESS Avao Bod price in Mumbai

Spotting the best wedding photographer in Kolkata can be quite a hectic task. Here’s Crazy lens photography to end your quest. We specialize in a fun and candid style of wedding photography, which can be customized according to your needs.
best pre wedding photographer in kolkata
pre wedding photography in kolkata

Klever Trade is a new-generation online stock trading platform which will change the way you trade forever. Klever Trade is a new-generation online stock trading platform which will change the way you trade forever. 02614245940
How to trade in algo
Best api for algo trading

Denex International - India's largest manufacturer and exporter of surgical disposables has a wide product base and are regularly adding new medical disposables to the list. The products include I.V. Cannula with PTFE Catheter of different gauges/ sizes, non-woven fabric products such as SURGEON'S GOWNS & APRONS, O.T. SHEETS and are manufactured under the brand name Amie IV Cannula (All Gauges). 9310148912
IV Catheter Manufacturer

Denex International - India's largest manufacturer and exporter of surgical disposables has a wide product base and are regularly adding new medical disposables to the list. The products include I.V. Cannula with PTFE Catheter of different gauges/ sizes, non-woven fabric products such as SURGEON'S GOWNS & APRONS, O.T. SHEETS and are manufactured under the brand name Amie IV Cannula (All Gauges). 9310148912
IV Cannula Manufacturer
IV Catheter Manufacturer

We always attempt to keep international standards in our vending machines to give the superior quality and taste of natural tea and coffee to our customers and users. We are one of the well-known providers of Coffee Machine in Gurgaon. 09873633436
Coffee Vending Machine in gurgaon
Vending Machine in Gurgaon

If you are planning to take the CELPIP test and looking forward to achieve your highest score, then there is great chances our course can really help you achieve your desired score in all four modules. In fact more than 85% of our students have achieved their dream score through our live online sessions.
celpip training near me
celpip training center near me

T-shaped front points are designed for excellent penetration of hard ice and comfort on mixed terrain, while providing solid purchase in snow
Petzl ICE AXES Quark price in Mumbai
Petzl CRAMPONS Sarken price in Mumbai

Need for dell laptop repairing contact dell service center in thane because we have door step support for dell laptop users thane if you have problem with your laptop like motherboard issue ,screen issue ,battery issue or ram replacement we capable to resolve your issue at your place within same day .For more information please visit call our office dell service center thane .

dell service center in Thane
dell service center in Mumbai

Post a Comment