我可以在Google静态地图中显示由一组点组成的路径。 我可以在Google静态地图中显示由overview_polyline的enc组成的路径。 但是,在大多数情况下,我无法显示具有以下两者的路径:points和enc。 虽然我在常规Google-Maps中看到了这条路径。 有时它确实有效,你可以看到: http://www.mobile-gap.com/where2go/launch.php?jump_to=9,13 但在大多数情况下,它只显示一个或另一个。 我的应用程序(旅行和活动)使用户能够添加两者结合的路径。
答案 0 :(得分: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 {i @ lFqPpGmSn @ uBiCuA_Am @ o @ g @ k @ i @ sA} @eByA} AyA {AuAu @y @ {@小号@ oEmDuJsH {HqGoFcFkCwBaAq @ sEwD_ @ C_ @ {@ gAkBoCk @沃顿ý@ I @ aCyAcEgDeA {@ @ WSMMGMIe @我们@]米@ E] EMIw @ C{ByAwByAt@eC@QJ_@FIJCJBz@vAv@
A { {1}} @ JRNbBdA \ RPHtBvA ^ VPX ^^ PAHA | A A|@d@Z
CxBz @ TA AlAv@t@n@xAnBrAjB~@~@hHfGlHbHjR~N&path=color:0x0000ff|weight:3|enc:ivuwFrxmbMxC|BlDhCv@t@bFfFfA~@jAx@fCxAdE
d \ lCl的@ dAXtAl @ | F |乙〜JfEnChAv @ b @〜@ v□的吨@〜 @ TZL @ PAJ @ hBZlBCl @@ R 6 P | G ^ ZLpEPbG @ N @ \ vEj @ HM @tATnJlAtATrA^jAh@bG|DjAt@h@Tf@PvAPbA@rAOvOkCnEu@l@QZO\O|@s@tAaBnA_Bf@g@ZSd@]h@Wp@Sh@If@Ct@AzBJtDXf@Hr@N|Aj@zDlBtK~FbAd@fA^dARlAJrCPtKp@
G | LJA | BC 3 H @&安培;路径=彩色:0x0000ff |重量:3 | ENC:gkmwFp | TBMB @ I @ hAxB ^ v @ XA BnTFpAx@vLp@~If@vGNzAVdBj@lBpAfC~@jBtAtD
CGH @ö@ v□的 @ ^ q @咗@ HwD_ @ C_ @ GW UCEVMp @ WhBIx @氯@ BrAFhAHvAEh @ CTQn @ _ @升? @ I @ b @ C_ 5 R [Fs的@@ @ YCW SG @ S_EcCcC_B {@dCqD} b [Q_A _ @} @ WoBk @&安培;路径=彩色: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.04419289 227905 | 40.6892494,-74.0445004& key = AIzaSyBZ2ijM7ygGfp_BPNY2ClcoSexWta8rXXQ& language = en“
这里的要点是标记用“&”分隔operator和path参数非常简单,lat / lng坐标用“|”分隔运营商。对于enc参数,您可以访问此link以查找编码折线。创建多边形并获取编码值。最后合并与示例中给出的参数相同的参数,您将获得所需的静态地图图像。
希望这会有所帮助!!