2012-09-07 126 views
3

我正在使用靜態谷歌地圖API v2下載地圖視圖的靜態圖像,其中只有一個圖像顯示單一標記。但是,添加到url的參數的圖像似乎沒有任何區別,並且在該位置僅顯示一個紅色標記。自定義標記圖標未顯示谷歌靜態地圖v2

請你能告訴我我哪裏出錯了嗎?

http://maps.googleapis.com/maps/api/staticmap 
?center=37.446754,-77.572746 
&size=70x61 
&maptype=roadmap 
&sensor=true 
&scale=2 
&zoom=15 
&key=some_key 
&markers=icon:https://foursquare.com/img/categories_v2/shops/financial_bg_64.png|37.446754,-77.572746 

回答

15

圖像URL必須刪除字母S HTTPS安全站點,這樣的工作,例如像這樣:

http://foursquare.com/img/categories_v2/shops/financial_bg_64.png 

完整代碼:

http://maps.googleapis.com/maps/api/staticmap? 
center=37.446754,-77.572746&size=70x61&maptype=roadmap&sensor=false 
&scale=2&zoom=15 
&markers=icon:http://foursquare.com/img/categories_v2/shops/financial_bg_64.png|37.446754,-77.572746 
+1

+1爲HTTP沒有使用https –

+0

你是說HTTPS沒有圖標的支持? – bart

1

你實際上沒有做任何錯誤,這是谷歌責怪:

「谷歌靜態地圖API不支持使用HT的自定義圖標URL TPS「

0

根據我的經驗, 沒有這樣的要求http或https只是在意圖標大小。 圖標大小不應超過64X64像素大小,靜態地圖會高興地顯示自定義圖標。接受如發現正確@max_

http://maps.googleapis.com/maps/api/staticmap? 
center=37.446754,-77.572746&size=70x61&maptype=roadmap&sensor=false 
&scale=2&zoom=15 
&markers=icon:http://foursquare.com/img/categories_v2/shops/financial_64X64.png|37.446754,-77.572746 

關閉過程與使用您的圖像下面64×64尺寸的,而不是

http://foursquare.com/img/categories_v2/shops/financial_64X64.png