[Google Static Maps] Handle styled Maps with the "style" parameter
還沒有人認領這個 Issue。
評估
研究方向
從 StaticMapsRequest.java 開始,沿著 param 和 paramAddToList 追蹤 custom(String, String),以了解重複參數是如何表示的。將 Google Static Maps 所要求的樣式行為與連結的樣式文件進行比較;當呼叫端可以透過受支援的請求 API 新增多個 style 參數時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
I use the Google Static Maps API and I would like to customize the presentation of the Map by applying my own styles.
I found this documentation: https://developers.google.com/maps/documentation/maps-static/styling
Is your feature request related to a problem? Please describe.
But I can't find a method in StaticMapsRequest.java to add styles.
As an alternative, I used StaticMapsRequest.custom(...) method.
req.custom("style", "feature:poi|visibility:off");
But I can't add multiple styles, because the custom method allows to add just one 'style' parameter.
I can't do the following:
StaticMapsRequest req = StaticMapsApi.newRequest(sc.context, new Size(WIDTH, HEIGHT));
req.center("Google Sydney");
req.zoom(16);
req.custom("style", "feature:poi|visibility:off");
req.custom("style", "feature:landscape|visibility:off");
ByteArrayInputStream bais = new ByteArrayInputStream(req.await().imageData);
BufferedImage img = ImageIO.read(bais);
Describe the solution you'd like
I would like to have a method to handle the 'style' parameter.
req.style(
new Style()
.feature(new StyleFeature().poi())
.element(new StyleElement().labels().icon())
.rules(new StyleRules().color(java.awt.Color.WHITE))
);
req.style(
new Style()
.feature(new StyleFeature().landscape().man_made())
.rules(new StyleRules().visbility().off())
);
Describe alternatives you've considered
The custom method allows to add a single string:
public A custom(String parameter, String value) {
return this.param(parameter, value);
}
An alternative would be to add a new custom method that allows a list of Strings:
public A custom(String parameter, List<String> values) {
values.forEach(v -> this.paramAddToList(parameter, v));
return this.getInstance();
}
- 主要語言
- Java
- 星號
- 1.8k
- 分支
- 972
- 平均合併
- 5 小時 7 分鐘
- 30 天內合併 PR
- 1
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
googlemaps/google-maps-services-java 的其他 Issue
-
PlacesApi.placeDetails(context, placeId).await() interface error可能已有人在做 @madtriceps 於 99 天前認領。 未關閉triage me type: bug
難度 3/5 1-2 天 新手友好度 48/100
-
triage me type: feature request
難度 5/5 一週以上 新手友好度 10/100
-
Bagg hacm未關閉
難度 5/5 一週以上 新手友好度 5/100
googlemaps/google-maps-services-java#1059 · 1 個 reaction ·
-
Issue in java da未關閉
難度 5/5 一週以上 新手友好度 10/100
-
Issue in java da未關閉
難度 5/5 一週以上 新手友好度 10/100
查看 googlemaps/google-maps-services-java 的全部 Issue
相似的 Issue
-
hermes-queue
難度 1/5 1 小時以內 新手友好度 91/100
chrisalunlloyd2-sudo/mindpalace#373 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
bug priority: lowest
難度 2/5 1-3 小時 新手友好度 62/100
SkriptLang/Skript#8953 · 1 則留言 ·
維護者通常 1 天內回覆
-
quality-assurance
難度 2/5 1-3 小時 新手友好度 62/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#228 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 91/100
維護者通常 2 天內回覆