knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of gepaf is to encode and decode the Google Encoded Polyline Algorithm Format.
Encoding
library(gepaf) coords <- data.frame( lat = c(38.5, 40.7, 43.252), lon = c(-120.2, -120.95, -126.453) ) encpoly <- encodePolyline(coords) encpoly
Decoding
coords <- decodePolyline(enc_polyline = "_p~iF~ps|U_ulLnnqC_mqNvxq`@") coords
Mostly a translation of https://github.com/mthh/polyline_ggl/ (itself a modest translation of other well known available implementations such as Node.js Mapbox one)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.