rn-maps-polyline
v2.0.0
Published
A tiny library to use polyline in react-native-maps
Downloads
26
Readme
rn-maps-polyline
A tiny library to use polyline in react-native-maps (MapView.Polyline), based in google-polyline
v2.0.0
Now decoding is almost 3x times faster than before
Install via npm
$ npm install --save rn-maps-polyline
Usage
import RNPolyline from 'rn-maps-polyline'
//or
import { decode, encode } from 'rn-maps-polyline'
or
var RNPolyline = require('rn-maps-polyline')
RNPolyline.encode([
{ latitude: 37.772, longitude: -122.214 },
{ latitude: 21.291, longitude: -157.821 },
{ latitude: -18.142, longitude: 178.431 },
{ latitude: -27.467, longitude: 153.027 }
])
> '_jpeFn||hVf}qcBvnixEfwtoF_fic_Afh|w@~u`zC'
RNPolyline.decode('_jpeFn||hVf}qcBvnixEfwtoF_fic_Afh|w@~u`zC')
> [
{ latitude: 37.772, longitude: -122.214 },
{ latitude: 21.291, longitude: -157.821 },
{ latitude: -18.142, longitude: 178.431 },
{ latitude: -27.467, longitude: 153.027 }
]
Contribute
The project is using babel and uglifyjs to compile so make sure you have both if you want to clone the repo