[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
-
Area-UIUX Issue-Bug Issue-Easy (good first issue)
难度 2/5 1-3 小时 新手友好度 67/100
TeamAmaze/AmazeFileManager#4769 ·
维护者通常 7 天内回复
-
Expose SManga.memo & SChapter.memo fields in GraphQL APIs to support source-specific client features未关闭enhancement
难度 2/5 1-3 小时 新手友好度 72/100
Suwayomi/Suwayomi-Server#2551 ·
维护者通常 9 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
weaviate/java-client#631 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复