";*/
//below array is used to map distance and period with actual record
data.push(results[i]);
createMarker(results[i]);
}
//geocoder to find distance and period
var geocoder = new google.maps.Geocoder;
//passing all destination to geocoder
var service = new google.maps.DistanceMatrixService;
service.getDistanceMatrix({
origins: origins,
destinations: destinations,
travelMode: 'DRIVING',
unitSystem: google.maps.UnitSystem.METRIC,
avoidHighways: false,
avoidTolls: false
}, function(response, status) {
if (status !== 'OK') {
console.log('Error was: ' + status);
} else {
var originList = response.originAddresses;
var destinationList = response.destinationAddresses;
var outputDiv = document.getElementById('output');
//outputDiv.innerHTML = '';
//deleteMarkers(markersArray);
//code to display marker on the map with relavent icon
var showGeocodedAddressOnMap = function(asDestination) {
var icon = asDestination ? destinationIcon : originIcon;
return function(results, status) {
if (status === 'OK') {
map.fitBounds(bounds.extend(results[0].geometry.location));
markersArray.push(new google.maps.Marker({
map: map,
position: results[0].geometry.location,
icon: icon
}));
} else {
console.log('Geocode was not successful due to: ' + status);
}
};
};
for (var i = 0; i ' + address.name + '' + results[j].distance.text + ' (' + results[j].duration.text + ')';
/*result_html += "