谷歌地图和很多路径点(长折线)
我尝试将 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 绕过这个问题?
谢谢你!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不,你无法绕过这个问题。你可以做的就是降低坐标的准确性,以便网址长度也减少。
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.
如果您有网络服务,您可以将点保存在网络服务器上托管的 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
Google静态图像API不支持查看KML文件。
Google static image API does not support for viewing of KML file.
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