2015-03-31 69 views
0

我可以在Google靜態地圖中顯示由點集合構成的路徑。 我可以在Google靜態地圖中顯示由overview_polyline的enc構成的路徑。 但是,在大多數情況下,我無法顯示具有兩個點的路徑和enc。 儘管我在常規的谷歌地圖中看到了路徑。 有時它的確如此工作,你可以看到: http://www.mobile-gap.com/where2go/launch.php?jump_to=9,13 但在大多數情況下,它只顯示一個或另一個。 我的應用程序(旅程和事件)使用戶能夠添加一個兩者結合的路徑。在Google靜態地圖中顯示路徑

回答

0

所以在問題作爲實現的基準的示例具有圖片標記「https://maps.googleapis.com/maps/api/staticmap?size=400x400&markers=color:0xFFFF00|label:1|40.74896068875827,-73.98549273862306&markers=color:0xFFFF00|label:2|40.7488758,-73.9680091&markers=color:0xFFFF00|label:3|40.705866,-74.00424&markers=color:0xFFFF00|label:4|40.7105139,-74.0155469&markers=color:0xFFFF00|label:5|40.6892494,-74.0445004&path=color:0x0000ff|weight:3|enc:kwuwFvhqbMbQ此長的URL {I @ lFqPpGmSn @ uBiCuA_Am @ö@克@沃頓I @ SA} @eByA}綾{AUAU @ÿ@ {@ s @ oEmDuJsH {HqGoFcFkCwBaAq @ sEwD_ @ c @ {@ gAkBoCk @ k @ y @ @ @ aCyAcEgDeA {@@ WSMMGMIe @ Us @] m @ E] EMIw @C{[email protected]@[email protected]@[email protected] A A|@[email protected] @JRNbBdA \ RPHtBvA^VPX ^^ pAhA | A [email protected]@[email protected][email protected][email protected]~N&path=color:0x0000ff|weight:3|enc:ivuwFrxmbMxC|[email protected]@[email protected]@fCxAdE CxBz @ tA @tATnJlAtATrA^[email protected]|[email protected]@[email protected]@[email protected]@QZO\O|@[email protected][email protected]@[email protected]][email protected]@[email protected]@[email protected]@[email protected]|[email protected][email protected]^[email protected] D \ lCl @ dAXtAl @ | F | B〜JfEnChAv @ b @〜@ v @ t @ t @ @ @ aA @ @ hBZlBCl @ @ r @ P | G @ ZLpEPbG @ n @ \ vEj @ hM [email protected]@[email protected]@[email protected] G | LjA | Bc @ h @ & path = color:0x0000ff | weight:3 | enc:gkmwFp | tbMb @ i @ hAxB^v @ xA [email protected]@[email protected]@tB^[email protected][HFXD CGh @ o @ v @ @^q @ Zo @ HwD_ @ c @ GW?UCEVMp @ WhBIx @ Cl @ BrAFhAHvAEh @ CTQn @ _ @ @ @ @ @ @ @ @ @ R [Fs @@ YCw @ Sg @ S_EcCcC_B {@dCqD} B [Q_A _ @} @ WoBk @ & path = color :0x228B22 |重量:3 | 40.7105139,-74.0155469 | 40.710611491308946,-74.01606188413086 | 40.710009675958524,-74.01634083386841 | 40.71043257379994,-74.01814327832642 | 40.70942214380081,-74.0224762910866 | 40.70942214380081,-74.0224762910866 | 40.708643372269236,-74.02586804028931 | 40.708643372269236,-74.02595387097779 | 40.6998918576991,-74.02623282071533 | 40.69009790752417,-74.03217659589234 | 40.68944709570568,-74.04419289227905 | 40.6892494,-74.0445004 &鍵= AIzaSyBZ2ijM7ygGfp_BPNY2ClcoSexWta8rXXQ &語言= EN」

這裏的標記是由分離點‘&’運營商和路徑參數是相當直截了當已緯度/經度座標相隔一個「|」運營商。對於enc參數,您可以訪問此link以查找編碼折線。創建你的polyines並獲得編碼值。最後合併與示例中給出的參數相同的參數,您將獲得所需的靜態地圖圖像。

希望這有助於!

+0

感謝您的回覆。 請注意,在我的問題中,我寫道它在某些情況下效果很好,但在其他情況下效果不好。當它不起作用時,它有時只顯示enc,有時只顯示lat/lng路徑。 – Shlomo 2015-04-02 06:43:25

+0

但是這怎麼可能..我的意思是一旦靜態圖像被加載,它應該顯示它由像標記,多段線等組成的所有組件。這個問題可能與底層平臺有關。 – AniV 2015-04-03 00:30:26

相關問題