From 65d94c9141cdac582fc3874b8cb72a49c83f30ab Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 28 Jul 2016 05:17:53 -0400 Subject: [PATCH 1/3] add javascript styling --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4578289..29f1c8a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ You can get the previous and next S2CellId from any given Key: 2. Get the Previous or Next Key 3. Convert the Key to an Id (uint64 string) -``` +```javascript var key = S2.latLngToKey(40.2574448, -111.7089464); var id = S2.toId(key); @@ -53,7 +53,7 @@ Convert from base 10 (decimal) `S2 Cell Id` to base 4 `quadkey` (aka hilbert cur Example '4/032212303102210' becomes '9749618446378729472' -``` +```javascript 'use strict'; var quadkey = '4/032212303102210' From 6252e4e9e9f71b4ee245067b2ac23f6c3615357b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 28 Jul 2016 05:21:24 -0400 Subject: [PATCH 2/3] syntax, comments with output --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 29f1c8a..8b37ab9 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ You can get the previous and next S2CellId from any given Key: 3. Convert the Key to an Id (uint64 string) ```javascript -var key = S2.latLngToKey(40.2574448, -111.7089464); -var id = S2.toId(key); +var key = S2.latLngToKey(40.2574448, -111.7089464); // '4/032212303102210' +var id = S2.toId(key); // '9749618446378729472' var nextKey = S2.nextKey(key); var nextId = S2.toId(nextKey); @@ -40,9 +40,9 @@ var prevKey = S2.prevKey(key); var prevId = S2.toId(prevKey); // See it -console.log(prevKey); -console.log(key); -console.log(nextKey); +console.log(prevKey); // '4/032212303102203' +console.log(key); // '4/032212303102210' +console.log(nextKey); // '4/032212303102211' console.log(nextId); ``` @@ -71,7 +71,7 @@ Convert from hilbert quadtree id to s2 cell id: Example '9749618446378729472' becomes '4/032212303102210' -``` +```javascript 'use strict'; var cellId = '9749618446378729472'; From 2796829356bdc34e691909a4789a5e385f46e87c Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 28 Jul 2016 05:23:39 -0400 Subject: [PATCH 3/3] add 'used by' section --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b37ab9..7453af5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,17 @@ s2-geometry (JavaScript/ES5.1) ====================== -A pure JavaScript/ES5.1 port of Google/Niantic's S2 Geometry library (used by **Ingress**, **Pokemon GO**) +A pure JavaScript/ES5.1 port of Google/Niantic's S2 Geometry library (as used by **Ingress**, **Pokemon GO**) Currently contains basic support for S2Cell +Where is this being used? +--------------------- + +* [pokemap-webapp](https://github.com/Daplie/pokemap-webapp) +* [node-pokemap](https://github.com/Daplie/node-pokemap) +* [Pokemon-GO-node-api](https://github.com/Daplie/Pokemon-GO-node-api) + Simple Examples ---------------