syntax, comments with output
This commit is contained in:
parent
65d94c9141
commit
6252e4e9e9
12
README.md
12
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)
|
3. Convert the Key to an Id (uint64 string)
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var key = S2.latLngToKey(40.2574448, -111.7089464);
|
var key = S2.latLngToKey(40.2574448, -111.7089464); // '4/032212303102210'
|
||||||
var id = S2.toId(key);
|
var id = S2.toId(key); // '9749618446378729472'
|
||||||
|
|
||||||
var nextKey = S2.nextKey(key);
|
var nextKey = S2.nextKey(key);
|
||||||
var nextId = S2.toId(nextKey);
|
var nextId = S2.toId(nextKey);
|
||||||
|
@ -40,9 +40,9 @@ var prevKey = S2.prevKey(key);
|
||||||
var prevId = S2.toId(prevKey);
|
var prevId = S2.toId(prevKey);
|
||||||
|
|
||||||
// See it
|
// See it
|
||||||
console.log(prevKey);
|
console.log(prevKey); // '4/032212303102203'
|
||||||
console.log(key);
|
console.log(key); // '4/032212303102210'
|
||||||
console.log(nextKey);
|
console.log(nextKey); // '4/032212303102211'
|
||||||
console.log(nextId);
|
console.log(nextId);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ Convert from hilbert quadtree id to s2 cell id:
|
||||||
|
|
||||||
Example '9749618446378729472' becomes '4/032212303102210'
|
Example '9749618446378729472' becomes '4/032212303102210'
|
||||||
|
|
||||||
```
|
```javascript
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var cellId = '9749618446378729472';
|
var cellId = '9749618446378729472';
|
||||||
|
|
Loading…
Reference in New Issue