How can I resolve the error in Transit mode code of Google Map in PHP -
hey freineds code of google map in php working other modes of travel(driving,walking, bycycling )other transit mode.i found mistake in calculating time taken reach desttination . code in php :
<?php $infos = json_decode(file_get_contents('http://maps.googleapis.com/maps/api/distancematrix/json?origins=guildford,+surrey&destinations=embankment,+london&mode=walking')); print_r($infos->rows[0]->elements[0]->duration); ?>
please me freinds.
there no transit
mode in google distance matrix api.
mode
— specifies mode of transport use when calculating directions. valid values are:
driving
(default) indicates standard driving directions using road network.
walking
requests walking directions via pedestrian paths & sidewalks (where available).
bicycling
requests bicycling directions via bicycle paths & preferred streets (currently available in , canadian cities).
https://developers.google.com/maps/documentation/distancematrix/#distancematrixrequests
Comments
Post a Comment