Porting Google's S2 Geometry Library to Javascript
Go to file
AJ ONeal 544fc8a48d v1.0.0 2016-07-26 00:42:53 -04:00
src v1.0.0 2016-07-26 00:42:53 -04:00
tests v1.0.0 2016-07-26 00:42:53 -04:00
AUTHORS v1.0.0 2016-07-26 00:42:53 -04:00
LICENSE v1.0.0 2016-07-26 00:42:53 -04:00
README.md v1.0.0 2016-07-26 00:42:53 -04:00
package.json v1.0.0 2016-07-26 00:42:53 -04:00

README.md

s2-geometry (JavaScript/ES5.1)

A pure JavaScript/ES5.1 port of Google/Niantic's S2 Geometry library (used by Ingress, Pokemon GO)

Currently contains basic support for S2Cell

Simple Examples

var level = 15;
var latlng = { lat: 40.2574448, lng: -111.7089464 };
var cell = S2.S2Cell.FromLatLng(latlng, level);

cell.getNeighbors();  // [ cellLeft, cellDown, cellRight, cellUp ]

cell.getLatLng();     // { lat: 40.2574448, lng: -111.7089464 }