【问题标题】:Combining Polylines on Google Static Map在谷歌静态地图上组合折线
【发布时间】:2014-04-07 23:12:40
【问题描述】:

我正在尝试使用多条折线发出静态地图请求。当我有一条多段线时它工作正常,但是当我将它们加在一起时,我没有得到预期的结果。具体来说,我试图突出显示相邻的街区。

折线 1 工作正常:

https://maps.googleapis.com/maps/api/staticmap?sensor=false&size=400x400&path=weight:10%7Cenc:{d`pEnpypUc@_@u@Q

折线 2 工作正常:

https://maps.googleapis.com/maps/api/staticmap?sensor=false&size=400x400&path=weight:10%7Cenc:c``pEtjypUi@fAu@zA[j@mAzB

但结合起来,我明白了:

https://maps.googleapis.com/maps/api/staticmap?sensor=false&size=400x400&path=weight:10%7Cenc:{d`pEnpypUc@_@u@Q%7Cc``pEtjypUi@fAu@zA[j@mAzB

【问题讨论】:

    标签: google-maps google-maps-api-3 google-static-maps


    【解决方案1】:

    这对我有用(单独的折线规范):

    https://maps.googleapis.com/maps/api/staticmap?sensor=false&size=400x400&path=weight:10%7Cenc:c``pEtjypUi@fAu@zA[j@mAzB&path=weight:10%7Cenc:{d`pEnpypUc@_@u@Q
    

    (您需要为每条折线添加“&path=weight:10%7Cenc:YourEncodedPolylineHere”)

    【讨论】:

    • 为了简化:您需要为每条折线添加“&path=weight:10%7Cenc:YourPolylineHere”。
    • 谢谢,已将其添加到答案中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-23
    • 1970-01-01
    • 1970-01-01
    • 2014-08-03
    相关资源
    最近更新 更多