import dcodeIO.Long in browser

This commit is contained in:
AJ ONeal 2016-07-27 20:45:56 -04:00
parent b5c41f04e4
commit f911efcdab
1 changed files with 2 additions and 2 deletions

View File

@ -306,7 +306,7 @@ S2.MAX_LEVEL = 30;
S2.POS_BITS = (2 * S2.MAX_LEVEL) + 1; S2.POS_BITS = (2 * S2.MAX_LEVEL) + 1;
S2.fromFacePosLevel = function (faceN, posS, levelN) { S2.fromFacePosLevel = function (faceN, posS, levelN) {
var Long = require('long'); var Long = exports.dcodeIO && exports.dcodeIO.Long || require('long');
if (!levelN) { if (!levelN) {
levelN = posS.length; levelN = posS.length;
@ -330,7 +330,7 @@ S2.fromFacePosLevel = function (faceN, posS, levelN) {
}; };
S2.toHilbertQuadkey = function (idS) { S2.toHilbertQuadkey = function (idS) {
var Long = require('long'); var Long = exports.dcodeIO && exports.dcodeIO.Long || require('long');
var bin = Long.fromString(idS, true, 10).toString(2); var bin = Long.fromString(idS, true, 10).toString(2);
var lsbIndex = bin.lastIndexOf('1'); var lsbIndex = bin.lastIndexOf('1');