Closed RichieMcMullen closed 3 years ago
You can use the Polyline Encoder library to decode the Polyline field. It returns the coordinates of each points. Edit: fixed link
Hi @qligier, the URL in your post doesn't go anywhere. I think you mean Polyline Encoder, which I have used and is excellent.
Btw, PHP-Geometry contains a nice implementation of the Ramer–Douglas–Peucker algorithm. This gives you a similar looking line from fewer points.
Instead of decoding the polyline into lat-lngs at the server side, you could do this in the browser if you use Leaflet maps through the Leaflet.encoded plugin. Other maps have similar functionality too :)
@RichTT a couple of issues I have bumped into with encoded polylines:
Yes, sorry for the link. I only knew the older google-map-polyline-encoding-tool and I've changed it just before sending the message. The Leaflet.encoded plugin seems a very good alternative.
Stale issue message
Having trouble displaying the map using the Polyline code retrieved from the activity object. Any ideas on how to display it (PHP or JS) ?