1
0
Fork 0

Fix formatting in buffered polyline post

This commit is contained in:
Daniel Kempkens 2014-03-23 22:23:08 +01:00
parent 13609812b6
commit 58ca5c5f75

View file

@ -12,9 +12,9 @@ comments: true
share: true share: true
--- ---
At work, we needed a simple way to buffer a polyline in order to search for stuff along the route from A to B. I'll explain how we used Google's Map API and [JSTS](https://github.com/bjornharrtell/jsts) in order to achieve this easily. At work, we needed a simple way to buffer a polyline in order to search for stuff along the route from A to B. I'll explain how we used Google's Maps API and [JSTS](https://github.com/bjornharrtell/jsts) in order to achieve this easily.
The first thing we had to do, was to "transform" each element in the overview_path (which the `DirectionsService` returns) to GeoJSON, because that's what JSTS understands. The first thing we had to do, was to "transform" each element in the `overview_path` (which the `DirectionsService` returns) to GeoJSON, because that's what JSTS understands.
{% highlight javascript linenos %} {% highlight javascript linenos %}
var overviewPath = response.routes[0].overview_path, var overviewPath = response.routes[0].overview_path,