Skip to content

Yhozen/rn-maps-polyline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rn-maps-polyline

npm npm npm

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

Releases

No releases published

Packages

No packages published