{"id":687,"date":"2022-08-30T15:05:30","date_gmt":"2022-08-30T15:05:30","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/google-maps-api-v3-how-to-specify-vehicletype-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:05:30","modified_gmt":"2022-08-30T15:05:30","slug":"google-maps-api-v3-how-to-specify-vehicletype-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/google-maps-api-v3-how-to-specify-vehicletype-collection-of-common-programming-errors\/","title":{"rendered":"Google Maps API v3 &#8211; How to specify &ldquo;VehicleType&rdquo;-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m having some difficulties to specify Vehicle Type in my request. According to the documentation, it should look like something like this:<\/p>\n<pre><code>var request = {\n    origin:start,\n    destination:end,\n    travelMode: google.maps.DirectionsTravelMode.DRIVING,\n    TransitDetails: google.maps.TransitLine.TransitVehicle.VehicleType.BUS\n};\n<\/code><\/pre>\n<p>But the folowing error shows up every time:<\/p>\n<pre><code>TypeError: google.maps.TransitLine is undefined\n<\/code><\/pre>\n<p>I think there&#8217;s something wrong with my TransitDetails path.. but I can&#8217;t figure out what exactly&#8230;<\/p>\n<ol>\n<li>\n<p>There is no <code>TransitDetails<\/code>-option for a <code>directionsRequest<\/code>.<\/p>\n<p>There is only a <code>TransitOptions<\/code>-option where you can define <code>departureTime<\/code> and <code>arrivalTime<\/code> . The <code>vehicleType<\/code> is a part of the <code>directionsResponse<\/code> and is a simple string(e.g. <code>BUS<\/code>)<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 21:39:09. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m having some difficulties to specify Vehicle Type in my request. According to the documentation, it should look like something like this: var request = { origin:start, destination:end, travelMode: google.maps.DirectionsTravelMode.DRIVING, TransitDetails: google.maps.TransitLine.TransitVehicle.VehicleType.BUS }; But the folowing error shows up every time: TypeError: google.maps.TransitLine is undefined I think there&#8217;s something wrong with my TransitDetails path.. but [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-687","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=687"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/687\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}