Ben Davidow
Ben Davidow

Reputation: 1215

Combining Polylines on Google Static Map

I'm trying to make a static map request with multiple polylines. It works fine when I have a single polyline, but when I add them together I don't get the intended results. Specifically, I'm trying to highlight adjacent street blocks.

Polyline 1 works fine:

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

Polyline 2 works fine:

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

But combined, I get this:

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

Upvotes: 2

Views: 3253

Answers (1)

geocodezip
geocodezip

Reputation: 161384

This works for me (separate the polyline specifications):

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

(You need to add "&path=weight:10%7Cenc:YourEncodedPolylineHere" for each polyline)

Upvotes: 7

Related Questions