Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 07-09-2015, 03:54 AM
code9 code9 is offline
Junior Member
 
Join Date: 07-09-15
Location: india
Posts: 5
iTrader: 0 / 0%
Unhappy Using google map api version3. need to calculate total distance.

Using google map api version. need to calculate total distance waypoints start and end.
here is the coding
Code:
directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); var route = response.routes[0]; // alert(route.legs[1].duration.text); var summaryPanel = document.getElementById('directions_panel'); summaryPanel.innerHTML = ''; // For each route, display summary information. var sum = 0; for (var i = 0; i < route.legs.length; i++) { var routeSegment = i + 1; sum += route.legs[i].distance.text; summaryPanel.innerHTML += '<b>Route Segment: ' + routeSegment + '</b><br>'; summaryPanel.innerHTML += route.legs[i].start_address + ' to '; summaryPanel.innerHTML += route.legs[i].end_address + '<br>'; summaryPanel.innerHTML += route.legs[i].duration.text + '<br>'; summaryPanel.innerHTML += sum + '<br><br>'; } } }); }
is it possible to calculate total( route.legs[i].duration.text) in the loop.
 
Reply With Quote

Advertisement

Advertisement

Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How Google Calculate Relevancy goodluckdomain SEO Forum 2 01-28-2012 03:21 PM
How to calculate estimated earnings in google adsense? ponmayil AdSense 4 10-25-2010 07:39 AM
How to calculate Google PR xpert SEO Forum 12 10-02-2010 11:51 AM
Calculate road trip distance between two points androo Web Design Lobby 0 06-28-2008 03:28 PM
How to Calculate Google PR riteshkj Google Forum 6 10-07-2004 10:06 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 11:36 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC