googlemaps / googlemaps/google-maps-services-java

GeoApiContext - Mobility - Failed to set the trip ID (Mobility Solution) via .experienceIdHeaderValue()

未關閉
#993 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
triage me type: bug
主要語言
Java
星號
1.8k
分支
973
PR 合併指標
30 天內沒有已合併 PR

描述

#### Environment details

Library version: 2.2.0

#### Steps to reproduce
We are going to manage trips for our mobility project and referring [this documentation](https://developers.google.com/maps/documentation/transportation-logistics-terms/on-demand-rides-deliveries-solution/managing-trips#java_example_2) to report the trip IDs (aka Experience IDs) but failed. It seems like there is no such method **experienceIdHeaderValue**. I created a GMP support ticket before but they asked me to report this issue here. Could you help on this?

Meanwhile, we'd like to know if we are allowed to set GMP request header for tripID by our own via the following part,
![Client Libraries_GeoApiContext_RequestHandler](https://github.com/googlemaps/google-maps-services-java/assets/68408504/d63e358b-1f56-4cd5-8fed-755f805fd63e)
![Client Libraries_GeoApiContext_RequestHandler_interface](https://github.com/googlemaps/google-maps-services-java/assets/68408504/a486a91c-2087-4932-bd06-9f1676e8f511)

Please find our screencaps for the **experienceIdHeaderValue** part in the attachment.
>>Translation of the image
_Java: cannot find symbol
symbol: method experienceIdHeaderValue(java.lang.String)
location: class com.google.maps.GeoApiContext.Builder_
error when compiling the code for experienceIdHeaderValue
implement_cannot_find_experienceIdHeaderValue
ref_current_version
failed to retrieve experienceIdHeaderValue in github

#### Code example
```Java
GeoApiContext context = new GeoApiContext.Builder()
.apiKey("AIza...")
.experienceIdHeaderValue("MCN-99a692...")
.build();
GeocodingResult[] results = GeocodingApi.geocode(context,
"1600 Amphitheatre Parkway Mountain View, CA 94043").await();
Gson gson = new GsonBuilder().setPrettyPrinting().create();
System.out.println(gson.toJson(results[0].addressComponents));
```

Thanks in advance.

Best Regards,
Sisi

貢獻指南

開啟貢獻指南

研究方向

先從報告中展示的 GeoApiContext.Builder 和 RequestHandler 介面開始,然後針對程式庫版本 2.2.0 重現缺少的 experienceIdHeaderValue() 呼叫。將用戶端 API 與連結的 Mobility 文件進行比較,並判斷是否支援 trip ID 標頭;當明確確立支援的用法或所需的程式庫變更後,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java
領域
api
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。