Ben*_*dow 2 google-maps google-maps-api-3 google-maps-static-api
我正在尝试使用多个折线创建静态地图请求.当我有一条折线时,它工作正常,但是当我将它们加在一起时,我得不到预期的结果.具体来说,我试图突出相邻的街区.
折线1工作正常:
https://maps.googleapis.com/maps/api/staticmap?sensor=false&size=400x400&path=weight:10%7Cenc:{d`pEnpypUc@_@u@Q
Run Code Online (Sandbox Code Playgroud)
折线2工作正常:
https://maps.googleapis.com/maps/api/staticmap?sensor=false&size=400x400&path=weight:10%7Cenc:c``pEtjypUi@fAu@zA[j@mAzB
Run Code Online (Sandbox Code Playgroud)
但结合起来,我明白了:
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
Run Code Online (Sandbox Code Playgroud)
这对我有用(将折线规格分开):
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
Run Code Online (Sandbox Code Playgroud)
(您需要为每条折线添加"&path = weight:10%7Cenc:YourEncodedPolylineHere")