@googlemaps/routing 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -143
- package/build/protos/google/maps/routing/v2/fallback_info.proto +1 -1
- package/build/protos/google/maps/routing/v2/geocoding_results.proto +1 -1
- package/build/protos/google/maps/routing/v2/localized_time.proto +1 -1
- package/build/protos/google/maps/routing/v2/location.proto +1 -1
- package/build/protos/google/maps/routing/v2/maneuver.proto +1 -1
- package/build/protos/google/maps/routing/v2/navigation_instruction.proto +1 -1
- package/build/protos/google/maps/routing/v2/polyline.proto +1 -1
- package/build/protos/google/maps/routing/v2/polyline_details.proto +1 -1
- package/build/protos/google/maps/routing/v2/route.proto +30 -16
- package/build/protos/google/maps/routing/v2/route_label.proto +1 -1
- package/build/protos/google/maps/routing/v2/route_modifiers.proto +1 -1
- package/build/protos/google/maps/routing/v2/route_travel_mode.proto +1 -1
- package/build/protos/google/maps/routing/v2/routes_service.proto +4 -3
- package/build/protos/google/maps/routing/v2/routing_preference.proto +1 -1
- package/build/protos/google/maps/routing/v2/speed_reading_interval.proto +5 -4
- package/build/protos/google/maps/routing/v2/toll_info.proto +1 -2
- package/build/protos/google/maps/routing/v2/toll_passes.proto +1 -1
- package/build/protos/google/maps/routing/v2/traffic_model.proto +9 -5
- package/build/protos/google/maps/routing/v2/transit.proto +1 -1
- package/build/protos/google/maps/routing/v2/transit_preferences.proto +1 -1
- package/build/protos/google/maps/routing/v2/units.proto +1 -1
- package/build/protos/google/maps/routing/v2/vehicle_emission_type.proto +1 -1
- package/build/protos/google/maps/routing/v2/vehicle_info.proto +1 -2
- package/build/protos/google/maps/routing/v2/waypoint.proto +6 -1
- package/build/protos/protos.d.ts +8 -2
- package/build/protos/protos.js +32 -3
- package/build/protos/protos.json +7 -3
- package/build/src/v2/index.js +1 -1
- package/build/src/v2/routes_client.d.ts +3 -2
- package/build/src/v2/routes_client.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
|
|
2
|
-
[//]: # "
|
|
2
|
+
[//]: # "The comments you see below are used to generate those parts of the template in later states."
|
|
3
3
|
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
|
|
4
4
|
|
|
5
|
-
# [
|
|
6
|
-
|
|
7
|
-
[](https://cloud.google.com/terms/launch-stages)
|
|
8
|
-
[](https://www.npmjs.org/package/@googlemaps/routing)
|
|
9
|
-
|
|
5
|
+
# [Routes API: Nodejs Client][homepage]
|
|
10
6
|
|
|
7
|
+
This library is considered to be in **preview**. This means it is still a
|
|
8
|
+
work-in-progress and under active development. Any release is subject to
|
|
9
|
+
backwards-incompatible changes at any time.
|
|
11
10
|
|
|
11
|
+
[](https://www.npmjs.org/package/@googlemaps/routing)
|
|
12
12
|
|
|
13
|
-
client for Node.js
|
|
13
|
+
Routes API client for Node.js
|
|
14
14
|
|
|
15
|
+
[//]: # "partials.introduction"
|
|
15
16
|
|
|
16
17
|
A comprehensive list of changes in each version may be found in
|
|
17
|
-
[the CHANGELOG]
|
|
18
|
+
[the CHANGELOG][homepage_changelog].
|
|
18
19
|
|
|
19
|
-
* [
|
|
20
|
+
* [Routes API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/routing/latest)
|
|
20
21
|
|
|
21
|
-
* [github.com/googleapis/google-cloud-node/packages/google-maps-routing](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routing)
|
|
22
22
|
|
|
23
23
|
Read more about the client libraries for Cloud APIs, including the older
|
|
24
24
|
Google APIs Client Libraries, in [Client Libraries Explained][explained].
|
|
@@ -27,149 +27,60 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
|
|
|
27
27
|
|
|
28
28
|
**Table of contents:**
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
* [Quickstart](#quickstart)
|
|
32
31
|
* [Before you begin](#before-you-begin)
|
|
33
32
|
* [Installing the client library](#installing-the-client-library)
|
|
34
|
-
|
|
35
|
-
* [Samples](#samples)
|
|
33
|
+
|
|
36
34
|
* [Versioning](#versioning)
|
|
37
35
|
* [Contributing](#contributing)
|
|
38
36
|
* [License](#license)
|
|
39
37
|
|
|
40
38
|
## Quickstart
|
|
41
|
-
|
|
42
39
|
### Before you begin
|
|
43
40
|
|
|
44
41
|
1. [Select or create a Cloud Platform project][projects].
|
|
45
42
|
1. [Enable billing for your project][billing].
|
|
46
|
-
1. [Enable the
|
|
43
|
+
1. [Enable the Routes API API][enable_api].
|
|
47
44
|
1. [Set up authentication][auth] so you can access the
|
|
48
45
|
API from your local workstation.
|
|
49
|
-
|
|
50
46
|
### Installing the client library
|
|
51
47
|
|
|
52
48
|
```bash
|
|
53
49
|
npm install @googlemaps/routing
|
|
54
50
|
```
|
|
55
51
|
|
|
52
|
+
## Terms of Service
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* This snippet has been automatically generated and should be regarded as a code template only.
|
|
62
|
-
* It will require modifications to work.
|
|
63
|
-
* It may require correct/in-range values for request initialization.
|
|
64
|
-
* TODO(developer): Uncomment these variables before running the sample.
|
|
65
|
-
*/
|
|
66
|
-
/**
|
|
67
|
-
* Required. Origin waypoint.
|
|
68
|
-
*/
|
|
69
|
-
// const origin = {}
|
|
70
|
-
/**
|
|
71
|
-
* Required. Destination waypoint.
|
|
72
|
-
*/
|
|
73
|
-
// const destination = {}
|
|
74
|
-
/**
|
|
75
|
-
* Optional. A set of waypoints along the route (excluding terminal points),
|
|
76
|
-
* for either stopping at or passing by. Up to 25 intermediate waypoints are
|
|
77
|
-
* supported.
|
|
78
|
-
*/
|
|
79
|
-
// const intermediates = 1234
|
|
80
|
-
/**
|
|
81
|
-
* Optional. Specifies the mode of transportation.
|
|
82
|
-
*/
|
|
83
|
-
// const travelMode = {}
|
|
84
|
-
/**
|
|
85
|
-
* Optional. Specifies how to compute the route. The server
|
|
86
|
-
* attempts to use the selected routing preference to compute the route. If
|
|
87
|
-
* the routing preference results in an error or an extra long latency, then
|
|
88
|
-
* an error is returned. In the future, we might implement a fallback
|
|
89
|
-
* mechanism to use a different option when the preferred option does not give
|
|
90
|
-
* a valid result. You can specify this option only when the `travel_mode` is
|
|
91
|
-
* `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
|
|
92
|
-
*/
|
|
93
|
-
// const routingPreference = {}
|
|
94
|
-
/**
|
|
95
|
-
* Optional. Specifies your preference for the quality of the polyline.
|
|
96
|
-
*/
|
|
97
|
-
// const polylineQuality = {}
|
|
98
|
-
/**
|
|
99
|
-
* Optional. Specifies the preferred encoding for the polyline.
|
|
100
|
-
*/
|
|
101
|
-
// const polylineEncoding = {}
|
|
102
|
-
/**
|
|
103
|
-
* Optional. The departure time. If you don't set this value, then this value
|
|
104
|
-
* defaults to the time that you made the request. If you set this value to a
|
|
105
|
-
* time that has already occurred, then the request fails.
|
|
106
|
-
*/
|
|
107
|
-
// const departureTime = {}
|
|
108
|
-
/**
|
|
109
|
-
* Optional. Specifies whether to calculate alternate routes in addition to the route.
|
|
110
|
-
*/
|
|
111
|
-
// const computeAlternativeRoutes = true
|
|
112
|
-
/**
|
|
113
|
-
* Optional. A set of conditions to satisfy that affect the way routes are
|
|
114
|
-
* calculated.
|
|
115
|
-
*/
|
|
116
|
-
// const routeModifiers = {}
|
|
117
|
-
/**
|
|
118
|
-
* Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
|
119
|
-
* information, see
|
|
120
|
-
* http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
|
|
121
|
-
* Language Support (https://developers.google.com/maps/faq#languagesupport)
|
|
122
|
-
* for the list of supported languages. When you don't provide this value, the
|
|
123
|
-
* display language is inferred from the location of the route request.
|
|
124
|
-
*/
|
|
125
|
-
// const languageCode = 'abc123'
|
|
126
|
-
/**
|
|
127
|
-
* Optional. Specifies the units of measure for the display fields. This
|
|
128
|
-
* includes the `instruction` field in `NavigationInstruction`. The units of
|
|
129
|
-
* measure used for the route, leg, step distance, and duration are not
|
|
130
|
-
* affected by this value. If you don't provide this value, then the display
|
|
131
|
-
* units are inferred from the location of the request.
|
|
132
|
-
*/
|
|
133
|
-
// const units = {}
|
|
134
|
-
|
|
135
|
-
// Imports the Routing library
|
|
136
|
-
const {RoutesClient} = require('@googlemaps/routing').v2;
|
|
137
|
-
|
|
138
|
-
// Instantiates a client
|
|
139
|
-
const routingClient = new RoutesClient();
|
|
140
|
-
|
|
141
|
-
async function callComputeRoutes() {
|
|
142
|
-
// Construct request
|
|
143
|
-
const request = {
|
|
144
|
-
origin,
|
|
145
|
-
destination,
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
// Run request
|
|
149
|
-
const response = await routingClient.computeRoutes(request);
|
|
150
|
-
console.log(response);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
callComputeRoutes();
|
|
154
|
-
|
|
155
|
-
```
|
|
54
|
+
`@googlemaps/routing` uses Google Maps Platform services. Use of Google
|
|
55
|
+
Maps Platform services through this library is subject to the
|
|
56
|
+
[Google Maps Platform Terms of Service][gmp-tos].
|
|
156
57
|
|
|
58
|
+
This library is not a Google Maps Platform Core Service.
|
|
59
|
+
Therefore, the Google Maps Platform Terms of Service (e.g., Technical
|
|
60
|
+
Support Services, Service Level Agreements, and Deprecation Policy)
|
|
61
|
+
do not apply to this library.
|
|
157
62
|
|
|
63
|
+
### European Economic Area (EEA) developers
|
|
158
64
|
|
|
159
|
-
|
|
65
|
+
If your billing address is in the European Economic Area, effective on
|
|
66
|
+
8 July 2025, the [Google Maps Platform EEA Terms of Service][gmp-tos-eea]
|
|
67
|
+
will apply to your use of the Services. Functionality varies by region.
|
|
68
|
+
[Learn more][gmp-tos-eea-faq].
|
|
160
69
|
|
|
161
|
-
|
|
70
|
+
[gmp-tos]: https://cloud.google.com/maps-platform/terms
|
|
71
|
+
[gmp-tos-eea]: https://cloud.google.com/terms/maps-platform/eea
|
|
72
|
+
[gmp-tos-eea-faq]: https://developers.google.com/maps/comms/eea/faq
|
|
162
73
|
|
|
163
|
-
|
|
164
|
-
| --------------------------- | --------------------------------- | ------ |
|
|
165
|
-
| Routes.compute_route_matrix | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js,packages/google-maps-routing/samples/README.md) |
|
|
166
|
-
| Routes.compute_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js,packages/google-maps-routing/samples/README.md) |
|
|
167
|
-
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/quickstart.js,packages/google-maps-routing/samples/README.md) |
|
|
74
|
+
## Samples
|
|
168
75
|
|
|
76
|
+
Samples are in the [`samples/`][homepage_samples] directory. Each sample's `README.md` has instructions for running its sample.
|
|
169
77
|
|
|
78
|
+
| Sample | Source Code |
|
|
79
|
+
| --------------------------- | --------------------------------- |
|
|
80
|
+
| compute route matrix | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js) |
|
|
81
|
+
| compute routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js) |
|
|
82
|
+
| maps | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/snippet_metadata_google.maps.routing.v2.json) |
|
|
170
83
|
|
|
171
|
-
The [Google Maps Routing Node.js Client API Reference][client-docs] documentation
|
|
172
|
-
also contains samples.
|
|
173
84
|
|
|
174
85
|
## Supported Node.js Versions
|
|
175
86
|
|
|
@@ -196,41 +107,29 @@ for versions compatible with Node.js 8.
|
|
|
196
107
|
|
|
197
108
|
This library follows [Semantic Versioning](http://semver.org/).
|
|
198
109
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
This library is considered to be in **preview**. This means it is still a
|
|
206
|
-
work-in-progress and under active development. Any release is subject to
|
|
207
|
-
backwards-incompatible changes at any time.
|
|
208
|
-
|
|
209
|
-
|
|
210
110
|
More Information: [Google Cloud Platform Launch Stages][launch_stages]
|
|
211
111
|
|
|
212
112
|
[launch_stages]: https://cloud.google.com/terms/launch-stages
|
|
213
113
|
|
|
214
114
|
## Contributing
|
|
215
115
|
|
|
216
|
-
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md).
|
|
116
|
+
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/CONTRIBUTING.md).
|
|
217
117
|
|
|
218
|
-
Please note that this `README.md
|
|
118
|
+
Please note that this `README.md`
|
|
219
119
|
and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
|
|
220
|
-
are generated from a central template.
|
|
221
|
-
to its templates in
|
|
222
|
-
[directory](https://github.com/googleapis/synthtool).
|
|
120
|
+
are generated from a central template.
|
|
223
121
|
|
|
224
122
|
## License
|
|
225
123
|
|
|
226
124
|
Apache Version 2.0
|
|
227
125
|
|
|
228
|
-
See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE)
|
|
229
|
-
|
|
230
|
-
[client-docs]: https://cloud.google.com/nodejs/docs/reference/routing/latest
|
|
126
|
+
See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/LICENSE)
|
|
231
127
|
|
|
232
128
|
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
|
|
233
129
|
[projects]: https://console.cloud.google.com/project
|
|
234
130
|
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
|
|
235
131
|
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=routes.googleapis.com
|
|
236
132
|
[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local
|
|
133
|
+
[homepage_samples]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples
|
|
134
|
+
[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/CHANGELOG.md
|
|
135
|
+
[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -121,8 +121,8 @@ message Route {
|
|
|
121
121
|
RouteLocalizedValues localized_values = 11;
|
|
122
122
|
|
|
123
123
|
// An opaque token that can be passed to [Navigation
|
|
124
|
-
// SDK](https://developers.google.com/maps/documentation/navigation)
|
|
125
|
-
// reconstruct the route during navigation, and, in the event of rerouting,
|
|
124
|
+
// SDK](https://developers.google.com/maps/documentation/mobility/driver-sdk/navigation)
|
|
125
|
+
// to reconstruct the route during navigation, and, in the event of rerouting,
|
|
126
126
|
// honor the original intention when the route was created. Treat this token
|
|
127
127
|
// as an opaque blob. Don't compare its value across requests as its value
|
|
128
128
|
// may change even if the service returns the exact same route.
|
|
@@ -141,16 +141,21 @@ message Route {
|
|
|
141
141
|
// about, such as possible traffic zone restrictions.
|
|
142
142
|
message RouteTravelAdvisory {
|
|
143
143
|
// Contains information about tolls on the route. This field is only populated
|
|
144
|
-
// if tolls are expected on the route
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
//
|
|
144
|
+
// if tolls are expected on the route and `TOLLS` is included in the request's
|
|
145
|
+
// [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations].
|
|
146
|
+
// If this field is set, but the `estimatedPrice` subfield is not populated,
|
|
147
|
+
// then the route contains tolls, but the estimated price is unknown. If
|
|
148
|
+
// `toll_info` is not set, then there are no tolls expected on the route.
|
|
148
149
|
TollInfo toll_info = 2;
|
|
149
150
|
|
|
150
|
-
// Speed reading intervals
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
151
|
+
// Speed reading intervals indicating traffic density. This field is only
|
|
152
|
+
// populated for requests when the request has a `TRAFFIC_AWARE` or
|
|
153
|
+
// `TRAFFIC_AWARE_OPTIMAL`
|
|
154
|
+
// [ComputeRoutesRequest.routing_preference][google.maps.routing.v2.ComputeRoutesRequest.routing_preference]
|
|
155
|
+
// value, and `TRAFFIC_ON_POLYLINE` is included in the
|
|
156
|
+
// [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations].
|
|
157
|
+
// The intervals cover the entire polyline of the route without overlap. The
|
|
158
|
+
// start point of a specified interval is the same as the end point of the
|
|
154
159
|
// preceding interval.
|
|
155
160
|
//
|
|
156
161
|
// Example:
|
|
@@ -160,6 +165,9 @@ message RouteTravelAdvisory {
|
|
|
160
165
|
repeated SpeedReadingInterval speed_reading_intervals = 3;
|
|
161
166
|
|
|
162
167
|
// The predicted fuel consumption in microliters.
|
|
168
|
+
// This field is only populated when `FUEL_CONSUMPTION` is included in the
|
|
169
|
+
// request's
|
|
170
|
+
// [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations].
|
|
163
171
|
int64 fuel_consumption_microliters = 5;
|
|
164
172
|
|
|
165
173
|
// Returned route may have restrictions that are not suitable for requested
|
|
@@ -177,14 +185,20 @@ message RouteTravelAdvisory {
|
|
|
177
185
|
message RouteLegTravelAdvisory {
|
|
178
186
|
// Contains information about tolls on the specific `RouteLeg`.
|
|
179
187
|
// This field is only populated if we expect there are tolls on the
|
|
180
|
-
// `RouteLeg
|
|
188
|
+
// `RouteLeg` and `TOLLS` is included in the request's
|
|
189
|
+
// [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations].
|
|
190
|
+
// If this field is set but the estimated_price subfield is not
|
|
181
191
|
// populated, we expect that road contains tolls but we do not know an
|
|
182
|
-
// estimated price. If
|
|
183
|
-
// `RouteLeg`.
|
|
192
|
+
// estimated price. If `toll_info` does not exist, then there is no toll on
|
|
193
|
+
// the `RouteLeg`.
|
|
184
194
|
TollInfo toll_info = 1;
|
|
185
195
|
|
|
186
|
-
// Speed reading intervals
|
|
187
|
-
//
|
|
196
|
+
// Speed reading intervals indicating traffic density. This field is only
|
|
197
|
+
// populated for requests when the request has a `TRAFFIC_AWARE` or
|
|
198
|
+
// `TRAFFIC_AWARE_OPTIMAL`
|
|
199
|
+
// [ComputeRoutesRequest.routing_preference][google.maps.routing.v2.ComputeRoutesRequest.routing_preference]
|
|
200
|
+
// value, and `TRAFFIC_ON_POLYLINE` is included in the
|
|
201
|
+
// [ComputeRoutesRequest.extra_computations][google.maps.routing.v2.ComputeRoutesRequest.extra_computations].
|
|
188
202
|
// The intervals cover the entire polyline of the `RouteLeg` without overlap.
|
|
189
203
|
// The start point of a specified interval is the same as the end point of the
|
|
190
204
|
// preceding interval.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -235,8 +235,8 @@ message ComputeRoutesRequest {
|
|
|
235
235
|
[(google.api.field_behavior) = OPTIONAL];
|
|
236
236
|
|
|
237
237
|
// Optional. The arrival time.
|
|
238
|
-
// NOTE:
|
|
239
|
-
// [RouteTravelMode][google.maps.routing.v2.RouteTravelMode]
|
|
238
|
+
// NOTE: This field is ignored when requests specify a
|
|
239
|
+
// [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] other than
|
|
240
240
|
// `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but
|
|
241
241
|
// not both. Transit trips are available for up to 7 days in the past or 100
|
|
242
242
|
// days in the future.
|
|
@@ -431,6 +431,7 @@ message ComputeRouteMatrixRequest {
|
|
|
431
431
|
// traffic. This setting affects the value returned in the duration field in
|
|
432
432
|
// the [RouteMatrixElement][google.maps.routing.v2.RouteMatrixElement] which
|
|
433
433
|
// contains the predicted time in traffic based on historical averages.
|
|
434
|
+
// `TrafficModel` is only available for requests that have set
|
|
434
435
|
// [RoutingPreference][google.maps.routing.v2.RoutingPreference] to
|
|
435
436
|
// `TRAFFIC_AWARE_OPTIMAL` and
|
|
436
437
|
// [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] to `DRIVE`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -35,13 +35,13 @@ message SpeedReadingInterval {
|
|
|
35
35
|
// Default value. This value is unused.
|
|
36
36
|
SPEED_UNSPECIFIED = 0;
|
|
37
37
|
|
|
38
|
-
// Normal speed, no
|
|
38
|
+
// Normal speed, no traffic delays.
|
|
39
39
|
NORMAL = 1;
|
|
40
40
|
|
|
41
|
-
// Slowdown detected,
|
|
41
|
+
// Slowdown detected, medium amount of traffic.
|
|
42
42
|
SLOW = 2;
|
|
43
43
|
|
|
44
|
-
// Traffic
|
|
44
|
+
// Traffic delays.
|
|
45
45
|
TRAFFIC_JAM = 3;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -51,6 +51,7 @@ message SpeedReadingInterval {
|
|
|
51
51
|
// The ending index of this interval in the polyline.
|
|
52
52
|
optional int32 end_polyline_point_index = 2;
|
|
53
53
|
|
|
54
|
+
// The type of speed in this interval.
|
|
54
55
|
oneof speed_type {
|
|
55
56
|
// Traffic speed in this interval.
|
|
56
57
|
Speed speed = 3;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -18,7 +18,6 @@ package google.maps.routing.v2;
|
|
|
18
18
|
|
|
19
19
|
import "google/type/money.proto";
|
|
20
20
|
|
|
21
|
-
option cc_enable_arenas = true;
|
|
22
21
|
option csharp_namespace = "Google.Maps.Routing.V2";
|
|
23
22
|
option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
|
|
24
23
|
option java_multiple_files = true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -25,10 +25,14 @@ option objc_class_prefix = "GMRV2";
|
|
|
25
25
|
option php_namespace = "Google\\Maps\\Routing\\V2";
|
|
26
26
|
option ruby_package = "Google::Maps::Routing::V2";
|
|
27
27
|
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
28
|
+
// This field specifies one of the following assumptions to use when calculating
|
|
29
|
+
// travel time in traffic conditions, shown in the enums below. Depending on the
|
|
30
|
+
// enum chosen, the `duration` field of the TrafficModel response will vary. The
|
|
31
|
+
// value contains the predicted time to destination in traffic, based on
|
|
32
|
+
// historical averages. `TrafficModel` is only available for requests that have
|
|
33
|
+
// set [`RoutingPreference`][google.maps.routing.v2.RoutingPreference] to
|
|
34
|
+
// `TRAFFIC_AWARE_OPTIMAL` and
|
|
35
|
+
// [`RouteTravelMode`][google.maps.routing.v2.RouteTravelMode] to `DRIVE`.
|
|
32
36
|
enum TrafficModel {
|
|
33
37
|
// Unused. If specified, will default to `BEST_GUESS`.
|
|
34
38
|
TRAFFIC_MODEL_UNSPECIFIED = 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -18,7 +18,6 @@ package google.maps.routing.v2;
|
|
|
18
18
|
|
|
19
19
|
import "google/maps/routing/v2/vehicle_emission_type.proto";
|
|
20
20
|
|
|
21
|
-
option cc_enable_arenas = true;
|
|
22
21
|
option csharp_namespace = "Google.Maps.Routing.V2";
|
|
23
22
|
option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
|
|
24
23
|
option java_multiple_files = true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -42,6 +42,11 @@ message Waypoint {
|
|
|
42
42
|
// Human readable address or a plus code.
|
|
43
43
|
// See https://plus.codes for details.
|
|
44
44
|
string address = 7;
|
|
45
|
+
|
|
46
|
+
// A token that identifies a
|
|
47
|
+
// [`NavigationPoint`](https://developers.google.com/maps/documentation/geocoding/reference/rest/v4alpha/geocode.destinations/searchDestinations#navigationpoint),
|
|
48
|
+
// obtained from the `SearchDestinations` method of the Geocoding API.
|
|
49
|
+
string navigation_point_token = 8;
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
// Marks this waypoint as a milestone rather a stopping point. For
|
package/build/protos/protos.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -11267,6 +11267,9 @@ export namespace google {
|
|
|
11267
11267
|
/** Waypoint address */
|
|
11268
11268
|
address?: (string|null);
|
|
11269
11269
|
|
|
11270
|
+
/** Waypoint navigationPointToken */
|
|
11271
|
+
navigationPointToken?: (string|null);
|
|
11272
|
+
|
|
11270
11273
|
/** Waypoint via */
|
|
11271
11274
|
via?: (boolean|null);
|
|
11272
11275
|
|
|
@@ -11295,6 +11298,9 @@ export namespace google {
|
|
|
11295
11298
|
/** Waypoint address. */
|
|
11296
11299
|
public address?: (string|null);
|
|
11297
11300
|
|
|
11301
|
+
/** Waypoint navigationPointToken. */
|
|
11302
|
+
public navigationPointToken?: (string|null);
|
|
11303
|
+
|
|
11298
11304
|
/** Waypoint via. */
|
|
11299
11305
|
public via: boolean;
|
|
11300
11306
|
|
|
@@ -11305,7 +11311,7 @@ export namespace google {
|
|
|
11305
11311
|
public sideOfRoad: boolean;
|
|
11306
11312
|
|
|
11307
11313
|
/** Waypoint locationType. */
|
|
11308
|
-
public locationType?: ("location"|"placeId"|"address");
|
|
11314
|
+
public locationType?: ("location"|"placeId"|"address"|"navigationPointToken");
|
|
11309
11315
|
|
|
11310
11316
|
/**
|
|
11311
11317
|
* Creates a new Waypoint instance using the specified properties.
|
package/build/protos/protos.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -31376,6 +31376,7 @@
|
|
|
31376
31376
|
* @property {google.maps.routing.v2.ILocation|null} [location] Waypoint location
|
|
31377
31377
|
* @property {string|null} [placeId] Waypoint placeId
|
|
31378
31378
|
* @property {string|null} [address] Waypoint address
|
|
31379
|
+
* @property {string|null} [navigationPointToken] Waypoint navigationPointToken
|
|
31379
31380
|
* @property {boolean|null} [via] Waypoint via
|
|
31380
31381
|
* @property {boolean|null} [vehicleStopover] Waypoint vehicleStopover
|
|
31381
31382
|
* @property {boolean|null} [sideOfRoad] Waypoint sideOfRoad
|
|
@@ -31420,6 +31421,14 @@
|
|
|
31420
31421
|
*/
|
|
31421
31422
|
Waypoint.prototype.address = null;
|
|
31422
31423
|
|
|
31424
|
+
/**
|
|
31425
|
+
* Waypoint navigationPointToken.
|
|
31426
|
+
* @member {string|null|undefined} navigationPointToken
|
|
31427
|
+
* @memberof google.maps.routing.v2.Waypoint
|
|
31428
|
+
* @instance
|
|
31429
|
+
*/
|
|
31430
|
+
Waypoint.prototype.navigationPointToken = null;
|
|
31431
|
+
|
|
31423
31432
|
/**
|
|
31424
31433
|
* Waypoint via.
|
|
31425
31434
|
* @member {boolean} via
|
|
@@ -31449,12 +31458,12 @@
|
|
|
31449
31458
|
|
|
31450
31459
|
/**
|
|
31451
31460
|
* Waypoint locationType.
|
|
31452
|
-
* @member {"location"|"placeId"|"address"|undefined} locationType
|
|
31461
|
+
* @member {"location"|"placeId"|"address"|"navigationPointToken"|undefined} locationType
|
|
31453
31462
|
* @memberof google.maps.routing.v2.Waypoint
|
|
31454
31463
|
* @instance
|
|
31455
31464
|
*/
|
|
31456
31465
|
Object.defineProperty(Waypoint.prototype, "locationType", {
|
|
31457
|
-
get: $util.oneOfGetter($oneOfFields = ["location", "placeId", "address"]),
|
|
31466
|
+
get: $util.oneOfGetter($oneOfFields = ["location", "placeId", "address", "navigationPointToken"]),
|
|
31458
31467
|
set: $util.oneOfSetter($oneOfFields)
|
|
31459
31468
|
});
|
|
31460
31469
|
|
|
@@ -31494,6 +31503,8 @@
|
|
|
31494
31503
|
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.sideOfRoad);
|
|
31495
31504
|
if (message.address != null && Object.hasOwnProperty.call(message, "address"))
|
|
31496
31505
|
writer.uint32(/* id 7, wireType 2 =*/58).string(message.address);
|
|
31506
|
+
if (message.navigationPointToken != null && Object.hasOwnProperty.call(message, "navigationPointToken"))
|
|
31507
|
+
writer.uint32(/* id 8, wireType 2 =*/66).string(message.navigationPointToken);
|
|
31497
31508
|
return writer;
|
|
31498
31509
|
};
|
|
31499
31510
|
|
|
@@ -31542,6 +31553,10 @@
|
|
|
31542
31553
|
message.address = reader.string();
|
|
31543
31554
|
break;
|
|
31544
31555
|
}
|
|
31556
|
+
case 8: {
|
|
31557
|
+
message.navigationPointToken = reader.string();
|
|
31558
|
+
break;
|
|
31559
|
+
}
|
|
31545
31560
|
case 3: {
|
|
31546
31561
|
message.via = reader.bool();
|
|
31547
31562
|
break;
|
|
@@ -31612,6 +31627,13 @@
|
|
|
31612
31627
|
if (!$util.isString(message.address))
|
|
31613
31628
|
return "address: string expected";
|
|
31614
31629
|
}
|
|
31630
|
+
if (message.navigationPointToken != null && message.hasOwnProperty("navigationPointToken")) {
|
|
31631
|
+
if (properties.locationType === 1)
|
|
31632
|
+
return "locationType: multiple values";
|
|
31633
|
+
properties.locationType = 1;
|
|
31634
|
+
if (!$util.isString(message.navigationPointToken))
|
|
31635
|
+
return "navigationPointToken: string expected";
|
|
31636
|
+
}
|
|
31615
31637
|
if (message.via != null && message.hasOwnProperty("via"))
|
|
31616
31638
|
if (typeof message.via !== "boolean")
|
|
31617
31639
|
return "via: boolean expected";
|
|
@@ -31645,6 +31667,8 @@
|
|
|
31645
31667
|
message.placeId = String(object.placeId);
|
|
31646
31668
|
if (object.address != null)
|
|
31647
31669
|
message.address = String(object.address);
|
|
31670
|
+
if (object.navigationPointToken != null)
|
|
31671
|
+
message.navigationPointToken = String(object.navigationPointToken);
|
|
31648
31672
|
if (object.via != null)
|
|
31649
31673
|
message.via = Boolean(object.via);
|
|
31650
31674
|
if (object.vehicleStopover != null)
|
|
@@ -31693,6 +31717,11 @@
|
|
|
31693
31717
|
if (options.oneofs)
|
|
31694
31718
|
object.locationType = "address";
|
|
31695
31719
|
}
|
|
31720
|
+
if (message.navigationPointToken != null && message.hasOwnProperty("navigationPointToken")) {
|
|
31721
|
+
object.navigationPointToken = message.navigationPointToken;
|
|
31722
|
+
if (options.oneofs)
|
|
31723
|
+
object.locationType = "navigationPointToken";
|
|
31724
|
+
}
|
|
31696
31725
|
return object;
|
|
31697
31726
|
};
|
|
31698
31727
|
|
package/build/protos/protos.json
CHANGED
|
@@ -1578,8 +1578,7 @@
|
|
|
1578
1578
|
"java_package": "com.google.maps.routing.v2",
|
|
1579
1579
|
"objc_class_prefix": "GMRV2",
|
|
1580
1580
|
"php_namespace": "Google\\Maps\\Routing\\V2",
|
|
1581
|
-
"ruby_package": "Google::Maps::Routing::V2"
|
|
1582
|
-
"cc_enable_arenas": true
|
|
1581
|
+
"ruby_package": "Google::Maps::Routing::V2"
|
|
1583
1582
|
},
|
|
1584
1583
|
"nested": {
|
|
1585
1584
|
"FallbackInfo": {
|
|
@@ -3045,7 +3044,8 @@
|
|
|
3045
3044
|
"oneof": [
|
|
3046
3045
|
"location",
|
|
3047
3046
|
"placeId",
|
|
3048
|
-
"address"
|
|
3047
|
+
"address",
|
|
3048
|
+
"navigationPointToken"
|
|
3049
3049
|
]
|
|
3050
3050
|
}
|
|
3051
3051
|
},
|
|
@@ -3062,6 +3062,10 @@
|
|
|
3062
3062
|
"type": "string",
|
|
3063
3063
|
"id": 7
|
|
3064
3064
|
},
|
|
3065
|
+
"navigationPointToken": {
|
|
3066
|
+
"type": "string",
|
|
3067
|
+
"id": 8
|
|
3068
|
+
},
|
|
3065
3069
|
"via": {
|
|
3066
3070
|
"type": "bool",
|
|
3067
3071
|
"id": 3
|
package/build/src/v2/index.js
CHANGED
|
@@ -179,8 +179,8 @@ export declare class RoutesClient {
|
|
|
179
179
|
* days in the future.
|
|
180
180
|
* @param {google.protobuf.Timestamp} [request.arrivalTime]
|
|
181
181
|
* Optional. The arrival time.
|
|
182
|
-
* NOTE:
|
|
183
|
-
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode}
|
|
182
|
+
* NOTE: This field is ignored when requests specify a
|
|
183
|
+
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} other than
|
|
184
184
|
* `TRANSIT`. You can specify either `departure_time` or `arrival_time`, but
|
|
185
185
|
* not both. Transit trips are available for up to 7 days in the past or 100
|
|
186
186
|
* days in the future.
|
|
@@ -368,6 +368,7 @@ export declare class RoutesClient {
|
|
|
368
368
|
* traffic. This setting affects the value returned in the duration field in
|
|
369
369
|
* the {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which
|
|
370
370
|
* contains the predicted time in traffic based on historical averages.
|
|
371
|
+
* `TrafficModel` is only available for requests that have set
|
|
371
372
|
* {@link protos.google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
372
373
|
* `TRAFFIC_AWARE_OPTIMAL` and
|
|
373
374
|
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2026 Google LLC
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -409,6 +409,7 @@ class RoutesClient {
|
|
|
409
409
|
* traffic. This setting affects the value returned in the duration field in
|
|
410
410
|
* the {@link protos.google.maps.routing.v2.RouteMatrixElement|RouteMatrixElement} which
|
|
411
411
|
* contains the predicted time in traffic based on historical averages.
|
|
412
|
+
* `TrafficModel` is only available for requests that have set
|
|
412
413
|
* {@link protos.google.maps.routing.v2.RoutingPreference|RoutingPreference} to
|
|
413
414
|
* `TRAFFIC_AWARE_OPTIMAL` and
|
|
414
415
|
* {@link protos.google.maps.routing.v2.RouteTravelMode|RouteTravelMode} to `DRIVE`.
|