谷歌地图和很多路径点(长折线)

发布于 2024-10-01 13:47:20 字数 349 浏览 1 评论 0 原文

我尝试将 Google 的静态地图服务集成到我的 C# 应用程序中。它应该在地图上绘制一条自定义路线。例如:

http://maps.google.com/maps/api/staticmap?size=512x512&path=color:0x0000ff|weight:5|40.737102,-73.990318|40.749825,-73.987963&sensor=false

这对于一些路径点 (~ <75) 效果很好,但如果路由足够长,URI 就会超过 2048 个字符限制,我会收到 414 错误消息。

是否可以通过 POST 绕过这个问题?

谢谢你!

I try to integrate Google's static Maps service in my C# application. It should plot a custom route on a map. For example:

http://maps.google.com/maps/api/staticmap?size=512x512&path=color:0x0000ff|weight:5|40.737102,-73.990318|40.749825,-73.987963&sensor=false

This works well for a few path points (~ <75) but if the route is long enough the URI exceeds the 2048 characters limit and I get a 414 error message.

Is it possible to bypass this problem, perhaps with a POST?

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

我的痛♀有谁懂 2024-10-08 13:47:20

不,你无法绕过这个问题。你可以做的就是降低坐标的准确性,以便网址长度也减少。

Nope you can't bypass that problem.What you can do is to maybe reduce the accuracy of the coords so that the url length gets reduced also.

做个ˇ局外人 2024-10-08 13:47:20

如果您有网络服务,您可以将点保存在网络服务器上托管的 KML 文件中,然后将其传递到 google 地图 http://code.google.com/apis/kml/documentation/whatiskml.html

if you have a web serve you can save the points in a KML file hosted on your webserver then pass it along to google Maps http://code.google.com/apis/kml/documentation/whatiskml.html

失与倦" 2024-10-08 13:47:20

Google静态图像API不支持查看KML文件。

Google static image API does not support for viewing of KML file.

掩饰不了的爱 2024-10-08 13:47:20

Google 最近将 URL 大小限制更改为 8192 个字符。

您可以在公开问题中查看功能请求标记为固定的跟踪器。

文档也证实了这一变化
https://developers.google.com/maps/documentation /static-maps/intro#url-size-restriction

Google recently changed the URL limit to 8192 characters in size.

You can see a feature request in public issue tracker that was marked as Fixed.

Also documentation confirms this change
https://developers.google.com/maps/documentation/static-maps/intro#url-size-restriction

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文