如何使用路径(折线)加载静态Google地图? [英] How to load a static google map with a path (polyline)?
问题描述
我已经实现了一些代码,这些代码可以在单击列表视图项时从URL加载图像;该图片已通过虚拟"图像进行了测试,并且在将图像显示在imageview对象中时不会出现任何问题.
I have implemented some code that loads an image from a URL upon a listview item being clicked; this has been tested with a 'dummy' image and works without any problem with the image being displayed in an imageview object.
但是,我真正想做的是通过URL加载带有路径(折线)的静态Google Map,但是由于某些原因,这是行不通的,我希望这里的人能够告诉我问题出在哪里我的网址:
However, what I really want to do is to load a Static Google Map with Paths (polyline) via URL, but for some reason this is not working and I hope that someone here will be able to tell me what is wrong with my URL:
http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384|40.755823,-73.986397
根据Google文档 http://code.google.com/apis/maps/documentation/staticmaps/我相信我的URL应该可用,因为带有路径的图像仅需要size属性(即所有其他属性都是可选的).
According to the Google documentation http://code.google.com/apis/maps/documentation/staticmaps/ I believe that my URL should work, because an image witha path only requires the size attribute (i.e. all others are optional).
当我尝试通过网络浏览器加载URL时,我在Google Chrome浏览器中收到错误403,告诉我googleapis网站需要登录.这是API密钥吗?我有一个API密钥,我以前曾将其用于非静态的google地图,并且将此密钥从地图的xml复制/粘贴到了我的URL中(使用key =属性),但同样失败了.
When I try to test load my URL via a web-browser I receive an Error 403 in Google Chrome telling me that the googleapis website requires a log in. Is this the API key? I have an API key that I've previously used for a non-static google map and I copy/pasted this key from the map's xml into my URL (using the key= attribute), but again this was not successful.
我已经尝试过在Google和这个论坛上进行搜索,但是似乎没有人以前曾遇到过这个问题-也许我只是在搜索方面真的很烂:(但希望有人可以提供帮助?
I've tried searching on google and this forum, but it seems that no-one has had this problem before - or maybe I'm just really bad at searching :( But hopefully someone can assist?
谢谢!
推荐答案
您缺少必需的sensor
查看全文