From 5e8fa09632d3cfe9e12bcb713c4b07446772c34c Mon Sep 17 00:00:00 2001 From: Robin Hawkes Date: Mon, 15 Feb 2016 22:55:25 +0000 Subject: [PATCH] Working prototype of tile loader with real map tiles --- dist/vizicities.js | 2626 +++++++++++++++++++++++++++++++++-- dist/vizicities.min.js | 5 +- dist/vizicities.min.js.map | 2 +- package.json | 2 + src/layer/tile/GridLayer.js | 138 +- src/layer/tile/Tile.js | 201 +++ src/layer/tile/TileCache.js | 50 + 7 files changed, 2835 insertions(+), 189 deletions(-) create mode 100644 src/layer/tile/Tile.js create mode 100644 src/layer/tile/TileCache.js diff --git a/dist/vizicities.js b/dist/vizicities.js index 7dec3ca..fd0d07b 100644 --- a/dist/vizicities.js +++ b/dist/vizicities.js @@ -4625,9 +4625,13 @@ return /******/ (function(modules) { // webpackBootstrap var _Layer3 = _interopRequireDefault(_Layer2); - var _Surface = __webpack_require__(34); + var _TileCache = __webpack_require__(34); - var _Surface2 = _interopRequireDefault(_Surface); + var _TileCache2 = _interopRequireDefault(_TileCache); + + var _lodashThrottle = __webpack_require__(44); + + var _lodashThrottle2 = _interopRequireDefault(_lodashThrottle); var _three = __webpack_require__(24); @@ -4644,8 +4648,12 @@ return /******/ (function(modules) { // webpackBootstrap _get(Object.getPrototypeOf(GridLayer.prototype), 'constructor', this).call(this); + this._tileCache = new _TileCache2['default'](1000); + + // TODO: Work out why changing the minLOD causes loads of issues this._minLOD = 3; this._maxLOD = 18; + this._frustum = new _three2['default'].Frustum(); } @@ -4671,9 +4679,13 @@ return /******/ (function(modules) { // webpackBootstrap value: function _initEvents() { var _this2 = this; - this._world.on('move', function (latlon) { + // Run LOD calculations based on render calls + // + // TODO: Perhaps don't perform a calculation if nothing has changed in a + // frame and there are no tiles waiting to be loaded. + this._world.on('preUpdate', (0, _lodashThrottle2['default'])(function () { _this2._calculateLOD(); - }); + }, 100)); } }, { key: '_updateFrustum', @@ -4686,15 +4698,22 @@ return /******/ (function(modules) { // webpackBootstrap this._frustum.setFromMatrix(new _three2['default'].Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse)); } }, { - key: '_surfaceInFrustum', - value: function _surfaceInFrustum(surface) { - return this._frustum.intersectsBox(new _three2['default'].Box3(new _three2['default'].Vector3(surface.bounds[0], 0, surface.bounds[3]), new _three2['default'].Vector3(surface.bounds[2], 0, surface.bounds[1]))); + key: '_tileInFrustum', + value: function _tileInFrustum(tile) { + var bounds = tile.getBounds(); + return this._frustum.intersectsBox(new _three2['default'].Box3(new _three2['default'].Vector3(bounds[0], 0, bounds[3]), new _three2['default'].Vector3(bounds[2], 0, bounds[1]))); } }, { key: '_calculateLOD', value: function _calculateLOD() { var _this3 = this; + if (this._stop) { + return; + } + + // var start = performance.now(); + var camera = this._world.getCamera(); // 1. Update and retrieve camera frustum @@ -4703,45 +4722,83 @@ return /******/ (function(modules) { // webpackBootstrap // 2. Add the four root items of the quadtree to a check list var checkList = this._checklist; checkList = []; - checkList.push((0, _Surface2['default'])('0', this._world)); - checkList.push((0, _Surface2['default'])('1', this._world)); - checkList.push((0, _Surface2['default'])('2', this._world)); - checkList.push((0, _Surface2['default'])('3', this._world)); + checkList.push(this._tileCache.requestTile('0', this)); + checkList.push(this._tileCache.requestTile('1', this)); + checkList.push(this._tileCache.requestTile('2', this)); + checkList.push(this._tileCache.requestTile('3', this)); // 3. Call Divide, passing in the check list this._divide(checkList); - // 4. Render the quadtree items remaining in the check list - checkList.forEach(function (surface, index) { - if (!_this3._surfaceInFrustum(surface)) { + // 4. Remove all tiles from layer + this._removeTiles(); + + var tileCount = 0; + + // 5. Render the tiles remaining in the check list + checkList.forEach(function (tile, index) { + // Skip tile if it's not in the current view frustum + if (!_this3._tileInFrustum(tile)) { return; } - // console.log(surface); + // TODO: Can probably speed this up + var center = tile.getCenter(); + var dist = new _three2['default'].Vector3(center[0], 0, center[1]).sub(camera.position).length(); - // surface.render(); - _this3._layer.add(surface.mesh); + // Manual distance limit to cut down on tiles so far away + if (dist > 8000) { + return; + } + + // Does the tile have a mesh? + // + // If yes, continue + // If no, generate tile mesh, request texture and skip + if (!tile.getMesh()) { + tile.requestTileAsync(); + return; + } + + // Are the mesh and texture ready? + // + // If yes, continue + // If no, skip + if (!tile.isReady()) { + return; + } + + // Add tile to layer (and to scene) + _this3._layer.add(tile.getMesh()); + + // Output added tile (for debugging) + // console.log(tile); + + tileCount++; }); + + // console.log(tileCount); + // console.log(performance.now() - start); } }, { key: '_divide', value: function _divide(checkList) { var count = 0; var currentItem; - var quadkey; + var quadcode; // 1. Loop until count equals check list length while (count != checkList.length) { currentItem = checkList[count]; - quadkey = currentItem.quadkey; + quadcode = currentItem.getQuadcode(); - // 2. Increase count and continue loop if quadkey equals max LOD / zoom + // 2. Increase count and continue loop if quadcode equals max LOD / zoom if (currentItem.length === this._maxLOD) { count++; continue; } - // 3. Else, calculate screen-space error metric for quadkey + // 3. Else, calculate screen-space error metric for quadcode if (this._screenSpaceError(currentItem)) { // 4. If error is sufficient... @@ -4749,10 +4806,10 @@ return /******/ (function(modules) { // webpackBootstrap checkList.splice(count, 1); // 4b. Add 4 child items to the check list - checkList.push((0, _Surface2['default'])(quadkey + '0', this._world)); - checkList.push((0, _Surface2['default'])(quadkey + '1', this._world)); - checkList.push((0, _Surface2['default'])(quadkey + '2', this._world)); - checkList.push((0, _Surface2['default'])(quadkey + '3', this._world)); + checkList.push(this._tileCache.requestTile(quadcode + '0', this)); + checkList.push(this._tileCache.requestTile(quadcode + '1', this)); + checkList.push(this._tileCache.requestTile(quadcode + '2', this)); + checkList.push(this._tileCache.requestTile(quadcode + '3', this)); // 4d. Continue the loop without increasing count continue; @@ -4764,44 +4821,55 @@ return /******/ (function(modules) { // webpackBootstrap } }, { key: '_screenSpaceError', - value: function _screenSpaceError(surface) { + value: function _screenSpaceError(tile) { var minDepth = this._minLOD; var maxDepth = this._maxLOD; + var quadcode = tile.getQuadcode(); + var camera = this._world.getCamera(); // Tweak this value to refine specific point that each quad is subdivided // - // It's used to multiple the dimensions of the surface sides before - // comparing against the surface distance from camera + // It's used to multiple the dimensions of the tile sides before + // comparing against the tile distance from camera var quality = 3.0; - // 1. Return false if quadkey length is greater than maxDepth - if (surface.quadkey.length > maxDepth) { + // 1. Return false if quadcode length is greater than maxDepth + if (quadcode.length > maxDepth) { return false; } - // 2. Return true if quadkey length is less than minDepth - if (surface.quadkey.length < minDepth) { + // 2. Return true if quadcode length is less than minDepth + if (quadcode.length < minDepth) { return true; } - // 3. Return false if quadkey bounds are not in view frustum - if (!this._surfaceInFrustum(surface)) { + // 3. Return false if quadcode bounds are not in view frustum + if (!this._tileInFrustum(tile)) { return false; } + var center = tile.getCenter(); + // 4. Calculate screen-space error metric - // TODO: Use closest distance to one of the 4 surface corners - var dist = new _three2['default'].Vector3(surface.center[0], 0, surface.center[1]).sub(camera.position).length(); + // TODO: Use closest distance to one of the 4 tile corners + var dist = new _three2['default'].Vector3(center[0], 0, center[1]).sub(camera.position).length(); - // console.log(surface, dist); - - var error = quality * surface.side / dist; + var error = quality * tile.getSide() / dist; // 5. Return true if error is greater than 1.0, else return false return error > 1.0; } + }, { + key: '_removeTiles', + value: function _removeTiles() { + // console.log('Pre:', this._layer.children.length); + for (var i = this._layer.children.length - 1; i >= 0; i--) { + this._layer.remove(this._layer.children[i]); + } + // console.log('Post:', this._layer.children.length); + } }]); return GridLayer; @@ -4828,6 +4896,1796 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + var _lruCache = __webpack_require__(35); + + var _lruCache2 = _interopRequireDefault(_lruCache); + + var _Tile = __webpack_require__(43); + + var _Tile2 = _interopRequireDefault(_Tile); + + // This process is based on a similar approach taken by OpenWebGlobe + // See: https://github.com/OpenWebGlobe/WebViewer/blob/master/source/core/globecache.js + + var TileCache = (function () { + function TileCache(cacheLimit) { + _classCallCheck(this, TileCache); + + this._cache = (0, _lruCache2['default'])(cacheLimit); + } + + // Returns true if all specified tile providers are ready to be used + // Otherwise, returns false + + _createClass(TileCache, [{ + key: 'isReady', + value: function isReady() { + return false; + } + + // Get a cached tile or request a new one if not in cache + }, { + key: 'requestTile', + value: function requestTile(quadcode, layer) { + var tile = this._cache.get(quadcode); + + if (!tile) { + // Set up a brand new tile + tile = new _Tile2['default'](quadcode, layer); + + // Request data for various tile providers + // tile.requestData(imageProviders); + + // Add tile to cache, though it won't be ready yet as the data is being + // requested from various places asynchronously + this._cache.set(quadcode, tile); + } + + return tile; + } + + // Get a cached tile without requesting a new one + }, { + key: 'getTile', + value: function getTile(quadcode) { + return this._cache.get(quadcode); + } + + // Destroy the cache and remove it from memory + // + // TODO: Call destroy method on items in cache + }, { + key: 'destroy', + value: function destroy() { + this._cache.reset(); + } + }]); + + return TileCache; + })(); + + exports['default'] = TileCache; + module.exports = exports['default']; + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = LRUCache + + // This will be a proper iterable 'Map' in engines that support it, + // or a fakey-fake PseudoMap in older versions. + var Map = __webpack_require__(36) + var util = __webpack_require__(39) + + // A linked list to keep track of recently-used-ness + var Yallist = __webpack_require__(42) + + // use symbols if possible, otherwise just _props + var symbols = {} + var hasSymbol = typeof Symbol === 'function' + var makeSymbol + if (hasSymbol) { + makeSymbol = function (key) { + return Symbol.for(key) + } + } else { + makeSymbol = function (key) { + return '_' + key + } + } + + function priv (obj, key, val) { + var sym + if (symbols[key]) { + sym = symbols[key] + } else { + sym = makeSymbol(key) + symbols[key] = sym + } + if (arguments.length === 2) { + return obj[sym] + } else { + obj[sym] = val + return val + } + } + + function naiveLength () { return 1 } + + // lruList is a yallist where the head is the youngest + // item, and the tail is the oldest. the list contains the Hit + // objects as the entries. + // Each Hit object has a reference to its Yallist.Node. This + // never changes. + // + // cache is a Map (or PseudoMap) that matches the keys to + // the Yallist.Node object. + function LRUCache (options) { + if (!(this instanceof LRUCache)) { + return new LRUCache(options) + } + + if (typeof options === 'number') { + options = { max: options } + } + + if (!options) { + options = {} + } + + var max = priv(this, 'max', options.max) + // Kind of weird to have a default max of Infinity, but oh well. + if (!max || + !(typeof max === 'number') || + max <= 0) { + priv(this, 'max', Infinity) + } + + var lc = options.length || naiveLength + if (typeof lc !== 'function') { + lc = naiveLength + } + priv(this, 'lengthCalculator', lc) + + priv(this, 'allowStale', options.stale || false) + priv(this, 'maxAge', options.maxAge || 0) + priv(this, 'dispose', options.dispose) + this.reset() + } + + // resize the cache when the max changes. + Object.defineProperty(LRUCache.prototype, 'max', { + set: function (mL) { + if (!mL || !(typeof mL === 'number') || mL <= 0) { + mL = Infinity + } + priv(this, 'max', mL) + trim(this) + }, + get: function () { + return priv(this, 'max') + }, + enumerable: true + }) + + Object.defineProperty(LRUCache.prototype, 'allowStale', { + set: function (allowStale) { + priv(this, 'allowStale', !!allowStale) + }, + get: function () { + return priv(this, 'allowStale') + }, + enumerable: true + }) + + Object.defineProperty(LRUCache.prototype, 'maxAge', { + set: function (mA) { + if (!mA || !(typeof mA === 'number') || mA < 0) { + mA = 0 + } + priv(this, 'maxAge', mA) + trim(this) + }, + get: function () { + return priv(this, 'maxAge') + }, + enumerable: true + }) + + // resize the cache when the lengthCalculator changes. + Object.defineProperty(LRUCache.prototype, 'lengthCalculator', { + set: function (lC) { + if (typeof lC !== 'function') { + lC = naiveLength + } + if (lC !== priv(this, 'lengthCalculator')) { + priv(this, 'lengthCalculator', lC) + priv(this, 'length', 0) + priv(this, 'lruList').forEach(function (hit) { + hit.length = priv(this, 'lengthCalculator').call(this, hit.value, hit.key) + priv(this, 'length', priv(this, 'length') + hit.length) + }, this) + } + trim(this) + }, + get: function () { return priv(this, 'lengthCalculator') }, + enumerable: true + }) + + Object.defineProperty(LRUCache.prototype, 'length', { + get: function () { return priv(this, 'length') }, + enumerable: true + }) + + Object.defineProperty(LRUCache.prototype, 'itemCount', { + get: function () { return priv(this, 'lruList').length }, + enumerable: true + }) + + LRUCache.prototype.rforEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = priv(this, 'lruList').tail; walker !== null;) { + var prev = walker.prev + forEachStep(this, fn, walker, thisp) + walker = prev + } + } + + function forEachStep (self, fn, node, thisp) { + var hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!priv(self, 'allowStale')) { + hit = undefined + } + } + if (hit) { + fn.call(thisp, hit.value, hit.key, self) + } + } + + LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = priv(this, 'lruList').head; walker !== null;) { + var next = walker.next + forEachStep(this, fn, walker, thisp) + walker = next + } + } + + LRUCache.prototype.keys = function () { + return priv(this, 'lruList').toArray().map(function (k) { + return k.key + }, this) + } + + LRUCache.prototype.values = function () { + return priv(this, 'lruList').toArray().map(function (k) { + return k.value + }, this) + } + + LRUCache.prototype.reset = function () { + if (priv(this, 'dispose') && + priv(this, 'lruList') && + priv(this, 'lruList').length) { + priv(this, 'lruList').forEach(function (hit) { + priv(this, 'dispose').call(this, hit.key, hit.value) + }, this) + } + + priv(this, 'cache', new Map()) // hash of items by key + priv(this, 'lruList', new Yallist()) // list of items in order of use recency + priv(this, 'length', 0) // length of items in the list + } + + LRUCache.prototype.dump = function () { + return priv(this, 'lruList').map(function (hit) { + if (!isStale(this, hit)) { + return { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + } + } + }, this).toArray().filter(function (h) { + return h + }) + } + + LRUCache.prototype.dumpLru = function () { + return priv(this, 'lruList') + } + + LRUCache.prototype.inspect = function (n, opts) { + var str = 'LRUCache {' + var extras = false + + var as = priv(this, 'allowStale') + if (as) { + str += '\n allowStale: true' + extras = true + } + + var max = priv(this, 'max') + if (max && max !== Infinity) { + if (extras) { + str += ',' + } + str += '\n max: ' + util.inspect(max, opts) + extras = true + } + + var maxAge = priv(this, 'maxAge') + if (maxAge) { + if (extras) { + str += ',' + } + str += '\n maxAge: ' + util.inspect(maxAge, opts) + extras = true + } + + var lc = priv(this, 'lengthCalculator') + if (lc && lc !== naiveLength) { + if (extras) { + str += ',' + } + str += '\n length: ' + util.inspect(priv(this, 'length'), opts) + extras = true + } + + var didFirst = false + priv(this, 'lruList').forEach(function (item) { + if (didFirst) { + str += ',\n ' + } else { + if (extras) { + str += ',\n' + } + didFirst = true + str += '\n ' + } + var key = util.inspect(item.key).split('\n').join('\n ') + var val = { value: item.value } + if (item.maxAge !== maxAge) { + val.maxAge = item.maxAge + } + if (lc !== naiveLength) { + val.length = item.length + } + if (isStale(this, item)) { + val.stale = true + } + + val = util.inspect(val, opts).split('\n').join('\n ') + str += key + ' => ' + val + }) + + if (didFirst || extras) { + str += '\n' + } + str += '}' + + return str + } + + LRUCache.prototype.set = function (key, value, maxAge) { + maxAge = maxAge || priv(this, 'maxAge') + + var now = maxAge ? Date.now() : 0 + var len = priv(this, 'lengthCalculator').call(this, value, key) + + if (priv(this, 'cache').has(key)) { + if (len > priv(this, 'max')) { + del(this, priv(this, 'cache').get(key)) + return false + } + + var node = priv(this, 'cache').get(key) + var item = node.value + + // dispose of the old one before overwriting + if (priv(this, 'dispose')) { + priv(this, 'dispose').call(this, key, item.value) + } + + item.now = now + item.maxAge = maxAge + item.value = value + priv(this, 'length', priv(this, 'length') + (len - item.length)) + item.length = len + this.get(key) + trim(this) + return true + } + + var hit = new Entry(key, value, len, now, maxAge) + + // oversized objects fall out of cache automatically. + if (hit.length > priv(this, 'max')) { + if (priv(this, 'dispose')) { + priv(this, 'dispose').call(this, key, value) + } + return false + } + + priv(this, 'length', priv(this, 'length') + hit.length) + priv(this, 'lruList').unshift(hit) + priv(this, 'cache').set(key, priv(this, 'lruList').head) + trim(this) + return true + } + + LRUCache.prototype.has = function (key) { + if (!priv(this, 'cache').has(key)) return false + var hit = priv(this, 'cache').get(key).value + if (isStale(this, hit)) { + return false + } + return true + } + + LRUCache.prototype.get = function (key) { + return get(this, key, true) + } + + LRUCache.prototype.peek = function (key) { + return get(this, key, false) + } + + LRUCache.prototype.pop = function () { + var node = priv(this, 'lruList').tail + if (!node) return null + del(this, node) + return node.value + } + + LRUCache.prototype.del = function (key) { + del(this, priv(this, 'cache').get(key)) + } + + LRUCache.prototype.load = function (arr) { + // reset the cache + this.reset() + + var now = Date.now() + // A previous serialized cache has the most recent items first + for (var l = arr.length - 1; l >= 0; l--) { + var hit = arr[l] + var expiresAt = hit.e || 0 + if (expiresAt === 0) { + // the item was created without expiration in a non aged cache + this.set(hit.k, hit.v) + } else { + var maxAge = expiresAt - now + // dont add already expired items + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge) + } + } + } + } + + LRUCache.prototype.prune = function () { + var self = this + priv(this, 'cache').forEach(function (value, key) { + get(self, key, false) + }) + } + + function get (self, key, doUse) { + var node = priv(self, 'cache').get(key) + if (node) { + var hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!priv(self, 'allowStale')) hit = undefined + } else { + if (doUse) { + priv(self, 'lruList').unshiftNode(node) + } + } + if (hit) hit = hit.value + } + return hit + } + + function isStale (self, hit) { + if (!hit || (!hit.maxAge && !priv(self, 'maxAge'))) { + return false + } + var stale = false + var diff = Date.now() - hit.now + if (hit.maxAge) { + stale = diff > hit.maxAge + } else { + stale = priv(self, 'maxAge') && (diff > priv(self, 'maxAge')) + } + return stale + } + + function trim (self) { + if (priv(self, 'length') > priv(self, 'max')) { + for (var walker = priv(self, 'lruList').tail; + priv(self, 'length') > priv(self, 'max') && walker !== null;) { + // We know that we're about to delete this one, and also + // what the next least recently used key will be, so just + // go ahead and set it now. + var prev = walker.prev + del(self, walker) + walker = prev + } + } + } + + function del (self, node) { + if (node) { + var hit = node.value + if (priv(self, 'dispose')) { + priv(self, 'dispose').call(this, hit.key, hit.value) + } + priv(self, 'length', priv(self, 'length') - hit.length) + priv(self, 'cache').delete(hit.key) + priv(self, 'lruList').removeNode(node) + } + } + + // classy, since V8 prefers predictable objects. + function Entry (key, value, length, now, maxAge) { + this.key = key + this.value = value + this.length = length + this.now = now + this.maxAge = maxAge || 0 + } + + +/***/ }, +/* 36 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {if (process.env.npm_package_name === 'pseudomap' && + process.env.npm_lifecycle_script === 'test') + process.env.TEST_PSEUDOMAP = 'true' + + if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { + module.exports = Map + } else { + module.exports = __webpack_require__(38) + } + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(37))) + +/***/ }, +/* 37 */ +/***/ function(module, exports) { + + // shim for using process in browser + + var process = module.exports = {}; + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + + function cleanUpNextTick() { + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + + function drainQueue() { + if (draining) { + return; + } + var timeout = setTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + clearTimeout(timeout); + } + + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + setTimeout(drainQueue, 0); + } + }; + + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() {} + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function() { return 0; }; + + +/***/ }, +/* 38 */ +/***/ function(module, exports) { + + var hasOwnProperty = Object.prototype.hasOwnProperty + + module.exports = PseudoMap + + function PseudoMap (set) { + if (!(this instanceof PseudoMap)) // whyyyyyyy + throw new TypeError("Constructor PseudoMap requires 'new'") + + this.clear() + + if (set) { + if ((set instanceof PseudoMap) || + (typeof Map === 'function' && set instanceof Map)) + set.forEach(function (value, key) { + this.set(key, value) + }, this) + else if (Array.isArray(set)) + set.forEach(function (kv) { + this.set(kv[0], kv[1]) + }, this) + else + throw new TypeError('invalid argument') + } + } + + PseudoMap.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + Object.keys(this._data).forEach(function (k) { + if (k !== 'size') + fn.call(thisp, this._data[k].value, this._data[k].key) + }, this) + } + + PseudoMap.prototype.has = function (k) { + return !!find(this._data, k) + } + + PseudoMap.prototype.get = function (k) { + var res = find(this._data, k) + return res && res.value + } + + PseudoMap.prototype.set = function (k, v) { + set(this._data, k, v) + } + + PseudoMap.prototype.delete = function (k) { + var res = find(this._data, k) + if (res) { + delete this._data[res._index] + this._data.size-- + } + } + + PseudoMap.prototype.clear = function () { + var data = Object.create(null) + data.size = 0 + + Object.defineProperty(this, '_data', { + value: data, + enumerable: false, + configurable: true, + writable: false + }) + } + + Object.defineProperty(PseudoMap.prototype, 'size', { + get: function () { + return this._data.size + }, + set: function (n) {}, + enumerable: true, + configurable: true + }) + + PseudoMap.prototype.values = + PseudoMap.prototype.keys = + PseudoMap.prototype.entries = function () { + throw new Error('iterators are not implemented in this version') + } + + // Either identical, or both NaN + function same (a, b) { + return a === b || a !== a && b !== b + } + + function Entry (k, v, i) { + this.key = k + this.value = v + this._index = i + } + + function find (data, k) { + for (var i = 0, s = '_' + k, key = s; + hasOwnProperty.call(data, key); + key = s + i++) { + if (same(data[key].key, k)) + return data[key] + } + } + + function set (data, k, v) { + for (var i = 0, s = '_' + k, key = s; + hasOwnProperty.call(data, key); + key = s + i++) { + if (same(data[key].key, k)) { + data[key].value = v + return + } + } + data.size++ + data[key] = new Entry(k, v, key) + } + + +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + + var formatRegExp = /%[sdj%]/g; + exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; + }; + + + // Mark that a method should not be used. + // Returns a modified function which warns once by default. + // If --no-deprecation is set, then it is a no-op. + exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; + }; + + + var debugs = {}; + var debugEnviron; + exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; + }; + + + /** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ + /* legacy: obj, showHidden, depth, colors*/ + function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); + } + exports.inspect = inspect; + + + // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics + inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] + }; + + // Don't use 'blue' not visible on cmd.exe + inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' + }; + + + function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } + } + + + function stylizeNoColor(str, styleType) { + return str; + } + + + function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; + } + + + function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); + } + + + function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); + } + + + function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; + } + + + function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; + } + + + function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; + } + + + function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; + } + + + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { + return Array.isArray(ar); + } + exports.isArray = isArray; + + function isBoolean(arg) { + return typeof arg === 'boolean'; + } + exports.isBoolean = isBoolean; + + function isNull(arg) { + return arg === null; + } + exports.isNull = isNull; + + function isNullOrUndefined(arg) { + return arg == null; + } + exports.isNullOrUndefined = isNullOrUndefined; + + function isNumber(arg) { + return typeof arg === 'number'; + } + exports.isNumber = isNumber; + + function isString(arg) { + return typeof arg === 'string'; + } + exports.isString = isString; + + function isSymbol(arg) { + return typeof arg === 'symbol'; + } + exports.isSymbol = isSymbol; + + function isUndefined(arg) { + return arg === void 0; + } + exports.isUndefined = isUndefined; + + function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; + } + exports.isRegExp = isRegExp; + + function isObject(arg) { + return typeof arg === 'object' && arg !== null; + } + exports.isObject = isObject; + + function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; + } + exports.isDate = isDate; + + function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); + } + exports.isError = isError; + + function isFunction(arg) { + return typeof arg === 'function'; + } + exports.isFunction = isFunction; + + function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; + } + exports.isPrimitive = isPrimitive; + + exports.isBuffer = __webpack_require__(40); + + function objectToString(o) { + return Object.prototype.toString.call(o); + } + + + function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); + } + + + var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + + // 26 Feb 16:19:34 + function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); + } + + + // log is just a thin wrapper to console.log that prepends a timestamp + exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); + }; + + + /** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ + exports.inherits = __webpack_require__(41); + + exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; + }; + + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(37))) + +/***/ }, +/* 40 */ +/***/ function(module, exports) { + + module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; + } + +/***/ }, +/* 41 */ +/***/ function(module, exports) { + + if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; + } else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } + + +/***/ }, +/* 42 */ +/***/ function(module, exports) { + + module.exports = Yallist + + Yallist.Node = Node + Yallist.create = Yallist + + function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self + } + + Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length -- + node.next = null + node.prev = null + node.list = null + } + + Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length ++ + } + + Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length ++ + } + + Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length + } + + Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length + } + + Yallist.prototype.pop = function () { + if (!this.tail) + return undefined + + var res = this.tail.value + this.tail = this.tail.prev + this.tail.next = null + this.length -- + return res + } + + Yallist.prototype.shift = function () { + if (!this.head) + return undefined + + var res = this.head.value + this.head = this.head.next + this.head.prev = null + this.length -- + return res + } + + Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } + } + + Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } + } + + Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } + } + + Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } + } + + Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res + } + + Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res + } + + Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc + } + + Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc + } + + Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr + } + + Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr + } + + Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret + } + + Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret + } + + Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this + } + + function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length ++ + } + + function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length ++ + } + + function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } + } + + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + var _geoLatLon = __webpack_require__(10); var _geoLatLon2 = _interopRequireDefault(_geoLatLon); @@ -4836,68 +6694,115 @@ return /******/ (function(modules) { // webpackBootstrap var _three2 = _interopRequireDefault(_three); + // Manages a single tile and its layers + var r2d = 180 / Math.PI; var loader = new _three2['default'].TextureLoader(); loader.setCrossOrigin(''); - var Surface = (function () { - function Surface(quadkey, world) { - _classCallCheck(this, Surface); + var Tile = (function () { + function Tile(quadcode, layer) { + _classCallCheck(this, Tile); - this.world = world; - this.quadkey = quadkey; - this.tile = this._quadkeyToTile(quadkey); - this.bounds = this._tileBounds(this.tile); - this.center = this._boundsToCenter(this.bounds); - this.side = new _three2['default'].Vector3(this.bounds[0], 0, this.bounds[3]).sub(new _three2['default'].Vector3(this.bounds[0], 0, this.bounds[1])).length(); + this._layer = layer; + this._quadcode = quadcode; - this.mesh = this._createMesh(); + this._ready = false; + + this._tile = this._quadcodeToTile(quadcode); + + // Bottom-left and top-right bounds in WGS84 coordinates + this._boundsLatLon = this._tileBoundsWGS84(this._tile); + + // Bottom-left and top-right bounds in world coordinates + this._boundsWorld = this._tileBoundsFromWGS84(this._boundsLatLon); + + // Tile center in world coordinates + this._center = this._boundsToCenter(this._boundsWorld); + + // Length of a tile side in world coorindates + this._side = this._getSide(this._boundsWorld); } - // Initialise without requiring new keyword + // Returns true if the tile mesh and texture are ready to be used + // Otherwise, returns false - _createClass(Surface, [{ - key: '_createDebugMesh', - value: function _createDebugMesh() { - var canvas = document.createElement('canvas'); - canvas.width = 256; - canvas.height = 256; - - var context = canvas.getContext('2d'); - context.font = 'Bold 20px Helvetica Neue, Verdana, Arial'; - context.fillStyle = 'rgba(255,0,0,1)'; - context.fillText(this.quadkey, 20, canvas.width / 2 + 10); - - var texture = new _three2['default'].Texture(canvas); - - // Silky smooth images when tilted - texture.magFilter = _three2['default'].LinearFilter; - texture.minFilter = _three2['default'].LinearMipMapLinearFilter; - - // TODO: Set this to renderer.getMaxAnisotropy() / 4 - texture.anisotropy = 4; - - texture.needsUpdate = true; - - var material = new _three2['default'].MeshBasicMaterial({ - map: texture, - transparent: true - }); - - var geom = new _three2['default'].PlaneGeometry(this.side, this.side, 1); - var mesh = new _three2['default'].Mesh(geom, material); - - mesh.rotation.x = -90 * Math.PI / 180; - mesh.position.y = 0.1; - - return mesh; + _createClass(Tile, [{ + key: 'isReady', + value: function isReady() { + return this._ready; } + + // Request data for the various tile providers + // + // Providers are provided here and not on instantiation of the class so that + // providers can be easily changed in subsequent requests without heavy + // management + // + // If requestData is called more than once then the provider data will be + // re-downloaded and the mesh output will be changed + // + // Being able to update tile data and output like this on-the-fly makes it + // appealing for situations where tile data may be dynamic / realtime + // (eg. realtime traffic tiles) + // + // May need to be intelligent about what exactly is updated each time + // requestData is called as it doesn't make sense to re-request and + // re-generate a mesh each time when only the image provider needs updating, + // and likewise it doesn't make sense to update the imagery when only terrain + // provider changes + }, { + key: 'requestTileAsync', + value: function requestTileAsync(imageProviders) { + var _this = this; + + // Making this asynchronous really speeds up the LOD framerate + setTimeout(function () { + if (!_this._mesh) { + _this._mesh = _this._createMesh(); + _this._requestTextureAsync(); + } + }, 0); + } + }, { + key: 'getQuadcode', + value: function getQuadcode() { + return this._quadcode; + } + }, { + key: 'getBounds', + value: function getBounds() { + return this._boundsWorld; + } + }, { + key: 'getCenter', + value: function getCenter() { + return this._center; + } + }, { + key: 'getSide', + value: function getSide() { + return this._side; + } + }, { + key: 'getMesh', + value: function getMesh() { + return this._mesh; + } + + // Destroys the tile and removes it from the layer and memory + // + // Ensure that this leaves no trace of the tile – no textures, no meshes, + // nothing in memory or the GPU + }, { + key: 'destroy', + value: function destroy() {} }, { key: '_createMesh', value: function _createMesh() { var mesh = new _three2['default'].Object3D(); - var geom = new _three2['default'].PlaneGeometry(this.side, this.side, 1); + var geom = new _three2['default'].PlaneGeometry(this._side, this._side, 1); var material = new _three2['default'].MeshBasicMaterial(); @@ -4906,62 +6811,55 @@ return /******/ (function(modules) { // webpackBootstrap mesh.add(localMesh); - mesh.position.x = this.center[0]; - mesh.position.z = this.center[1]; + mesh.position.x = this._center[0]; + mesh.position.z = this._center[1]; var box = new _three2['default'].BoxHelper(localMesh); mesh.add(box); - mesh.add(this._createDebugMesh()); - - // var letter = String.fromCharCode(97 + Math.floor(Math.random() * 26)); - // var url = 'http://' + letter + '.basemaps.cartocdn.com/light_nolabels/'; - // // var url = 'http://tile.stamen.com/toner-lite/'; - // - // loader.load(url + this.tile[2] + '/' + this.tile[0] + '/' + this.tile[1] + '@2x.png', texture => { - // console.log('Loaded'); - // // Silky smooth images when tilted - // texture.magFilter = THREE.LinearFilter; - // texture.minFilter = THREE.LinearMipMapLinearFilter; - // - // // TODO: Set this to renderer.getMaxAnisotropy() / 4 - // texture.anisotropy = 4; - // - // texture.needsUpdate = true; - // - // var material = new THREE.MeshBasicMaterial({map: texture}); - // - // var localMesh = new THREE.Mesh(geom, material); - // localMesh.rotation.x = -90 * Math.PI / 180; - // - // // Sometimes tiles don't appear, even though the images have loaded ok - // // This helps a little but it's a total hack and the real solution needs - // // to be found. - // setTimeout(function() { - // mesh.add(localMesh); - // }, 2000); - // - // mesh.position.x = this.center[0]; - // mesh.position.z = this.center[1]; - // - // var box = new THREE.BoxHelper(localMesh); - // mesh.add(box); - // - // this._createDebugMesh(); - // }); + // mesh.add(this._createDebugMesh()); return mesh; } }, { - key: '_quadkeyToTile', - value: function _quadkeyToTile(quadkey) { + key: '_requestTextureAsync', + value: function _requestTextureAsync() { + var _this2 = this; + + var letter = String.fromCharCode(97 + Math.floor(Math.random() * 26)); + var url = 'http://' + letter + '.basemaps.cartocdn.com/light_nolabels/'; + // var url = 'http://tile.stamen.com/toner-lite/'; + + loader.load(url + this._tile[2] + '/' + this._tile[0] + '/' + this._tile[1] + '.png', function (texture) { + // console.log('Loaded'); + // Silky smooth images when tilted + texture.magFilter = _three2['default'].LinearFilter; + texture.minFilter = _three2['default'].LinearMipMapLinearFilter; + + // TODO: Set this to renderer.getMaxAnisotropy() / 4 + texture.anisotropy = 4; + + texture.needsUpdate = true; + + _this2._mesh.children[0].material.map = texture; + _this2._mesh.children[0].material.needsUpdate = true; + _this2._ready = true; + }, null, function (xhr) { + console.log(xhr); + }); + } + + // Convert from quadcode to TMS tile coordinates + }, { + key: '_quadcodeToTile', + value: function _quadcodeToTile(quadcode) { var x = 0; var y = 0; - var z = quadkey.length; + var z = quadcode.length; for (var i = z; i > 0; i--) { var mask = 1 << i - 1; - var q = +quadkey[z - i]; + var q = +quadcode[z - i]; if (q === 1) { x |= mask; } @@ -4976,25 +6874,18 @@ return /******/ (function(modules) { // webpackBootstrap return [x, y, z]; } - }, { - key: '_boundsToCenter', - value: function _boundsToCenter(bounds) { - var x = bounds[0] + (bounds[2] - bounds[0]) / 2; - var y = bounds[1] + (bounds[3] - bounds[1]) / 2; - return [x, y]; - } + // Convert WGS84 tile bounds to world coordinates }, { - key: '_tileBounds', - value: function _tileBounds(tile) { - var boundsWGS84 = this._tileBoundsWGS84(tile); - - var sw = this.world.latLonToPoint((0, _geoLatLon2['default'])(boundsWGS84[1], boundsWGS84[0])); - var ne = this.world.latLonToPoint((0, _geoLatLon2['default'])(boundsWGS84[3], boundsWGS84[2])); + key: '_tileBoundsFromWGS84', + value: function _tileBoundsFromWGS84(boundsWGS84) { + var sw = this._layer._world.latLonToPoint((0, _geoLatLon2['default'])(boundsWGS84[1], boundsWGS84[0])); + var ne = this._layer._world.latLonToPoint((0, _geoLatLon2['default'])(boundsWGS84[3], boundsWGS84[2])); return [sw.x, sw.y, ne.x, ne.y]; - // return [swMerc[0], -swMerc[1], neMerc[0], -neMerc[1]]; } + + // Get tile bounds in WGS84 coordinates }, { key: '_tileBoundsWGS84', value: function _tileBoundsWGS84(tile) { @@ -5015,18 +6906,455 @@ return /******/ (function(modules) { // webpackBootstrap var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z); return r2d * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n))); } + }, { + key: '_boundsToCenter', + value: function _boundsToCenter(bounds) { + var x = bounds[0] + (bounds[2] - bounds[0]) / 2; + var y = bounds[1] + (bounds[3] - bounds[1]) / 2; + + return [x, y]; + } + }, { + key: '_getSide', + value: function _getSide(bounds) { + return new _three2['default'].Vector3(bounds[0], 0, bounds[3]).sub(new _three2['default'].Vector3(bounds[0], 0, bounds[1])).length(); + } }]); - return Surface; + return Tile; })(); - exports['default'] = function (quadkey, world) { - return new Surface(quadkey, world); - }; - - ; + exports['default'] = Tile; module.exports = exports['default']; +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * lodash 4.0.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + var debounce = __webpack_require__(45); + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide an options object to indicate whether + * `func` should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked + * on the trailing edge of the timeout only if the the throttled function is + * invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=true] Specify invoking on the leading + * edge of the timeout. + * @param {boolean} [options.trailing=true] Specify invoking on the trailing + * edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // avoid excessively updating the position while scrolling + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // cancel a trailing throttled invocation + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + module.exports = throttle; + + +/***/ }, +/* 45 */ +/***/ function(module, exports) { + + /** + * lodash 4.0.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used as references for various `Number` constants. */ + var NAN = 0 / 0; + + /** `Object#toString` result references. */ + var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Built-in method references without a dependency on `root`. */ + var freeParseInt = parseInt; + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @type Function + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => logs the number of milliseconds it took for the deferred function to be invoked + */ + var now = Date.now; + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide an options object to indicate whether `func` should be invoked on + * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent calls + * to the debounced function return the result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked + * on the trailing edge of the timeout only if the the debounced function is + * invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=false] Specify invoking on the leading + * edge of the timeout. + * @param {number} [options.maxWait] The maximum time `func` is allowed to be + * delayed before it's invoked. + * @param {boolean} [options.trailing=true] Specify invoking on the trailing + * edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var args, + maxTimeoutId, + result, + stamp, + thisArg, + timeoutId, + trailingCall, + lastCalled = 0, + leading = false, + maxWait = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait); + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function cancel() { + if (timeoutId) { + clearTimeout(timeoutId); + } + if (maxTimeoutId) { + clearTimeout(maxTimeoutId); + } + lastCalled = 0; + args = maxTimeoutId = thisArg = timeoutId = trailingCall = undefined; + } + + function complete(isCalled, id) { + if (id) { + clearTimeout(id); + } + maxTimeoutId = timeoutId = trailingCall = undefined; + if (isCalled) { + lastCalled = now(); + result = func.apply(thisArg, args); + if (!timeoutId && !maxTimeoutId) { + args = thisArg = undefined; + } + } + } + + function delayed() { + var remaining = wait - (now() - stamp); + if (remaining <= 0 || remaining > wait) { + complete(trailingCall, maxTimeoutId); + } else { + timeoutId = setTimeout(delayed, remaining); + } + } + + function flush() { + if ((timeoutId && trailingCall) || (maxTimeoutId && trailing)) { + result = func.apply(thisArg, args); + } + cancel(); + return result; + } + + function maxDelayed() { + complete(trailing, timeoutId); + } + + function debounced() { + args = arguments; + stamp = now(); + thisArg = this; + trailingCall = trailing && (timeoutId || !leading); + + if (maxWait === false) { + var leadingCall = leading && !timeoutId; + } else { + if (!maxTimeoutId && !leading) { + lastCalled = stamp; + } + var remaining = maxWait - (stamp - lastCalled), + isCalled = remaining <= 0 || remaining > maxWait; + + if (isCalled) { + if (maxTimeoutId) { + maxTimeoutId = clearTimeout(maxTimeoutId); + } + lastCalled = stamp; + result = func.apply(thisArg, args); + } + else if (!maxTimeoutId) { + maxTimeoutId = setTimeout(maxDelayed, remaining); + } + } + if (isCalled && timeoutId) { + timeoutId = clearTimeout(timeoutId); + } + else if (!timeoutId && wait !== maxWait) { + timeoutId = setTimeout(delayed, wait); + } + if (leadingCall) { + isCalled = true; + result = func.apply(thisArg, args); + } + if (isCalled && !timeoutId && !maxTimeoutId) { + args = thisArg = undefined; + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array constructors, and + // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; + } + + /** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ + function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + module.exports = debounce; + + /***/ } /******/ ]) }); diff --git a/dist/vizicities.min.js b/dist/vizicities.min.js index 83855e2..5df8b5a 100644 --- a/dist/vizicities.min.js +++ b/dist/vizicities.min.js @@ -1,3 +1,4 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("proj4"),require("THREE")):"function"==typeof define&&define.amd?define(["proj4","THREE"],t):"object"==typeof exports?exports.VIZI=t(require("proj4"),require("THREE")):e.VIZI=t(e.proj4,e.THREE)}(this,function(e,t){return function(e){function __webpack_require__(n){if(t[n])return t[n].exports;var r=t[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}var t={};return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.p="",__webpack_require__(0)}([function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=_interopRequireDefault(r),i=n(28),a=_interopRequireDefault(i),u=n(31),s=_interopRequireDefault(u),l=n(33),c=_interopRequireDefault(l),f=n(11),d=_interopRequireDefault(f),h=n(10),p=_interopRequireDefault(h),v={version:"0.3",World:o["default"],Controls:a["default"],EnvironmentLayer:s["default"],GridLayer:c["default"],Point:d["default"],LatLon:p["default"]};t["default"]=v,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;ni;i++)u[i]=o[i].fn;return u},EventEmitter.prototype.emit=function(e,t,n,o,i,a){var u=r?r+e:e;if(!this._events||!this._events[u])return!1;var s,l,c=this._events[u],f=arguments.length;if("function"==typeof c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,o),!0;case 5:return c.fn.call(c.context,t,n,o,i),!0;case 6:return c.fn.call(c.context,t,n,o,i,a),!0}for(l=1,s=new Array(f-1);f>l;l++)s[l-1]=arguments[l];c.fn.apply(c.context,s)}else{var d,h=c.length;for(l=0;h>l;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),f){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;default:if(!s)for(d=1,s=new Array(f-1);f>d;d++)s[d-1]=arguments[d];c[l].fn.apply(c[l].context,s)}}return!0},EventEmitter.prototype.on=function(e,t,n){var o=new EE(t,n||this),i=r?r+e:e;return this._events||(this._events=r?{}:Object.create(null)),this._events[i]?this._events[i].fn?this._events[i]=[this._events[i],o]:this._events[i].push(o):this._events[i]=o,this},EventEmitter.prototype.once=function(e,t,n){var o=new EE(t,n||this,!0),i=r?r+e:e;return this._events||(this._events=r?{}:Object.create(null)),this._events[i]?this._events[i].fn?this._events[i]=[this._events[i],o]:this._events[i].push(o):this._events[i]=o,this},EventEmitter.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events||!this._events[i])return this;var a=this._events[i],u=[];if(t)if(a.fn)(a.fn!==t||o&&!a.once||n&&a.context!==n)&&u.push(a);else for(var s=0,l=a.length;l>s;s++)(a[s].fn!==t||o&&!a[s].once||n&&a[s].context!==n)&&u.push(a[s]);return u.length?this._events[i]=1===u.length?u[0]:u:delete this._events[i],this},EventEmitter.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[r?r+e:e]:this._events=r?{}:Object.create(null),this):this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prototype.setMaxListeners=function(){return this},EventEmitter.prefixed=r,e.exports=EventEmitter},function(e,t,n){function isIndex(e,t){return e="number"==typeof e||s.test(e)?+e:-1,t=null==t?i:t,e>-1&&e%1==0&&t>e}function assignValue(e,t,n){var r=e[t];(!eq(r,n)||eq(r,l[t])&&!c.call(e,t)||void 0===n&&!(t in e))&&(e[t]=n)}function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function copyObject(e,t,n){return copyObjectWith(e,t,n)}function copyObjectWith(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i="function"==typeof i?(o--,i):void 0,a&&isIterateeCall(n[0],n[1],a)&&(i=3>o?void 0:i,o=1),t=Object(t);++r-1&&e%1==0&&i>=e}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var r=n(4),o=n(5),i=9007199254740991,a="[object Function]",u="[object GeneratorFunction]",s=/^(?:0|[1-9]\d*)$/,l=Object.prototype,c=l.hasOwnProperty,f=l.toString,d=baseProperty("length"),h=createAssigner(function(e,t){copyObject(t,r(t),e)});e.exports=h},function(e,t){function baseTimes(e,t){for(var n=-1,r=Array(e);++n-1&&e%1==0&&t>e}function baseHas(e,t){return l.call(e,t)||"object"==typeof e&&t in e&&null===f(e)}function baseKeys(e){return h(Object(e))}function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function indexKeys(e){var t=e?e.length:void 0;return isLength(t)&&(v(e)||isString(e)||isArguments(e))?baseTimes(t,String):null}function isPrototype(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||s;return e===n}function isArguments(e){return isArrayLikeObject(e)&&l.call(e,"callee")&&(!d.call(e,"callee")||c.call(e)==r)}function isArrayLike(e){return null!=e&&!("function"==typeof e&&isFunction(e))&&isLength(p(e))}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function isFunction(e){var t=isObject(e)?c.call(e):"";return t==o||t==i}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&n>=e}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isString(e){return"string"==typeof e||!v(e)&&isObjectLike(e)&&c.call(e)==a}function keys(e){var t=isPrototype(e);if(!t&&!isArrayLike(e))return baseKeys(e);var n=indexKeys(e),r=!!n,o=n||[],i=o.length;for(var a in e)!baseHas(e,a)||r&&("length"==a||isIndex(a,i))||t&&"constructor"==a||o.push(a);return o}var n=9007199254740991,r="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",a="[object String]",u=/^(?:0|[1-9]\d*)$/,s=Object.prototype,l=s.hasOwnProperty,c=s.toString,f=Object.getPrototypeOf,d=s.propertyIsEnumerable,h=Object.keys,p=baseProperty("length"),v=Array.isArray;e.exports=keys},function(e,t){function apply(e,t,n){var r=n.length;switch(r){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function rest(e,t){if("function"!=typeof e)throw new TypeError(n);return t=v(void 0===t?e.length-1:toInteger(t),0),function(){for(var n=arguments,r=-1,o=v(n.length-t,0),i=Array(o);++re?-1:1;return t*o}var n=e%1;return e===e?n?e-n:e:0}function toNumber(e){if(isObject(e)){var t=isFunction(e.valueOf)?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var n=c.test(e);return n||f.test(e)?d(e.slice(2),n?2:8):l.test(e)?i:+e}var n="Expected a function",r=1/0,o=1.7976931348623157e308,i=NaN,a="[object Function]",u="[object GeneratorFunction]",s=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,f=/^0o[0-7]+$/i,d=parseInt,h=Object.prototype,p=h.toString,v=Math.max;e.exports=rest},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),o=_interopRequireDefault(r),i=n(15),a=_interopRequireDefault(i),u=n(17),s=_interopRequireDefault(u),l=n(19),c=_interopRequireDefault(l),f=n(20),d=_interopRequireDefault(f),h={};h.EPSG3857=o["default"],h.EPSG900913=r.EPSG900913,h.EPSG3395=a["default"],h.EPSG4326=s["default"],h.Simple=c["default"],h.Proj4=d["default"],t["default"]=h,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=_interopRequireDefault(r),i=n(8),a=_interopRequireDefault(i),u=n(13),s=_interopRequireDefault(u),l=n(14),c=_interopRequireDefault(l),f={code:"EPSG:3857",projection:s["default"],transformScale:1/(Math.PI*s["default"].R),transformation:function(){var e=1/(Math.PI*s["default"].R);return new c["default"](e,0,-e,0)}()},d=(0,o["default"])({},a["default"],f),h=(0,o["default"])({},d,{code:"EPSG:900913"});t.EPSG900913=h,t["default"]=d},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=_interopRequireDefault(r),i=n(9),a=_interopRequireDefault(i),u=n(10),s=(_interopRequireDefault(u),{wrapLon:[-180,180],R:6378137,distance:function(e,t,n){var r,o,i,a=Math.PI/180;if(n){r=e.lat*a,o=t.lat*a;var u=e.lon*a,s=t.lon*a,l=o-r,c=s-u,f=l/2,d=c/2;i=Math.sin(f)*Math.sin(f)+Math.cos(r)*Math.cos(o)*Math.sin(d)*Math.sin(d);var h=2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i));return this.R*h}return r=e.lat*a,o=t.lat*a,i=Math.sin(r)*Math.sin(o)+Math.cos(r)*Math.cos(o)*Math.cos((t.lon-e.lon)*a),this.R*Math.acos(Math.min(i,1))},pointScale:function(e,t){return this.projection.pointScale?this.projection.pointScale(e,t):[1,1]},metresToProjected:function(e,t){return e*t[1]},projectedToMetres:function(e,t){return e/t[1]},metresToWorld:function(e,t,n){var r=this.metresToProjected(e,t),o=this.scale(n);n&&(o/=2);var i=o*(this.transformScale*r)/t[1];return i},worldToMetres:function(e,t,n){var r=this.scale(n);n&&(r/=2);var o=e/r/this.transformScale*t[1],i=this.projectedToMetres(o,t);return i}});t["default"]=(0,o["default"])({},a["default"],s),e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),o=_interopRequireDefault(r),i=n(11),a=_interopRequireDefault(i),u=n(12),s=_interopRequireDefault(u),l={scaleFactor:1e6,latLonToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return t&&(r/=2),this.transformation._transform(n,r)},pointToLatLon:function(e,t){var n=this.scale(t);t&&(n/=2);var r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return e>=0?256*Math.pow(2,e):this.scaleFactor},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);e&&(n/=2);var r=this.transformation.transform((0,a["default"])(t[0]),n),o=this.transformation.transform((0,a["default"])(t[1]),n);return[r,o]},wrapLatLon:function(e){var t=this.wrapLat?(0,s["default"])(e.lat,this.wrapLat,!0):e.lat,n=this.wrapLon?(0,s["default"])(e.lon,this.wrapLon,!0):e.lon,r=e.alt;return(0,o["default"])(t,n,r)}};t["default"]=l,e.exports=t["default"]},function(e,t){function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function defineProperties(e,t){for(var n=0;nl&&Math.abs(c)>1e-7;l++)t=a*Math.sin(s),t=Math.pow((1-t)/(1+t),a/2),c=Math.PI/2-2*Math.atan(u*t)-s,s+=c;return(0,o["default"])(s*n,e.x*n/r)},pointScale:function(e){var t=Math.PI/180,n=e.lat*t,r=Math.sin(n),o=r*r,i=Math.cos(n),a=Math.sqrt(1-this.ECC2*o)/i;return[a,a]},bounds:[[-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]]};t["default"]=u,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=_interopRequireDefault(r),i=n(8),a=_interopRequireDefault(i),u=n(18),s=_interopRequireDefault(u),l=n(14),c=_interopRequireDefault(l),f={code:"EPSG:4326",projection:s["default"],transformScale:1/180,transformation:new c["default"](1/180,0,-1/180,0)},d=(0,o["default"])({},a["default"],f);t["default"]=d,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),o=_interopRequireDefault(r),i=n(11),a=_interopRequireDefault(i),u={project:function(e){return(0,a["default"])(e.lon,e.lat)},unproject:function(e){return(0,o["default"])(e.y,e.x)},pointScale:function(e){var t=111132.92,n=-559.82,r=1.175,o=-.0023,i=111412.84,a=-93.5,u=.118,s=Math.PI/180,l=e.lat*s,c=t+n*Math.cos(2*l)+r*Math.cos(4*l)+o*Math.cos(6*l),f=i*Math.cos(l)+a*Math.cos(3*l)+u*Math.cos(5*l);return[1/c,1/f]},bounds:[[-180,-90],[180,90]]};t["default"]=u,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=_interopRequireDefault(r),i=n(9),a=_interopRequireDefault(i),u=n(18),s=_interopRequireDefault(u),l=n(14),c=_interopRequireDefault(l),f={projection:s["default"],transformation:new c["default"](1,0,1,0),scale:function(e){return e?Math.pow(2,e):1},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lon-e.lon,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0},d=(0,o["default"])({},a["default"],f);t["default"]=d,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=_interopRequireDefault(r),i=n(8),a=_interopRequireDefault(i),u=n(21),s=_interopRequireDefault(u),l=n(14),c=_interopRequireDefault(l),f=function(e,t,n){var r=(0,s["default"])(t,n),o=r.bounds[1][0]-r.bounds[0][0],i=r.bounds[1][1]-r.bounds[0][1],a=o/2,u=i/2,l=1/a,f=1/u,d=Math.min(l,f),h=d*(r.bounds[0][0]+a),p=d*(r.bounds[0][1]+u);return{code:e,projection:r,transformScale:d,transformation:new c["default"](d,-h,-d,p)}},d=function(e,t,n){return(0,o["default"])({},a["default"],f(e,t,n))};t["default"]=d,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(22),o=_interopRequireDefault(r),i=n(10),a=_interopRequireDefault(i),u=n(11),s=_interopRequireDefault(u),l=function(e,t){var n=(0,o["default"])(e),r=function(e){return(0,s["default"])(n.forward([e.lon,e.lat]))},i=function(e){var t=n.inverse([e.x,e.y]);return(0,a["default"])(t[1],t[0])};return{project:r,unproject:i,pointScale:function(e,t){return[1,1]},bounds:function(){if(t)return t;var e=r([-90,-180]),n=r([90,180]);return[e,n]}()}};t["default"]=l,e.exports=t["default"]},function(t,n){t.exports=e},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;ni||8*(1-p.dot(this.object.quaternion))>i?(h.copy(this.object.position),p.copy(this.object.quaternion),c=!1,!0):!1}}()}function OrbitControls(t,n){function pan(e,t){var n=o.domElement===document?o.domElement.body:o.domElement;r.pan(e,t,n.clientWidth,n.clientHeight)}function getAutoRotationAngle(){return 2*Math.PI/60/60*o.autoRotateSpeed}function getZoomScale(){return Math.pow(.95,o.zoomSpeed)}function onMouseDown(e){if(o.enabled!==!1){if(e.preventDefault(),e.button===o.mouseButtons.ORBIT){if(o.enableRotate===!1)return;v=p.ROTATE,i.set(e.clientX,e.clientY)}else if(e.button===o.mouseButtons.ZOOM){if(o.enableZoom===!1)return;v=p.DOLLY,f.set(e.clientX,e.clientY)}else if(e.button===o.mouseButtons.PAN){if(o.enablePan===!1)return;v=p.PAN,s.set(e.clientX,e.clientY)}v!==p.NONE&&(document.addEventListener("mousemove",onMouseMove,!1),document.addEventListener("mouseup",onMouseUp,!1),o.dispatchEvent(m))}}function onMouseMove(e){if(o.enabled!==!1){e.preventDefault();var t=o.domElement===document?o.domElement.body:o.domElement;if(v===p.ROTATE){if(o.enableRotate===!1)return;a.set(e.clientX,e.clientY),u.subVectors(a,i),r.rotateLeft(2*Math.PI*u.x/t.clientWidth*o.rotateSpeed),r.rotateUp(2*Math.PI*u.y/t.clientHeight*o.rotateSpeed),i.copy(a)}else if(v===p.DOLLY){if(o.enableZoom===!1)return;d.set(e.clientX,e.clientY),h.subVectors(d,f),h.y>0?r.dollyIn(getZoomScale()):h.y<0&&r.dollyOut(getZoomScale()),f.copy(d)}else if(v===p.PAN){if(o.enablePan===!1)return;l.set(e.clientX,e.clientY),c.subVectors(l,s),pan(c.x,c.y),s.copy(l)}v!==p.NONE&&o.update()}}function onMouseUp(){o.enabled!==!1&&(document.removeEventListener("mousemove",onMouseMove,!1),document.removeEventListener("mouseup",onMouseUp,!1),o.dispatchEvent(y),v=p.NONE)}function onMouseWheel(e){if(o.enabled!==!1&&o.enableZoom!==!1&&v===p.NONE){e.preventDefault(),e.stopPropagation();var t=0;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),t>0?r.dollyOut(getZoomScale()):0>t&&r.dollyIn(getZoomScale()),o.update(),o.dispatchEvent(m),o.dispatchEvent(y)}}function onKeyDown(e){if(o.enabled!==!1&&o.enableKeys!==!1&&o.enablePan!==!1)switch(e.keyCode){case o.keys.UP:pan(0,o.keyPanSpeed),o.update();break;case o.keys.BOTTOM:pan(0,-o.keyPanSpeed),o.update();break;case o.keys.LEFT:pan(o.keyPanSpeed,0),o.update();break;case o.keys.RIGHT:pan(-o.keyPanSpeed,0),o.update()}}function touchstart(e){if(o.enabled!==!1){switch(e.touches.length){case 1:if(o.enableRotate===!1)return;v=p.TOUCH_ROTATE,i.set(e.touches[0].pageX,e.touches[0].pageY);break;case 2:if(o.enableZoom===!1)return;v=p.TOUCH_DOLLY;var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);f.set(0,r);break;case 3:if(o.enablePan===!1)return;v=p.TOUCH_PAN,s.set(e.touches[0].pageX,e.touches[0].pageY);break;default:v=p.NONE}v!==p.NONE&&o.dispatchEvent(m)}}function touchmove(e){if(o.enabled!==!1){e.preventDefault(),e.stopPropagation();var t=o.domElement===document?o.domElement.body:o.domElement;switch(e.touches.length){case 1:if(o.enableRotate===!1)return;if(v!==p.TOUCH_ROTATE)return;a.set(e.touches[0].pageX,e.touches[0].pageY),u.subVectors(a,i),r.rotateLeft(2*Math.PI*u.x/t.clientWidth*o.rotateSpeed),r.rotateUp(2*Math.PI*u.y/t.clientHeight*o.rotateSpeed),i.copy(a),o.update();break;case 2:if(o.enableZoom===!1)return;if(v!==p.TOUCH_DOLLY)return;var n=e.touches[0].pageX-e.touches[1].pageX,_=e.touches[0].pageY-e.touches[1].pageY,m=Math.sqrt(n*n+_*_);d.set(0,m),h.subVectors(d,f),h.y>0?r.dollyOut(getZoomScale()):h.y<0&&r.dollyIn(getZoomScale()),f.copy(d),o.update();break;case 3:if(o.enablePan===!1)return;if(v!==p.TOUCH_PAN)return;l.set(e.touches[0].pageX,e.touches[0].pageY),c.subVectors(l,s),pan(c.x,c.y),s.copy(l),o.update();break;default:v=p.NONE}}}function touchend(){o.enabled!==!1&&(o.dispatchEvent(y),v=p.NONE)}function contextmenu(e){e.preventDefault()}var r=new OrbitConstraint(t);this.domElement=void 0!==n?n:document,Object.defineProperty(this,"constraint",{get:function(){return r}}),this.getPolarAngle=function(){return r.getPolarAngle()},this.getAzimuthalAngle=function(){return r.getAzimuthalAngle()},this.enabled=!0,this.center=this.target,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:e.MOUSE.LEFT,ZOOM:e.MOUSE.MIDDLE,PAN:e.MOUSE.RIGHT};var o=this,i=new e.Vector2,a=new e.Vector2,u=new e.Vector2,s=new e.Vector2,l=new e.Vector2,c=new e.Vector2,f=new e.Vector2,d=new e.Vector2,h=new e.Vector2,p={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},v=p.NONE;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom;var _={type:"change"},m={type:"start"},y={type:"end"};this.update=function(){this.autoRotate&&v===p.NONE&&r.rotateLeft(getAutoRotationAngle()),r.update()===!0&&this.dispatchEvent(_)},this.reset=function(){v=p.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(_),this.update()},this.dispose=function(){this.domElement.removeEventListener("contextmenu",contextmenu,!1),this.domElement.removeEventListener("mousedown",onMouseDown,!1),this.domElement.removeEventListener("mousewheel",onMouseWheel,!1),this.domElement.removeEventListener("MozMousePixelScroll",onMouseWheel,!1),this.domElement.removeEventListener("touchstart",touchstart,!1),this.domElement.removeEventListener("touchend",touchend,!1),this.domElement.removeEventListener("touchmove",touchmove,!1),document.removeEventListener("mousemove",onMouseMove,!1),document.removeEventListener("mouseup",onMouseUp,!1),window.removeEventListener("keydown",onKeyDown,!1)},this.domElement.addEventListener("contextmenu",contextmenu,!1),this.domElement.addEventListener("mousedown",onMouseDown,!1),this.domElement.addEventListener("mousewheel",onMouseWheel,!1),this.domElement.addEventListener("MozMousePixelScroll",onMouseWheel,!1),this.domElement.addEventListener("touchstart",touchstart,!1),this.domElement.addEventListener("touchend",touchend,!1),this.domElement.addEventListener("touchmove",touchmove,!1),window.addEventListener("keydown",onKeyDown,!1),this.update()}var t=e.MOUSE;return t||(t={LEFT:0,MIDDLE:1,RIGHT:2}),OrbitControls.prototype=Object.create(e.EventDispatcher.prototype),OrbitControls.prototype.constructor=OrbitControls,Object.defineProperties(OrbitControls.prototype,{object:{get:function(){return this.constraint.object}},target:{get:function(){return this.constraint.target},set:function(e){console.warn("THREE.OrbitControls: target is now immutable. Use target.set() instead."),this.constraint.target.copy(e)}},minDistance:{get:function(){return this.constraint.minDistance},set:function(e){this.constraint.minDistance=e}},maxDistance:{get:function(){return this.constraint.maxDistance},set:function(e){this.constraint.maxDistance=e}},minZoom:{get:function(){return this.constraint.minZoom},set:function(e){this.constraint.minZoom=e}},maxZoom:{get:function(){return this.constraint.maxZoom},set:function(e){this.constraint.maxZoom=e}},minPolarAngle:{get:function(){return this.constraint.minPolarAngle},set:function(e){this.constraint.minPolarAngle=e}},maxPolarAngle:{get:function(){return this.constraint.maxPolarAngle},set:function(e){this.constraint.maxPolarAngle=e}},minAzimuthAngle:{get:function(){return this.constraint.minAzimuthAngle},set:function(e){this.constraint.minAzimuthAngle=e}},maxAzimuthAngle:{get:function(){return this.constraint.maxAzimuthAngle},set:function(e){this.constraint.maxAzimuthAngle=e}},enableDamping:{get:function(){return this.constraint.enableDamping},set:function(e){this.constraint.enableDamping=e}},dampingFactor:{get:function(){return this.constraint.dampingFactor},set:function(e){this.constraint.dampingFactor=e}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.constraint.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.constraint.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor=e}}}),OrbitControls}},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;nn)return!1;if(e.quadkey.length1}}]),GridLayer}(a["default"]);t["default"]=function(){return new f},e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;n0;o--){var i=1<o;o++)u[o]=i[o].fn;return u},EventEmitter.prototype.emit=function(e,t,n,i,o,a){var u=r?r+e:e;if(!this._events||!this._events[u])return!1;var s,l,c=this._events[u],f=arguments.length;if("function"==typeof c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,o),!0;case 6:return c.fn.call(c.context,t,n,i,o,a),!0}for(l=1,s=new Array(f-1);f>l;l++)s[l-1]=arguments[l];c.fn.apply(c.context,s)}else{var h,p=c.length;for(l=0;p>l;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),f){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;default:if(!s)for(h=1,s=new Array(f-1);f>h;h++)s[h-1]=arguments[h];c[l].fn.apply(c[l].context,s)}}return!0},EventEmitter.prototype.on=function(e,t,n){var i=new EE(t,n||this),o=r?r+e:e;return this._events||(this._events=r?{}:Object.create(null)),this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],i]:this._events[o].push(i):this._events[o]=i,this},EventEmitter.prototype.once=function(e,t,n){var i=new EE(t,n||this,!0),o=r?r+e:e;return this._events||(this._events=r?{}:Object.create(null)),this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],i]:this._events[o].push(i):this._events[o]=i,this},EventEmitter.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events||!this._events[o])return this;var a=this._events[o],u=[];if(t)if(a.fn)(a.fn!==t||i&&!a.once||n&&a.context!==n)&&u.push(a);else for(var s=0,l=a.length;l>s;s++)(a[s].fn!==t||i&&!a[s].once||n&&a[s].context!==n)&&u.push(a[s]);return u.length?this._events[o]=1===u.length?u[0]:u:delete this._events[o],this},EventEmitter.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[r?r+e:e]:this._events=r?{}:Object.create(null),this):this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prototype.setMaxListeners=function(){return this},EventEmitter.prefixed=r,e.exports=EventEmitter},function(e,t,n){function isIndex(e,t){return e="number"==typeof e||s.test(e)?+e:-1,t=null==t?o:t,e>-1&&e%1==0&&t>e}function assignValue(e,t,n){var r=e[t];(!eq(r,n)||eq(r,l[t])&&!c.call(e,t)||void 0===n&&!(t in e))&&(e[t]=n)}function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function copyObject(e,t,n){return copyObjectWith(e,t,n)}function copyObjectWith(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o="function"==typeof o?(i--,o):void 0,a&&isIterateeCall(n[0],n[1],a)&&(o=3>i?void 0:o,i=1),t=Object(t);++r-1&&e%1==0&&o>=e}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var r=n(4),i=n(5),o=9007199254740991,a="[object Function]",u="[object GeneratorFunction]",s=/^(?:0|[1-9]\d*)$/,l=Object.prototype,c=l.hasOwnProperty,f=l.toString,h=baseProperty("length"),p=createAssigner(function(e,t){copyObject(t,r(t),e)});e.exports=p},function(e,t){function baseTimes(e,t){for(var n=-1,r=Array(e);++n-1&&e%1==0&&t>e}function baseHas(e,t){return l.call(e,t)||"object"==typeof e&&t in e&&null===f(e)}function baseKeys(e){return p(Object(e))}function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function indexKeys(e){var t=e?e.length:void 0;return isLength(t)&&(v(e)||isString(e)||isArguments(e))?baseTimes(t,String):null}function isPrototype(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||s;return e===n}function isArguments(e){return isArrayLikeObject(e)&&l.call(e,"callee")&&(!h.call(e,"callee")||c.call(e)==r)}function isArrayLike(e){return null!=e&&!("function"==typeof e&&isFunction(e))&&isLength(d(e))}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function isFunction(e){var t=isObject(e)?c.call(e):"";return t==i||t==o}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&n>=e}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isString(e){return"string"==typeof e||!v(e)&&isObjectLike(e)&&c.call(e)==a}function keys(e){var t=isPrototype(e);if(!t&&!isArrayLike(e))return baseKeys(e);var n=indexKeys(e),r=!!n,i=n||[],o=i.length;for(var a in e)!baseHas(e,a)||r&&("length"==a||isIndex(a,o))||t&&"constructor"==a||i.push(a);return i}var n=9007199254740991,r="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",a="[object String]",u=/^(?:0|[1-9]\d*)$/,s=Object.prototype,l=s.hasOwnProperty,c=s.toString,f=Object.getPrototypeOf,h=s.propertyIsEnumerable,p=Object.keys,d=baseProperty("length"),v=Array.isArray;e.exports=keys},function(e,t){function apply(e,t,n){var r=n.length;switch(r){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function rest(e,t){if("function"!=typeof e)throw new TypeError(n);return t=v(void 0===t?e.length-1:toInteger(t),0),function(){for(var n=arguments,r=-1,i=v(n.length-t,0),o=Array(i);++re?-1:1;return t*i}var n=e%1;return e===e?n?e-n:e:0}function toNumber(e){if(isObject(e)){var t=isFunction(e.valueOf)?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var n=c.test(e);return n||f.test(e)?h(e.slice(2),n?2:8):l.test(e)?o:+e}var n="Expected a function",r=1/0,i=1.7976931348623157e308,o=NaN,a="[object Function]",u="[object GeneratorFunction]",s=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,f=/^0o[0-7]+$/i,h=parseInt,p=Object.prototype,d=p.toString,v=Math.max;e.exports=rest},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=_interopRequireDefault(r),o=n(15),a=_interopRequireDefault(o),u=n(17),s=_interopRequireDefault(u),l=n(19),c=_interopRequireDefault(l),f=n(20),h=_interopRequireDefault(f),p={};p.EPSG3857=i["default"],p.EPSG900913=r.EPSG900913,p.EPSG3395=a["default"],p.EPSG4326=s["default"],p.Simple=c["default"],p.Proj4=h["default"],t["default"]=p,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=_interopRequireDefault(r),o=n(8),a=_interopRequireDefault(o),u=n(13),s=_interopRequireDefault(u),l=n(14),c=_interopRequireDefault(l),f={code:"EPSG:3857",projection:s["default"],transformScale:1/(Math.PI*s["default"].R),transformation:function(){var e=1/(Math.PI*s["default"].R);return new c["default"](e,0,-e,0)}()},h=(0,i["default"])({},a["default"],f),p=(0,i["default"])({},h,{code:"EPSG:900913"});t.EPSG900913=p,t["default"]=h},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=_interopRequireDefault(r),o=n(9),a=_interopRequireDefault(o),u=n(10),s=(_interopRequireDefault(u),{wrapLon:[-180,180],R:6378137,distance:function(e,t,n){var r,i,o,a=Math.PI/180;if(n){r=e.lat*a,i=t.lat*a;var u=e.lon*a,s=t.lon*a,l=i-r,c=s-u,f=l/2,h=c/2;o=Math.sin(f)*Math.sin(f)+Math.cos(r)*Math.cos(i)*Math.sin(h)*Math.sin(h);var p=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o));return this.R*p}return r=e.lat*a,i=t.lat*a,o=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lon-e.lon)*a),this.R*Math.acos(Math.min(o,1))},pointScale:function(e,t){return this.projection.pointScale?this.projection.pointScale(e,t):[1,1]},metresToProjected:function(e,t){return e*t[1]},projectedToMetres:function(e,t){return e/t[1]},metresToWorld:function(e,t,n){var r=this.metresToProjected(e,t),i=this.scale(n);n&&(i/=2);var o=i*(this.transformScale*r)/t[1];return o},worldToMetres:function(e,t,n){var r=this.scale(n);n&&(r/=2);var i=e/r/this.transformScale*t[1],o=this.projectedToMetres(i,t);return o}});t["default"]=(0,i["default"])({},a["default"],s),e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=_interopRequireDefault(r),o=n(11),a=_interopRequireDefault(o),u=n(12),s=_interopRequireDefault(u),l={scaleFactor:1e6,latLonToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return t&&(r/=2),this.transformation._transform(n,r)},pointToLatLon:function(e,t){var n=this.scale(t);t&&(n/=2);var r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return e>=0?256*Math.pow(2,e):this.scaleFactor},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);e&&(n/=2);var r=this.transformation.transform((0,a["default"])(t[0]),n),i=this.transformation.transform((0,a["default"])(t[1]),n);return[r,i]},wrapLatLon:function(e){var t=this.wrapLat?(0,s["default"])(e.lat,this.wrapLat,!0):e.lat,n=this.wrapLon?(0,s["default"])(e.lon,this.wrapLon,!0):e.lon,r=e.alt;return(0,i["default"])(t,n,r)}};t["default"]=l,e.exports=t["default"]},function(e,t){function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function defineProperties(e,t){for(var n=0;nl&&Math.abs(c)>1e-7;l++)t=a*Math.sin(s),t=Math.pow((1-t)/(1+t),a/2),c=Math.PI/2-2*Math.atan(u*t)-s,s+=c;return(0,i["default"])(s*n,e.x*n/r)},pointScale:function(e){var t=Math.PI/180,n=e.lat*t,r=Math.sin(n),i=r*r,o=Math.cos(n),a=Math.sqrt(1-this.ECC2*i)/o;return[a,a]},bounds:[[-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]]};t["default"]=u,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=_interopRequireDefault(r),o=n(8),a=_interopRequireDefault(o),u=n(18),s=_interopRequireDefault(u),l=n(14),c=_interopRequireDefault(l),f={code:"EPSG:4326",projection:s["default"],transformScale:1/180,transformation:new c["default"](1/180,0,-1/180,0)},h=(0,i["default"])({},a["default"],f);t["default"]=h,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=_interopRequireDefault(r),o=n(11),a=_interopRequireDefault(o),u={project:function(e){return(0,a["default"])(e.lon,e.lat)},unproject:function(e){return(0,i["default"])(e.y,e.x)},pointScale:function(e){var t=111132.92,n=-559.82,r=1.175,i=-.0023,o=111412.84,a=-93.5,u=.118,s=Math.PI/180,l=e.lat*s,c=t+n*Math.cos(2*l)+r*Math.cos(4*l)+i*Math.cos(6*l),f=o*Math.cos(l)+a*Math.cos(3*l)+u*Math.cos(5*l);return[1/c,1/f]},bounds:[[-180,-90],[180,90]]};t["default"]=u,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=_interopRequireDefault(r),o=n(9),a=_interopRequireDefault(o),u=n(18),s=_interopRequireDefault(u),l=n(14),c=_interopRequireDefault(l),f={projection:s["default"],transformation:new c["default"](1,0,1,0),scale:function(e){return e?Math.pow(2,e):1},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lon-e.lon,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0},h=(0,i["default"])({},a["default"],f);t["default"]=h,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=_interopRequireDefault(r),o=n(8),a=_interopRequireDefault(o),u=n(21),s=_interopRequireDefault(u),l=n(14),c=_interopRequireDefault(l),f=function(e,t,n){var r=(0,s["default"])(t,n),i=r.bounds[1][0]-r.bounds[0][0],o=r.bounds[1][1]-r.bounds[0][1],a=i/2,u=o/2,l=1/a,f=1/u,h=Math.min(l,f),p=h*(r.bounds[0][0]+a),d=h*(r.bounds[0][1]+u);return{code:e,projection:r,transformScale:h,transformation:new c["default"](h,-p,-h,d)}},h=function(e,t,n){return(0,i["default"])({},a["default"],f(e,t,n))};t["default"]=h,e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(22),i=_interopRequireDefault(r),o=n(10),a=_interopRequireDefault(o),u=n(11),s=_interopRequireDefault(u),l=function(e,t){var n=(0,i["default"])(e),r=function(e){return(0,s["default"])(n.forward([e.lon,e.lat]))},o=function(e){var t=n.inverse([e.x,e.y]);return(0,a["default"])(t[1],t[0])};return{project:r,unproject:o,pointScale:function(e,t){return[1,1]},bounds:function(){if(t)return t;var e=r([-90,-180]),n=r([90,180]);return[e,n]}()}};t["default"]=l,e.exports=t["default"]},function(t,n){t.exports=e},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;no||8*(1-d.dot(this.object.quaternion))>o?(p.copy(this.object.position),d.copy(this.object.quaternion),c=!1,!0):!1}}()}function OrbitControls(t,n){function pan(e,t){var n=i.domElement===document?i.domElement.body:i.domElement;r.pan(e,t,n.clientWidth,n.clientHeight)}function getAutoRotationAngle(){return 2*Math.PI/60/60*i.autoRotateSpeed}function getZoomScale(){return Math.pow(.95,i.zoomSpeed)}function onMouseDown(e){if(i.enabled!==!1){if(e.preventDefault(),e.button===i.mouseButtons.ORBIT){if(i.enableRotate===!1)return;v=d.ROTATE,o.set(e.clientX,e.clientY)}else if(e.button===i.mouseButtons.ZOOM){if(i.enableZoom===!1)return;v=d.DOLLY,f.set(e.clientX,e.clientY)}else if(e.button===i.mouseButtons.PAN){if(i.enablePan===!1)return;v=d.PAN,s.set(e.clientX,e.clientY)}v!==d.NONE&&(document.addEventListener("mousemove",onMouseMove,!1),document.addEventListener("mouseup",onMouseUp,!1),i.dispatchEvent(m))}}function onMouseMove(e){if(i.enabled!==!1){e.preventDefault();var t=i.domElement===document?i.domElement.body:i.domElement;if(v===d.ROTATE){if(i.enableRotate===!1)return;a.set(e.clientX,e.clientY),u.subVectors(a,o),r.rotateLeft(2*Math.PI*u.x/t.clientWidth*i.rotateSpeed),r.rotateUp(2*Math.PI*u.y/t.clientHeight*i.rotateSpeed),o.copy(a)}else if(v===d.DOLLY){if(i.enableZoom===!1)return;h.set(e.clientX,e.clientY),p.subVectors(h,f),p.y>0?r.dollyIn(getZoomScale()):p.y<0&&r.dollyOut(getZoomScale()),f.copy(h)}else if(v===d.PAN){if(i.enablePan===!1)return;l.set(e.clientX,e.clientY),c.subVectors(l,s),pan(c.x,c.y),s.copy(l)}v!==d.NONE&&i.update()}}function onMouseUp(){i.enabled!==!1&&(document.removeEventListener("mousemove",onMouseMove,!1),document.removeEventListener("mouseup",onMouseUp,!1),i.dispatchEvent(_),v=d.NONE)}function onMouseWheel(e){if(i.enabled!==!1&&i.enableZoom!==!1&&v===d.NONE){e.preventDefault(),e.stopPropagation();var t=0;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),t>0?r.dollyOut(getZoomScale()):0>t&&r.dollyIn(getZoomScale()),i.update(),i.dispatchEvent(m),i.dispatchEvent(_)}}function onKeyDown(e){if(i.enabled!==!1&&i.enableKeys!==!1&&i.enablePan!==!1)switch(e.keyCode){case i.keys.UP:pan(0,i.keyPanSpeed),i.update();break;case i.keys.BOTTOM:pan(0,-i.keyPanSpeed),i.update();break;case i.keys.LEFT:pan(i.keyPanSpeed,0),i.update();break;case i.keys.RIGHT:pan(-i.keyPanSpeed,0),i.update()}}function touchstart(e){if(i.enabled!==!1){switch(e.touches.length){case 1:if(i.enableRotate===!1)return;v=d.TOUCH_ROTATE,o.set(e.touches[0].pageX,e.touches[0].pageY);break;case 2:if(i.enableZoom===!1)return;v=d.TOUCH_DOLLY;var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);f.set(0,r);break;case 3:if(i.enablePan===!1)return;v=d.TOUCH_PAN,s.set(e.touches[0].pageX,e.touches[0].pageY);break;default:v=d.NONE}v!==d.NONE&&i.dispatchEvent(m)}}function touchmove(e){if(i.enabled!==!1){e.preventDefault(),e.stopPropagation();var t=i.domElement===document?i.domElement.body:i.domElement;switch(e.touches.length){case 1:if(i.enableRotate===!1)return;if(v!==d.TOUCH_ROTATE)return;a.set(e.touches[0].pageX,e.touches[0].pageY),u.subVectors(a,o),r.rotateLeft(2*Math.PI*u.x/t.clientWidth*i.rotateSpeed),r.rotateUp(2*Math.PI*u.y/t.clientHeight*i.rotateSpeed),o.copy(a),i.update();break;case 2:if(i.enableZoom===!1)return;if(v!==d.TOUCH_DOLLY)return;var n=e.touches[0].pageX-e.touches[1].pageX,y=e.touches[0].pageY-e.touches[1].pageY,m=Math.sqrt(n*n+y*y);h.set(0,m),p.subVectors(h,f),p.y>0?r.dollyOut(getZoomScale()):p.y<0&&r.dollyIn(getZoomScale()),f.copy(h),i.update();break;case 3:if(i.enablePan===!1)return;if(v!==d.TOUCH_PAN)return;l.set(e.touches[0].pageX,e.touches[0].pageY),c.subVectors(l,s),pan(c.x,c.y),s.copy(l),i.update();break;default:v=d.NONE}}}function touchend(){i.enabled!==!1&&(i.dispatchEvent(_),v=d.NONE)}function contextmenu(e){e.preventDefault()}var r=new OrbitConstraint(t);this.domElement=void 0!==n?n:document,Object.defineProperty(this,"constraint",{get:function(){return r}}),this.getPolarAngle=function(){return r.getPolarAngle()},this.getAzimuthalAngle=function(){return r.getAzimuthalAngle()},this.enabled=!0,this.center=this.target,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:e.MOUSE.LEFT,ZOOM:e.MOUSE.MIDDLE,PAN:e.MOUSE.RIGHT};var i=this,o=new e.Vector2,a=new e.Vector2,u=new e.Vector2,s=new e.Vector2,l=new e.Vector2,c=new e.Vector2,f=new e.Vector2,h=new e.Vector2,p=new e.Vector2,d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},v=d.NONE;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom;var y={type:"change"},m={type:"start"},_={type:"end"};this.update=function(){this.autoRotate&&v===d.NONE&&r.rotateLeft(getAutoRotationAngle()),r.update()===!0&&this.dispatchEvent(y)},this.reset=function(){v=d.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(y),this.update()},this.dispose=function(){this.domElement.removeEventListener("contextmenu",contextmenu,!1),this.domElement.removeEventListener("mousedown",onMouseDown,!1),this.domElement.removeEventListener("mousewheel",onMouseWheel,!1),this.domElement.removeEventListener("MozMousePixelScroll",onMouseWheel,!1),this.domElement.removeEventListener("touchstart",touchstart,!1),this.domElement.removeEventListener("touchend",touchend,!1),this.domElement.removeEventListener("touchmove",touchmove,!1),document.removeEventListener("mousemove",onMouseMove,!1),document.removeEventListener("mouseup",onMouseUp,!1),window.removeEventListener("keydown",onKeyDown,!1)},this.domElement.addEventListener("contextmenu",contextmenu,!1),this.domElement.addEventListener("mousedown",onMouseDown,!1),this.domElement.addEventListener("mousewheel",onMouseWheel,!1),this.domElement.addEventListener("MozMousePixelScroll",onMouseWheel,!1),this.domElement.addEventListener("touchstart",touchstart,!1),this.domElement.addEventListener("touchend",touchend,!1),this.domElement.addEventListener("touchmove",touchmove,!1),window.addEventListener("keydown",onKeyDown,!1),this.update()}var t=e.MOUSE;return t||(t={LEFT:0,MIDDLE:1,RIGHT:2}),OrbitControls.prototype=Object.create(e.EventDispatcher.prototype),OrbitControls.prototype.constructor=OrbitControls,Object.defineProperties(OrbitControls.prototype,{object:{get:function(){return this.constraint.object}},target:{get:function(){return this.constraint.target},set:function(e){console.warn("THREE.OrbitControls: target is now immutable. Use target.set() instead."),this.constraint.target.copy(e)}},minDistance:{get:function(){return this.constraint.minDistance},set:function(e){this.constraint.minDistance=e}},maxDistance:{get:function(){return this.constraint.maxDistance},set:function(e){this.constraint.maxDistance=e}},minZoom:{get:function(){return this.constraint.minZoom},set:function(e){this.constraint.minZoom=e}},maxZoom:{get:function(){return this.constraint.maxZoom},set:function(e){this.constraint.maxZoom=e}},minPolarAngle:{get:function(){return this.constraint.minPolarAngle},set:function(e){this.constraint.minPolarAngle=e}},maxPolarAngle:{get:function(){return this.constraint.maxPolarAngle},set:function(e){this.constraint.maxPolarAngle=e}},minAzimuthAngle:{get:function(){return this.constraint.minAzimuthAngle},set:function(e){this.constraint.minAzimuthAngle=e}},maxAzimuthAngle:{get:function(){return this.constraint.maxAzimuthAngle},set:function(e){this.constraint.maxAzimuthAngle=e}},enableDamping:{get:function(){return this.constraint.enableDamping},set:function(e){this.constraint.enableDamping=e}},dampingFactor:{get:function(){return this.constraint.dampingFactor},set:function(e){this.constraint.dampingFactor=e}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.constraint.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.constraint.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor=e}}}),OrbitControls}},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;n8e3))return n.getMesh()?void(n.isReady()&&(e._layer.add(n.getMesh()),r++)):void n.requestTileAsync()}})}}},{key:"_divide",value:function(e){for(var t,n,r=0;r!=e.length;)t=e[r],n=t.getQuadcode(),t.length!==this._maxLOD&&this._screenSpaceError(t)?(e.splice(r,1),e.push(this._tileCache.requestTile(n+"0",this)),e.push(this._tileCache.requestTile(n+"1",this)),e.push(this._tileCache.requestTile(n+"2",this)),e.push(this._tileCache.requestTile(n+"3",this))):r++}},{key:"_screenSpaceError",value:function(e){var t=this._minLOD,n=this._maxLOD,r=e.getQuadcode(),i=this._world.getCamera(),o=3;if(r.length>n)return!1;if(r.length1}},{key:"_removeTiles",value:function(){for(var e=this._layer.children.length-1;e>=0;e--)this._layer.remove(this._layer.children[e])}}]),GridLayer}(a["default"]);t["default"]=function(){return new p},e.exports=t["default"]},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;n=t)&&priv(this,"max",1/0);var n=e.length||naiveLength;"function"!=typeof n&&(n=naiveLength),priv(this,"lengthCalculator",n),priv(this,"allowStale",e.stale||!1),priv(this,"maxAge",e.maxAge||0),priv(this,"dispose",e.dispose),this.reset()}function forEachStep(e,t,n,r){var i=n.value;isStale(e,i)&&(del(e,n),priv(e,"allowStale")||(i=void 0)),i&&t.call(r,i.value,i.key,e)}function get(e,t,n){var r=priv(e,"cache").get(t);if(r){var i=r.value;isStale(e,i)?(del(e,r),priv(e,"allowStale")||(i=void 0)):n&&priv(e,"lruList").unshiftNode(r),i&&(i=i.value)}return i}function isStale(e,t){if(!t||!t.maxAge&&!priv(e,"maxAge"))return!1;var n=!1,r=Date.now()-t.now;return n=t.maxAge?r>t.maxAge:priv(e,"maxAge")&&r>priv(e,"maxAge")}function trim(e){if(priv(e,"length")>priv(e,"max"))for(var t=priv(e,"lruList").tail;priv(e,"length")>priv(e,"max")&&null!==t;){var n=t.prev;del(e,t),t=n}}function del(e,t){if(t){var n=t.value;priv(e,"dispose")&&priv(e,"dispose").call(this,n.key,n.value),priv(e,"length",priv(e,"length")-n.length),priv(e,"cache")["delete"](n.key),priv(e,"lruList").removeNode(t)}}function Entry(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}e.exports=LRUCache;var r,i=n(36),o=n(39),a=n(42),u={},s="function"==typeof Symbol;r=s?function(e){return Symbol["for"](e)}:function(e){return"_"+e},Object.defineProperty(LRUCache.prototype,"max",{set:function(e){(!e||"number"!=typeof e||0>=e)&&(e=1/0),priv(this,"max",e),trim(this)},get:function(){return priv(this,"max")},enumerable:!0}),Object.defineProperty(LRUCache.prototype,"allowStale",{set:function(e){priv(this,"allowStale",!!e)},get:function(){return priv(this,"allowStale")},enumerable:!0}),Object.defineProperty(LRUCache.prototype,"maxAge",{set:function(e){(!e||"number"!=typeof e||0>e)&&(e=0),priv(this,"maxAge",e),trim(this)},get:function(){return priv(this,"maxAge")},enumerable:!0}),Object.defineProperty(LRUCache.prototype,"lengthCalculator",{set:function(e){"function"!=typeof e&&(e=naiveLength),e!==priv(this,"lengthCalculator")&&(priv(this,"lengthCalculator",e),priv(this,"length",0),priv(this,"lruList").forEach(function(e){e.length=priv(this,"lengthCalculator").call(this,e.value,e.key),priv(this,"length",priv(this,"length")+e.length)},this)),trim(this)},get:function(){return priv(this,"lengthCalculator")},enumerable:!0}),Object.defineProperty(LRUCache.prototype,"length",{get:function(){return priv(this,"length")},enumerable:!0}),Object.defineProperty(LRUCache.prototype,"itemCount",{get:function(){return priv(this,"lruList").length},enumerable:!0}),LRUCache.prototype.rforEach=function(e,t){t=t||this;for(var n=priv(this,"lruList").tail;null!==n;){var r=n.prev;forEachStep(this,e,n,t),n=r}},LRUCache.prototype.forEach=function(e,t){t=t||this;for(var n=priv(this,"lruList").head;null!==n;){var r=n.next;forEachStep(this,e,n,t),n=r}},LRUCache.prototype.keys=function(){return priv(this,"lruList").toArray().map(function(e){return e.key},this)},LRUCache.prototype.values=function(){return priv(this,"lruList").toArray().map(function(e){return e.value},this)},LRUCache.prototype.reset=function(){priv(this,"dispose")&&priv(this,"lruList")&&priv(this,"lruList").length&&priv(this,"lruList").forEach(function(e){priv(this,"dispose").call(this,e.key,e.value)},this),priv(this,"cache",new i),priv(this,"lruList",new a),priv(this,"length",0)},LRUCache.prototype.dump=function(){return priv(this,"lruList").map(function(e){return isStale(this,e)?void 0:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}},this).toArray().filter(function(e){return e})},LRUCache.prototype.dumpLru=function(){return priv(this,"lruList")},LRUCache.prototype.inspect=function(e,t){var n="LRUCache {",r=!1,i=priv(this,"allowStale");i&&(n+="\n allowStale: true",r=!0);var a=priv(this,"max");a&&a!==1/0&&(r&&(n+=","),n+="\n max: "+o.inspect(a,t),r=!0);var u=priv(this,"maxAge");u&&(r&&(n+=","),n+="\n maxAge: "+o.inspect(u,t),r=!0);var s=priv(this,"lengthCalculator");s&&s!==naiveLength&&(r&&(n+=","),n+="\n length: "+o.inspect(priv(this,"length"),t),r=!0);var l=!1;return priv(this,"lruList").forEach(function(e){l?n+=",\n ":(r&&(n+=",\n"),l=!0,n+="\n ");var i=o.inspect(e.key).split("\n").join("\n "),a={value:e.value};e.maxAge!==u&&(a.maxAge=e.maxAge),s!==naiveLength&&(a.length=e.length),isStale(this,e)&&(a.stale=!0),a=o.inspect(a,t).split("\n").join("\n "),n+=i+" => "+a}),(l||r)&&(n+="\n"),n+="}"},LRUCache.prototype.set=function(e,t,n){n=n||priv(this,"maxAge");var r=n?Date.now():0,i=priv(this,"lengthCalculator").call(this,t,e);if(priv(this,"cache").has(e)){if(i>priv(this,"max"))return del(this,priv(this,"cache").get(e)),!1;var o=priv(this,"cache").get(e),a=o.value;return priv(this,"dispose")&&priv(this,"dispose").call(this,e,a.value),a.now=r,a.maxAge=n,a.value=t,priv(this,"length",priv(this,"length")+(i-a.length)),a.length=i,this.get(e),trim(this),!0}var u=new Entry(e,t,i,r,n);return u.length>priv(this,"max")?(priv(this,"dispose")&&priv(this,"dispose").call(this,e,t),!1):(priv(this,"length",priv(this,"length")+u.length),priv(this,"lruList").unshift(u),priv(this,"cache").set(e,priv(this,"lruList").head),trim(this),!0)},LRUCache.prototype.has=function(e){if(!priv(this,"cache").has(e))return!1;var t=priv(this,"cache").get(e).value;return isStale(this,t)?!1:!0},LRUCache.prototype.get=function(e){return get(this,e,!0)},LRUCache.prototype.peek=function(e){return get(this,e,!1)},LRUCache.prototype.pop=function(){var e=priv(this,"lruList").tail;return e?(del(this,e),e.value):null},LRUCache.prototype.del=function(e){del(this,priv(this,"cache").get(e))},LRUCache.prototype.load=function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-t;o>0&&this.set(r.k,r.v,o)}}},LRUCache.prototype.prune=function(){var e=this;priv(this,"cache").forEach(function(t,n){get(e,n,!1)})}},function(e,t,n){(function(t){"pseudomap"===t.env.npm_package_name&&"test"===t.env.npm_lifecycle_script&&(t.env.TEST_PSEUDOMAP="true"),"function"!=typeof Map||t.env.TEST_PSEUDOMAP?e.exports=n(38):e.exports=Map}).call(t,n(37))},function(e,t){function cleanUpNextTick(){o=!1,n.length?i=n.concat(i):a=-1,i.length&&drainQueue()}function drainQueue(){if(!o){var e=setTimeout(cleanUpNextTick);o=!0;for(var t=i.length;t;){for(n=i,i=[];++a1)for(var n=1;n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),isBoolean(n)?r.showHidden=n:n&&t._extend(r,n),isUndefined(r.showHidden)&&(r.showHidden=!1),isUndefined(r.depth)&&(r.depth=2),isUndefined(r.colors)&&(r.colors=!1),isUndefined(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=stylizeWithColor),formatValue(r,e,r.depth)}function stylizeWithColor(e,t){var n=inspect.styles[t];return n?"["+inspect.colors[n][0]+"m"+e+"["+inspect.colors[n][1]+"m":e}function stylizeNoColor(e,t){return e}function arrayToHash(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function formatValue(e,n,r){if(e.customInspect&&n&&isFunction(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return isString(i)||(i=formatValue(e,i,r)),i}var o=formatPrimitive(e,n);if(o)return o;var a=Object.keys(n),u=arrayToHash(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),isError(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return formatError(n);if(0===a.length){if(isFunction(n)){var s=n.name?": "+n.name:"";return e.stylize("[Function"+s+"]","special")}if(isRegExp(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(isDate(n))return e.stylize(Date.prototype.toString.call(n),"date");if(isError(n))return formatError(n)}var l="",c=!1,f=["{","}"];if(isArray(n)&&(c=!0,f=["[","]"]),isFunction(n)){var h=n.name?": "+n.name:"";l=" [Function"+h+"]"}if(isRegExp(n)&&(l=" "+RegExp.prototype.toString.call(n)),isDate(n)&&(l=" "+Date.prototype.toUTCString.call(n)),isError(n)&&(l=" "+formatError(n)),0===a.length&&(!c||0==n.length))return f[0]+l+f[1];if(0>r)return isRegExp(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var p;return p=c?formatArray(e,n,r,u,a):a.map(function(t){return formatProperty(e,n,r,u,t,c)}),e.seen.pop(),reduceToSingleString(p,l,f)}function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return isNumber(t)?e.stylize(""+t,"number"):isBoolean(t)?e.stylize(""+t,"boolean"):isNull(t)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,t,n,r,i){for(var o=[],a=0,u=t.length;u>a;++a)hasOwnProperty(t,String(a))?o.push(formatProperty(e,t,n,r,String(a),!0)):o.push(""); +return i.forEach(function(i){i.match(/^\d+$/)||o.push(formatProperty(e,t,n,r,i,!0))}),o}function formatProperty(e,t,n,r,i,o){var a,u,s;if(s=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},s.get?u=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(u=e.stylize("[Setter]","special")),hasOwnProperty(r,i)||(a="["+i+"]"),u||(e.seen.indexOf(s.value)<0?(u=isNull(n)?formatValue(e,s.value,null):formatValue(e,s.value,n-1),u.indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),isUndefined(a)){if(o&&i.match(/^\d+$/))return u;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function reduceToSingleString(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return 10>e?"0"+e.toString(10):e.toString(10)}function timestamp(){var e=new Date,t=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),u[e.getMonth()],t].join(" ")}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var i=/%[sdj%]/g;t.format=function(e){if(!isString(e)){for(var t=[],n=0;n=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),u=r[n];o>n;u=r[++n])a+=isNull(u)||!isObject(u)?" "+u:" "+inspect(u);return a},t.deprecate=function(n,i){function deprecated(){if(!o){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),o=!0}return n.apply(this,arguments)}if(isUndefined(e.process))return function(){return t.deprecate(n,i).apply(this,arguments)};if(r.noDeprecation===!0)return n;var o=!1;return deprecated};var o,a={};t.debuglog=function(e){if(isUndefined(o)&&(o=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!a[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var n=r.pid;a[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else a[e]=function(){};return a[e]},t.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=isArray,t.isBoolean=isBoolean,t.isNull=isNull,t.isNullOrUndefined=isNullOrUndefined,t.isNumber=isNumber,t.isString=isString,t.isSymbol=isSymbol,t.isUndefined=isUndefined,t.isRegExp=isRegExp,t.isObject=isObject,t.isDate=isDate,t.isError=isError,t.isFunction=isFunction,t.isPrimitive=isPrimitive,t.isBuffer=n(40);var u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",timestamp(),t.format.apply(t,arguments))},t.inherits=n(41),t._extend=function(e,t){if(!t||!isObject(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(t,function(){return this}(),n(37))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){function Yallist(e){var t=this;if(t instanceof Yallist||(t=new Yallist),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var n=0,r=arguments.length;r>n;n++)t.push(arguments[n]);return t}function push(e,t){e.tail=new Node(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function unshift(e,t){e.head=new Node(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Node(e,t,n,r){return this instanceof Node?(this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,void(n?(n.prev=this,this.next=n):this.next=null)):new Node(e,t,n,r)}e.exports=Yallist,Yallist.Node=Node,Yallist.create=Yallist,Yallist.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null},Yallist.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},Yallist.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},Yallist.prototype.push=function(){for(var e=0,t=arguments.length;t>e;e++)push(this,arguments[e]);return this.length},Yallist.prototype.unshift=function(){for(var e=0,t=arguments.length;t>e;e++)unshift(this,arguments[e]);return this.length},Yallist.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail.next=null,this.length--,e}},Yallist.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head.prev=null,this.length--,e}},Yallist.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},Yallist.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},Yallist.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&e>t;t++)n=n.next;return t===e&&null!==n?n.value:void 0},Yallist.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&e>t;t++)n=n.prev;return t===e&&null!==n?n.value:void 0},Yallist.prototype.map=function(e,t){t=t||this;for(var n=new Yallist,r=this.head;null!==r;)n.push(e.call(t,r.value,this)),r=r.next;return n},Yallist.prototype.mapReverse=function(e,t){t=t||this;for(var n=new Yallist,r=this.tail;null!==r;)n.push(e.call(t,r.value,this)),r=r.prev;return n},Yallist.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},Yallist.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},Yallist.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},Yallist.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},Yallist.prototype.slice=function(e,t){t=t||this.length,0>t&&(t+=this.length),e=e||0,0>e&&(e+=this.length);var n=new Yallist;if(e>t||0>t)return n;0>e&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;null!==i&&e>r;r++)i=i.next;for(;null!==i&&t>r;r++,i=i.next)n.push(i.value);return n},Yallist.prototype.sliceReverse=function(e,t){t=t||this.length,0>t&&(t+=this.length),e=e||0,0>e&&(e+=this.length);var n=new Yallist;if(e>t||0>t)return n;0>e&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;null!==i&&r>t;r--)i=i.prev;for(;null!==i&&r>e;r--,i=i.prev)n.push(i.value);return n},Yallist.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this}},function(e,t,n){function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;n0;i--){var o=1<=e||e>t?complete(c,o):l=setTimeout(delayed,e)}function flush(){return(l&&c||o&&y)&&(a=e.apply(s,i)),cancel(),a}function maxDelayed(){complete(y,l)}function debounced(){if(i=arguments,u=d(),s=this,c=y&&(l||!h),v===!1)var n=h&&!l;else{o||h||(f=u);var r=v-(u-f),p=0>=r||r>v;p?(o&&(o=clearTimeout(o)),f=u,a=e.apply(s,i)):o||(o=setTimeout(maxDelayed,r))}return p&&l?l=clearTimeout(l):l||t===v||(l=setTimeout(delayed,t)),n&&(p=!0,a=e.apply(s,i)),!p||l||o||(i=s=void 0),a}var i,o,a,u,s,l,c,f=0,h=!1,v=!1,y=!0;if("function"!=typeof e)throw new TypeError(n);return t=toNumber(t)||0,isObject(r)&&(h=!!r.leading,v="maxWait"in r&&p(toNumber(r.maxWait)||0,t),y="trailing"in r?!!r.trailing:y),debounced.cancel=cancel,debounced.flush=flush,debounced}function isFunction(e){var t=isObject(e)?h.call(e):"";return t==i||t==o}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function toNumber(e){if(isObject(e)){var t=isFunction(e.valueOf)?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=s.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):u.test(e)?r:+e}var n="Expected a function",r=NaN,i="[object Function]",o="[object GeneratorFunction]",a=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt,f=Object.prototype,h=f.toString,p=Math.max,d=Date.now;e.exports=debounce}])}); //# sourceMappingURL=vizicities.min.js.map diff --git a/dist/vizicities.min.js.map b/dist/vizicities.min.js.map index 3a030f9..496101c 100644 --- a/dist/vizicities.min.js.map +++ b/dist/vizicities.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","vizicities.min.js","webpack:/webpack/bootstrap 47fcd39c2099515160d3","webpack:///src/vizicities.js","webpack:///src/World.js","webpack:///~/eventemitter3/index.js","webpack:///~/lodash.assign/index.js","webpack:///~/lodash.keys/index.js","webpack:///~/lodash.rest/index.js","webpack:///src/geo/CRS/index.js","webpack:///src/geo/CRS/CRS.EPSG3857.js","webpack:///src/geo/CRS/CRS.Earth.js","webpack:///src/geo/CRS/CRS.js","webpack:///src/geo/LatLon.js","webpack:///src/geo/Point.js","webpack:///src/util/wrapNum.js","webpack:///src/geo/projection/Projection.SphericalMercator.js","webpack:///src/util/Transformation.js","webpack:///src/geo/CRS/CRS.EPSG3395.js","webpack:///src/geo/projection/Projection.Mercator.js","webpack:///src/geo/CRS/CRS.EPSG4326.js","webpack:///src/geo/projection/Projection.LatLon.js","webpack:///src/geo/CRS/CRS.Simple.js","webpack:///src/geo/CRS/CRS.Proj4.js","webpack:///src/geo/projection/Projection.Proj4.js","webpack:/external \"proj4\"","webpack:///src/engine/Engine.js","webpack:/external \"THREE\"","webpack:///src/engine/Scene.js","webpack:///src/engine/Renderer.js","webpack:///src/engine/Camera.js","webpack:///src/controls/index.js","webpack:///src/controls/Controls.Orbit.js","webpack:///~/three-orbit-controls/index.js","webpack:///src/layer/environment/EnvironmentLayer.js","webpack:///src/layer/Layer.js","webpack:///src/layer/tile/GridLayer.js","webpack:///src/layer/tile/Surface.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_22__","__WEBPACK_EXTERNAL_MODULE_24__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","_World","_World2","_controlsIndex","_controlsIndex2","_layerEnvironmentEnvironmentLayer","_layerEnvironmentEnvironmentLayer2","_layerTileGridLayer","_layerTileGridLayer2","_geoPoint","_geoPoint2","_geoLatLon","_geoLatLon2","VIZI","version","World","Controls","EnvironmentLayer","GridLayer","Point","LatLon","_classCallCheck","instance","Constructor","TypeError","_inherits","subClass","superClass","prototype","create","constructor","enumerable","writable","configurable","setPrototypeOf","__proto__","_createClass","defineProperties","target","props","i","length","descriptor","key","protoProps","staticProps","_get","_x","_x2","_x3","_again","object","property","receiver","Function","desc","getOwnPropertyDescriptor","undefined","getter","get","parent","getPrototypeOf","_eventemitter3","_eventemitter32","_lodashAssign","_lodashAssign2","_geoCRSIndex","_geoCRSIndex2","_engineEngine","_engineEngine2","_EventEmitter","domId","options","defaults","crs","EPSG3857","_layers","_controls","_initContainer","_initEngine","_initEvents","_update","_container","document","getElementById","_engine","on","_onControlsMoveEnd","point","_point","x","z","_resetView","pointToLatLon","latlon","emit","_moveStart","_move","_moveEnd","_lastPosition","delta","clock","getDelta","window","requestAnimationFrame","bind","forEach","controls","update","_originLatlon","_originPoint","project","latLonToPoint","projectedPoint","_subtract","add","unproject","_camera","layer","_addToWorld","push","_scene","_layer","EE","fn","context","once","EventEmitter","prefix","_events","listeners","event","exists","evt","available","l","ee","Array","a1","a2","a3","a4","a5","args","len","arguments","removeListener","apply","j","listener","events","removeAllListeners","off","addListener","setMaxListeners","prefixed","isIndex","reIsUint","test","MAX_SAFE_INTEGER","assignValue","objValue","eq","objectProto","hasOwnProperty","baseProperty","copyObject","source","copyObjectWith","customizer","index","newValue","createAssigner","assigner","rest","sources","guard","isIterateeCall","isObject","type","isArrayLike","other","isFunction","isLength","getLength","tag","objectToString","funcTag","genTag","keys","toString","assign","baseTimes","n","iteratee","result","baseHas","baseKeys","nativeKeys","indexKeys","isArray","isString","isArguments","String","isPrototype","Ctor","proto","isArrayLikeObject","propertyIsEnumerable","argsTag","isObjectLike","stringTag","isProto","indexes","skipIndexes","func","thisArg","start","FUNC_ERROR_TEXT","nativeMax","toInteger","array","otherArgs","toNumber","INFINITY","sign","MAX_INTEGER","remainder","valueOf","replace","reTrim","isBinary","reIsBinary","reIsOctal","freeParseInt","slice","reIsBadHex","NAN","parseInt","Math","max","_CRSEPSG3857","_CRSEPSG38572","_CRSEPSG3395","_CRSEPSG33952","_CRSEPSG4326","_CRSEPSG43262","_CRSSimple","_CRSSimple2","_CRSProj4","_CRSProj42","CRS","EPSG900913","EPSG3395","EPSG4326","Simple","Proj4","_CRSEarth","_CRSEarth2","_projectionProjectionSphericalMercator","_projectionProjectionSphericalMercator2","_utilTransformation","_utilTransformation2","_EPSG3857","code","projection","transformScale","PI","R","transformation","scale","_CRS","_CRS2","_LatLon","Earth","wrapLon","distance","latlon1","latlon2","accurate","lat1","lat2","a","rad","lat","lon1","lon","lon2","deltaLat","deltaLon","halfDeltaLat","halfDeltaLon","sin","cos","atan2","sqrt","acos","min","pointScale","metresToProjected","metres","projectedToMetres","projectedUnits","metresToWorld","zoom","projectedMetres","scaledMetres","worldToMetres","worldUnits","realMetres","_LatLon2","_Point","_Point2","_utilWrapNum","_utilWrapNum2","scaleFactor","_transform","untransformedPoint","untransform","pow","log","LN2","getProjectedBounds","infinite","b","bounds","s","transform","wrapLatLon","wrapLat","alt","isNaN","Error","lng","y","round","clone","_add","wrapNum","range","includeMax","d","SphericalMercator","MAX_LATITUDE","ECC","ECC2","atan","exp","k","sinLat","sinLat2","cosLat","v","h","Transformation","_a","_b","_c","_d","_projectionProjectionMercator","_projectionProjectionMercator2","_EPSG3395","Mercator","R_MINOR","r","tmp","e","con","ts","tan","phi","dphi","abs","_projectionProjectionLatLon","_projectionProjectionLatLon2","_EPSG4326","ProjectionLatLon","m1","m2","m3","m4","p1","p2","p3","latlen","lonlen","_Simple","dx","dy","_projectionProjectionProj4","_projectionProjectionProj42","_Proj4","def","diffX","diffY","halfX","halfY","scaleX","scaleY","offsetX","offsetY","_proj4","_proj42","proj","forward","inverse","bottomLeft","topRight","_three","_three2","_Scene","_Scene2","_Renderer","_Renderer2","_Camera","_Camera2","Engine","container","console","_renderer","Clock","_frustum","Frustum","render","scene","Scene","fog","Fog","renderer","WebGLRenderer","antialias","setClearColor","color","gammaInput","gammaOutput","appendChild","domElement","updateSize","setSize","clientWidth","clientHeight","addEventListener","camera","PerspectiveCamera","position","aspect","updateProjectionMatrix","_ControlsOrbit","_ControlsOrbit2","Orbit","_threeOrbitControls","_threeOrbitControls2","_OrbitControls","_this","_world","center","animate","pointDelta","metresDelta","angle","angleDelta","noZoom","world","addControls","maxPolarAngle","THREE","OrbitConstraint","Vector3","minDistance","maxDistance","Infinity","minZoom","maxZoom","minPolarAngle","minAzimuthAngle","maxAzimuthAngle","enableDamping","dampingFactor","theta","scope","EPS","phiDelta","thetaDelta","panOffset","zoomChanged","getPolarAngle","getAzimuthalAngle","rotateLeft","rotateUp","panLeft","te","matrix","elements","adjDist","set","normalize","multiplyScalar","panUp","pan","deltaX","deltaY","screenWidth","screenHeight","offset","sub","targetDistance","fov","OrthographicCamera","right","left","top","bottom","warn","dollyIn","dollyScale","dollyOut","quat","Quaternion","setFromUnitVectors","up","quatInverse","lastPosition","lastQuaternion","copy","applyQuaternion","radius","lookAt","distanceToSquared","dot","quaternion","OrbitControls","element","body","constraint","getAutoRotationAngle","autoRotateSpeed","getZoomScale","zoomSpeed","onMouseDown","enabled","preventDefault","button","mouseButtons","ORBIT","enableRotate","state","STATE","ROTATE","rotateStart","clientX","clientY","ZOOM","enableZoom","DOLLY","dollyStart","PAN","enablePan","panStart","NONE","onMouseMove","onMouseUp","dispatchEvent","startEvent","rotateEnd","rotateDelta","subVectors","rotateSpeed","dollyEnd","dollyDelta","panEnd","panDelta","removeEventListener","endEvent","onMouseWheel","stopPropagation","wheelDelta","detail","onKeyDown","enableKeys","keyCode","UP","keyPanSpeed","BOTTOM","LEFT","RIGHT","touchstart","touches","TOUCH_ROTATE","pageX","pageY","TOUCH_DOLLY","TOUCH_PAN","touchmove","touchend","contextmenu","autoRotate","MOUSE","MIDDLE","Vector2","target0","position0","zoom0","changeEvent","reset","dispose","EventDispatcher","noRotate","noPan","noKeys","staticMoving","dynamicDampingFactor","_Layer2","_Layer3","_Layer","_initLights","_initGrid","directionalLight","DirectionalLight","intesity","directionalLight2","helper","DirectionalLightHelper","helper2","size","step","gridHelper","GridHelper","_engineScene","Layer","Object3D","addLayer","_onAdd","_Surface","_Surface2","_minLOD","_maxLOD","setTimeout","_calculateLOD","_this2","getCamera","projScreenMatrix","Matrix4","multiplyMatrices","projectionMatrix","matrixWorldInverse","setFromMatrix","surface","intersectsBox","Box3","_this3","_updateFrustum","checkList","_checklist","_divide","_surfaceInFrustum","mesh","currentItem","quadkey","count","_screenSpaceError","splice","minDepth","maxDepth","quality","dist","error","side","r2d","loader","TextureLoader","setCrossOrigin","Surface","tile","_quadkeyToTile","_tileBounds","_boundsToCenter","_createMesh","canvas","createElement","width","height","getContext","font","fillStyle","fillText","texture","Texture","magFilter","LinearFilter","minFilter","LinearMipMapLinearFilter","anisotropy","needsUpdate","material","MeshBasicMaterial","map","transparent","geom","PlaneGeometry","Mesh","rotation","localMesh","box","BoxHelper","_createDebugMesh","mask","q","boundsWGS84","_tileBoundsWGS84","sw","ne","_tile2lon","w","_tile2lat"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,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EAAGC,GACX,MAAOD,GAAIqJ,KAAKgF,IAAI,EAAGpO,GAAK,IAAM,OpCkvJjChD,IAAK,YACL3C,MoChvJM,SAAC8U,EAAGnP,GACX,GAAIsG,GAAI8C,KAAK4B,GAAK,EAAI5B,KAAK4B,GAAKmE,EAAI/F,KAAKgF,IAAI,EAAGpO,EAChD,OAAOgkB,GAAM5a,KAAK2G,KAAK,IAAO3G,KAAK4G,IAAI1J,GAAK8C,KAAK4G,KAAK1J,SA/JpD8d,UpCs5JLvrB,GAAQ,WoClvJM,SAASyqB,EAASnM,GAC/B,MAAO,IAAIiN,GAAQd,EAASnM,IpCsvJ7Bre,EAAOD,QAAUA,EAAQ","file":"vizicities.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"proj4\"), require(\"THREE\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"proj4\", \"THREE\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VIZI\"] = factory(require(\"proj4\"), require(\"THREE\"));\n\telse\n\t\troot[\"VIZI\"] = factory(root[\"proj4\"], root[\"THREE\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_22__, __WEBPACK_EXTERNAL_MODULE_24__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"proj4\"), require(\"THREE\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"proj4\", \"THREE\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VIZI\"] = factory(require(\"proj4\"), require(\"THREE\"));\n\telse\n\t\troot[\"VIZI\"] = factory(root[\"proj4\"], root[\"THREE\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_22__, __WEBPACK_EXTERNAL_MODULE_24__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _World = __webpack_require__(1);\n\t\n\tvar _World2 = _interopRequireDefault(_World);\n\t\n\tvar _controlsIndex = __webpack_require__(28);\n\t\n\tvar _controlsIndex2 = _interopRequireDefault(_controlsIndex);\n\t\n\tvar _layerEnvironmentEnvironmentLayer = __webpack_require__(31);\n\t\n\tvar _layerEnvironmentEnvironmentLayer2 = _interopRequireDefault(_layerEnvironmentEnvironmentLayer);\n\t\n\tvar _layerTileGridLayer = __webpack_require__(33);\n\t\n\tvar _layerTileGridLayer2 = _interopRequireDefault(_layerTileGridLayer);\n\t\n\tvar _geoPoint = __webpack_require__(11);\n\t\n\tvar _geoPoint2 = _interopRequireDefault(_geoPoint);\n\t\n\tvar _geoLatLon = __webpack_require__(10);\n\t\n\tvar _geoLatLon2 = _interopRequireDefault(_geoLatLon);\n\t\n\tvar VIZI = {\n\t version: '0.3',\n\t\n\t // Public API\n\t World: _World2['default'],\n\t Controls: _controlsIndex2['default'],\n\t EnvironmentLayer: _layerEnvironmentEnvironmentLayer2['default'],\n\t GridLayer: _layerTileGridLayer2['default'],\n\t Point: _geoPoint2['default'],\n\t LatLon: _geoLatLon2['default']\n\t};\n\t\n\texports['default'] = VIZI;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _eventemitter3 = __webpack_require__(2);\n\t\n\tvar _eventemitter32 = _interopRequireDefault(_eventemitter3);\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _geoCRSIndex = __webpack_require__(6);\n\t\n\tvar _geoCRSIndex2 = _interopRequireDefault(_geoCRSIndex);\n\t\n\tvar _geoPoint = __webpack_require__(11);\n\t\n\tvar _geoPoint2 = _interopRequireDefault(_geoPoint);\n\t\n\tvar _geoLatLon = __webpack_require__(10);\n\t\n\tvar _geoLatLon2 = _interopRequireDefault(_geoLatLon);\n\t\n\tvar _engineEngine = __webpack_require__(23);\n\t\n\tvar _engineEngine2 = _interopRequireDefault(_engineEngine);\n\t\n\t// Pretty much any event someone using ViziCities would need will be emitted or\n\t// proxied by World (eg. render events, etc)\n\t\n\tvar World = (function (_EventEmitter) {\n\t _inherits(World, _EventEmitter);\n\t\n\t function World(domId, options) {\n\t _classCallCheck(this, World);\n\t\n\t _get(Object.getPrototypeOf(World.prototype), 'constructor', this).call(this);\n\t\n\t var defaults = {\n\t crs: _geoCRSIndex2['default'].EPSG3857\n\t };\n\t\n\t this.options = (0, _lodashAssign2['default'])(defaults, options);\n\t\n\t this._layers = [];\n\t this._controls = [];\n\t\n\t this._initContainer(domId);\n\t this._initEngine();\n\t this._initEvents();\n\t\n\t // Kick off the update and render loop\n\t this._update();\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t _createClass(World, [{\n\t key: '_initContainer',\n\t value: function _initContainer(domId) {\n\t this._container = document.getElementById(domId);\n\t }\n\t }, {\n\t key: '_initEngine',\n\t value: function _initEngine() {\n\t this._engine = (0, _engineEngine2['default'])(this._container);\n\t\n\t // Engine events\n\t //\n\t // Consider proxying these through events on World for public access\n\t // this._engine.on('preRender', () => {});\n\t // this._engine.on('postRender', () => {});\n\t }\n\t }, {\n\t key: '_initEvents',\n\t value: function _initEvents() {\n\t this.on('controlsMoveEnd', this._onControlsMoveEnd);\n\t }\n\t }, {\n\t key: '_onControlsMoveEnd',\n\t value: function _onControlsMoveEnd(point) {\n\t var _point = (0, _geoPoint2['default'])(point.x, point.z);\n\t this._resetView(this.pointToLatLon(_point));\n\t }\n\t\n\t // Reset world view\n\t }, {\n\t key: '_resetView',\n\t value: function _resetView(latlon) {\n\t this.emit('preResetView');\n\t\n\t this._moveStart();\n\t this._move(latlon);\n\t this._moveEnd();\n\t\n\t this.emit('postResetView');\n\t }\n\t }, {\n\t key: '_moveStart',\n\t value: function _moveStart() {\n\t this.emit('moveStart');\n\t }\n\t }, {\n\t key: '_move',\n\t value: function _move(latlon) {\n\t this._lastPosition = latlon;\n\t this.emit('move', latlon);\n\t }\n\t }, {\n\t key: '_moveEnd',\n\t value: function _moveEnd() {\n\t this.emit('moveEnd');\n\t }\n\t }, {\n\t key: '_update',\n\t value: function _update() {\n\t var delta = this._engine.clock.getDelta();\n\t\n\t // Once _update is called it will run forever, for now\n\t window.requestAnimationFrame(this._update.bind(this));\n\t\n\t // Update controls\n\t this._controls.forEach(function (controls) {\n\t controls.update();\n\t });\n\t\n\t this.emit('preUpdate');\n\t this._engine.update(delta);\n\t this.emit('postUpdate');\n\t }\n\t\n\t // Set world view\n\t }, {\n\t key: 'setView',\n\t value: function setView(latlon) {\n\t // Store initial geographic coordinate for the [0,0,0] world position\n\t //\n\t // The origin point doesn't move in three.js / 3D space so only set it once\n\t // here instead of every time _resetView is called\n\t //\n\t // If it was updated every time then coorindates would shift over time and\n\t // would be out of place / context with previously-placed points (0,0 would\n\t // refer to a different point each time)\n\t this._originLatlon = latlon;\n\t this._originPoint = this.project(latlon);\n\t\n\t this._resetView(latlon);\n\t return this;\n\t }\n\t\n\t // Return world geographic position\n\t }, {\n\t key: 'getPosition',\n\t value: function getPosition() {\n\t return this._lastPosition;\n\t }\n\t\n\t // Transform geographic coordinate to world point\n\t //\n\t // This doesn't take into account the origin offset\n\t //\n\t // For example, this takes a geographic coordinate and returns a point\n\t // relative to the origin point of the projection (not the world)\n\t }, {\n\t key: 'project',\n\t value: function project(latlon) {\n\t return this.options.crs.latLonToPoint((0, _geoLatLon2['default'])(latlon));\n\t }\n\t\n\t // Transform world point to geographic coordinate\n\t //\n\t // This doesn't take into account the origin offset\n\t //\n\t // For example, this takes a point relative to the origin point of the\n\t // projection (not the world) and returns a geographic coordinate\n\t }, {\n\t key: 'unproject',\n\t value: function unproject(point) {\n\t return this.options.crs.pointToLatLon((0, _geoPoint2['default'])(point));\n\t }\n\t\n\t // Takes into account the origin offset\n\t //\n\t // For example, this takes a geographic coordinate and returns a point\n\t // relative to the three.js / 3D origin (0,0)\n\t }, {\n\t key: 'latLonToPoint',\n\t value: function latLonToPoint(latlon) {\n\t var projectedPoint = this.project((0, _geoLatLon2['default'])(latlon));\n\t return projectedPoint._subtract(this._originPoint);\n\t }\n\t\n\t // Takes into account the origin offset\n\t //\n\t // For example, this takes a point relative to the three.js / 3D origin (0,0)\n\t // and returns the exact geographic coordinate at that point\n\t }, {\n\t key: 'pointToLatLon',\n\t value: function pointToLatLon(point) {\n\t var projectedPoint = (0, _geoPoint2['default'])(point).add(this._originPoint);\n\t return this.unproject(projectedPoint);\n\t }\n\t\n\t // Unsure if it's a good idea to expose this here for components like\n\t // GridLayer to use (eg. to keep track of a frustum)\n\t }, {\n\t key: 'getCamera',\n\t value: function getCamera() {\n\t return this._engine._camera;\n\t }\n\t }, {\n\t key: 'addLayer',\n\t value: function addLayer(layer) {\n\t layer._addToWorld(this);\n\t\n\t this._layers.push(layer);\n\t\n\t // Could move this into Layer but it'll do here for now\n\t this._engine._scene.add(layer._layer);\n\t\n\t this.emit('layerAdded', layer);\n\t return this;\n\t }\n\t\n\t // Remove layer and perform clean up operations\n\t }, {\n\t key: 'removeLayer',\n\t value: function removeLayer(layer) {}\n\t }, {\n\t key: 'addControls',\n\t value: function addControls(controls) {\n\t controls._addToWorld(this);\n\t\n\t this._controls.push(controls);\n\t\n\t this.emit('controlsAdded', controls);\n\t return this;\n\t }\n\t }, {\n\t key: 'removeControls',\n\t value: function removeControls(controls) {}\n\t }]);\n\t\n\t return World;\n\t})(_eventemitter32['default']);\n\t\n\texports['default'] = function (domId, options) {\n\t return new World(domId, options);\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t//\n\t// We store our EE objects in a plain object whose properties are event names.\n\t// If `Object.create(null)` is not supported we prefix the event names with a\n\t// `~` to make sure that the built-in object properties are not overridden or\n\t// used as an attack vector.\n\t// We also assume that `Object.create(null)` is available when the event name\n\t// is an ES6 Symbol.\n\t//\n\tvar prefix = typeof Object.create !== 'function' ? '~' : false;\n\t\n\t/**\n\t * Representation of a single EventEmitter function.\n\t *\n\t * @param {Function} fn Event handler to be called.\n\t * @param {Mixed} context Context for function execution.\n\t * @param {Boolean} once Only emit once\n\t * @api private\n\t */\n\tfunction EE(fn, context, once) {\n\t this.fn = fn;\n\t this.context = context;\n\t this.once = once || false;\n\t}\n\t\n\t/**\n\t * Minimal EventEmitter interface that is molded against the Node.js\n\t * EventEmitter interface.\n\t *\n\t * @constructor\n\t * @api public\n\t */\n\tfunction EventEmitter() { /* Nothing to set */ }\n\t\n\t/**\n\t * Holds the assigned EventEmitters by name.\n\t *\n\t * @type {Object}\n\t * @private\n\t */\n\tEventEmitter.prototype._events = undefined;\n\t\n\t/**\n\t * Return a list of assigned event listeners.\n\t *\n\t * @param {String} event The events that should be listed.\n\t * @param {Boolean} exists We only need to know if there are listeners.\n\t * @returns {Array|Boolean}\n\t * @api public\n\t */\n\tEventEmitter.prototype.listeners = function listeners(event, exists) {\n\t var evt = prefix ? prefix + event : event\n\t , available = this._events && this._events[evt];\n\t\n\t if (exists) return !!available;\n\t if (!available) return [];\n\t if (available.fn) return [available.fn];\n\t\n\t for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n\t ee[i] = available[i].fn;\n\t }\n\t\n\t return ee;\n\t};\n\t\n\t/**\n\t * Emit an event to all registered event listeners.\n\t *\n\t * @param {String} event The name of the event.\n\t * @returns {Boolean} Indication if we've emitted an event.\n\t * @api public\n\t */\n\tEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n\t var evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events || !this._events[evt]) return false;\n\t\n\t var listeners = this._events[evt]\n\t , len = arguments.length\n\t , args\n\t , i;\n\t\n\t if ('function' === typeof listeners.fn) {\n\t if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\t\n\t switch (len) {\n\t case 1: return listeners.fn.call(listeners.context), true;\n\t case 2: return listeners.fn.call(listeners.context, a1), true;\n\t case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n\t case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n\t case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n\t case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n\t }\n\t\n\t for (i = 1, args = new Array(len -1); i < len; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t\n\t listeners.fn.apply(listeners.context, args);\n\t } else {\n\t var length = listeners.length\n\t , j;\n\t\n\t for (i = 0; i < length; i++) {\n\t if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\t\n\t switch (len) {\n\t case 1: listeners[i].fn.call(listeners[i].context); break;\n\t case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n\t case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n\t default:\n\t if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n\t args[j - 1] = arguments[j];\n\t }\n\t\n\t listeners[i].fn.apply(listeners[i].context, args);\n\t }\n\t }\n\t }\n\t\n\t return true;\n\t};\n\t\n\t/**\n\t * Register a new EventListener for the given event.\n\t *\n\t * @param {String} event Name of the event.\n\t * @param {Functon} fn Callback function.\n\t * @param {Mixed} context The context of the function.\n\t * @api public\n\t */\n\tEventEmitter.prototype.on = function on(event, fn, context) {\n\t var listener = new EE(fn, context || this)\n\t , evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events) this._events = prefix ? {} : Object.create(null);\n\t if (!this._events[evt]) this._events[evt] = listener;\n\t else {\n\t if (!this._events[evt].fn) this._events[evt].push(listener);\n\t else this._events[evt] = [\n\t this._events[evt], listener\n\t ];\n\t }\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Add an EventListener that's only called once.\n\t *\n\t * @param {String} event Name of the event.\n\t * @param {Function} fn Callback function.\n\t * @param {Mixed} context The context of the function.\n\t * @api public\n\t */\n\tEventEmitter.prototype.once = function once(event, fn, context) {\n\t var listener = new EE(fn, context || this, true)\n\t , evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events) this._events = prefix ? {} : Object.create(null);\n\t if (!this._events[evt]) this._events[evt] = listener;\n\t else {\n\t if (!this._events[evt].fn) this._events[evt].push(listener);\n\t else this._events[evt] = [\n\t this._events[evt], listener\n\t ];\n\t }\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Remove event listeners.\n\t *\n\t * @param {String} event The event we want to remove.\n\t * @param {Function} fn The listener that we need to find.\n\t * @param {Mixed} context Only remove listeners matching this context.\n\t * @param {Boolean} once Only remove once listeners.\n\t * @api public\n\t */\n\tEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n\t var evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events || !this._events[evt]) return this;\n\t\n\t var listeners = this._events[evt]\n\t , events = [];\n\t\n\t if (fn) {\n\t if (listeners.fn) {\n\t if (\n\t listeners.fn !== fn\n\t || (once && !listeners.once)\n\t || (context && listeners.context !== context)\n\t ) {\n\t events.push(listeners);\n\t }\n\t } else {\n\t for (var i = 0, length = listeners.length; i < length; i++) {\n\t if (\n\t listeners[i].fn !== fn\n\t || (once && !listeners[i].once)\n\t || (context && listeners[i].context !== context)\n\t ) {\n\t events.push(listeners[i]);\n\t }\n\t }\n\t }\n\t }\n\t\n\t //\n\t // Reset the array, or remove it completely if we have no more listeners.\n\t //\n\t if (events.length) {\n\t this._events[evt] = events.length === 1 ? events[0] : events;\n\t } else {\n\t delete this._events[evt];\n\t }\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Remove all listeners or only the listeners for the specified event.\n\t *\n\t * @param {String} event The event want to remove all listeners for.\n\t * @api public\n\t */\n\tEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n\t if (!this._events) return this;\n\t\n\t if (event) delete this._events[prefix ? prefix + event : event];\n\t else this._events = prefix ? {} : Object.create(null);\n\t\n\t return this;\n\t};\n\t\n\t//\n\t// Alias methods names because people roll like that.\n\t//\n\tEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\tEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\t\n\t//\n\t// This function doesn't apply anymore.\n\t//\n\tEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n\t return this;\n\t};\n\t\n\t//\n\t// Expose the prefix.\n\t//\n\tEventEmitter.prefixed = prefix;\n\t\n\t//\n\t// Expose the module.\n\t//\n\tif (true) {\n\t module.exports = EventEmitter;\n\t}\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/**\n\t * lodash 4.0.2 (Custom Build) \n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright 2012-2016 The Dojo Foundation \n\t * Based on Underscore.js 1.8.3 \n\t * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t * Available under MIT license \n\t */\n\tvar keys = __webpack_require__(4),\n\t rest = __webpack_require__(5);\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar MAX_SAFE_INTEGER = 9007199254740991;\n\t\n\t/** `Object#toString` result references. */\n\tvar funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]';\n\t\n\t/** Used to detect unsigned integer values. */\n\tvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\t\n\t/**\n\t * Checks if `value` is a valid array-like index.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n\t * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n\t */\n\tfunction isIndex(value, length) {\n\t value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n\t length = length == null ? MAX_SAFE_INTEGER : length;\n\t return value > -1 && value % 1 == 0 && value < length;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/**\n\t * Assigns `value` to `key` of `object` if the existing value is not equivalent\n\t * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n\t * for equality comparisons.\n\t *\n\t * @private\n\t * @param {Object} object The object to modify.\n\t * @param {string} key The key of the property to assign.\n\t * @param {*} value The value to assign.\n\t */\n\tfunction assignValue(object, key, value) {\n\t var objValue = object[key];\n\t if ((!eq(objValue, value) ||\n\t (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||\n\t (value === undefined && !(key in object))) {\n\t object[key] = value;\n\t }\n\t}\n\t\n\t/**\n\t * The base implementation of `_.property` without support for deep paths.\n\t *\n\t * @private\n\t * @param {string} key The key of the property to get.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction baseProperty(key) {\n\t return function(object) {\n\t return object == null ? undefined : object[key];\n\t };\n\t}\n\t\n\t/**\n\t * Copies properties of `source` to `object`.\n\t *\n\t * @private\n\t * @param {Object} source The object to copy properties from.\n\t * @param {Array} props The property names to copy.\n\t * @param {Object} [object={}] The object to copy properties to.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction copyObject(source, props, object) {\n\t return copyObjectWith(source, props, object);\n\t}\n\t\n\t/**\n\t * This function is like `copyObject` except that it accepts a function to\n\t * customize copied values.\n\t *\n\t * @private\n\t * @param {Object} source The object to copy properties from.\n\t * @param {Array} props The property names to copy.\n\t * @param {Object} [object={}] The object to copy properties to.\n\t * @param {Function} [customizer] The function to customize copied values.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction copyObjectWith(source, props, object, customizer) {\n\t object || (object = {});\n\t\n\t var index = -1,\n\t length = props.length;\n\t\n\t while (++index < length) {\n\t var key = props[index],\n\t newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key];\n\t\n\t assignValue(object, key, newValue);\n\t }\n\t return object;\n\t}\n\t\n\t/**\n\t * Creates a function like `_.assign`.\n\t *\n\t * @private\n\t * @param {Function} assigner The function to assign values.\n\t * @returns {Function} Returns the new assigner function.\n\t */\n\tfunction createAssigner(assigner) {\n\t return rest(function(object, sources) {\n\t var index = -1,\n\t length = sources.length,\n\t customizer = length > 1 ? sources[length - 1] : undefined,\n\t guard = length > 2 ? sources[2] : undefined;\n\t\n\t customizer = typeof customizer == 'function' ? (length--, customizer) : undefined;\n\t if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n\t customizer = length < 3 ? undefined : customizer;\n\t length = 1;\n\t }\n\t object = Object(object);\n\t while (++index < length) {\n\t var source = sources[index];\n\t if (source) {\n\t assigner(object, source, index, customizer);\n\t }\n\t }\n\t return object;\n\t });\n\t}\n\t\n\t/**\n\t * Gets the \"length\" property value of `object`.\n\t *\n\t * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n\t * that affects Safari on at least iOS 8.1-8.3 ARM64.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {*} Returns the \"length\" value.\n\t */\n\tvar getLength = baseProperty('length');\n\t\n\t/**\n\t * Checks if the provided arguments are from an iteratee call.\n\t *\n\t * @private\n\t * @param {*} value The potential iteratee value argument.\n\t * @param {*} index The potential iteratee index or key argument.\n\t * @param {*} object The potential iteratee object argument.\n\t * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n\t */\n\tfunction isIterateeCall(value, index, object) {\n\t if (!isObject(object)) {\n\t return false;\n\t }\n\t var type = typeof index;\n\t if (type == 'number'\n\t ? (isArrayLike(object) && isIndex(index, object.length))\n\t : (type == 'string' && index in object)) {\n\t return eq(object[index], value);\n\t }\n\t return false;\n\t}\n\t\n\t/**\n\t * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n\t * comparison between two values to determine if they are equivalent.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to compare.\n\t * @param {*} other The other value to compare.\n\t * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n\t * @example\n\t *\n\t * var object = { 'user': 'fred' };\n\t * var other = { 'user': 'fred' };\n\t *\n\t * _.eq(object, object);\n\t * // => true\n\t *\n\t * _.eq(object, other);\n\t * // => false\n\t *\n\t * _.eq('a', 'a');\n\t * // => true\n\t *\n\t * _.eq('a', Object('a'));\n\t * // => false\n\t *\n\t * _.eq(NaN, NaN);\n\t * // => true\n\t */\n\tfunction eq(value, other) {\n\t return value === other || (value !== value && other !== other);\n\t}\n\t\n\t/**\n\t * Checks if `value` is array-like. A value is considered array-like if it's\n\t * not a function and has a `value.length` that's an integer greater than or\n\t * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @type Function\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n\t * @example\n\t *\n\t * _.isArrayLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLike(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLike('abc');\n\t * // => true\n\t *\n\t * _.isArrayLike(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLike(value) {\n\t return value != null &&\n\t !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8 which returns 'object' for typed array constructors, and\n\t // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like length.\n\t *\n\t * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n\t * @example\n\t *\n\t * _.isLength(3);\n\t * // => true\n\t *\n\t * _.isLength(Number.MIN_VALUE);\n\t * // => false\n\t *\n\t * _.isLength(Infinity);\n\t * // => false\n\t *\n\t * _.isLength('3');\n\t * // => false\n\t */\n\tfunction isLength(value) {\n\t return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n\t * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Assigns own enumerable properties of source objects to the destination\n\t * object. Source objects are applied from left to right. Subsequent sources\n\t * overwrite property assignments of previous sources.\n\t *\n\t * **Note:** This method mutates `object` and is loosely based on\n\t * [`Object.assign`](https://mdn.io/Object/assign).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The destination object.\n\t * @param {...Object} [sources] The source objects.\n\t * @returns {Object} Returns `object`.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.c = 3;\n\t * }\n\t *\n\t * function Bar() {\n\t * this.e = 5;\n\t * }\n\t *\n\t * Foo.prototype.d = 4;\n\t * Bar.prototype.f = 6;\n\t *\n\t * _.assign({ 'a': 1 }, new Foo, new Bar);\n\t * // => { 'a': 1, 'c': 3, 'e': 5 }\n\t */\n\tvar assign = createAssigner(function(object, source) {\n\t copyObject(source, keys(source), object);\n\t});\n\t\n\tmodule.exports = assign;\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t/**\n\t * lodash 4.0.2 (Custom Build) \n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright 2012-2016 The Dojo Foundation \n\t * Based on Underscore.js 1.8.3 \n\t * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t * Available under MIT license \n\t */\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar MAX_SAFE_INTEGER = 9007199254740991;\n\t\n\t/** `Object#toString` result references. */\n\tvar argsTag = '[object Arguments]',\n\t funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]',\n\t stringTag = '[object String]';\n\t\n\t/** Used to detect unsigned integer values. */\n\tvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\t\n\t/**\n\t * The base implementation of `_.times` without support for iteratee shorthands\n\t * or max array length checks.\n\t *\n\t * @private\n\t * @param {number} n The number of times to invoke `iteratee`.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Array} Returns the array of results.\n\t */\n\tfunction baseTimes(n, iteratee) {\n\t var index = -1,\n\t result = Array(n);\n\t\n\t while (++index < n) {\n\t result[index] = iteratee(index);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like index.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n\t * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n\t */\n\tfunction isIndex(value, length) {\n\t value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n\t length = length == null ? MAX_SAFE_INTEGER : length;\n\t return value > -1 && value % 1 == 0 && value < length;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/** Built-in value references. */\n\tvar getPrototypeOf = Object.getPrototypeOf,\n\t propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeKeys = Object.keys;\n\t\n\t/**\n\t * The base implementation of `_.has` without support for deep paths.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {Array|string} key The key to check.\n\t * @returns {boolean} Returns `true` if `key` exists, else `false`.\n\t */\n\tfunction baseHas(object, key) {\n\t // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,\n\t // that are composed entirely of index properties, return `false` for\n\t // `hasOwnProperty` checks of them.\n\t return hasOwnProperty.call(object, key) ||\n\t (typeof object == 'object' && key in object && getPrototypeOf(object) === null);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.keys` which doesn't skip the constructor\n\t * property of prototypes or treat sparse arrays as dense.\n\t *\n\t * @private\n\t * @type Function\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction baseKeys(object) {\n\t return nativeKeys(Object(object));\n\t}\n\t\n\t/**\n\t * The base implementation of `_.property` without support for deep paths.\n\t *\n\t * @private\n\t * @param {string} key The key of the property to get.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction baseProperty(key) {\n\t return function(object) {\n\t return object == null ? undefined : object[key];\n\t };\n\t}\n\t\n\t/**\n\t * Gets the \"length\" property value of `object`.\n\t *\n\t * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n\t * that affects Safari on at least iOS 8.1-8.3 ARM64.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {*} Returns the \"length\" value.\n\t */\n\tvar getLength = baseProperty('length');\n\t\n\t/**\n\t * Creates an array of index keys for `object` values of arrays,\n\t * `arguments` objects, and strings, otherwise `null` is returned.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array|null} Returns index keys, else `null`.\n\t */\n\tfunction indexKeys(object) {\n\t var length = object ? object.length : undefined;\n\t if (isLength(length) &&\n\t (isArray(object) || isString(object) || isArguments(object))) {\n\t return baseTimes(length, String);\n\t }\n\t return null;\n\t}\n\t\n\t/**\n\t * Checks if `value` is likely a prototype object.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n\t */\n\tfunction isPrototype(value) {\n\t var Ctor = value && value.constructor,\n\t proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\t\n\t return value === proto;\n\t}\n\t\n\t/**\n\t * Checks if `value` is likely an `arguments` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isArguments(function() { return arguments; }());\n\t * // => true\n\t *\n\t * _.isArguments([1, 2, 3]);\n\t * // => false\n\t */\n\tfunction isArguments(value) {\n\t // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n\t return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n\t (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as an `Array` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @type Function\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isArray([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArray(document.body.children);\n\t * // => false\n\t *\n\t * _.isArray('abc');\n\t * // => false\n\t *\n\t * _.isArray(_.noop);\n\t * // => false\n\t */\n\tvar isArray = Array.isArray;\n\t\n\t/**\n\t * Checks if `value` is array-like. A value is considered array-like if it's\n\t * not a function and has a `value.length` that's an integer greater than or\n\t * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @type Function\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n\t * @example\n\t *\n\t * _.isArrayLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLike(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLike('abc');\n\t * // => true\n\t *\n\t * _.isArrayLike(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLike(value) {\n\t return value != null &&\n\t !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));\n\t}\n\t\n\t/**\n\t * This method is like `_.isArrayLike` except that it also checks if `value`\n\t * is an object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @type Function\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n\t * @example\n\t *\n\t * _.isArrayLikeObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLikeObject(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLikeObject('abc');\n\t * // => false\n\t *\n\t * _.isArrayLikeObject(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLikeObject(value) {\n\t return isObjectLike(value) && isArrayLike(value);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8 which returns 'object' for typed array constructors, and\n\t // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like length.\n\t *\n\t * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n\t * @example\n\t *\n\t * _.isLength(3);\n\t * // => true\n\t *\n\t * _.isLength(Number.MIN_VALUE);\n\t * // => false\n\t *\n\t * _.isLength(Infinity);\n\t * // => false\n\t *\n\t * _.isLength('3');\n\t * // => false\n\t */\n\tfunction isLength(value) {\n\t return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n\t * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\tfunction isObjectLike(value) {\n\t return !!value && typeof value == 'object';\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `String` primitive or object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isString('abc');\n\t * // => true\n\t *\n\t * _.isString(1);\n\t * // => false\n\t */\n\tfunction isString(value) {\n\t return typeof value == 'string' ||\n\t (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n\t}\n\t\n\t/**\n\t * Creates an array of the own enumerable property names of `object`.\n\t *\n\t * **Note:** Non-object values are coerced to objects. See the\n\t * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n\t * for more details.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.keys(new Foo);\n\t * // => ['a', 'b'] (iteration order is not guaranteed)\n\t *\n\t * _.keys('hi');\n\t * // => ['0', '1']\n\t */\n\tfunction keys(object) {\n\t var isProto = isPrototype(object);\n\t if (!(isProto || isArrayLike(object))) {\n\t return baseKeys(object);\n\t }\n\t var indexes = indexKeys(object),\n\t skipIndexes = !!indexes,\n\t result = indexes || [],\n\t length = result.length;\n\t\n\t for (var key in object) {\n\t if (baseHas(object, key) &&\n\t !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n\t !(isProto && key == 'constructor')) {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\tmodule.exports = keys;\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t/**\n\t * lodash 4.0.1 (Custom Build) \n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright 2012-2016 The Dojo Foundation \n\t * Based on Underscore.js 1.8.3 \n\t * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t * Available under MIT license \n\t */\n\t\n\t/** Used as the `TypeError` message for \"Functions\" methods. */\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar INFINITY = 1 / 0,\n\t MAX_INTEGER = 1.7976931348623157e+308,\n\t NAN = 0 / 0;\n\t\n\t/** `Object#toString` result references. */\n\tvar funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]';\n\t\n\t/** Used to match leading and trailing whitespace. */\n\tvar reTrim = /^\\s+|\\s+$/g;\n\t\n\t/** Used to detect bad signed hexadecimal string values. */\n\tvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\t\n\t/** Used to detect binary string values. */\n\tvar reIsBinary = /^0b[01]+$/i;\n\t\n\t/** Used to detect octal string values. */\n\tvar reIsOctal = /^0o[0-7]+$/i;\n\t\n\t/** Built-in method references without a dependency on `root`. */\n\tvar freeParseInt = parseInt;\n\t\n\t/**\n\t * A faster alternative to `Function#apply`, this function invokes `func`\n\t * with the `this` binding of `thisArg` and the arguments of `args`.\n\t *\n\t * @private\n\t * @param {Function} func The function to invoke.\n\t * @param {*} thisArg The `this` binding of `func`.\n\t * @param {...*} args The arguments to invoke `func` with.\n\t * @returns {*} Returns the result of `func`.\n\t */\n\tfunction apply(func, thisArg, args) {\n\t var length = args.length;\n\t switch (length) {\n\t case 0: return func.call(thisArg);\n\t case 1: return func.call(thisArg, args[0]);\n\t case 2: return func.call(thisArg, args[0], args[1]);\n\t case 3: return func.call(thisArg, args[0], args[1], args[2]);\n\t }\n\t return func.apply(thisArg, args);\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeMax = Math.max;\n\t\n\t/**\n\t * Creates a function that invokes `func` with the `this` binding of the\n\t * created function and arguments from `start` and beyond provided as an array.\n\t *\n\t * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Function\n\t * @param {Function} func The function to apply a rest parameter to.\n\t * @param {number} [start=func.length-1] The start position of the rest parameter.\n\t * @returns {Function} Returns the new function.\n\t * @example\n\t *\n\t * var say = _.rest(function(what, names) {\n\t * return what + ' ' + _.initial(names).join(', ') +\n\t * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n\t * });\n\t *\n\t * say('hello', 'fred', 'barney', 'pebbles');\n\t * // => 'hello fred, barney, & pebbles'\n\t */\n\tfunction rest(func, start) {\n\t if (typeof func != 'function') {\n\t throw new TypeError(FUNC_ERROR_TEXT);\n\t }\n\t start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);\n\t return function() {\n\t var args = arguments,\n\t index = -1,\n\t length = nativeMax(args.length - start, 0),\n\t array = Array(length);\n\t\n\t while (++index < length) {\n\t array[index] = args[start + index];\n\t }\n\t switch (start) {\n\t case 0: return func.call(this, array);\n\t case 1: return func.call(this, args[0], array);\n\t case 2: return func.call(this, args[0], args[1], array);\n\t }\n\t var otherArgs = Array(start + 1);\n\t index = -1;\n\t while (++index < start) {\n\t otherArgs[index] = args[index];\n\t }\n\t otherArgs[start] = array;\n\t return apply(func, this, otherArgs);\n\t };\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8 which returns 'object' for typed array constructors, and\n\t // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n\t * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Converts `value` to an integer.\n\t *\n\t * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to convert.\n\t * @returns {number} Returns the converted integer.\n\t * @example\n\t *\n\t * _.toInteger(3);\n\t * // => 3\n\t *\n\t * _.toInteger(Number.MIN_VALUE);\n\t * // => 0\n\t *\n\t * _.toInteger(Infinity);\n\t * // => 1.7976931348623157e+308\n\t *\n\t * _.toInteger('3');\n\t * // => 3\n\t */\n\tfunction toInteger(value) {\n\t if (!value) {\n\t return value === 0 ? value : 0;\n\t }\n\t value = toNumber(value);\n\t if (value === INFINITY || value === -INFINITY) {\n\t var sign = (value < 0 ? -1 : 1);\n\t return sign * MAX_INTEGER;\n\t }\n\t var remainder = value % 1;\n\t return value === value ? (remainder ? value - remainder : value) : 0;\n\t}\n\t\n\t/**\n\t * Converts `value` to a number.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to process.\n\t * @returns {number} Returns the number.\n\t * @example\n\t *\n\t * _.toNumber(3);\n\t * // => 3\n\t *\n\t * _.toNumber(Number.MIN_VALUE);\n\t * // => 5e-324\n\t *\n\t * _.toNumber(Infinity);\n\t * // => Infinity\n\t *\n\t * _.toNumber('3');\n\t * // => 3\n\t */\n\tfunction toNumber(value) {\n\t if (isObject(value)) {\n\t var other = isFunction(value.valueOf) ? value.valueOf() : value;\n\t value = isObject(other) ? (other + '') : other;\n\t }\n\t if (typeof value != 'string') {\n\t return value === 0 ? value : +value;\n\t }\n\t value = value.replace(reTrim, '');\n\t var isBinary = reIsBinary.test(value);\n\t return (isBinary || reIsOctal.test(value))\n\t ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n\t : (reIsBadHex.test(value) ? NAN : +value);\n\t}\n\t\n\tmodule.exports = rest;\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _CRSEPSG3857 = __webpack_require__(7);\n\t\n\tvar _CRSEPSG38572 = _interopRequireDefault(_CRSEPSG3857);\n\t\n\tvar _CRSEPSG3395 = __webpack_require__(15);\n\t\n\tvar _CRSEPSG33952 = _interopRequireDefault(_CRSEPSG3395);\n\t\n\tvar _CRSEPSG4326 = __webpack_require__(17);\n\t\n\tvar _CRSEPSG43262 = _interopRequireDefault(_CRSEPSG4326);\n\t\n\tvar _CRSSimple = __webpack_require__(19);\n\t\n\tvar _CRSSimple2 = _interopRequireDefault(_CRSSimple);\n\t\n\tvar _CRSProj4 = __webpack_require__(20);\n\t\n\tvar _CRSProj42 = _interopRequireDefault(_CRSProj4);\n\t\n\tvar CRS = {};\n\t\n\tCRS.EPSG3857 = _CRSEPSG38572['default'];\n\tCRS.EPSG900913 = _CRSEPSG3857.EPSG900913;\n\tCRS.EPSG3395 = _CRSEPSG33952['default'];\n\tCRS.EPSG4326 = _CRSEPSG43262['default'];\n\tCRS.Simple = _CRSSimple2['default'];\n\tCRS.Proj4 = _CRSProj42['default'];\n\t\n\texports['default'] = CRS;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS.EPSG3857 (WGS 84 / Pseudo-Mercator) CRS implementation.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG3857.js\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRSEarth = __webpack_require__(8);\n\t\n\tvar _CRSEarth2 = _interopRequireDefault(_CRSEarth);\n\t\n\tvar _projectionProjectionSphericalMercator = __webpack_require__(13);\n\t\n\tvar _projectionProjectionSphericalMercator2 = _interopRequireDefault(_projectionProjectionSphericalMercator);\n\t\n\tvar _utilTransformation = __webpack_require__(14);\n\t\n\tvar _utilTransformation2 = _interopRequireDefault(_utilTransformation);\n\t\n\tvar _EPSG3857 = {\n\t code: 'EPSG:3857',\n\t projection: _projectionProjectionSphericalMercator2['default'],\n\t\n\t // Work out how to de-dupe this (scoping issue)\n\t transformScale: 1 / (Math.PI * _projectionProjectionSphericalMercator2['default'].R),\n\t\n\t // Scale and transformation inputs changed to account for central origin in\n\t // WebGL, instead of top-left origin used in Leaflet\n\t transformation: (function () {\n\t // TODO: Cannot use this.transformScale due to scope\n\t var scale = 1 / (Math.PI * _projectionProjectionSphericalMercator2['default'].R);\n\t\n\t return new _utilTransformation2['default'](scale, 0, -scale, 0);\n\t })()\n\t};\n\t\n\tvar EPSG3857 = (0, _lodashAssign2['default'])({}, _CRSEarth2['default'], _EPSG3857);\n\t\n\tvar EPSG900913 = (0, _lodashAssign2['default'])({}, EPSG3857, {\n\t code: 'EPSG:900913'\n\t});\n\t\n\texports.EPSG900913 = EPSG900913;\n\texports['default'] = EPSG3857;\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS.Earth is the base class for all CRS representing Earth.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.Earth.js\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRS = __webpack_require__(9);\n\t\n\tvar _CRS2 = _interopRequireDefault(_CRS);\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar Earth = {\n\t wrapLon: [-180, 180],\n\t\n\t R: 6378137,\n\t\n\t // Distance between two geographical points using spherical law of cosines\n\t // approximation or Haversine\n\t //\n\t // See: http://www.movable-type.co.uk/scripts/latlong.html\n\t distance: function distance(latlon1, latlon2, accurate) {\n\t var rad = Math.PI / 180;\n\t\n\t var lat1;\n\t var lat2;\n\t\n\t var a;\n\t\n\t if (!accurate) {\n\t lat1 = latlon1.lat * rad;\n\t lat2 = latlon2.lat * rad;\n\t\n\t a = Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos((latlon2.lon - latlon1.lon) * rad);\n\t\n\t return this.R * Math.acos(Math.min(a, 1));\n\t } else {\n\t lat1 = latlon1.lat * rad;\n\t lat2 = latlon2.lat * rad;\n\t\n\t var lon1 = latlon1.lon * rad;\n\t var lon2 = latlon2.lon * rad;\n\t\n\t var deltaLat = lat2 - lat1;\n\t var deltaLon = lon2 - lon1;\n\t\n\t var halfDeltaLat = deltaLat / 2;\n\t var halfDeltaLon = deltaLon / 2;\n\t\n\t a = Math.sin(halfDeltaLat) * Math.sin(halfDeltaLat) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(halfDeltaLon) * Math.sin(halfDeltaLon);\n\t\n\t var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t\n\t return this.R * c;\n\t }\n\t },\n\t\n\t // Scale factor for converting between real metres and projected metres\n\t //\n\t // projectedMetres = realMetres * pointScale\n\t // realMetres = projectedMetres / pointScale\n\t //\n\t // Defaults to a scale factor of 1 if no calculation method exists\n\t //\n\t // Probably need to run this through the CRS transformation or similar so the\n\t // resulting scale is relative to the dimensions of the world space\n\t // Eg. 1 metre in projected space is likly scaled up or down to some other\n\t // number\n\t pointScale: function pointScale(latlon, accurate) {\n\t return this.projection.pointScale ? this.projection.pointScale(latlon, accurate) : [1, 1];\n\t },\n\t\n\t // Convert real metres to projected units\n\t //\n\t // Latitude scale is chosen because it fluctuates more than longitude\n\t metresToProjected: function metresToProjected(metres, pointScale) {\n\t return metres * pointScale[1];\n\t },\n\t\n\t // Convert projected units to real metres\n\t //\n\t // Latitude scale is chosen because it fluctuates more than longitude\n\t projectedToMetres: function projectedToMetres(projectedUnits, pointScale) {\n\t return projectedUnits / pointScale[1];\n\t },\n\t\n\t // Convert real metres to a value in world (WebGL) units\n\t metresToWorld: function metresToWorld(metres, pointScale, zoom) {\n\t // Transform metres to projected metres using the latitude point scale\n\t //\n\t // Latitude scale is chosen because it fluctuates more than longitude\n\t var projectedMetres = this.metresToProjected(metres, pointScale);\n\t\n\t var scale = this.scale(zoom);\n\t\n\t // Half scale if using zoom as WebGL origin is in the centre, not top left\n\t if (zoom) {\n\t scale /= 2;\n\t }\n\t\n\t // Scale projected metres\n\t var scaledMetres = scale * (this.transformScale * projectedMetres) / pointScale[1];\n\t\n\t return scaledMetres;\n\t },\n\t\n\t // Convert world (WebGL) units to a value in real metres\n\t worldToMetres: function worldToMetres(worldUnits, pointScale, zoom) {\n\t var scale = this.scale(zoom);\n\t\n\t // Half scale if using zoom as WebGL origin is in the centre, not top left\n\t if (zoom) {\n\t scale /= 2;\n\t }\n\t\n\t var projectedUnits = worldUnits / scale / this.transformScale * pointScale[1];\n\t var realMetres = this.projectedToMetres(projectedUnits, pointScale);\n\t\n\t return realMetres;\n\t }\n\t};\n\t\n\texports['default'] = (0, _lodashAssign2['default'])({}, _CRS2['default'], Earth);\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS is the base object for all defined CRS (Coordinate Reference Systems)\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.js\n\t */\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar _Point = __webpack_require__(11);\n\t\n\tvar _Point2 = _interopRequireDefault(_Point);\n\t\n\tvar _utilWrapNum = __webpack_require__(12);\n\t\n\tvar _utilWrapNum2 = _interopRequireDefault(_utilWrapNum);\n\t\n\tvar CRS = {\n\t // Scale factor determines final dimensions of world space\n\t //\n\t // Projection transformation in range -1 to 1 is multiplied by scale factor to\n\t // find final world coordinates\n\t //\n\t // Scale factor can be considered as half the amount of the desired dimension\n\t // for the largest side when transformation is equal to 1 or -1, or as the\n\t // distance between 0 and 1 on the largest side\n\t //\n\t // For example, if you want the world dimensions to be between -1000 and 1000\n\t // then the scale factor will be 1000\n\t scaleFactor: 1000000,\n\t\n\t // Converts geo coords to pixel / WebGL ones\n\t latLonToPoint: function latLonToPoint(latlon, zoom) {\n\t var projectedPoint = this.projection.project(latlon);\n\t var scale = this.scale(zoom);\n\t\n\t // Half scale if using zoom as WebGL origin is in the centre, not top left\n\t if (zoom) {\n\t scale /= 2;\n\t }\n\t\n\t return this.transformation._transform(projectedPoint, scale);\n\t },\n\t\n\t // Converts pixel / WebGL coords to geo coords\n\t pointToLatLon: function pointToLatLon(point, zoom) {\n\t var scale = this.scale(zoom);\n\t\n\t // Half scale if using zoom as WebGL origin is in the centre, not top left\n\t if (zoom) {\n\t scale /= 2;\n\t }\n\t\n\t var untransformedPoint = this.transformation.untransform(point, scale);\n\t\n\t return this.projection.unproject(untransformedPoint);\n\t },\n\t\n\t // Converts geo coords to projection-specific coords (e.g. in meters)\n\t project: function project(latlon) {\n\t return this.projection.project(latlon);\n\t },\n\t\n\t // Converts projected coords to geo coords\n\t unproject: function unproject(point) {\n\t return this.projection.unproject(point);\n\t },\n\t\n\t // If zoom is provided, returns the map width in pixels for a given zoom\n\t // Else, provides fixed scale value\n\t scale: function scale(zoom) {\n\t // If zoom is provided then return scale based on map tile zoom\n\t if (zoom >= 0) {\n\t return 256 * Math.pow(2, zoom);\n\t // Else, return fixed scale value to expand projected coordinates from\n\t // their 0 to 1 range into something more practical\n\t } else {\n\t return this.scaleFactor;\n\t }\n\t },\n\t\n\t // Returns zoom level for a given scale value\n\t // This only works with a scale value that is based on map pixel width\n\t zoom: function zoom(scale) {\n\t return Math.log(scale / 256) / Math.LN2;\n\t },\n\t\n\t // Returns the bounds of the world in projected coords if applicable\n\t getProjectedBounds: function getProjectedBounds(zoom) {\n\t if (this.infinite) {\n\t return null;\n\t }\n\t\n\t var b = this.projection.bounds;\n\t var s = this.scale(zoom);\n\t\n\t // Half scale if using zoom as WebGL origin is in the centre, not top left\n\t if (zoom) {\n\t s /= 2;\n\t }\n\t\n\t // Bottom left\n\t var min = this.transformation.transform((0, _Point2['default'])(b[0]), s);\n\t\n\t // Top right\n\t var max = this.transformation.transform((0, _Point2['default'])(b[1]), s);\n\t\n\t return [min, max];\n\t },\n\t\n\t // Whether a coordinate axis wraps in a given range (e.g. longitude from -180 to 180); depends on CRS\n\t // wrapLon: [min, max],\n\t // wrapLat: [min, max],\n\t\n\t // If true, the coordinate space will be unbounded (infinite in all directions)\n\t // infinite: false,\n\t\n\t // Wraps geo coords in certain ranges if applicable\n\t wrapLatLon: function wrapLatLon(latlon) {\n\t var lat = this.wrapLat ? (0, _utilWrapNum2['default'])(latlon.lat, this.wrapLat, true) : latlon.lat;\n\t var lon = this.wrapLon ? (0, _utilWrapNum2['default'])(latlon.lon, this.wrapLon, true) : latlon.lon;\n\t var alt = latlon.alt;\n\t\n\t return (0, _LatLon2['default'])(lat, lon, alt);\n\t }\n\t};\n\t\n\texports['default'] = CRS;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\t/*\n\t * LatLon is a helper class for ensuring consistent geographic coordinates.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/LatLng.js\n\t */\n\t\n\tvar LatLon = (function () {\n\t function LatLon(lat, lon, alt) {\n\t _classCallCheck(this, LatLon);\n\t\n\t if (isNaN(lat) || isNaN(lon)) {\n\t throw new Error('Invalid LatLon object: (' + lat + ', ' + lon + ')');\n\t }\n\t\n\t this.lat = +lat;\n\t this.lon = +lon;\n\t\n\t if (alt !== undefined) {\n\t this.alt = +alt;\n\t }\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t //\n\t // Accepts (LatLon), ([lat, lon, alt]), ([lat, lon]) and (lat, lon, alt)\n\t // Also converts between lng and lon\n\t\n\t _createClass(LatLon, [{\n\t key: 'clone',\n\t value: function clone() {\n\t return new LatLon(this.lat, this.lon, this.alt);\n\t }\n\t }]);\n\t\n\t return LatLon;\n\t})();\n\t\n\texports['default'] = function (a, b, c) {\n\t if (a instanceof LatLon) {\n\t return a;\n\t }\n\t if (Array.isArray(a) && typeof a[0] !== 'object') {\n\t if (a.length === 3) {\n\t return new LatLon(a[0], a[1], a[2]);\n\t }\n\t if (a.length === 2) {\n\t return new LatLon(a[0], a[1]);\n\t }\n\t return null;\n\t }\n\t if (a === undefined || a === null) {\n\t return a;\n\t }\n\t if (typeof a === 'object' && 'lat' in a) {\n\t return new LatLon(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);\n\t }\n\t if (b === undefined) {\n\t return null;\n\t }\n\t return new LatLon(a, b, c);\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 11 */\n/***/ function(module, exports) {\n\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * Point is a helper class for ensuring consistent world positions.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/Point.js\n\t */\n\t\n\tvar Point = (function () {\n\t function Point(x, y, round) {\n\t _classCallCheck(this, Point);\n\t\n\t this.x = round ? Math.round(x) : x;\n\t this.y = round ? Math.round(y) : y;\n\t }\n\t\n\t // Accepts (point), ([x, y]) and (x, y, round)\n\t\n\t _createClass(Point, [{\n\t key: \"clone\",\n\t value: function clone() {\n\t return new Point(this.x, this.y);\n\t }\n\t\n\t // Non-destructive\n\t }, {\n\t key: \"add\",\n\t value: function add(point) {\n\t return this.clone()._add(_point(point));\n\t }\n\t\n\t // Destructive\n\t }, {\n\t key: \"_add\",\n\t value: function _add(point) {\n\t this.x += point.x;\n\t this.y += point.y;\n\t return this;\n\t }\n\t\n\t // Non-destructive\n\t }, {\n\t key: \"subtract\",\n\t value: function subtract(point) {\n\t return this.clone()._subtract(_point(point));\n\t }\n\t\n\t // Destructive\n\t }, {\n\t key: \"_subtract\",\n\t value: function _subtract(point) {\n\t this.x -= point.x;\n\t this.y -= point.y;\n\t return this;\n\t }\n\t }]);\n\t\n\t return Point;\n\t})();\n\t\n\tvar _point = function _point(x, y, round) {\n\t if (x instanceof Point) {\n\t return x;\n\t }\n\t if (Array.isArray(x)) {\n\t return new Point(x[0], x[1]);\n\t }\n\t if (x === undefined || x === null) {\n\t return x;\n\t }\n\t return new Point(x, y, round);\n\t};\n\t\n\t// Initialise without requiring new keyword\n\texports[\"default\"] = _point;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t/*\n\t * Wrap the given number to lie within a certain range (eg. longitude)\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/core/Util.js\n\t */\n\t\n\tvar wrapNum = function wrapNum(x, range, includeMax) {\n\t var max = range[1];\n\t var min = range[0];\n\t var d = max - min;\n\t return x === max && includeMax ? x : ((x - min) % d + d) % d + min;\n\t};\n\t\n\texports[\"default\"] = wrapNum;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * Spherical Mercator is the most popular map projection, used by EPSG:3857 CRS\n\t * used by default.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.SphericalMercator.js\n\t */\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar _Point = __webpack_require__(11);\n\t\n\tvar _Point2 = _interopRequireDefault(_Point);\n\t\n\tvar SphericalMercator = {\n\t // Radius / WGS84 semi-major axis\n\t R: 6378137,\n\t MAX_LATITUDE: 85.0511287798,\n\t\n\t // WGS84 eccentricity\n\t ECC: 0.081819191,\n\t ECC2: 0.081819191 * 0.081819191,\n\t\n\t project: function project(latlon) {\n\t var d = Math.PI / 180;\n\t var max = this.MAX_LATITUDE;\n\t var lat = Math.max(Math.min(max, latlon.lat), -max);\n\t var sin = Math.sin(lat * d);\n\t\n\t return (0, _Point2['default'])(this.R * latlon.lon * d, this.R * Math.log((1 + sin) / (1 - sin)) / 2);\n\t },\n\t\n\t unproject: function unproject(point) {\n\t var d = 180 / Math.PI;\n\t\n\t return (0, _LatLon2['default'])((2 * Math.atan(Math.exp(point.y / this.R)) - Math.PI / 2) * d, point.x * d / this.R);\n\t },\n\t\n\t // Scale factor for converting between real metres and projected metres\n\t //\n\t // projectedMetres = realMetres * pointScale\n\t // realMetres = projectedMetres / pointScale\n\t //\n\t // Accurate scale factor uses proper Web Mercator scaling\n\t // See pg.9: http://www.hydrometronics.com/downloads/Web%20Mercator%20-%20Non-Conformal,%20Non-Mercator%20(notes).pdf\n\t // See: http://jsfiddle.net/robhawkes/yws924cf/\n\t pointScale: function pointScale(latlon, accurate) {\n\t var rad = Math.PI / 180;\n\t\n\t var k;\n\t\n\t if (!accurate) {\n\t k = 1 / Math.cos(latlon.lat * rad);\n\t\n\t // [scaleX, scaleY]\n\t return [k, k];\n\t } else {\n\t var lat = latlon.lat * rad;\n\t var lon = latlon.lon * rad;\n\t\n\t var a = this.R;\n\t\n\t var sinLat = Math.sin(lat);\n\t var sinLat2 = sinLat * sinLat;\n\t\n\t var cosLat = Math.cos(lat);\n\t\n\t // Radius meridian\n\t var p = a * (1 - this.ECC2) / Math.pow(1 - this.ECC2 * sinLat2, 3 / 2);\n\t\n\t // Radius prime meridian\n\t var v = a / Math.sqrt(1 - this.ECC2 * sinLat2);\n\t\n\t // Scale N/S\n\t var h = a / p / cosLat;\n\t\n\t // Scale E/W\n\t k = a / v / cosLat;\n\t\n\t // [scaleX, scaleY]\n\t return [k, h];\n\t }\n\t },\n\t\n\t // Not using this.R due to scoping\n\t bounds: (function () {\n\t var d = 6378137 * Math.PI;\n\t return [[-d, -d], [d, d]];\n\t })()\n\t};\n\t\n\texports['default'] = SphericalMercator;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\t/*\n\t * Transformation is an utility class to perform simple point transformations\n\t * through a 2d-matrix.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geometry/Transformation.js\n\t */\n\t\n\tvar _geoPoint = __webpack_require__(11);\n\t\n\tvar _geoPoint2 = _interopRequireDefault(_geoPoint);\n\t\n\tvar Transformation = (function () {\n\t function Transformation(a, b, c, d) {\n\t _classCallCheck(this, Transformation);\n\t\n\t this._a = a;\n\t this._b = b;\n\t this._c = c;\n\t this._d = d;\n\t }\n\t\n\t _createClass(Transformation, [{\n\t key: 'transform',\n\t value: function transform(point, scale) {\n\t // Copy input point as to not destroy the original data\n\t return this._transform(point.clone(), scale);\n\t }\n\t\n\t // Destructive transform (faster)\n\t }, {\n\t key: '_transform',\n\t value: function _transform(point, scale) {\n\t scale = scale || 1;\n\t\n\t point.x = scale * (this._a * point.x + this._b);\n\t point.y = scale * (this._c * point.y + this._d);\n\t return point;\n\t }\n\t }, {\n\t key: 'untransform',\n\t value: function untransform(point, scale) {\n\t scale = scale || 1;\n\t return (0, _geoPoint2['default'])((point.x / scale - this._b) / this._a, (point.y / scale - this._d) / this._c);\n\t }\n\t }]);\n\t\n\t return Transformation;\n\t})();\n\t\n\texports['default'] = Transformation;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS.EPSG3395 (WGS 84 / World Mercator) CRS implementation.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG3395.js\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRSEarth = __webpack_require__(8);\n\t\n\tvar _CRSEarth2 = _interopRequireDefault(_CRSEarth);\n\t\n\tvar _projectionProjectionMercator = __webpack_require__(16);\n\t\n\tvar _projectionProjectionMercator2 = _interopRequireDefault(_projectionProjectionMercator);\n\t\n\tvar _utilTransformation = __webpack_require__(14);\n\t\n\tvar _utilTransformation2 = _interopRequireDefault(_utilTransformation);\n\t\n\tvar _EPSG3395 = {\n\t code: 'EPSG:3395',\n\t projection: _projectionProjectionMercator2['default'],\n\t\n\t // Work out how to de-dupe this (scoping issue)\n\t transformScale: 1 / (Math.PI * _projectionProjectionMercator2['default'].R),\n\t\n\t // Scale and transformation inputs changed to account for central origin in\n\t // WebGL, instead of top-left origin used in Leaflet\n\t transformation: (function () {\n\t // TODO: Cannot use this.transformScale due to scope\n\t var scale = 1 / (Math.PI * _projectionProjectionMercator2['default'].R);\n\t\n\t return new _utilTransformation2['default'](scale, 0, -scale, 0);\n\t })()\n\t};\n\t\n\tvar EPSG3395 = (0, _lodashAssign2['default'])({}, _CRSEarth2['default'], _EPSG3395);\n\t\n\texports['default'] = EPSG3395;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * Mercator projection that takes into account that the Earth is not a perfect\n\t * sphere. Less popular than spherical mercator; used by projections like\n\t * EPSG:3395.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.Mercator.js\n\t */\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar _Point = __webpack_require__(11);\n\t\n\tvar _Point2 = _interopRequireDefault(_Point);\n\t\n\tvar Mercator = {\n\t // Radius / WGS84 semi-major axis\n\t R: 6378137,\n\t R_MINOR: 6356752.314245179,\n\t\n\t // WGS84 eccentricity\n\t ECC: 0.081819191,\n\t ECC2: 0.081819191 * 0.081819191,\n\t\n\t project: function project(latlon) {\n\t var d = Math.PI / 180;\n\t var r = this.R;\n\t var y = latlon.lat * d;\n\t var tmp = this.R_MINOR / r;\n\t var e = Math.sqrt(1 - tmp * tmp);\n\t var con = e * Math.sin(y);\n\t\n\t var ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2);\n\t y = -r * Math.log(Math.max(ts, 1E-10));\n\t\n\t return (0, _Point2['default'])(latlon.lon * d * r, y);\n\t },\n\t\n\t unproject: function unproject(point) {\n\t var d = 180 / Math.PI;\n\t var r = this.R;\n\t var tmp = this.R_MINOR / r;\n\t var e = Math.sqrt(1 - tmp * tmp);\n\t var ts = Math.exp(-point.y / r);\n\t var phi = Math.PI / 2 - 2 * Math.atan(ts);\n\t\n\t for (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {\n\t con = e * Math.sin(phi);\n\t con = Math.pow((1 - con) / (1 + con), e / 2);\n\t dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;\n\t phi += dphi;\n\t }\n\t\n\t return (0, _LatLon2['default'])(phi * d, point.x * d / r);\n\t },\n\t\n\t // Scale factor for converting between real metres and projected metres\n\t //\n\t // projectedMetres = realMetres * pointScale\n\t // realMetres = projectedMetres / pointScale\n\t //\n\t // See pg.8: http://www.hydrometronics.com/downloads/Web%20Mercator%20-%20Non-Conformal,%20Non-Mercator%20(notes).pdf\n\t pointScale: function pointScale(latlon) {\n\t var rad = Math.PI / 180;\n\t var lat = latlon.lat * rad;\n\t var sinLat = Math.sin(lat);\n\t var sinLat2 = sinLat * sinLat;\n\t var cosLat = Math.cos(lat);\n\t\n\t var k = Math.sqrt(1 - this.ECC2 * sinLat2) / cosLat;\n\t\n\t // [scaleX, scaleY]\n\t return [k, k];\n\t },\n\t\n\t bounds: [[-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]]\n\t};\n\t\n\texports['default'] = Mercator;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS.EPSG4326 is a CRS popular among advanced GIS specialists.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG4326.js\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRSEarth = __webpack_require__(8);\n\t\n\tvar _CRSEarth2 = _interopRequireDefault(_CRSEarth);\n\t\n\tvar _projectionProjectionLatLon = __webpack_require__(18);\n\t\n\tvar _projectionProjectionLatLon2 = _interopRequireDefault(_projectionProjectionLatLon);\n\t\n\tvar _utilTransformation = __webpack_require__(14);\n\t\n\tvar _utilTransformation2 = _interopRequireDefault(_utilTransformation);\n\t\n\tvar _EPSG4326 = {\n\t code: 'EPSG:4326',\n\t projection: _projectionProjectionLatLon2['default'],\n\t\n\t // Work out how to de-dupe this (scoping issue)\n\t transformScale: 1 / 180,\n\t\n\t // Scale and transformation inputs changed to account for central origin in\n\t // WebGL, instead of top-left origin used in Leaflet\n\t //\n\t // TODO: Cannot use this.transformScale due to scope\n\t transformation: new _utilTransformation2['default'](1 / 180, 0, -1 / 180, 0)\n\t};\n\t\n\tvar EPSG4326 = (0, _lodashAssign2['default'])({}, _CRSEarth2['default'], _EPSG4326);\n\t\n\texports['default'] = EPSG4326;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * Simple equirectangular (Plate Carree) projection, used by CRS like EPSG:4326\n\t * and Simple.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.LonLat.js\n\t */\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar _Point = __webpack_require__(11);\n\t\n\tvar _Point2 = _interopRequireDefault(_Point);\n\t\n\tvar ProjectionLatLon = {\n\t project: function project(latlon) {\n\t return (0, _Point2['default'])(latlon.lon, latlon.lat);\n\t },\n\t\n\t unproject: function unproject(point) {\n\t return (0, _LatLon2['default'])(point.y, point.x);\n\t },\n\t\n\t // Scale factor for converting between real metres and degrees\n\t //\n\t // degrees = realMetres * pointScale\n\t // realMetres = degrees / pointScale\n\t //\n\t // See: http://stackoverflow.com/questions/639695/how-to-convert-latitude-or-longitude-to-meters\n\t // See: http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from\n\t pointScale: function pointScale(latlon) {\n\t var m1 = 111132.92;\n\t var m2 = -559.82;\n\t var m3 = 1.175;\n\t var m4 = -0.0023;\n\t var p1 = 111412.84;\n\t var p2 = -93.5;\n\t var p3 = 0.118;\n\t\n\t var rad = Math.PI / 180;\n\t var lat = latlon.lat * rad;\n\t\n\t var latlen = m1 + m2 * Math.cos(2 * lat) + m3 * Math.cos(4 * lat) + m4 * Math.cos(6 * lat);\n\t var lonlen = p1 * Math.cos(lat) + p2 * Math.cos(3 * lat) + p3 * Math.cos(5 * lat);\n\t\n\t return [1 / latlen, 1 / lonlen];\n\t },\n\t\n\t bounds: [[-180, -90], [180, 90]]\n\t};\n\t\n\texports['default'] = ProjectionLatLon;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * A simple CRS that can be used for flat non-Earth maps like panoramas or game\n\t * maps.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.Simple.js\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRS = __webpack_require__(9);\n\t\n\tvar _CRS2 = _interopRequireDefault(_CRS);\n\t\n\tvar _projectionProjectionLatLon = __webpack_require__(18);\n\t\n\tvar _projectionProjectionLatLon2 = _interopRequireDefault(_projectionProjectionLatLon);\n\t\n\tvar _utilTransformation = __webpack_require__(14);\n\t\n\tvar _utilTransformation2 = _interopRequireDefault(_utilTransformation);\n\t\n\tvar _Simple = {\n\t projection: _projectionProjectionLatLon2['default'],\n\t\n\t // Straight 1:1 mapping (-1, -1 would be top-left)\n\t transformation: new _utilTransformation2['default'](1, 0, 1, 0),\n\t\n\t scale: function scale(zoom) {\n\t // If zoom is provided then return scale based on map tile zoom\n\t if (zoom) {\n\t return Math.pow(2, zoom);\n\t // Else, make no change to scale – may need to increase this or make it a\n\t // user-definable variable\n\t } else {\n\t return 1;\n\t }\n\t },\n\t\n\t zoom: function zoom(scale) {\n\t return Math.log(scale) / Math.LN2;\n\t },\n\t\n\t distance: function distance(latlon1, latlon2) {\n\t var dx = latlon2.lon - latlon1.lon;\n\t var dy = latlon2.lat - latlon1.lat;\n\t\n\t return Math.sqrt(dx * dx + dy * dy);\n\t },\n\t\n\t infinite: true\n\t};\n\t\n\tvar Simple = (0, _lodashAssign2['default'])({}, _CRS2['default'], _Simple);\n\t\n\texports['default'] = Simple;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS.Proj4 for any Proj4-supported CRS.\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRSEarth = __webpack_require__(8);\n\t\n\tvar _CRSEarth2 = _interopRequireDefault(_CRSEarth);\n\t\n\tvar _projectionProjectionProj4 = __webpack_require__(21);\n\t\n\tvar _projectionProjectionProj42 = _interopRequireDefault(_projectionProjectionProj4);\n\t\n\tvar _utilTransformation = __webpack_require__(14);\n\t\n\tvar _utilTransformation2 = _interopRequireDefault(_utilTransformation);\n\t\n\tvar _Proj4 = function _Proj4(code, def, bounds) {\n\t var projection = (0, _projectionProjectionProj42['default'])(def, bounds);\n\t\n\t // Transformation calcuations\n\t var diffX = projection.bounds[1][0] - projection.bounds[0][0];\n\t var diffY = projection.bounds[1][1] - projection.bounds[0][1];\n\t\n\t var halfX = diffX / 2;\n\t var halfY = diffY / 2;\n\t\n\t // This is the raw scale factor\n\t var scaleX = 1 / halfX;\n\t var scaleY = 1 / halfY;\n\t\n\t // Find the minimum scale factor\n\t //\n\t // The minimum scale factor comes from the largest side and is the one\n\t // you want to use for both axis so they stay relative in dimension\n\t var scale = Math.min(scaleX, scaleY);\n\t\n\t // Find amount to offset each axis by to make the central point lie on\n\t // the [0,0] origin\n\t var offsetX = scale * (projection.bounds[0][0] + halfX);\n\t var offsetY = scale * (projection.bounds[0][1] + halfY);\n\t\n\t return {\n\t code: code,\n\t projection: projection,\n\t\n\t transformScale: scale,\n\t\n\t // Map the input to a [-1,1] range with [0,0] in the centre\n\t transformation: new _utilTransformation2['default'](scale, -offsetX, -scale, offsetY)\n\t };\n\t};\n\t\n\tvar Proj4 = function Proj4(code, def, bounds) {\n\t return (0, _lodashAssign2['default'])({}, _CRSEarth2['default'], _Proj4(code, def, bounds));\n\t};\n\t\n\texports['default'] = Proj4;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 21 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * Proj4 support for any projection.\n\t */\n\t\n\tvar _proj4 = __webpack_require__(22);\n\t\n\tvar _proj42 = _interopRequireDefault(_proj4);\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar _Point = __webpack_require__(11);\n\t\n\tvar _Point2 = _interopRequireDefault(_Point);\n\t\n\tvar Proj4 = function Proj4(def, bounds) {\n\t var proj = (0, _proj42['default'])(def);\n\t\n\t var project = function project(latlon) {\n\t return (0, _Point2['default'])(proj.forward([latlon.lon, latlon.lat]));\n\t };\n\t\n\t var unproject = function unproject(point) {\n\t var inverse = proj.inverse([point.x, point.y]);\n\t return (0, _LatLon2['default'])(inverse[1], inverse[0]);\n\t };\n\t\n\t return {\n\t project: project,\n\t unproject: unproject,\n\t\n\t // Scale factor for converting between real metres and projected metres\\\n\t //\n\t // Need to work out the best way to provide the pointScale calculations\n\t // for custom, unknown projections (if wanting to override default)\n\t //\n\t // For now, user can manually override crs.pointScale or\n\t // crs.projection.pointScale\n\t //\n\t // projectedMetres = realMetres * pointScale\n\t // realMetres = projectedMetres / pointScale\n\t pointScale: function pointScale(latlon, accurate) {\n\t return [1, 1];\n\t },\n\t\n\t // Try and calculate bounds if none are provided\n\t //\n\t // This will provide incorrect bounds for some projections, so perhaps make\n\t // bounds a required input instead\n\t bounds: (function () {\n\t if (bounds) {\n\t return bounds;\n\t } else {\n\t var bottomLeft = project([-90, -180]);\n\t var topRight = project([90, 180]);\n\t\n\t return [bottomLeft, topRight];\n\t }\n\t })()\n\t };\n\t};\n\t\n\texports['default'] = Proj4;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_22__;\n\n/***/ },\n/* 23 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _eventemitter3 = __webpack_require__(2);\n\t\n\tvar _eventemitter32 = _interopRequireDefault(_eventemitter3);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _Scene = __webpack_require__(25);\n\t\n\tvar _Scene2 = _interopRequireDefault(_Scene);\n\t\n\tvar _Renderer = __webpack_require__(26);\n\t\n\tvar _Renderer2 = _interopRequireDefault(_Renderer);\n\t\n\tvar _Camera = __webpack_require__(27);\n\t\n\tvar _Camera2 = _interopRequireDefault(_Camera);\n\t\n\tvar Engine = (function (_EventEmitter) {\n\t _inherits(Engine, _EventEmitter);\n\t\n\t function Engine(container) {\n\t _classCallCheck(this, Engine);\n\t\n\t console.log('Init Engine');\n\t\n\t _get(Object.getPrototypeOf(Engine.prototype), 'constructor', this).call(this);\n\t\n\t this._scene = _Scene2['default'];\n\t this._renderer = (0, _Renderer2['default'])(container);\n\t this._camera = (0, _Camera2['default'])(container);\n\t this.clock = new _three2['default'].Clock();\n\t\n\t this._frustum = new _three2['default'].Frustum();\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t _createClass(Engine, [{\n\t key: 'update',\n\t value: function update(delta) {\n\t this.emit('preRender');\n\t this._renderer.render(this._scene, this._camera);\n\t this.emit('postRender');\n\t }\n\t }]);\n\t\n\t return Engine;\n\t})(_eventemitter32['default']);\n\t\n\texports['default'] = function (container) {\n\t return new Engine(container);\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_24__;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\t// This can be imported from anywhere and will still reference the same scene,\n\t// though there is a helper reference in Engine.scene\n\t\n\texports['default'] = (function () {\n\t var scene = new _three2['default'].Scene();\n\t scene.fog = new _three2['default'].Fog(0xffffff, 1, 15000);\n\t return scene;\n\t})();\n\t\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 26 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _Scene = __webpack_require__(25);\n\t\n\tvar _Scene2 = _interopRequireDefault(_Scene);\n\t\n\t// This can only be accessed from Engine.renderer if you want to reference the\n\t// same scene in multiple places\n\t\n\texports['default'] = function (container) {\n\t var renderer = new _three2['default'].WebGLRenderer({\n\t antialias: true\n\t });\n\t\n\t renderer.setClearColor(_Scene2['default'].fog.color, 1);\n\t\n\t // Gamma settings make things look nicer\n\t renderer.gammaInput = true;\n\t renderer.gammaOutput = true;\n\t\n\t container.appendChild(renderer.domElement);\n\t\n\t var updateSize = function updateSize() {\n\t renderer.setSize(container.clientWidth, container.clientHeight);\n\t };\n\t\n\t window.addEventListener('resize', updateSize, false);\n\t updateSize();\n\t\n\t return renderer;\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\t// This can only be accessed from Engine.camera if you want to reference the\n\t// same scene in multiple places\n\t\n\texports['default'] = function (container) {\n\t var camera = new _three2['default'].PerspectiveCamera(40, 1, 1, 40000);\n\t camera.position.y = 400;\n\t camera.position.z = 400;\n\t\n\t var updateSize = function updateSize() {\n\t camera.aspect = container.clientWidth / container.clientHeight;\n\t camera.updateProjectionMatrix();\n\t };\n\t\n\t window.addEventListener('resize', updateSize, false);\n\t updateSize();\n\t\n\t return camera;\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 28 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _ControlsOrbit = __webpack_require__(29);\n\t\n\tvar _ControlsOrbit2 = _interopRequireDefault(_ControlsOrbit);\n\t\n\tvar Controls = {\n\t Orbit: _ControlsOrbit2['default']\n\t};\n\t\n\texports['default'] = Controls;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 29 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _eventemitter3 = __webpack_require__(2);\n\t\n\tvar _eventemitter32 = _interopRequireDefault(_eventemitter3);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _threeOrbitControls = __webpack_require__(30);\n\t\n\tvar _threeOrbitControls2 = _interopRequireDefault(_threeOrbitControls);\n\t\n\tvar _OrbitControls = (0, _threeOrbitControls2['default'])(_three2['default']);\n\t\n\tvar Orbit = (function (_EventEmitter) {\n\t _inherits(Orbit, _EventEmitter);\n\t\n\t function Orbit() {\n\t _classCallCheck(this, Orbit);\n\t\n\t _get(Object.getPrototypeOf(Orbit.prototype), 'constructor', this).call(this);\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t // Proxy control events\n\t //\n\t // There's currently no distinction between pan, orbit and zoom events\n\t\n\t _createClass(Orbit, [{\n\t key: '_initEvents',\n\t value: function _initEvents() {\n\t var _this = this;\n\t\n\t this._controls.addEventListener('start', function (event) {\n\t _this._world.emit('controlsMoveStart', event.target.center);\n\t });\n\t\n\t this._controls.addEventListener('change', function (event) {\n\t _this._world.emit('controlsMove', event.target.center);\n\t });\n\t\n\t this._controls.addEventListener('end', function (event) {\n\t _this._world.emit('controlsMoveEnd', event.target.center);\n\t });\n\t }\n\t\n\t // Moving the camera along the [x,y,z] axis based on a target position\n\t }, {\n\t key: '_panTo',\n\t value: function _panTo(point, animate) {}\n\t }, {\n\t key: '_panBy',\n\t value: function _panBy(pointDelta, animate) {}\n\t\n\t // Zooming the camera in and out\n\t }, {\n\t key: '_zoomTo',\n\t value: function _zoomTo(metres, animate) {}\n\t }, {\n\t key: '_zoomBy',\n\t value: function _zoomBy(metresDelta, animate) {}\n\t\n\t // Force camera to look at something other than the target\n\t }, {\n\t key: '_lookAt',\n\t value: function _lookAt(point, animate) {}\n\t\n\t // Make camera look at the target\n\t }, {\n\t key: '_lookAtTarget',\n\t value: function _lookAtTarget() {}\n\t\n\t // Tilt (up and down)\n\t }, {\n\t key: '_tiltTo',\n\t value: function _tiltTo(angle, animate) {}\n\t }, {\n\t key: '_tiltBy',\n\t value: function _tiltBy(angleDelta, animate) {}\n\t\n\t // Rotate (left and right)\n\t }, {\n\t key: '_rotateTo',\n\t value: function _rotateTo(angle, animate) {}\n\t }, {\n\t key: '_rotateBy',\n\t value: function _rotateBy(angleDelta, animate) {}\n\t\n\t // Fly to the given point, animating pan and tilt/rotation to final position\n\t // with nice zoom out and in\n\t //\n\t // Calling flyTo a second time before the previous animation has completed\n\t // will immediately start the new animation from wherever the previous one\n\t // has got to\n\t }, {\n\t key: '_flyTo',\n\t value: function _flyTo(point, noZoom) {}\n\t\n\t // Proxy to OrbitControls.update()\n\t }, {\n\t key: 'update',\n\t value: function update() {\n\t this._controls.update();\n\t }\n\t\n\t // Add controls to world instance and store world reference\n\t }, {\n\t key: 'addTo',\n\t value: function addTo(world) {\n\t world.addControls(this);\n\t return this;\n\t }\n\t\n\t // Internal method called by World.addControls to actually add the controls\n\t }, {\n\t key: '_addToWorld',\n\t value: function _addToWorld(world) {\n\t this._world = world;\n\t\n\t // TODO: Override panLeft and panUp methods to prevent panning on Y axis\n\t // See: http://stackoverflow.com/a/26188674/997339\n\t this._controls = new _OrbitControls(world._engine._camera, world._container);\n\t\n\t // Disable keys for now as no events are fired for them anyway\n\t this._controls.keys = false;\n\t\n\t // 89 degrees\n\t this._controls.maxPolarAngle = 1.5533;\n\t\n\t // this._controls.enableDamping = true;\n\t // this._controls.dampingFactor = 0.25;\n\t\n\t this._initEvents();\n\t\n\t this.emit('added');\n\t }\n\t }]);\n\t\n\t return Orbit;\n\t})(_eventemitter32['default']);\n\t\n\texports['default'] = function () {\n\t return new Orbit();\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 30 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(THREE) {\n\t\tvar MOUSE = THREE.MOUSE\n\t\tif (!MOUSE)\n\t\t\tMOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };\n\t\n\t\t/**\n\t\t * @author qiao / https://github.com/qiao\n\t\t * @author mrdoob / http://mrdoob.com\n\t\t * @author alteredq / http://alteredqualia.com/\n\t\t * @author WestLangley / http://github.com/WestLangley\n\t\t * @author erich666 / http://erichaines.com\n\t\t */\n\t\t/*global THREE, console */\n\t\n\t\tfunction OrbitConstraint ( object ) {\n\t\n\t\t\tthis.object = object;\n\t\n\t\t\t// \"target\" sets the location of focus, where the object orbits around\n\t\t\t// and where it pans with respect to.\n\t\t\tthis.target = new THREE.Vector3();\n\t\n\t\t\t// Limits to how far you can dolly in and out ( PerspectiveCamera only )\n\t\t\tthis.minDistance = 0;\n\t\t\tthis.maxDistance = Infinity;\n\t\n\t\t\t// Limits to how far you can zoom in and out ( OrthographicCamera only )\n\t\t\tthis.minZoom = 0;\n\t\t\tthis.maxZoom = Infinity;\n\t\n\t\t\t// How far you can orbit vertically, upper and lower limits.\n\t\t\t// Range is 0 to Math.PI radians.\n\t\t\tthis.minPolarAngle = 0; // radians\n\t\t\tthis.maxPolarAngle = Math.PI; // radians\n\t\n\t\t\t// How far you can orbit horizontally, upper and lower limits.\n\t\t\t// If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].\n\t\t\tthis.minAzimuthAngle = - Infinity; // radians\n\t\t\tthis.maxAzimuthAngle = Infinity; // radians\n\t\n\t\t\t// Set to true to enable damping (inertia)\n\t\t\t// If damping is enabled, you must call controls.update() in your animation loop\n\t\t\tthis.enableDamping = false;\n\t\t\tthis.dampingFactor = 0.25;\n\t\n\t\t\t////////////\n\t\t\t// internals\n\t\n\t\t\tvar scope = this;\n\t\n\t\t\tvar EPS = 0.000001;\n\t\n\t\t\t// Current position in spherical coordinate system.\n\t\t\tvar theta;\n\t\t\tvar phi;\n\t\n\t\t\t// Pending changes\n\t\t\tvar phiDelta = 0;\n\t\t\tvar thetaDelta = 0;\n\t\t\tvar scale = 1;\n\t\t\tvar panOffset = new THREE.Vector3();\n\t\t\tvar zoomChanged = false;\n\t\n\t\t\t// API\n\t\n\t\t\tthis.getPolarAngle = function () {\n\t\n\t\t\t\treturn phi;\n\t\n\t\t\t};\n\t\n\t\t\tthis.getAzimuthalAngle = function () {\n\t\n\t\t\t\treturn theta;\n\t\n\t\t\t};\n\t\n\t\t\tthis.rotateLeft = function ( angle ) {\n\t\n\t\t\t\tthetaDelta -= angle;\n\t\n\t\t\t};\n\t\n\t\t\tthis.rotateUp = function ( angle ) {\n\t\n\t\t\t\tphiDelta -= angle;\n\t\n\t\t\t};\n\t\n\t\t\t// pass in distance in world space to move left\n\t\t\tthis.panLeft = function() {\n\t\n\t\t\t\tvar v = new THREE.Vector3();\n\t\n\t\t\t return function panLeft(distance) {\n\t\t\t var te = this.object.matrix.elements;\n\t\t\t var adjDist = distance / Math.cos(phi);\n\t\n\t\t\t v.set(te[ 0 ], 0, te[ 2 ]).normalize();\n\t\t\t v.multiplyScalar(-adjDist);\n\t\n\t\t\t panOffset.add(v);\n\t\t\t };\n\t\n\t\t\t}();\n\t\n\t\t\t// pass in distance in world space to move up\n\t\t\tthis.panUp = function() {\n\t\n\t\t\t\tvar v = new THREE.Vector3();\n\t\n\t\t\t return function panUp(distance) {\n\t\t\t var te = this.object.matrix.elements;\n\t\t\t var adjDist = distance / Math.cos(phi);\n\t\n\t\t\t v.set(te[ 8 ], 0, te[ 10 ]).normalize();\n\t\t\t v.multiplyScalar(-adjDist);\n\t\n\t\t\t panOffset.add(v);\n\t\t\t };\n\t\n\t\t\t}();\n\t\n\t\t\t// pass in x,y of change desired in pixel space,\n\t\t\t// right and down are positive\n\t\t\tthis.pan = function ( deltaX, deltaY, screenWidth, screenHeight ) {\n\t\n\t\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\t\n\t\t\t\t\t// perspective\n\t\t\t\t\tvar position = scope.object.position;\n\t\t\t\t\tvar offset = position.clone().sub( scope.target );\n\t\t\t\t\tvar targetDistance = offset.length();\n\t\n\t\t\t\t\t// half of the fov is center to top of screen\n\t\t\t\t\ttargetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );\n\t\n\t\t\t\t\t// we actually don't use screenWidth, since perspective camera is fixed to screen height\n\t\t\t\t\tscope.panLeft( 2 * deltaX * targetDistance / screenHeight );\n\t\t\t\t\tscope.panUp( 2 * deltaY * targetDistance / screenHeight );\n\t\n\t\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\t\n\t\t\t\t\t// orthographic\n\t\t\t\t\tscope.panLeft( deltaX * ( scope.object.right - scope.object.left ) / screenWidth );\n\t\t\t\t\tscope.panUp( deltaY * ( scope.object.top - scope.object.bottom ) / screenHeight );\n\t\n\t\t\t\t} else {\n\t\n\t\t\t\t\t// camera neither orthographic or perspective\n\t\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n\t\n\t\t\t\t}\n\t\n\t\t\t};\n\t\n\t\t\tthis.dollyIn = function ( dollyScale ) {\n\t\n\t\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\t\n\t\t\t\t\tscale /= dollyScale;\n\t\n\t\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\t\n\t\t\t\t\tscope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom * dollyScale ) );\n\t\t\t\t\tscope.object.updateProjectionMatrix();\n\t\t\t\t\tzoomChanged = true;\n\t\n\t\t\t\t} else {\n\t\n\t\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\t\n\t\t\t\t}\n\t\n\t\t\t};\n\t\n\t\t\tthis.dollyOut = function ( dollyScale ) {\n\t\n\t\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\t\n\t\t\t\t\tscale *= dollyScale;\n\t\n\t\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\t\n\t\t\t\t\tscope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / dollyScale ) );\n\t\t\t\t\tscope.object.updateProjectionMatrix();\n\t\t\t\t\tzoomChanged = true;\n\t\n\t\t\t\t} else {\n\t\n\t\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\t\n\t\t\t\t}\n\t\n\t\t\t};\n\t\n\t\t\tthis.update = function() {\n\t\n\t\t\t\tvar offset = new THREE.Vector3();\n\t\n\t\t\t\t// so camera.up is the orbit axis\n\t\t\t\tvar quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );\n\t\t\t\tvar quatInverse = quat.clone().inverse();\n\t\n\t\t\t\tvar lastPosition = new THREE.Vector3();\n\t\t\t\tvar lastQuaternion = new THREE.Quaternion();\n\t\n\t\t\t\treturn function () {\n\t\n\t\t\t\t\tvar position = this.object.position;\n\t\n\t\t\t\t\toffset.copy( position ).sub( this.target );\n\t\n\t\t\t\t\t// rotate offset to \"y-axis-is-up\" space\n\t\t\t\t\toffset.applyQuaternion( quat );\n\t\n\t\t\t\t\t// angle from z-axis around y-axis\n\t\n\t\t\t\t\ttheta = Math.atan2( offset.x, offset.z );\n\t\n\t\t\t\t\t// angle from y-axis\n\t\n\t\t\t\t\tphi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y );\n\t\n\t\t\t\t\ttheta += thetaDelta;\n\t\t\t\t\tphi += phiDelta;\n\t\n\t\t\t\t\t// restrict theta to be between desired limits\n\t\t\t\t\ttheta = Math.max( this.minAzimuthAngle, Math.min( this.maxAzimuthAngle, theta ) );\n\t\n\t\t\t\t\t// restrict phi to be between desired limits\n\t\t\t\t\tphi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );\n\t\n\t\t\t\t\t// restrict phi to be betwee EPS and PI-EPS\n\t\t\t\t\tphi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\t\n\t\t\t\t\tvar radius = offset.length() * scale;\n\t\n\t\t\t\t\t// restrict radius to be between desired limits\n\t\t\t\t\tradius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) );\n\t\n\t\t\t\t\t// move target to panned location\n\t\t\t\t\tthis.target.add( panOffset );\n\t\n\t\t\t\t\toffset.x = radius * Math.sin( phi ) * Math.sin( theta );\n\t\t\t\t\toffset.y = radius * Math.cos( phi );\n\t\t\t\t\toffset.z = radius * Math.sin( phi ) * Math.cos( theta );\n\t\n\t\t\t\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\t\t\t\toffset.applyQuaternion( quatInverse );\n\t\n\t\t\t\t\tposition.copy( this.target ).add( offset );\n\t\n\t\t\t\t\tthis.object.lookAt( this.target );\n\t\n\t\t\t\t\tif ( this.enableDamping === true ) {\n\t\n\t\t\t\t\t\tthetaDelta *= ( 1 - this.dampingFactor );\n\t\t\t\t\t\tphiDelta *= ( 1 - this.dampingFactor );\n\t\n\t\t\t\t\t} else {\n\t\n\t\t\t\t\t\tthetaDelta = 0;\n\t\t\t\t\t\tphiDelta = 0;\n\t\n\t\t\t\t\t}\n\t\n\t\t\t\t\tscale = 1;\n\t\t\t\t\tpanOffset.set( 0, 0, 0 );\n\t\n\t\t\t\t\t// update condition is:\n\t\t\t\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t\t\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\t\n\t\t\t\t\tif ( zoomChanged ||\n\t\t\t\t\t\t lastPosition.distanceToSquared( this.object.position ) > EPS ||\n\t\t\t\t\t\t8 * ( 1 - lastQuaternion.dot( this.object.quaternion ) ) > EPS ) {\n\t\n\t\t\t\t\t\tlastPosition.copy( this.object.position );\n\t\t\t\t\t\tlastQuaternion.copy( this.object.quaternion );\n\t\t\t\t\t\tzoomChanged = false;\n\t\n\t\t\t\t\t\treturn true;\n\t\n\t\t\t\t\t}\n\t\n\t\t\t\t\treturn false;\n\t\n\t\t\t\t};\n\t\n\t\t\t}();\n\t\n\t\t};\n\t\n\t\n\t\t// This set of controls performs orbiting, dollying (zooming), and panning. It maintains\n\t\t// the \"up\" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is\n\t\t// supported.\n\t\t//\n\t\t// Orbit - left mouse / touch: one finger move\n\t\t// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n\t\t// Pan - right mouse, or arrow keys / touch: three finter swipe\n\t\n\t\tfunction OrbitControls ( object, domElement ) {\n\t\n\t\t\tvar constraint = new OrbitConstraint( object );\n\t\n\t\t\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\t\n\t\t\t// API\n\t\n\t\t\tObject.defineProperty( this, 'constraint', {\n\t\n\t\t\t\tget: function() {\n\t\n\t\t\t\t\treturn constraint;\n\t\n\t\t\t\t}\n\t\n\t\t\t} );\n\t\n\t\t\tthis.getPolarAngle = function () {\n\t\n\t\t\t\treturn constraint.getPolarAngle();\n\t\n\t\t\t};\n\t\n\t\t\tthis.getAzimuthalAngle = function () {\n\t\n\t\t\t\treturn constraint.getAzimuthalAngle();\n\t\n\t\t\t};\n\t\n\t\t\t// Set to false to disable this control\n\t\t\tthis.enabled = true;\n\t\n\t\t\t// center is old, deprecated; use \"target\" instead\n\t\t\tthis.center = this.target;\n\t\n\t\t\t// This option actually enables dollying in and out; left as \"zoom\" for\n\t\t\t// backwards compatibility.\n\t\t\t// Set to false to disable zooming\n\t\t\tthis.enableZoom = true;\n\t\t\tthis.zoomSpeed = 1.0;\n\t\n\t\t\t// Set to false to disable rotating\n\t\t\tthis.enableRotate = true;\n\t\t\tthis.rotateSpeed = 1.0;\n\t\n\t\t\t// Set to false to disable panning\n\t\t\tthis.enablePan = true;\n\t\t\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\t\n\t\t\t// Set to true to automatically rotate around the target\n\t\t\t// If auto-rotate is enabled, you must call controls.update() in your animation loop\n\t\t\tthis.autoRotate = false;\n\t\t\tthis.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\t\n\t\t\t// Set to false to disable use of the keys\n\t\t\tthis.enableKeys = true;\n\t\n\t\t\t// The four arrow keys\n\t\t\tthis.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\t\n\t\t\t// Mouse buttons\n\t\t\tthis.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };\n\t\n\t\t\t////////////\n\t\t\t// internals\n\t\n\t\t\tvar scope = this;\n\t\n\t\t\tvar rotateStart = new THREE.Vector2();\n\t\t\tvar rotateEnd = new THREE.Vector2();\n\t\t\tvar rotateDelta = new THREE.Vector2();\n\t\n\t\t\tvar panStart = new THREE.Vector2();\n\t\t\tvar panEnd = new THREE.Vector2();\n\t\t\tvar panDelta = new THREE.Vector2();\n\t\n\t\t\tvar dollyStart = new THREE.Vector2();\n\t\t\tvar dollyEnd = new THREE.Vector2();\n\t\t\tvar dollyDelta = new THREE.Vector2();\n\t\n\t\t\tvar STATE = { NONE : - 1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };\n\t\n\t\t\tvar state = STATE.NONE;\n\t\n\t\t\t// for reset\n\t\n\t\t\tthis.target0 = this.target.clone();\n\t\t\tthis.position0 = this.object.position.clone();\n\t\t\tthis.zoom0 = this.object.zoom;\n\t\n\t\t\t// events\n\t\n\t\t\tvar changeEvent = { type: 'change' };\n\t\t\tvar startEvent = { type: 'start' };\n\t\t\tvar endEvent = { type: 'end' };\n\t\n\t\t\t// pass in x,y of change desired in pixel space,\n\t\t\t// right and down are positive\n\t\t\tfunction pan( deltaX, deltaY ) {\n\t\n\t\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\t\n\t\t\t\tconstraint.pan( deltaX, deltaY, element.clientWidth, element.clientHeight );\n\t\n\t\t\t}\n\t\n\t\t\tthis.update = function () {\n\t\n\t\t\t\tif ( this.autoRotate && state === STATE.NONE ) {\n\t\n\t\t\t\t\tconstraint.rotateLeft( getAutoRotationAngle() );\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( constraint.update() === true ) {\n\t\n\t\t\t\t\tthis.dispatchEvent( changeEvent );\n\t\n\t\t\t\t}\n\t\n\t\t\t};\n\t\n\t\t\tthis.reset = function () {\n\t\n\t\t\t\tstate = STATE.NONE;\n\t\n\t\t\t\tthis.target.copy( this.target0 );\n\t\t\t\tthis.object.position.copy( this.position0 );\n\t\t\t\tthis.object.zoom = this.zoom0;\n\t\n\t\t\t\tthis.object.updateProjectionMatrix();\n\t\t\t\tthis.dispatchEvent( changeEvent );\n\t\n\t\t\t\tthis.update();\n\t\n\t\t\t};\n\t\n\t\t\tfunction getAutoRotationAngle() {\n\t\n\t\t\t\treturn 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\t\n\t\t\t}\n\t\n\t\t\tfunction getZoomScale() {\n\t\n\t\t\t\treturn Math.pow( 0.95, scope.zoomSpeed );\n\t\n\t\t\t}\n\t\n\t\t\tfunction onMouseDown( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tevent.preventDefault();\n\t\n\t\t\t\tif ( event.button === scope.mouseButtons.ORBIT ) {\n\t\n\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\n\t\t\t\t\tstate = STATE.ROTATE;\n\t\n\t\t\t\t\trotateStart.set( event.clientX, event.clientY );\n\t\n\t\t\t\t} else if ( event.button === scope.mouseButtons.ZOOM ) {\n\t\n\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\n\t\t\t\t\tstate = STATE.DOLLY;\n\t\n\t\t\t\t\tdollyStart.set( event.clientX, event.clientY );\n\t\n\t\t\t\t} else if ( event.button === scope.mouseButtons.PAN ) {\n\t\n\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\n\t\t\t\t\tstate = STATE.PAN;\n\t\n\t\t\t\t\tpanStart.set( event.clientX, event.clientY );\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( state !== STATE.NONE ) {\n\t\n\t\t\t\t\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\t\t\t\t\tdocument.addEventListener( 'mouseup', onMouseUp, false );\n\t\t\t\t\tscope.dispatchEvent( startEvent );\n\t\n\t\t\t\t}\n\t\n\t\t\t}\n\t\n\t\t\tfunction onMouseMove( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tevent.preventDefault();\n\t\n\t\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\t\n\t\t\t\tif ( state === STATE.ROTATE ) {\n\t\n\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\n\t\t\t\t\trotateEnd.set( event.clientX, event.clientY );\n\t\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\t\n\t\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\t\tconstraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\t\n\t\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\t\tconstraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\t\n\t\t\t\t\trotateStart.copy( rotateEnd );\n\t\n\t\t\t\t} else if ( state === STATE.DOLLY ) {\n\t\n\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\n\t\t\t\t\tdollyEnd.set( event.clientX, event.clientY );\n\t\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\t\n\t\t\t\t\tif ( dollyDelta.y > 0 ) {\n\t\n\t\t\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\t\n\t\t\t\t\t} else if ( dollyDelta.y < 0 ) {\n\t\n\t\t\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\t\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdollyStart.copy( dollyEnd );\n\t\n\t\t\t\t} else if ( state === STATE.PAN ) {\n\t\n\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\n\t\t\t\t\tpanEnd.set( event.clientX, event.clientY );\n\t\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\n\t\t\t\t\tpan( panDelta.x, panDelta.y );\n\t\n\t\t\t\t\tpanStart.copy( panEnd );\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( state !== STATE.NONE ) scope.update();\n\t\n\t\t\t}\n\t\n\t\t\tfunction onMouseUp( /* event */ ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\t\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\t\t\t\tscope.dispatchEvent( endEvent );\n\t\t\t\tstate = STATE.NONE;\n\t\n\t\t\t}\n\t\n\t\t\tfunction onMouseWheel( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE ) return;\n\t\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\n\t\t\t\tvar delta = 0;\n\t\n\t\t\t\tif ( event.wheelDelta !== undefined ) {\n\t\n\t\t\t\t\t// WebKit / Opera / Explorer 9\n\t\n\t\t\t\t\tdelta = event.wheelDelta;\n\t\n\t\t\t\t} else if ( event.detail !== undefined ) {\n\t\n\t\t\t\t\t// Firefox\n\t\n\t\t\t\t\tdelta = - event.detail;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( delta > 0 ) {\n\t\n\t\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\t\n\t\t\t\t} else if ( delta < 0 ) {\n\t\n\t\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\t\n\t\t\t\t}\n\t\n\t\t\t\tscope.update();\n\t\t\t\tscope.dispatchEvent( startEvent );\n\t\t\t\tscope.dispatchEvent( endEvent );\n\t\n\t\t\t}\n\t\n\t\t\tfunction onKeyDown( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return;\n\t\n\t\t\t\tswitch ( event.keyCode ) {\n\t\n\t\t\t\t\tcase scope.keys.UP:\n\t\t\t\t\t\tpan( 0, scope.keyPanSpeed );\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase scope.keys.BOTTOM:\n\t\t\t\t\t\tpan( 0, - scope.keyPanSpeed );\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase scope.keys.LEFT:\n\t\t\t\t\t\tpan( scope.keyPanSpeed, 0 );\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase scope.keys.RIGHT:\n\t\t\t\t\t\tpan( - scope.keyPanSpeed, 0 );\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t}\n\t\n\t\t\t}\n\t\n\t\t\tfunction touchstart( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tswitch ( event.touches.length ) {\n\t\n\t\t\t\t\tcase 1:\t// one-fingered touch: rotate\n\t\n\t\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\n\t\t\t\t\t\tstate = STATE.TOUCH_ROTATE;\n\t\n\t\t\t\t\t\trotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 2:\t// two-fingered touch: dolly\n\t\n\t\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\n\t\t\t\t\t\tstate = STATE.TOUCH_DOLLY;\n\t\n\t\t\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\t\t\t\t\t\tdollyStart.set( 0, distance );\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 3: // three-fingered touch: pan\n\t\n\t\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\n\t\t\t\t\t\tstate = STATE.TOUCH_PAN;\n\t\n\t\t\t\t\t\tpanStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tdefault:\n\t\n\t\t\t\t\t\tstate = STATE.NONE;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( state !== STATE.NONE ) scope.dispatchEvent( startEvent );\n\t\n\t\t\t}\n\t\n\t\t\tfunction touchmove( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\n\t\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\t\n\t\t\t\tswitch ( event.touches.length ) {\n\t\n\t\t\t\t\tcase 1: // one-fingered touch: rotate\n\t\n\t\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\t\t\t\t\tif ( state !== STATE.TOUCH_ROTATE ) return;\n\t\n\t\t\t\t\t\trotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\t\n\t\t\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\t\t\tconstraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\t\t\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\t\t\tconstraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\t\n\t\t\t\t\t\trotateStart.copy( rotateEnd );\n\t\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 2: // two-fingered touch: dolly\n\t\n\t\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\t\t\t\t\tif ( state !== STATE.TOUCH_DOLLY ) return;\n\t\n\t\t\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\t\n\t\t\t\t\t\tdollyEnd.set( 0, distance );\n\t\t\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\t\n\t\t\t\t\t\tif ( dollyDelta.y > 0 ) {\n\t\n\t\t\t\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\t\n\t\t\t\t\t\t} else if ( dollyDelta.y < 0 ) {\n\t\n\t\t\t\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\t\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tdollyStart.copy( dollyEnd );\n\t\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 3: // three-fingered touch: pan\n\t\n\t\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\t\t\t\t\tif ( state !== STATE.TOUCH_PAN ) return;\n\t\n\t\t\t\t\t\tpanEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\n\t\t\t\t\t\tpan( panDelta.x, panDelta.y );\n\t\n\t\t\t\t\t\tpanStart.copy( panEnd );\n\t\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tdefault:\n\t\n\t\t\t\t\t\tstate = STATE.NONE;\n\t\n\t\t\t\t}\n\t\n\t\t\t}\n\t\n\t\t\tfunction touchend( /* event */ ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tscope.dispatchEvent( endEvent );\n\t\t\t\tstate = STATE.NONE;\n\t\n\t\t\t}\n\t\n\t\t\tfunction contextmenu( event ) {\n\t\n\t\t\t\tevent.preventDefault();\n\t\n\t\t\t}\n\t\n\t\t\tthis.dispose = function() {\n\t\n\t\t\t\tthis.domElement.removeEventListener( 'contextmenu', contextmenu, false );\n\t\t\t\tthis.domElement.removeEventListener( 'mousedown', onMouseDown, false );\n\t\t\t\tthis.domElement.removeEventListener( 'mousewheel', onMouseWheel, false );\n\t\t\t\tthis.domElement.removeEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox\n\t\n\t\t\t\tthis.domElement.removeEventListener( 'touchstart', touchstart, false );\n\t\t\t\tthis.domElement.removeEventListener( 'touchend', touchend, false );\n\t\t\t\tthis.domElement.removeEventListener( 'touchmove', touchmove, false );\n\t\n\t\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\t\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\t\n\t\t\t\twindow.removeEventListener( 'keydown', onKeyDown, false );\n\t\n\t\t\t}\n\t\n\t\t\tthis.domElement.addEventListener( 'contextmenu', contextmenu, false );\n\t\n\t\t\tthis.domElement.addEventListener( 'mousedown', onMouseDown, false );\n\t\t\tthis.domElement.addEventListener( 'mousewheel', onMouseWheel, false );\n\t\t\tthis.domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox\n\t\n\t\t\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\t\t\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\t\t\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\t\n\t\t\twindow.addEventListener( 'keydown', onKeyDown, false );\n\t\n\t\t\t// force an update at start\n\t\t\tthis.update();\n\t\n\t\t};\n\t\n\t\tOrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n\t\tOrbitControls.prototype.constructor = OrbitControls;\n\t\n\t\tObject.defineProperties( OrbitControls.prototype, {\n\t\n\t\t\tobject: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.object;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\ttarget: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.target;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: target is now immutable. Use target.set() instead.' );\n\t\t\t\t\tthis.constraint.target.copy( value );\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tminDistance : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.minDistance;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.minDistance = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tmaxDistance : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.maxDistance;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.maxDistance = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tminZoom : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.minZoom;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.minZoom = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tmaxZoom : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.maxZoom;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.maxZoom = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tminPolarAngle : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.minPolarAngle;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.minPolarAngle = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tmaxPolarAngle : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.maxPolarAngle;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.maxPolarAngle = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tminAzimuthAngle : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.minAzimuthAngle;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.minAzimuthAngle = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tmaxAzimuthAngle : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.maxAzimuthAngle;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.maxAzimuthAngle = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tenableDamping : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.enableDamping;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.enableDamping = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tdampingFactor : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.dampingFactor;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.dampingFactor = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\t// backward compatibility\n\t\n\t\t\tnoZoom: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n\t\t\t\t\treturn ! this.enableZoom;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n\t\t\t\t\tthis.enableZoom = ! value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tnoRotate: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n\t\t\t\t\treturn ! this.enableRotate;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n\t\t\t\t\tthis.enableRotate = ! value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tnoPan: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n\t\t\t\t\treturn ! this.enablePan;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n\t\t\t\t\tthis.enablePan = ! value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tnoKeys: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n\t\t\t\t\treturn ! this.enableKeys;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n\t\t\t\t\tthis.enableKeys = ! value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tstaticMoving : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n\t\t\t\t\treturn ! this.constraint.enableDamping;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n\t\t\t\t\tthis.constraint.enableDamping = ! value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tdynamicDampingFactor : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n\t\t\t\t\treturn this.constraint.dampingFactor;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n\t\t\t\t\tthis.constraint.dampingFactor = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t}\n\t\n\t\t} );\n\t\n\t\treturn OrbitControls;\n\t}\n\n\n/***/ },\n/* 31 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Layer2 = __webpack_require__(32);\n\t\n\tvar _Layer3 = _interopRequireDefault(_Layer2);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar EnvironmentLayer = (function (_Layer) {\n\t _inherits(EnvironmentLayer, _Layer);\n\t\n\t function EnvironmentLayer() {\n\t _classCallCheck(this, EnvironmentLayer);\n\t\n\t _get(Object.getPrototypeOf(EnvironmentLayer.prototype), 'constructor', this).call(this);\n\t\n\t this._initLights();\n\t this._initGrid();\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t _createClass(EnvironmentLayer, [{\n\t key: '_onAdd',\n\t value: function _onAdd() {}\n\t\n\t // Not fleshed out or thought through yet\n\t //\n\t // Lights could potentially be put it their own 'layer' to keep this class\n\t // much simpler and less messy\n\t }, {\n\t key: '_initLights',\n\t value: function _initLights() {\n\t // Position doesn't really matter (the angle is important), however it's\n\t // used here so the helpers look more natural.\n\t\n\t var directionalLight = new _three2['default'].DirectionalLight(0x999999);\n\t directionalLight.intesity = 0.1;\n\t directionalLight.position.x = 100;\n\t directionalLight.position.y = 100;\n\t directionalLight.position.z = 100;\n\t\n\t var directionalLight2 = new _three2['default'].DirectionalLight(0x999999);\n\t directionalLight2.intesity = 0.1;\n\t directionalLight2.position.x = -100;\n\t directionalLight2.position.y = 100;\n\t directionalLight2.position.z = -100;\n\t\n\t var helper = new _three2['default'].DirectionalLightHelper(directionalLight, 10);\n\t var helper2 = new _three2['default'].DirectionalLightHelper(directionalLight2, 10);\n\t\n\t this._layer.add(directionalLight);\n\t this._layer.add(directionalLight2);\n\t\n\t this._layer.add(helper);\n\t this._layer.add(helper2);\n\t }\n\t\n\t // Add grid helper for context during initial development\n\t }, {\n\t key: '_initGrid',\n\t value: function _initGrid() {\n\t var size = 4000;\n\t var step = 100;\n\t\n\t var gridHelper = new _three2['default'].GridHelper(size, step);\n\t this._layer.add(gridHelper);\n\t }\n\t }]);\n\t\n\t return EnvironmentLayer;\n\t})(_Layer3['default']);\n\t\n\texports['default'] = function () {\n\t return new EnvironmentLayer();\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 32 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _eventemitter3 = __webpack_require__(2);\n\t\n\tvar _eventemitter32 = _interopRequireDefault(_eventemitter3);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _engineScene = __webpack_require__(25);\n\t\n\tvar _engineScene2 = _interopRequireDefault(_engineScene);\n\t\n\tvar Layer = (function (_EventEmitter) {\n\t _inherits(Layer, _EventEmitter);\n\t\n\t function Layer() {\n\t _classCallCheck(this, Layer);\n\t\n\t _get(Object.getPrototypeOf(Layer.prototype), 'constructor', this).call(this);\n\t\n\t this._layer = new _three2['default'].Object3D();\n\t }\n\t\n\t // Add layer to world instance and store world reference\n\t\n\t _createClass(Layer, [{\n\t key: 'addTo',\n\t value: function addTo(world) {\n\t world.addLayer(this);\n\t return this;\n\t }\n\t\n\t // Internal method called by World.addLayer to actually add the layer\n\t }, {\n\t key: '_addToWorld',\n\t value: function _addToWorld(world) {\n\t this._world = world;\n\t this._onAdd(world);\n\t this.emit('added');\n\t }\n\t }]);\n\t\n\t return Layer;\n\t})(_eventemitter32['default']);\n\t\n\texports['default'] = Layer;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 33 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Layer2 = __webpack_require__(32);\n\t\n\tvar _Layer3 = _interopRequireDefault(_Layer2);\n\t\n\tvar _Surface = __webpack_require__(34);\n\t\n\tvar _Surface2 = _interopRequireDefault(_Surface);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\t// TODO: Prevent tiles from being loaded if they are further than a certain\n\t// distance from the camera and are unlikely to be seen anyway\n\t\n\tvar GridLayer = (function (_Layer) {\n\t _inherits(GridLayer, _Layer);\n\t\n\t function GridLayer() {\n\t _classCallCheck(this, GridLayer);\n\t\n\t _get(Object.getPrototypeOf(GridLayer.prototype), 'constructor', this).call(this);\n\t\n\t this._minLOD = 3;\n\t this._maxLOD = 18;\n\t this._frustum = new _three2['default'].Frustum();\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t _createClass(GridLayer, [{\n\t key: '_onAdd',\n\t value: function _onAdd(world) {\n\t var _this = this;\n\t\n\t this._initEvents();\n\t\n\t // Trigger initial quadtree calculation on the next frame\n\t //\n\t // TODO: This is a hack to ensure the camera is all set up - a better\n\t // solution should be found\n\t setTimeout(function () {\n\t _this._calculateLOD();\n\t }, 0);\n\t }\n\t }, {\n\t key: '_initEvents',\n\t value: function _initEvents() {\n\t var _this2 = this;\n\t\n\t this._world.on('move', function (latlon) {\n\t _this2._calculateLOD();\n\t });\n\t }\n\t }, {\n\t key: '_updateFrustum',\n\t value: function _updateFrustum() {\n\t var camera = this._world.getCamera();\n\t var projScreenMatrix = new _three2['default'].Matrix4();\n\t projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);\n\t\n\t this._frustum.setFromMatrix(camera.projectionMatrix);\n\t this._frustum.setFromMatrix(new _three2['default'].Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse));\n\t }\n\t }, {\n\t key: '_surfaceInFrustum',\n\t value: function _surfaceInFrustum(surface) {\n\t return this._frustum.intersectsBox(new _three2['default'].Box3(new _three2['default'].Vector3(surface.bounds[0], 0, surface.bounds[3]), new _three2['default'].Vector3(surface.bounds[2], 0, surface.bounds[1])));\n\t }\n\t }, {\n\t key: '_calculateLOD',\n\t value: function _calculateLOD() {\n\t var _this3 = this;\n\t\n\t var camera = this._world.getCamera();\n\t\n\t // 1. Update and retrieve camera frustum\n\t this._updateFrustum(this._frustum, camera);\n\t\n\t // 2. Add the four root items of the quadtree to a check list\n\t var checkList = this._checklist;\n\t checkList = [];\n\t checkList.push((0, _Surface2['default'])('0', this._world));\n\t checkList.push((0, _Surface2['default'])('1', this._world));\n\t checkList.push((0, _Surface2['default'])('2', this._world));\n\t checkList.push((0, _Surface2['default'])('3', this._world));\n\t\n\t // 3. Call Divide, passing in the check list\n\t this._divide(checkList);\n\t\n\t // 4. Render the quadtree items remaining in the check list\n\t checkList.forEach(function (surface, index) {\n\t if (!_this3._surfaceInFrustum(surface)) {\n\t return;\n\t }\n\t\n\t // console.log(surface);\n\t\n\t // surface.render();\n\t _this3._layer.add(surface.mesh);\n\t });\n\t }\n\t }, {\n\t key: '_divide',\n\t value: function _divide(checkList) {\n\t var count = 0;\n\t var currentItem;\n\t var quadkey;\n\t\n\t // 1. Loop until count equals check list length\n\t while (count != checkList.length) {\n\t currentItem = checkList[count];\n\t quadkey = currentItem.quadkey;\n\t\n\t // 2. Increase count and continue loop if quadkey equals max LOD / zoom\n\t if (currentItem.length === this._maxLOD) {\n\t count++;\n\t continue;\n\t }\n\t\n\t // 3. Else, calculate screen-space error metric for quadkey\n\t if (this._screenSpaceError(currentItem)) {\n\t // 4. If error is sufficient...\n\t\n\t // 4a. Remove parent item from the check list\n\t checkList.splice(count, 1);\n\t\n\t // 4b. Add 4 child items to the check list\n\t checkList.push((0, _Surface2['default'])(quadkey + '0', this._world));\n\t checkList.push((0, _Surface2['default'])(quadkey + '1', this._world));\n\t checkList.push((0, _Surface2['default'])(quadkey + '2', this._world));\n\t checkList.push((0, _Surface2['default'])(quadkey + '3', this._world));\n\t\n\t // 4d. Continue the loop without increasing count\n\t continue;\n\t } else {\n\t // 5. Else, increase count and continue loop\n\t count++;\n\t }\n\t }\n\t }\n\t }, {\n\t key: '_screenSpaceError',\n\t value: function _screenSpaceError(surface) {\n\t var minDepth = this._minLOD;\n\t var maxDepth = this._maxLOD;\n\t\n\t var camera = this._world.getCamera();\n\t\n\t // Tweak this value to refine specific point that each quad is subdivided\n\t //\n\t // It's used to multiple the dimensions of the surface sides before\n\t // comparing against the surface distance from camera\n\t var quality = 3.0;\n\t\n\t // 1. Return false if quadkey length is greater than maxDepth\n\t if (surface.quadkey.length > maxDepth) {\n\t return false;\n\t }\n\t\n\t // 2. Return true if quadkey length is less than minDepth\n\t if (surface.quadkey.length < minDepth) {\n\t return true;\n\t }\n\t\n\t // 3. Return false if quadkey bounds are not in view frustum\n\t if (!this._surfaceInFrustum(surface)) {\n\t return false;\n\t }\n\t\n\t // 4. Calculate screen-space error metric\n\t // TODO: Use closest distance to one of the 4 surface corners\n\t var dist = new _three2['default'].Vector3(surface.center[0], 0, surface.center[1]).sub(camera.position).length();\n\t\n\t // console.log(surface, dist);\n\t\n\t var error = quality * surface.side / dist;\n\t\n\t // 5. Return true if error is greater than 1.0, else return false\n\t return error > 1.0;\n\t }\n\t }]);\n\t\n\t return GridLayer;\n\t})(_Layer3['default']);\n\t\n\texports['default'] = function () {\n\t return new GridLayer();\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 34 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tvar _geoLatLon = __webpack_require__(10);\n\t\n\tvar _geoLatLon2 = _interopRequireDefault(_geoLatLon);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar r2d = 180 / Math.PI;\n\t\n\tvar loader = new _three2['default'].TextureLoader();\n\tloader.setCrossOrigin('');\n\t\n\tvar Surface = (function () {\n\t function Surface(quadkey, world) {\n\t _classCallCheck(this, Surface);\n\t\n\t this.world = world;\n\t this.quadkey = quadkey;\n\t this.tile = this._quadkeyToTile(quadkey);\n\t this.bounds = this._tileBounds(this.tile);\n\t this.center = this._boundsToCenter(this.bounds);\n\t this.side = new _three2['default'].Vector3(this.bounds[0], 0, this.bounds[3]).sub(new _three2['default'].Vector3(this.bounds[0], 0, this.bounds[1])).length();\n\t\n\t this.mesh = this._createMesh();\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t _createClass(Surface, [{\n\t key: '_createDebugMesh',\n\t value: function _createDebugMesh() {\n\t var canvas = document.createElement('canvas');\n\t canvas.width = 256;\n\t canvas.height = 256;\n\t\n\t var context = canvas.getContext('2d');\n\t context.font = 'Bold 20px Helvetica Neue, Verdana, Arial';\n\t context.fillStyle = 'rgba(255,0,0,1)';\n\t context.fillText(this.quadkey, 20, canvas.width / 2 + 10);\n\t\n\t var texture = new _three2['default'].Texture(canvas);\n\t\n\t // Silky smooth images when tilted\n\t texture.magFilter = _three2['default'].LinearFilter;\n\t texture.minFilter = _three2['default'].LinearMipMapLinearFilter;\n\t\n\t // TODO: Set this to renderer.getMaxAnisotropy() / 4\n\t texture.anisotropy = 4;\n\t\n\t texture.needsUpdate = true;\n\t\n\t var material = new _three2['default'].MeshBasicMaterial({\n\t map: texture,\n\t transparent: true\n\t });\n\t\n\t var geom = new _three2['default'].PlaneGeometry(this.side, this.side, 1);\n\t var mesh = new _three2['default'].Mesh(geom, material);\n\t\n\t mesh.rotation.x = -90 * Math.PI / 180;\n\t mesh.position.y = 0.1;\n\t\n\t return mesh;\n\t }\n\t }, {\n\t key: '_createMesh',\n\t value: function _createMesh() {\n\t var mesh = new _three2['default'].Object3D();\n\t var geom = new _three2['default'].PlaneGeometry(this.side, this.side, 1);\n\t\n\t var material = new _three2['default'].MeshBasicMaterial();\n\t\n\t var localMesh = new _three2['default'].Mesh(geom, material);\n\t localMesh.rotation.x = -90 * Math.PI / 180;\n\t\n\t mesh.add(localMesh);\n\t\n\t mesh.position.x = this.center[0];\n\t mesh.position.z = this.center[1];\n\t\n\t var box = new _three2['default'].BoxHelper(localMesh);\n\t mesh.add(box);\n\t\n\t mesh.add(this._createDebugMesh());\n\t\n\t // var letter = String.fromCharCode(97 + Math.floor(Math.random() * 26));\n\t // var url = 'http://' + letter + '.basemaps.cartocdn.com/light_nolabels/';\n\t // // var url = 'http://tile.stamen.com/toner-lite/';\n\t //\n\t // loader.load(url + this.tile[2] + '/' + this.tile[0] + '/' + this.tile[1] + '@2x.png', texture => {\n\t // console.log('Loaded');\n\t // // Silky smooth images when tilted\n\t // texture.magFilter = THREE.LinearFilter;\n\t // texture.minFilter = THREE.LinearMipMapLinearFilter;\n\t //\n\t // // TODO: Set this to renderer.getMaxAnisotropy() / 4\n\t // texture.anisotropy = 4;\n\t //\n\t // texture.needsUpdate = true;\n\t //\n\t // var material = new THREE.MeshBasicMaterial({map: texture});\n\t //\n\t // var localMesh = new THREE.Mesh(geom, material);\n\t // localMesh.rotation.x = -90 * Math.PI / 180;\n\t //\n\t // // Sometimes tiles don't appear, even though the images have loaded ok\n\t // // This helps a little but it's a total hack and the real solution needs\n\t // // to be found.\n\t // setTimeout(function() {\n\t // mesh.add(localMesh);\n\t // }, 2000);\n\t //\n\t // mesh.position.x = this.center[0];\n\t // mesh.position.z = this.center[1];\n\t //\n\t // var box = new THREE.BoxHelper(localMesh);\n\t // mesh.add(box);\n\t //\n\t // this._createDebugMesh();\n\t // });\n\t\n\t return mesh;\n\t }\n\t }, {\n\t key: '_quadkeyToTile',\n\t value: function _quadkeyToTile(quadkey) {\n\t var x = 0;\n\t var y = 0;\n\t var z = quadkey.length;\n\t\n\t for (var i = z; i > 0; i--) {\n\t var mask = 1 << i - 1;\n\t var q = +quadkey[z - i];\n\t if (q === 1) {\n\t x |= mask;\n\t }\n\t if (q === 2) {\n\t y |= mask;\n\t }\n\t if (q === 3) {\n\t x |= mask;\n\t y |= mask;\n\t }\n\t }\n\t\n\t return [x, y, z];\n\t }\n\t }, {\n\t key: '_boundsToCenter',\n\t value: function _boundsToCenter(bounds) {\n\t var x = bounds[0] + (bounds[2] - bounds[0]) / 2;\n\t var y = bounds[1] + (bounds[3] - bounds[1]) / 2;\n\t\n\t return [x, y];\n\t }\n\t }, {\n\t key: '_tileBounds',\n\t value: function _tileBounds(tile) {\n\t var boundsWGS84 = this._tileBoundsWGS84(tile);\n\t\n\t var sw = this.world.latLonToPoint((0, _geoLatLon2['default'])(boundsWGS84[1], boundsWGS84[0]));\n\t var ne = this.world.latLonToPoint((0, _geoLatLon2['default'])(boundsWGS84[3], boundsWGS84[2]));\n\t\n\t return [sw.x, sw.y, ne.x, ne.y];\n\t // return [swMerc[0], -swMerc[1], neMerc[0], -neMerc[1]];\n\t }\n\t }, {\n\t key: '_tileBoundsWGS84',\n\t value: function _tileBoundsWGS84(tile) {\n\t var e = this._tile2lon(tile[0] + 1, tile[2]);\n\t var w = this._tile2lon(tile[0], tile[2]);\n\t var s = this._tile2lat(tile[1] + 1, tile[2]);\n\t var n = this._tile2lat(tile[1], tile[2]);\n\t return [w, s, e, n];\n\t }\n\t }, {\n\t key: '_tile2lon',\n\t value: function _tile2lon(x, z) {\n\t return x / Math.pow(2, z) * 360 - 180;\n\t }\n\t }, {\n\t key: '_tile2lat',\n\t value: function _tile2lat(y, z) {\n\t var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z);\n\t return r2d * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n\t }\n\t }]);\n\t\n\t return Surface;\n\t})();\n\t\n\texports['default'] = function (quadkey, world) {\n\t return new Surface(quadkey, world);\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ }\n/******/ ])\n});\n;"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 47fcd39c2099515160d3\n **/","import World from './World';\nimport Controls from './controls/index';\nimport EnvironmentLayer from './layer/environment/EnvironmentLayer';\nimport GridLayer from './layer/tile/GridLayer';\nimport Point from './geo/Point';\nimport LatLon from './geo/LatLon';\n\nconst VIZI = {\n version: '0.3',\n\n // Public API\n World: World,\n Controls: Controls,\n EnvironmentLayer: EnvironmentLayer,\n GridLayer: GridLayer,\n Point: Point,\n LatLon: LatLon\n};\n\nexport default VIZI;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/vizicities.js\n **/","import EventEmitter from 'eventemitter3';\nimport extend from 'lodash.assign';\nimport CRS from './geo/CRS/index';\nimport Point from './geo/Point';\nimport LatLon from './geo/LatLon';\nimport Engine from './engine/Engine';\n\n// Pretty much any event someone using ViziCities would need will be emitted or\n// proxied by World (eg. render events, etc)\n\nclass World extends EventEmitter {\n constructor(domId, options) {\n super();\n\n var defaults = {\n crs: CRS.EPSG3857\n };\n\n this.options = extend(defaults, options);\n\n this._layers = [];\n this._controls = [];\n\n this._initContainer(domId);\n this._initEngine();\n this._initEvents();\n\n // Kick off the update and render loop\n this._update();\n }\n\n _initContainer(domId) {\n this._container = document.getElementById(domId);\n }\n\n _initEngine() {\n this._engine = Engine(this._container);\n\n // Engine events\n //\n // Consider proxying these through events on World for public access\n // this._engine.on('preRender', () => {});\n // this._engine.on('postRender', () => {});\n }\n\n _initEvents() {\n this.on('controlsMoveEnd', this._onControlsMoveEnd);\n }\n\n _onControlsMoveEnd(point) {\n var _point = Point(point.x, point.z);\n this._resetView(this.pointToLatLon(_point));\n }\n\n // Reset world view\n _resetView(latlon) {\n this.emit('preResetView');\n\n this._moveStart();\n this._move(latlon);\n this._moveEnd();\n\n this.emit('postResetView');\n }\n\n _moveStart() {\n this.emit('moveStart');\n }\n\n _move(latlon) {\n this._lastPosition = latlon;\n this.emit('move', latlon);\n }\n _moveEnd() {\n this.emit('moveEnd');\n }\n\n _update() {\n var delta = this._engine.clock.getDelta();\n\n // Once _update is called it will run forever, for now\n window.requestAnimationFrame(this._update.bind(this));\n\n // Update controls\n this._controls.forEach(controls => {\n controls.update();\n });\n\n this.emit('preUpdate');\n this._engine.update(delta);\n this.emit('postUpdate');\n }\n\n // Set world view\n setView(latlon) {\n // Store initial geographic coordinate for the [0,0,0] world position\n //\n // The origin point doesn't move in three.js / 3D space so only set it once\n // here instead of every time _resetView is called\n //\n // If it was updated every time then coorindates would shift over time and\n // would be out of place / context with previously-placed points (0,0 would\n // refer to a different point each time)\n this._originLatlon = latlon;\n this._originPoint = this.project(latlon);\n\n this._resetView(latlon);\n return this;\n }\n\n // Return world geographic position\n getPosition() {\n return this._lastPosition;\n }\n\n // Transform geographic coordinate to world point\n //\n // This doesn't take into account the origin offset\n //\n // For example, this takes a geographic coordinate and returns a point\n // relative to the origin point of the projection (not the world)\n project(latlon) {\n return this.options.crs.latLonToPoint(LatLon(latlon));\n }\n\n // Transform world point to geographic coordinate\n //\n // This doesn't take into account the origin offset\n //\n // For example, this takes a point relative to the origin point of the\n // projection (not the world) and returns a geographic coordinate\n unproject(point) {\n return this.options.crs.pointToLatLon(Point(point));\n }\n\n // Takes into account the origin offset\n //\n // For example, this takes a geographic coordinate and returns a point\n // relative to the three.js / 3D origin (0,0)\n latLonToPoint(latlon) {\n var projectedPoint = this.project(LatLon(latlon));\n return projectedPoint._subtract(this._originPoint);\n }\n\n // Takes into account the origin offset\n //\n // For example, this takes a point relative to the three.js / 3D origin (0,0)\n // and returns the exact geographic coordinate at that point\n pointToLatLon(point) {\n var projectedPoint = Point(point).add(this._originPoint);\n return this.unproject(projectedPoint);\n }\n\n // Unsure if it's a good idea to expose this here for components like\n // GridLayer to use (eg. to keep track of a frustum)\n getCamera() {\n return this._engine._camera;\n }\n\n addLayer(layer) {\n layer._addToWorld(this);\n\n this._layers.push(layer);\n\n // Could move this into Layer but it'll do here for now\n this._engine._scene.add(layer._layer);\n\n this.emit('layerAdded', layer);\n return this;\n }\n\n // Remove layer and perform clean up operations\n removeLayer(layer) {}\n\n addControls(controls) {\n controls._addToWorld(this);\n\n this._controls.push(controls);\n\n this.emit('controlsAdded', controls);\n return this;\n }\n\n removeControls(controls) {}\n}\n\n// Initialise without requiring new keyword\nexport default function(domId, options) {\n return new World(domId, options);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/World.js\n **/","'use strict';\n\n//\n// We store our EE objects in a plain object whose properties are event names.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// `~` to make sure that the built-in object properties are not overridden or\n// used as an attack vector.\n// We also assume that `Object.create(null)` is available when the event name\n// is an ES6 Symbol.\n//\nvar prefix = typeof Object.create !== 'function' ? '~' : false;\n\n/**\n * Representation of a single EventEmitter function.\n *\n * @param {Function} fn Event handler to be called.\n * @param {Mixed} context Context for function execution.\n * @param {Boolean} once Only emit once\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal EventEmitter interface that is molded against the Node.js\n * EventEmitter interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() { /* Nothing to set */ }\n\n/**\n * Holds the assigned EventEmitters by name.\n *\n * @type {Object}\n * @private\n */\nEventEmitter.prototype._events = undefined;\n\n/**\n * Return a list of assigned event listeners.\n *\n * @param {String} event The events that should be listed.\n * @param {Boolean} exists We only need to know if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events && this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Emit an event to all registered event listeners.\n *\n * @param {String} event The name of the event.\n * @returns {Boolean} Indication if we've emitted an event.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events || !this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if ('function' === typeof listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Register a new EventListener for the given event.\n *\n * @param {String} event Name of the event.\n * @param {Functon} fn Callback function.\n * @param {Mixed} context The context of the function.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events) this._events = prefix ? {} : Object.create(null);\n if (!this._events[evt]) this._events[evt] = listener;\n else {\n if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [\n this._events[evt], listener\n ];\n }\n\n return this;\n};\n\n/**\n * Add an EventListener that's only called once.\n *\n * @param {String} event Name of the event.\n * @param {Function} fn Callback function.\n * @param {Mixed} context The context of the function.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events) this._events = prefix ? {} : Object.create(null);\n if (!this._events[evt]) this._events[evt] = listener;\n else {\n if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [\n this._events[evt], listener\n ];\n }\n\n return this;\n};\n\n/**\n * Remove event listeners.\n *\n * @param {String} event The event we want to remove.\n * @param {Function} fn The listener that we need to find.\n * @param {Mixed} context Only remove listeners matching this context.\n * @param {Boolean} once Only remove once listeners.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events || !this._events[evt]) return this;\n\n var listeners = this._events[evt]\n , events = [];\n\n if (fn) {\n if (listeners.fn) {\n if (\n listeners.fn !== fn\n || (once && !listeners.once)\n || (context && listeners.context !== context)\n ) {\n events.push(listeners);\n }\n } else {\n for (var i = 0, length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) {\n this._events[evt] = events.length === 1 ? events[0] : events;\n } else {\n delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners or only the listeners for the specified event.\n *\n * @param {String} event The event want to remove all listeners for.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n if (!this._events) return this;\n\n if (event) delete this._events[prefix ? prefix + event : event];\n else this._events = prefix ? {} : Object.create(null);\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/eventemitter3/index.js\n ** module id = 2\n ** module chunks = 0\n **/","/**\n * lodash 4.0.2 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar keys = require('lodash.keys'),\n rest = require('lodash.rest');\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if ((!eq(objValue, value) ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object) {\n return copyObjectWith(source, props, object);\n}\n\n/**\n * This function is like `copyObject` except that it accepts a function to\n * customize copied values.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObjectWith(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index],\n newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key];\n\n assignValue(object, key, newValue);\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return rest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = typeof customizer == 'function' ? (length--, customizer) : undefined;\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\n/**\n * Checks if the provided arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'fred' };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @type Function\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null &&\n !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array constructors, and\n // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Assigns own enumerable properties of source objects to the destination\n * object. Source objects are applied from left to right. Subsequent sources\n * overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function Foo() {\n * this.c = 3;\n * }\n *\n * function Bar() {\n * this.e = 5;\n * }\n *\n * Foo.prototype.d = 4;\n * Bar.prototype.f = 6;\n *\n * _.assign({ 'a': 1 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3, 'e': 5 }\n */\nvar assign = createAssigner(function(object, source) {\n copyObject(source, keys(source), object);\n});\n\nmodule.exports = assign;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash.assign/index.js\n ** module id = 3\n ** module chunks = 0\n **/","/**\n * lodash 4.0.2 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n stringTag = '[object String]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar getPrototypeOf = Object.getPrototypeOf,\n propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = Object.keys;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,\n // that are composed entirely of index properties, return `false` for\n // `hasOwnProperty` checks of them.\n return hasOwnProperty.call(object, key) ||\n (typeof object == 'object' && key in object && getPrototypeOf(object) === null);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't skip the constructor\n * property of prototypes or treat sparse arrays as dense.\n *\n * @private\n * @type Function\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n return nativeKeys(Object(object));\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\n/**\n * Creates an array of index keys for `object` values of arrays,\n * `arguments` objects, and strings, otherwise `null` is returned.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array|null} Returns index keys, else `null`.\n */\nfunction indexKeys(object) {\n var length = object ? object.length : undefined;\n if (isLength(length) &&\n (isArray(object) || isString(object) || isArguments(object))) {\n return baseTimes(length, String);\n }\n return null;\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @type Function\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @type Function\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null &&\n !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @type Function\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array constructors, and\n // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n var isProto = isPrototype(object);\n if (!(isProto || isArrayLike(object))) {\n return baseKeys(object);\n }\n var indexes = indexKeys(object),\n skipIndexes = !!indexes,\n result = indexes || [],\n length = result.length;\n\n for (var key in object) {\n if (baseHas(object, key) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n !(isProto && key == 'constructor')) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = keys;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash.keys/index.js\n ** module id = 4\n ** module chunks = 0\n **/","/**\n * lodash 4.0.1 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n var length = args.length;\n switch (length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as an array.\n *\n * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n switch (start) {\n case 0: return func.call(this, array);\n case 1: return func.call(this, args[0], array);\n case 2: return func.call(this, args[0], args[1], array);\n }\n var otherArgs = Array(start + 1);\n index = -1;\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array constructors, and\n // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3');\n * // => 3\n */\nfunction toInteger(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n var remainder = value % 1;\n return value === value ? (remainder ? value - remainder : value) : 0;\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3);\n * // => 3\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3');\n * // => 3\n */\nfunction toNumber(value) {\n if (isObject(value)) {\n var other = isFunction(value.valueOf) ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = rest;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash.rest/index.js\n ** module id = 5\n ** module chunks = 0\n **/","import EPSG3857 from './CRS.EPSG3857';\nimport {EPSG900913} from './CRS.EPSG3857';\nimport EPSG3395 from './CRS.EPSG3395';\nimport EPSG4326 from './CRS.EPSG4326';\nimport Simple from './CRS.Simple';\nimport Proj4 from './CRS.Proj4';\n\nconst CRS = {};\n\nCRS.EPSG3857 = EPSG3857;\nCRS.EPSG900913 = EPSG900913;\nCRS.EPSG3395 = EPSG3395;\nCRS.EPSG4326 = EPSG4326;\nCRS.Simple = Simple;\nCRS.Proj4 = Proj4;\n\nexport default CRS;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/index.js\n **/","/*\n * CRS.EPSG3857 (WGS 84 / Pseudo-Mercator) CRS implementation.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG3857.js\n */\n\nimport extend from 'lodash.assign';\nimport Earth from './CRS.Earth';\nimport SphericalMercator from '../projection/Projection.SphericalMercator';\nimport Transformation from '../../util/Transformation';\n\nvar _EPSG3857 = {\n code: 'EPSG:3857',\n projection: SphericalMercator,\n\n // Work out how to de-dupe this (scoping issue)\n transformScale: 1 / (Math.PI * SphericalMercator.R),\n\n // Scale and transformation inputs changed to account for central origin in\n // WebGL, instead of top-left origin used in Leaflet\n transformation: (function() {\n // TODO: Cannot use this.transformScale due to scope\n var scale = 1 / (Math.PI * SphericalMercator.R);\n\n return new Transformation(scale, 0, -scale, 0);\n }())\n};\n\nconst EPSG3857 = extend({}, Earth, _EPSG3857);\n\nconst EPSG900913 = extend({}, EPSG3857, {\n code: 'EPSG:900913'\n});\n\nexport {EPSG900913};\n\nexport default EPSG3857;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.EPSG3857.js\n **/","/*\n * CRS.Earth is the base class for all CRS representing Earth.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.Earth.js\n */\n\nimport extend from 'lodash.assign';\nimport CRS from './CRS';\nimport LatLon from '../LatLon';\n\nconst Earth = {\n wrapLon: [-180, 180],\n\n R: 6378137,\n\n // Distance between two geographical points using spherical law of cosines\n // approximation or Haversine\n //\n // See: http://www.movable-type.co.uk/scripts/latlong.html\n distance: function(latlon1, latlon2, accurate) {\n var rad = Math.PI / 180;\n\n var lat1;\n var lat2;\n\n var a;\n\n if (!accurate) {\n lat1 = latlon1.lat * rad;\n lat2 = latlon2.lat * rad;\n\n a = Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos((latlon2.lon - latlon1.lon) * rad);\n\n return this.R * Math.acos(Math.min(a, 1));\n } else {\n lat1 = latlon1.lat * rad;\n lat2 = latlon2.lat * rad;\n\n var lon1 = latlon1.lon * rad;\n var lon2 = latlon2.lon * rad;\n\n var deltaLat = lat2 - lat1;\n var deltaLon = lon2 - lon1;\n\n var halfDeltaLat = deltaLat / 2;\n var halfDeltaLon = deltaLon / 2;\n\n a = Math.sin(halfDeltaLat) * Math.sin(halfDeltaLat) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(halfDeltaLon) * Math.sin(halfDeltaLon);\n\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\n return this.R * c;\n }\n },\n\n // Scale factor for converting between real metres and projected metres\n //\n // projectedMetres = realMetres * pointScale\n // realMetres = projectedMetres / pointScale\n //\n // Defaults to a scale factor of 1 if no calculation method exists\n //\n // Probably need to run this through the CRS transformation or similar so the\n // resulting scale is relative to the dimensions of the world space\n // Eg. 1 metre in projected space is likly scaled up or down to some other\n // number\n pointScale: function(latlon, accurate) {\n return (this.projection.pointScale) ? this.projection.pointScale(latlon, accurate) : [1, 1];\n },\n\n // Convert real metres to projected units\n //\n // Latitude scale is chosen because it fluctuates more than longitude\n metresToProjected: function(metres, pointScale) {\n return metres * pointScale[1];\n },\n\n // Convert projected units to real metres\n //\n // Latitude scale is chosen because it fluctuates more than longitude\n projectedToMetres: function(projectedUnits, pointScale) {\n return projectedUnits / pointScale[1];\n },\n\n // Convert real metres to a value in world (WebGL) units\n metresToWorld: function(metres, pointScale, zoom) {\n // Transform metres to projected metres using the latitude point scale\n //\n // Latitude scale is chosen because it fluctuates more than longitude\n var projectedMetres = this.metresToProjected(metres, pointScale);\n\n var scale = this.scale(zoom);\n\n // Half scale if using zoom as WebGL origin is in the centre, not top left\n if (zoom) {\n scale /= 2;\n }\n\n // Scale projected metres\n var scaledMetres = (scale * (this.transformScale * projectedMetres)) / pointScale[1];\n\n return scaledMetres;\n },\n\n // Convert world (WebGL) units to a value in real metres\n worldToMetres: function(worldUnits, pointScale, zoom) {\n var scale = this.scale(zoom);\n\n // Half scale if using zoom as WebGL origin is in the centre, not top left\n if (zoom) {\n scale /= 2;\n }\n\n var projectedUnits = ((worldUnits / scale) / this.transformScale) * pointScale[1];\n var realMetres = this.projectedToMetres(projectedUnits, pointScale);\n\n return realMetres;\n }\n};\n\nexport default extend({}, CRS, Earth);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.Earth.js\n **/","/*\n * CRS is the base object for all defined CRS (Coordinate Reference Systems)\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.js\n */\n\nimport LatLon from '../LatLon';\nimport Point from '../Point';\nimport wrapNum from '../../util/wrapNum';\n\nconst CRS = {\n // Scale factor determines final dimensions of world space\n //\n // Projection transformation in range -1 to 1 is multiplied by scale factor to\n // find final world coordinates\n //\n // Scale factor can be considered as half the amount of the desired dimension\n // for the largest side when transformation is equal to 1 or -1, or as the\n // distance between 0 and 1 on the largest side\n //\n // For example, if you want the world dimensions to be between -1000 and 1000\n // then the scale factor will be 1000\n scaleFactor: 1000000,\n\n // Converts geo coords to pixel / WebGL ones\n latLonToPoint: function(latlon, zoom) {\n var projectedPoint = this.projection.project(latlon);\n var scale = this.scale(zoom);\n\n // Half scale if using zoom as WebGL origin is in the centre, not top left\n if (zoom) {\n scale /= 2;\n }\n\n return this.transformation._transform(projectedPoint, scale);\n },\n\n // Converts pixel / WebGL coords to geo coords\n pointToLatLon: function(point, zoom) {\n var scale = this.scale(zoom);\n\n // Half scale if using zoom as WebGL origin is in the centre, not top left\n if (zoom) {\n scale /= 2;\n }\n\n var untransformedPoint = this.transformation.untransform(point, scale);\n\n return this.projection.unproject(untransformedPoint);\n },\n\n // Converts geo coords to projection-specific coords (e.g. in meters)\n project: function(latlon) {\n return this.projection.project(latlon);\n },\n\n // Converts projected coords to geo coords\n unproject: function(point) {\n return this.projection.unproject(point);\n },\n\n // If zoom is provided, returns the map width in pixels for a given zoom\n // Else, provides fixed scale value\n scale: function(zoom) {\n // If zoom is provided then return scale based on map tile zoom\n if (zoom >= 0) {\n return 256 * Math.pow(2, zoom);\n // Else, return fixed scale value to expand projected coordinates from\n // their 0 to 1 range into something more practical\n } else {\n return this.scaleFactor;\n }\n },\n\n // Returns zoom level for a given scale value\n // This only works with a scale value that is based on map pixel width\n zoom: function(scale) {\n return Math.log(scale / 256) / Math.LN2;\n },\n\n // Returns the bounds of the world in projected coords if applicable\n getProjectedBounds: function(zoom) {\n if (this.infinite) { return null; }\n\n var b = this.projection.bounds;\n var s = this.scale(zoom);\n\n // Half scale if using zoom as WebGL origin is in the centre, not top left\n if (zoom) {\n s /= 2;\n }\n\n // Bottom left\n var min = this.transformation.transform(Point(b[0]), s);\n\n // Top right\n var max = this.transformation.transform(Point(b[1]), s);\n\n return [min, max];\n },\n\n // Whether a coordinate axis wraps in a given range (e.g. longitude from -180 to 180); depends on CRS\n // wrapLon: [min, max],\n // wrapLat: [min, max],\n\n // If true, the coordinate space will be unbounded (infinite in all directions)\n // infinite: false,\n\n // Wraps geo coords in certain ranges if applicable\n wrapLatLon: function(latlon) {\n var lat = this.wrapLat ? wrapNum(latlon.lat, this.wrapLat, true) : latlon.lat;\n var lon = this.wrapLon ? wrapNum(latlon.lon, this.wrapLon, true) : latlon.lon;\n var alt = latlon.alt;\n\n return LatLon(lat, lon, alt);\n }\n};\n\nexport default CRS;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.js\n **/","/*\n * LatLon is a helper class for ensuring consistent geographic coordinates.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/LatLng.js\n */\n\nclass LatLon {\n constructor(lat, lon, alt) {\n if (isNaN(lat) || isNaN(lon)) {\n throw new Error('Invalid LatLon object: (' + lat + ', ' + lon + ')');\n }\n\n this.lat = +lat;\n this.lon = +lon;\n\n if (alt !== undefined) {\n this.alt = +alt;\n }\n }\n\n clone() {\n return new LatLon(this.lat, this.lon, this.alt);\n }\n}\n\n// Initialise without requiring new keyword\n//\n// Accepts (LatLon), ([lat, lon, alt]), ([lat, lon]) and (lat, lon, alt)\n// Also converts between lng and lon\nexport default function(a, b, c) {\n if (a instanceof LatLon) {\n return a;\n }\n if (Array.isArray(a) && typeof a[0] !== 'object') {\n if (a.length === 3) {\n return new LatLon(a[0], a[1], a[2]);\n }\n if (a.length === 2) {\n return new LatLon(a[0], a[1]);\n }\n return null;\n }\n if (a === undefined || a === null) {\n return a;\n }\n if (typeof a === 'object' && 'lat' in a) {\n return new LatLon(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);\n }\n if (b === undefined) {\n return null;\n }\n return new LatLon(a, b, c);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/LatLon.js\n **/","/*\n * Point is a helper class for ensuring consistent world positions.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/Point.js\n */\n\nclass Point {\n constructor(x, y, round) {\n this.x = (round ? Math.round(x) : x);\n this.y = (round ? Math.round(y) : y);\n }\n\n clone() {\n return new Point(this.x, this.y);\n }\n\n // Non-destructive\n add(point) {\n return this.clone()._add(_point(point));\n }\n\n // Destructive\n _add(point) {\n this.x += point.x;\n this.y += point.y;\n return this;\n }\n\n // Non-destructive\n subtract(point) {\n return this.clone()._subtract(_point(point));\n }\n\n // Destructive\n _subtract(point) {\n this.x -= point.x;\n this.y -= point.y;\n return this;\n }\n}\n\n// Accepts (point), ([x, y]) and (x, y, round)\nvar _point = function(x, y, round) {\n if (x instanceof Point) {\n return x;\n }\n if (Array.isArray(x)) {\n return new Point(x[0], x[1]);\n }\n if (x === undefined || x === null) {\n return x;\n }\n return new Point(x, y, round);\n};\n\n// Initialise without requiring new keyword\nexport default _point;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/Point.js\n **/","/*\n * Wrap the given number to lie within a certain range (eg. longitude)\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/core/Util.js\n */\n\nconst wrapNum = function(x, range, includeMax) {\n var max = range[1];\n var min = range[0];\n var d = max - min;\n return x === max && includeMax ? x : ((x - min) % d + d) % d + min;\n};\n\nexport default wrapNum;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/util/wrapNum.js\n **/","/*\n * Spherical Mercator is the most popular map projection, used by EPSG:3857 CRS\n * used by default.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.SphericalMercator.js\n */\n\nimport LatLon from '../LatLon';\nimport Point from '../Point';\n\nconst SphericalMercator = {\n // Radius / WGS84 semi-major axis\n R: 6378137,\n MAX_LATITUDE: 85.0511287798,\n\n // WGS84 eccentricity\n ECC: 0.081819191,\n ECC2: 0.081819191 * 0.081819191,\n\n project: function(latlon) {\n var d = Math.PI / 180;\n var max = this.MAX_LATITUDE;\n var lat = Math.max(Math.min(max, latlon.lat), -max);\n var sin = Math.sin(lat * d);\n\n return Point(\n this.R * latlon.lon * d,\n this.R * Math.log((1 + sin) / (1 - sin)) / 2\n );\n },\n\n unproject: function(point) {\n var d = 180 / Math.PI;\n\n return LatLon(\n (2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\n point.x * d / this.R\n );\n },\n\n // Scale factor for converting between real metres and projected metres\n //\n // projectedMetres = realMetres * pointScale\n // realMetres = projectedMetres / pointScale\n //\n // Accurate scale factor uses proper Web Mercator scaling\n // See pg.9: http://www.hydrometronics.com/downloads/Web%20Mercator%20-%20Non-Conformal,%20Non-Mercator%20(notes).pdf\n // See: http://jsfiddle.net/robhawkes/yws924cf/\n pointScale: function(latlon, accurate) {\n var rad = Math.PI / 180;\n\n var k;\n\n if (!accurate) {\n k = 1 / Math.cos(latlon.lat * rad);\n\n // [scaleX, scaleY]\n return [k, k];\n } else {\n var lat = latlon.lat * rad;\n var lon = latlon.lon * rad;\n\n var a = this.R;\n\n var sinLat = Math.sin(lat);\n var sinLat2 = sinLat * sinLat;\n\n var cosLat = Math.cos(lat);\n\n // Radius meridian\n var p = a * (1 - this.ECC2) / Math.pow(1 - this.ECC2 * sinLat2, 3 / 2);\n\n // Radius prime meridian\n var v = a / Math.sqrt(1 - this.ECC2 * sinLat2);\n\n // Scale N/S\n var h = (a / p) / cosLat;\n\n // Scale E/W\n k = (a / v) / cosLat;\n\n // [scaleX, scaleY]\n return [k, h];\n }\n },\n\n // Not using this.R due to scoping\n bounds: (function() {\n var d = 6378137 * Math.PI;\n return [[-d, -d], [d, d]];\n })()\n};\n\nexport default SphericalMercator;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/projection/Projection.SphericalMercator.js\n **/","/*\n * Transformation is an utility class to perform simple point transformations\n * through a 2d-matrix.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geometry/Transformation.js\n */\n\nimport Point from '../geo/Point';\n\nclass Transformation {\n constructor(a, b, c, d) {\n this._a = a;\n this._b = b;\n this._c = c;\n this._d = d;\n }\n\n transform(point, scale) {\n // Copy input point as to not destroy the original data\n return this._transform(point.clone(), scale);\n }\n\n // Destructive transform (faster)\n _transform(point, scale) {\n scale = scale || 1;\n\n point.x = scale * (this._a * point.x + this._b);\n point.y = scale * (this._c * point.y + this._d);\n return point;\n }\n\n untransform(point, scale) {\n scale = scale || 1;\n return Point(\n (point.x / scale - this._b) / this._a,\n (point.y / scale - this._d) / this._c\n );\n }\n}\n\nexport default Transformation;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/util/Transformation.js\n **/","/*\n * CRS.EPSG3395 (WGS 84 / World Mercator) CRS implementation.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG3395.js\n */\n\nimport extend from 'lodash.assign';\nimport Earth from './CRS.Earth';\nimport Mercator from '../projection/Projection.Mercator';\nimport Transformation from '../../util/Transformation';\n\nvar _EPSG3395 = {\n code: 'EPSG:3395',\n projection: Mercator,\n\n // Work out how to de-dupe this (scoping issue)\n transformScale: 1 / (Math.PI * Mercator.R),\n\n // Scale and transformation inputs changed to account for central origin in\n // WebGL, instead of top-left origin used in Leaflet\n transformation: (function() {\n // TODO: Cannot use this.transformScale due to scope\n var scale = 1 / (Math.PI * Mercator.R);\n\n return new Transformation(scale, 0, -scale, 0);\n }())\n};\n\nconst EPSG3395 = extend({}, Earth, _EPSG3395);\n\nexport default EPSG3395;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.EPSG3395.js\n **/","/*\n * Mercator projection that takes into account that the Earth is not a perfect\n * sphere. Less popular than spherical mercator; used by projections like\n * EPSG:3395.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.Mercator.js\n */\n\nimport LatLon from '../LatLon';\nimport Point from '../Point';\n\nconst Mercator = {\n // Radius / WGS84 semi-major axis\n R: 6378137,\n R_MINOR: 6356752.314245179,\n\n // WGS84 eccentricity\n ECC: 0.081819191,\n ECC2: 0.081819191 * 0.081819191,\n\n project: function(latlon) {\n var d = Math.PI / 180;\n var r = this.R;\n var y = latlon.lat * d;\n var tmp = this.R_MINOR / r;\n var e = Math.sqrt(1 - tmp * tmp);\n var con = e * Math.sin(y);\n\n var ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2);\n y = -r * Math.log(Math.max(ts, 1E-10));\n\n return Point(latlon.lon * d * r, y);\n },\n\n unproject: function(point) {\n var d = 180 / Math.PI;\n var r = this.R;\n var tmp = this.R_MINOR / r;\n var e = Math.sqrt(1 - tmp * tmp);\n var ts = Math.exp(-point.y / r);\n var phi = Math.PI / 2 - 2 * Math.atan(ts);\n\n for (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {\n con = e * Math.sin(phi);\n con = Math.pow((1 - con) / (1 + con), e / 2);\n dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;\n phi += dphi;\n }\n\n return LatLon(phi * d, point.x * d / r);\n },\n\n // Scale factor for converting between real metres and projected metres\n //\n // projectedMetres = realMetres * pointScale\n // realMetres = projectedMetres / pointScale\n //\n // See pg.8: http://www.hydrometronics.com/downloads/Web%20Mercator%20-%20Non-Conformal,%20Non-Mercator%20(notes).pdf\n pointScale: function(latlon) {\n var rad = Math.PI / 180;\n var lat = latlon.lat * rad;\n var sinLat = Math.sin(lat);\n var sinLat2 = sinLat * sinLat;\n var cosLat = Math.cos(lat);\n\n var k = Math.sqrt(1 - this.ECC2 * sinLat2) / cosLat;\n\n // [scaleX, scaleY]\n return [k, k];\n },\n\n bounds: [[-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]]\n};\n\nexport default Mercator;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/projection/Projection.Mercator.js\n **/","/*\n * CRS.EPSG4326 is a CRS popular among advanced GIS specialists.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG4326.js\n */\n\nimport extend from 'lodash.assign';\nimport Earth from './CRS.Earth';\nimport LatLonProjection from '../projection/Projection.LatLon';\nimport Transformation from '../../util/Transformation';\n\nvar _EPSG4326 = {\n code: 'EPSG:4326',\n projection: LatLonProjection,\n\n // Work out how to de-dupe this (scoping issue)\n transformScale: 1 / 180,\n\n // Scale and transformation inputs changed to account for central origin in\n // WebGL, instead of top-left origin used in Leaflet\n //\n // TODO: Cannot use this.transformScale due to scope\n transformation: new Transformation(1 / 180, 0, -1 / 180, 0)\n};\n\nconst EPSG4326 = extend({}, Earth, _EPSG4326);\n\nexport default EPSG4326;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.EPSG4326.js\n **/","/*\n * Simple equirectangular (Plate Carree) projection, used by CRS like EPSG:4326\n * and Simple.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.LonLat.js\n */\n\nimport LatLon from '../LatLon';\nimport Point from '../Point';\n\nconst ProjectionLatLon = {\n project: function(latlon) {\n return Point(latlon.lon, latlon.lat);\n },\n\n unproject: function(point) {\n return LatLon(point.y, point.x);\n },\n\n // Scale factor for converting between real metres and degrees\n //\n // degrees = realMetres * pointScale\n // realMetres = degrees / pointScale\n //\n // See: http://stackoverflow.com/questions/639695/how-to-convert-latitude-or-longitude-to-meters\n // See: http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from\n pointScale: function(latlon) {\n var m1 = 111132.92;\n var m2 = -559.82;\n var m3 = 1.175;\n var m4 = -0.0023;\n var p1 = 111412.84;\n var p2 = -93.5;\n var p3 = 0.118;\n\n var rad = Math.PI / 180;\n var lat = latlon.lat * rad;\n\n var latlen = m1 + m2 * Math.cos(2 * lat) + m3 * Math.cos(4 * lat) + m4 * Math.cos(6 * lat);\n var lonlen = p1 * Math.cos(lat) + p2 * Math.cos(3 * lat) + p3 * Math.cos(5 * lat);\n\n return [1 / latlen, 1 / lonlen];\n },\n\n bounds: [[-180, -90], [180, 90]]\n};\n\nexport default ProjectionLatLon;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/projection/Projection.LatLon.js\n **/","/*\n * A simple CRS that can be used for flat non-Earth maps like panoramas or game\n * maps.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.Simple.js\n */\n\nimport extend from 'lodash.assign';\nimport CRS from './CRS';\nimport LatLonProjection from '../projection/Projection.LatLon';\nimport Transformation from '../../util/Transformation';\n\nvar _Simple = {\n projection: LatLonProjection,\n\n // Straight 1:1 mapping (-1, -1 would be top-left)\n transformation: new Transformation(1, 0, 1, 0),\n\n scale: function(zoom) {\n // If zoom is provided then return scale based on map tile zoom\n if (zoom) {\n return Math.pow(2, zoom);\n // Else, make no change to scale – may need to increase this or make it a\n // user-definable variable\n } else {\n return 1;\n }\n },\n\n zoom: function(scale) {\n return Math.log(scale) / Math.LN2;\n },\n\n distance: function(latlon1, latlon2) {\n var dx = latlon2.lon - latlon1.lon;\n var dy = latlon2.lat - latlon1.lat;\n\n return Math.sqrt(dx * dx + dy * dy);\n },\n\n infinite: true\n};\n\nconst Simple = extend({}, CRS, _Simple);\n\nexport default Simple;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.Simple.js\n **/","/*\n * CRS.Proj4 for any Proj4-supported CRS.\n */\n\nimport extend from 'lodash.assign';\nimport Earth from './CRS.Earth';\nimport Proj4Projection from '../projection/Projection.Proj4';\nimport Transformation from '../../util/Transformation';\n\nvar _Proj4 = function(code, def, bounds) {\n var projection = Proj4Projection(def, bounds);\n\n // Transformation calcuations\n var diffX = projection.bounds[1][0] - projection.bounds[0][0];\n var diffY = projection.bounds[1][1] - projection.bounds[0][1];\n\n var halfX = diffX / 2;\n var halfY = diffY / 2;\n\n // This is the raw scale factor\n var scaleX = 1 / halfX;\n var scaleY = 1 / halfY;\n\n // Find the minimum scale factor\n //\n // The minimum scale factor comes from the largest side and is the one\n // you want to use for both axis so they stay relative in dimension\n var scale = Math.min(scaleX, scaleY);\n\n // Find amount to offset each axis by to make the central point lie on\n // the [0,0] origin\n var offsetX = scale * (projection.bounds[0][0] + halfX);\n var offsetY = scale * (projection.bounds[0][1] + halfY);\n\n return {\n code: code,\n projection: projection,\n\n transformScale: scale,\n\n // Map the input to a [-1,1] range with [0,0] in the centre\n transformation: new Transformation(scale, -offsetX, -scale, offsetY)\n };\n};\n\nconst Proj4 = function(code, def, bounds) {\n return extend({}, Earth, _Proj4(code, def, bounds));\n};\n\nexport default Proj4;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.Proj4.js\n **/","/*\n * Proj4 support for any projection.\n */\n\nimport proj4 from 'proj4';\nimport LatLon from '../LatLon';\nimport Point from '../Point';\n\nconst Proj4 = function(def, bounds) {\n var proj = proj4(def);\n\n var project = function(latlon) {\n return Point(proj.forward([latlon.lon, latlon.lat]));\n };\n\n var unproject = function(point) {\n var inverse = proj.inverse([point.x, point.y]);\n return LatLon(inverse[1], inverse[0]);\n };\n\n return {\n project: project,\n unproject: unproject,\n\n // Scale factor for converting between real metres and projected metres\\\n //\n // Need to work out the best way to provide the pointScale calculations\n // for custom, unknown projections (if wanting to override default)\n //\n // For now, user can manually override crs.pointScale or\n // crs.projection.pointScale\n //\n // projectedMetres = realMetres * pointScale\n // realMetres = projectedMetres / pointScale\n pointScale: function(latlon, accurate) {\n return [1, 1];\n },\n\n // Try and calculate bounds if none are provided\n //\n // This will provide incorrect bounds for some projections, so perhaps make\n // bounds a required input instead\n bounds: (function() {\n if (bounds) {\n return bounds;\n } else {\n var bottomLeft = project([-90, -180]);\n var topRight = project([90, 180]);\n\n return [bottomLeft, topRight];\n }\n })()\n };\n};\n\nexport default Proj4;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/projection/Projection.Proj4.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_22__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"proj4\"\n ** module id = 22\n ** module chunks = 0\n **/","import EventEmitter from 'eventemitter3';\nimport THREE from 'three';\nimport Scene from './Scene';\nimport Renderer from './Renderer';\nimport Camera from './Camera';\n\nclass Engine extends EventEmitter {\n constructor(container) {\n console.log('Init Engine');\n\n super();\n\n this._scene = Scene;\n this._renderer = Renderer(container);\n this._camera = Camera(container);\n this.clock = new THREE.Clock();\n\n this._frustum = new THREE.Frustum();\n }\n\n update(delta) {\n this.emit('preRender');\n this._renderer.render(this._scene, this._camera);\n this.emit('postRender');\n }\n}\n\n// Initialise without requiring new keyword\nexport default function(container) {\n return new Engine(container);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/engine/Engine.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_24__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"THREE\"\n ** module id = 24\n ** module chunks = 0\n **/","import THREE from 'three';\n\n// This can be imported from anywhere and will still reference the same scene,\n// though there is a helper reference in Engine.scene\n\nexport default (function() {\n var scene = new THREE.Scene();\n scene.fog = new THREE.Fog(0xffffff, 1, 15000);\n return scene;\n})();\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/engine/Scene.js\n **/","import THREE from 'three';\nimport Scene from './Scene';\n\n// This can only be accessed from Engine.renderer if you want to reference the\n// same scene in multiple places\n\nexport default function(container) {\n var renderer = new THREE.WebGLRenderer({\n antialias: true\n });\n\n renderer.setClearColor(Scene.fog.color, 1);\n\n // Gamma settings make things look nicer\n renderer.gammaInput = true;\n renderer.gammaOutput = true;\n\n container.appendChild(renderer.domElement);\n\n var updateSize = function() {\n renderer.setSize(container.clientWidth, container.clientHeight);\n };\n\n window.addEventListener('resize', updateSize, false);\n updateSize();\n\n return renderer;\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/engine/Renderer.js\n **/","import THREE from 'three';\n\n// This can only be accessed from Engine.camera if you want to reference the\n// same scene in multiple places\n\nexport default function(container) {\n var camera = new THREE.PerspectiveCamera(40, 1, 1, 40000);\n camera.position.y = 400;\n camera.position.z = 400;\n\n var updateSize = function() {\n camera.aspect = container.clientWidth / container.clientHeight;\n camera.updateProjectionMatrix();\n };\n\n window.addEventListener('resize', updateSize, false);\n updateSize();\n\n return camera;\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/engine/Camera.js\n **/","import Orbit from './Controls.Orbit';\n\nconst Controls = {\n Orbit: Orbit\n};\n\nexport default Controls;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/controls/index.js\n **/","import EventEmitter from 'eventemitter3';\nimport THREE from 'three';\nimport OrbitControls from 'three-orbit-controls';\n\nvar _OrbitControls = OrbitControls(THREE);\n\nclass Orbit extends EventEmitter {\n constructor() {\n super();\n }\n\n // Proxy control events\n //\n // There's currently no distinction between pan, orbit and zoom events\n _initEvents() {\n this._controls.addEventListener('start', (event) => {\n this._world.emit('controlsMoveStart', event.target.center);\n });\n\n this._controls.addEventListener('change', (event) => {\n this._world.emit('controlsMove', event.target.center);\n });\n\n this._controls.addEventListener('end', (event) => {\n this._world.emit('controlsMoveEnd', event.target.center);\n });\n }\n\n // Moving the camera along the [x,y,z] axis based on a target position\n _panTo(point, animate) {}\n _panBy(pointDelta, animate) {}\n\n // Zooming the camera in and out\n _zoomTo(metres, animate) {}\n _zoomBy(metresDelta, animate) {}\n\n // Force camera to look at something other than the target\n _lookAt(point, animate) {}\n\n // Make camera look at the target\n _lookAtTarget() {}\n\n // Tilt (up and down)\n _tiltTo(angle, animate) {}\n _tiltBy(angleDelta, animate) {}\n\n // Rotate (left and right)\n _rotateTo(angle, animate) {}\n _rotateBy(angleDelta, animate) {}\n\n // Fly to the given point, animating pan and tilt/rotation to final position\n // with nice zoom out and in\n //\n // Calling flyTo a second time before the previous animation has completed\n // will immediately start the new animation from wherever the previous one\n // has got to\n _flyTo(point, noZoom) {}\n\n // Proxy to OrbitControls.update()\n update() {\n this._controls.update();\n }\n\n // Add controls to world instance and store world reference\n addTo(world) {\n world.addControls(this);\n return this;\n }\n\n // Internal method called by World.addControls to actually add the controls\n _addToWorld(world) {\n this._world = world;\n\n // TODO: Override panLeft and panUp methods to prevent panning on Y axis\n // See: http://stackoverflow.com/a/26188674/997339\n this._controls = new _OrbitControls(world._engine._camera, world._container);\n\n // Disable keys for now as no events are fired for them anyway\n this._controls.keys = false;\n\n // 89 degrees\n this._controls.maxPolarAngle = 1.5533;\n\n // this._controls.enableDamping = true;\n // this._controls.dampingFactor = 0.25;\n\n this._initEvents();\n\n this.emit('added');\n }\n}\n\n// Initialise without requiring new keyword\nexport default function() {\n return new Orbit();\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/controls/Controls.Orbit.js\n **/","module.exports = function(THREE) {\n\tvar MOUSE = THREE.MOUSE\n\tif (!MOUSE)\n\t\tMOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };\n\n\t/**\n\t * @author qiao / https://github.com/qiao\n\t * @author mrdoob / http://mrdoob.com\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t * @author erich666 / http://erichaines.com\n\t */\n\t/*global THREE, console */\n\n\tfunction OrbitConstraint ( object ) {\n\n\t\tthis.object = object;\n\n\t\t// \"target\" sets the location of focus, where the object orbits around\n\t\t// and where it pans with respect to.\n\t\tthis.target = new THREE.Vector3();\n\n\t\t// Limits to how far you can dolly in and out ( PerspectiveCamera only )\n\t\tthis.minDistance = 0;\n\t\tthis.maxDistance = Infinity;\n\n\t\t// Limits to how far you can zoom in and out ( OrthographicCamera only )\n\t\tthis.minZoom = 0;\n\t\tthis.maxZoom = Infinity;\n\n\t\t// How far you can orbit vertically, upper and lower limits.\n\t\t// Range is 0 to Math.PI radians.\n\t\tthis.minPolarAngle = 0; // radians\n\t\tthis.maxPolarAngle = Math.PI; // radians\n\n\t\t// How far you can orbit horizontally, upper and lower limits.\n\t\t// If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].\n\t\tthis.minAzimuthAngle = - Infinity; // radians\n\t\tthis.maxAzimuthAngle = Infinity; // radians\n\n\t\t// Set to true to enable damping (inertia)\n\t\t// If damping is enabled, you must call controls.update() in your animation loop\n\t\tthis.enableDamping = false;\n\t\tthis.dampingFactor = 0.25;\n\n\t\t////////////\n\t\t// internals\n\n\t\tvar scope = this;\n\n\t\tvar EPS = 0.000001;\n\n\t\t// Current position in spherical coordinate system.\n\t\tvar theta;\n\t\tvar phi;\n\n\t\t// Pending changes\n\t\tvar phiDelta = 0;\n\t\tvar thetaDelta = 0;\n\t\tvar scale = 1;\n\t\tvar panOffset = new THREE.Vector3();\n\t\tvar zoomChanged = false;\n\n\t\t// API\n\n\t\tthis.getPolarAngle = function () {\n\n\t\t\treturn phi;\n\n\t\t};\n\n\t\tthis.getAzimuthalAngle = function () {\n\n\t\t\treturn theta;\n\n\t\t};\n\n\t\tthis.rotateLeft = function ( angle ) {\n\n\t\t\tthetaDelta -= angle;\n\n\t\t};\n\n\t\tthis.rotateUp = function ( angle ) {\n\n\t\t\tphiDelta -= angle;\n\n\t\t};\n\n\t\t// pass in distance in world space to move left\n\t\tthis.panLeft = function() {\n\n\t\t\tvar v = new THREE.Vector3();\n\n\t\t return function panLeft(distance) {\n\t\t var te = this.object.matrix.elements;\n\t\t var adjDist = distance / Math.cos(phi);\n\n\t\t v.set(te[ 0 ], 0, te[ 2 ]).normalize();\n\t\t v.multiplyScalar(-adjDist);\n\n\t\t panOffset.add(v);\n\t\t };\n\n\t\t}();\n\n\t\t// pass in distance in world space to move up\n\t\tthis.panUp = function() {\n\n\t\t\tvar v = new THREE.Vector3();\n\n\t\t return function panUp(distance) {\n\t\t var te = this.object.matrix.elements;\n\t\t var adjDist = distance / Math.cos(phi);\n\n\t\t v.set(te[ 8 ], 0, te[ 10 ]).normalize();\n\t\t v.multiplyScalar(-adjDist);\n\n\t\t panOffset.add(v);\n\t\t };\n\n\t\t}();\n\n\t\t// pass in x,y of change desired in pixel space,\n\t\t// right and down are positive\n\t\tthis.pan = function ( deltaX, deltaY, screenWidth, screenHeight ) {\n\n\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\t// perspective\n\t\t\t\tvar position = scope.object.position;\n\t\t\t\tvar offset = position.clone().sub( scope.target );\n\t\t\t\tvar targetDistance = offset.length();\n\n\t\t\t\t// half of the fov is center to top of screen\n\t\t\t\ttargetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );\n\n\t\t\t\t// we actually don't use screenWidth, since perspective camera is fixed to screen height\n\t\t\t\tscope.panLeft( 2 * deltaX * targetDistance / screenHeight );\n\t\t\t\tscope.panUp( 2 * deltaY * targetDistance / screenHeight );\n\n\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\t// orthographic\n\t\t\t\tscope.panLeft( deltaX * ( scope.object.right - scope.object.left ) / screenWidth );\n\t\t\t\tscope.panUp( deltaY * ( scope.object.top - scope.object.bottom ) / screenHeight );\n\n\t\t\t} else {\n\n\t\t\t\t// camera neither orthographic or perspective\n\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.dollyIn = function ( dollyScale ) {\n\n\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\tscale /= dollyScale;\n\n\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\tscope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom * dollyScale ) );\n\t\t\t\tscope.object.updateProjectionMatrix();\n\t\t\t\tzoomChanged = true;\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.dollyOut = function ( dollyScale ) {\n\n\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\tscale *= dollyScale;\n\n\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\tscope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / dollyScale ) );\n\t\t\t\tscope.object.updateProjectionMatrix();\n\t\t\t\tzoomChanged = true;\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.update = function() {\n\n\t\t\tvar offset = new THREE.Vector3();\n\n\t\t\t// so camera.up is the orbit axis\n\t\t\tvar quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );\n\t\t\tvar quatInverse = quat.clone().inverse();\n\n\t\t\tvar lastPosition = new THREE.Vector3();\n\t\t\tvar lastQuaternion = new THREE.Quaternion();\n\n\t\t\treturn function () {\n\n\t\t\t\tvar position = this.object.position;\n\n\t\t\t\toffset.copy( position ).sub( this.target );\n\n\t\t\t\t// rotate offset to \"y-axis-is-up\" space\n\t\t\t\toffset.applyQuaternion( quat );\n\n\t\t\t\t// angle from z-axis around y-axis\n\n\t\t\t\ttheta = Math.atan2( offset.x, offset.z );\n\n\t\t\t\t// angle from y-axis\n\n\t\t\t\tphi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y );\n\n\t\t\t\ttheta += thetaDelta;\n\t\t\t\tphi += phiDelta;\n\n\t\t\t\t// restrict theta to be between desired limits\n\t\t\t\ttheta = Math.max( this.minAzimuthAngle, Math.min( this.maxAzimuthAngle, theta ) );\n\n\t\t\t\t// restrict phi to be between desired limits\n\t\t\t\tphi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );\n\n\t\t\t\t// restrict phi to be betwee EPS and PI-EPS\n\t\t\t\tphi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\n\t\t\t\tvar radius = offset.length() * scale;\n\n\t\t\t\t// restrict radius to be between desired limits\n\t\t\t\tradius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) );\n\n\t\t\t\t// move target to panned location\n\t\t\t\tthis.target.add( panOffset );\n\n\t\t\t\toffset.x = radius * Math.sin( phi ) * Math.sin( theta );\n\t\t\t\toffset.y = radius * Math.cos( phi );\n\t\t\t\toffset.z = radius * Math.sin( phi ) * Math.cos( theta );\n\n\t\t\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\t\t\toffset.applyQuaternion( quatInverse );\n\n\t\t\t\tposition.copy( this.target ).add( offset );\n\n\t\t\t\tthis.object.lookAt( this.target );\n\n\t\t\t\tif ( this.enableDamping === true ) {\n\n\t\t\t\t\tthetaDelta *= ( 1 - this.dampingFactor );\n\t\t\t\t\tphiDelta *= ( 1 - this.dampingFactor );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthetaDelta = 0;\n\t\t\t\t\tphiDelta = 0;\n\n\t\t\t\t}\n\n\t\t\t\tscale = 1;\n\t\t\t\tpanOffset.set( 0, 0, 0 );\n\n\t\t\t\t// update condition is:\n\t\t\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n\t\t\t\tif ( zoomChanged ||\n\t\t\t\t\t lastPosition.distanceToSquared( this.object.position ) > EPS ||\n\t\t\t\t\t8 * ( 1 - lastQuaternion.dot( this.object.quaternion ) ) > EPS ) {\n\n\t\t\t\t\tlastPosition.copy( this.object.position );\n\t\t\t\t\tlastQuaternion.copy( this.object.quaternion );\n\t\t\t\t\tzoomChanged = false;\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\n\t\t\t};\n\n\t\t}();\n\n\t};\n\n\n\t// This set of controls performs orbiting, dollying (zooming), and panning. It maintains\n\t// the \"up\" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is\n\t// supported.\n\t//\n\t// Orbit - left mouse / touch: one finger move\n\t// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n\t// Pan - right mouse, or arrow keys / touch: three finter swipe\n\n\tfunction OrbitControls ( object, domElement ) {\n\n\t\tvar constraint = new OrbitConstraint( object );\n\n\t\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\t\t// API\n\n\t\tObject.defineProperty( this, 'constraint', {\n\n\t\t\tget: function() {\n\n\t\t\t\treturn constraint;\n\n\t\t\t}\n\n\t\t} );\n\n\t\tthis.getPolarAngle = function () {\n\n\t\t\treturn constraint.getPolarAngle();\n\n\t\t};\n\n\t\tthis.getAzimuthalAngle = function () {\n\n\t\t\treturn constraint.getAzimuthalAngle();\n\n\t\t};\n\n\t\t// Set to false to disable this control\n\t\tthis.enabled = true;\n\n\t\t// center is old, deprecated; use \"target\" instead\n\t\tthis.center = this.target;\n\n\t\t// This option actually enables dollying in and out; left as \"zoom\" for\n\t\t// backwards compatibility.\n\t\t// Set to false to disable zooming\n\t\tthis.enableZoom = true;\n\t\tthis.zoomSpeed = 1.0;\n\n\t\t// Set to false to disable rotating\n\t\tthis.enableRotate = true;\n\t\tthis.rotateSpeed = 1.0;\n\n\t\t// Set to false to disable panning\n\t\tthis.enablePan = true;\n\t\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\n\t\t// Set to true to automatically rotate around the target\n\t\t// If auto-rotate is enabled, you must call controls.update() in your animation loop\n\t\tthis.autoRotate = false;\n\t\tthis.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\n\t\t// Set to false to disable use of the keys\n\t\tthis.enableKeys = true;\n\n\t\t// The four arrow keys\n\t\tthis.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\n\t\t// Mouse buttons\n\t\tthis.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };\n\n\t\t////////////\n\t\t// internals\n\n\t\tvar scope = this;\n\n\t\tvar rotateStart = new THREE.Vector2();\n\t\tvar rotateEnd = new THREE.Vector2();\n\t\tvar rotateDelta = new THREE.Vector2();\n\n\t\tvar panStart = new THREE.Vector2();\n\t\tvar panEnd = new THREE.Vector2();\n\t\tvar panDelta = new THREE.Vector2();\n\n\t\tvar dollyStart = new THREE.Vector2();\n\t\tvar dollyEnd = new THREE.Vector2();\n\t\tvar dollyDelta = new THREE.Vector2();\n\n\t\tvar STATE = { NONE : - 1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };\n\n\t\tvar state = STATE.NONE;\n\n\t\t// for reset\n\n\t\tthis.target0 = this.target.clone();\n\t\tthis.position0 = this.object.position.clone();\n\t\tthis.zoom0 = this.object.zoom;\n\n\t\t// events\n\n\t\tvar changeEvent = { type: 'change' };\n\t\tvar startEvent = { type: 'start' };\n\t\tvar endEvent = { type: 'end' };\n\n\t\t// pass in x,y of change desired in pixel space,\n\t\t// right and down are positive\n\t\tfunction pan( deltaX, deltaY ) {\n\n\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\t\tconstraint.pan( deltaX, deltaY, element.clientWidth, element.clientHeight );\n\n\t\t}\n\n\t\tthis.update = function () {\n\n\t\t\tif ( this.autoRotate && state === STATE.NONE ) {\n\n\t\t\t\tconstraint.rotateLeft( getAutoRotationAngle() );\n\n\t\t\t}\n\n\t\t\tif ( constraint.update() === true ) {\n\n\t\t\t\tthis.dispatchEvent( changeEvent );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.reset = function () {\n\n\t\t\tstate = STATE.NONE;\n\n\t\t\tthis.target.copy( this.target0 );\n\t\t\tthis.object.position.copy( this.position0 );\n\t\t\tthis.object.zoom = this.zoom0;\n\n\t\t\tthis.object.updateProjectionMatrix();\n\t\t\tthis.dispatchEvent( changeEvent );\n\n\t\t\tthis.update();\n\n\t\t};\n\n\t\tfunction getAutoRotationAngle() {\n\n\t\t\treturn 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\n\t\t}\n\n\t\tfunction getZoomScale() {\n\n\t\t\treturn Math.pow( 0.95, scope.zoomSpeed );\n\n\t\t}\n\n\t\tfunction onMouseDown( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tevent.preventDefault();\n\n\t\t\tif ( event.button === scope.mouseButtons.ORBIT ) {\n\n\t\t\t\tif ( scope.enableRotate === false ) return;\n\n\t\t\t\tstate = STATE.ROTATE;\n\n\t\t\t\trotateStart.set( event.clientX, event.clientY );\n\n\t\t\t} else if ( event.button === scope.mouseButtons.ZOOM ) {\n\n\t\t\t\tif ( scope.enableZoom === false ) return;\n\n\t\t\t\tstate = STATE.DOLLY;\n\n\t\t\t\tdollyStart.set( event.clientX, event.clientY );\n\n\t\t\t} else if ( event.button === scope.mouseButtons.PAN ) {\n\n\t\t\t\tif ( scope.enablePan === false ) return;\n\n\t\t\t\tstate = STATE.PAN;\n\n\t\t\t\tpanStart.set( event.clientX, event.clientY );\n\n\t\t\t}\n\n\t\t\tif ( state !== STATE.NONE ) {\n\n\t\t\t\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\t\t\t\tdocument.addEventListener( 'mouseup', onMouseUp, false );\n\t\t\t\tscope.dispatchEvent( startEvent );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onMouseMove( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tevent.preventDefault();\n\n\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\t\tif ( state === STATE.ROTATE ) {\n\n\t\t\t\tif ( scope.enableRotate === false ) return;\n\n\t\t\t\trotateEnd.set( event.clientX, event.clientY );\n\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\tconstraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\n\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\tconstraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\t\trotateStart.copy( rotateEnd );\n\n\t\t\t} else if ( state === STATE.DOLLY ) {\n\n\t\t\t\tif ( scope.enableZoom === false ) return;\n\n\t\t\t\tdollyEnd.set( event.clientX, event.clientY );\n\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\n\t\t\t\t} else if ( dollyDelta.y < 0 ) {\n\n\t\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\n\t\t\t\t}\n\n\t\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t\t} else if ( state === STATE.PAN ) {\n\n\t\t\t\tif ( scope.enablePan === false ) return;\n\n\t\t\t\tpanEnd.set( event.clientX, event.clientY );\n\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\n\t\t\t\tpan( panDelta.x, panDelta.y );\n\n\t\t\t\tpanStart.copy( panEnd );\n\n\t\t\t}\n\n\t\t\tif ( state !== STATE.NONE ) scope.update();\n\n\t\t}\n\n\t\tfunction onMouseUp( /* event */ ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\t\t\tscope.dispatchEvent( endEvent );\n\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t\tfunction onMouseWheel( event ) {\n\n\t\t\tif ( scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE ) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tvar delta = 0;\n\n\t\t\tif ( event.wheelDelta !== undefined ) {\n\n\t\t\t\t// WebKit / Opera / Explorer 9\n\n\t\t\t\tdelta = event.wheelDelta;\n\n\t\t\t} else if ( event.detail !== undefined ) {\n\n\t\t\t\t// Firefox\n\n\t\t\t\tdelta = - event.detail;\n\n\t\t\t}\n\n\t\t\tif ( delta > 0 ) {\n\n\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\n\t\t\t} else if ( delta < 0 ) {\n\n\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\n\t\t\t}\n\n\t\t\tscope.update();\n\t\t\tscope.dispatchEvent( startEvent );\n\t\t\tscope.dispatchEvent( endEvent );\n\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\n\t\t\tif ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return;\n\n\t\t\tswitch ( event.keyCode ) {\n\n\t\t\t\tcase scope.keys.UP:\n\t\t\t\t\tpan( 0, scope.keyPanSpeed );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase scope.keys.BOTTOM:\n\t\t\t\t\tpan( 0, - scope.keyPanSpeed );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase scope.keys.LEFT:\n\t\t\t\t\tpan( scope.keyPanSpeed, 0 );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase scope.keys.RIGHT:\n\t\t\t\t\tpan( - scope.keyPanSpeed, 0 );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction touchstart( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tswitch ( event.touches.length ) {\n\n\t\t\t\tcase 1:\t// one-fingered touch: rotate\n\n\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\n\t\t\t\t\tstate = STATE.TOUCH_ROTATE;\n\n\t\t\t\t\trotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\t// two-fingered touch: dolly\n\n\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\n\t\t\t\t\tstate = STATE.TOUCH_DOLLY;\n\n\t\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\t\t\t\t\tdollyStart.set( 0, distance );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\t\tif ( scope.enablePan === false ) return;\n\n\t\t\t\t\tstate = STATE.TOUCH_PAN;\n\n\t\t\t\t\tpanStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tstate = STATE.NONE;\n\n\t\t\t}\n\n\t\t\tif ( state !== STATE.NONE ) scope.dispatchEvent( startEvent );\n\n\t\t}\n\n\t\tfunction touchmove( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\t\tswitch ( event.touches.length ) {\n\n\t\t\t\tcase 1: // one-fingered touch: rotate\n\n\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\t\t\t\tif ( state !== STATE.TOUCH_ROTATE ) return;\n\n\t\t\t\t\trotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\t\tconstraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\t\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\t\tconstraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\t\t\trotateStart.copy( rotateEnd );\n\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2: // two-fingered touch: dolly\n\n\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\t\t\t\tif ( state !== STATE.TOUCH_DOLLY ) return;\n\n\t\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\t\t\tdollyEnd.set( 0, distance );\n\t\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\n\t\t\t\t\t} else if ( dollyDelta.y < 0 ) {\n\n\t\t\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\t\t\t\tif ( state !== STATE.TOUCH_PAN ) return;\n\n\t\t\t\t\tpanEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\n\t\t\t\t\tpan( panDelta.x, panDelta.y );\n\n\t\t\t\t\tpanStart.copy( panEnd );\n\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tstate = STATE.NONE;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction touchend( /* event */ ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tscope.dispatchEvent( endEvent );\n\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t\tfunction contextmenu( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t}\n\n\t\tthis.dispose = function() {\n\n\t\t\tthis.domElement.removeEventListener( 'contextmenu', contextmenu, false );\n\t\t\tthis.domElement.removeEventListener( 'mousedown', onMouseDown, false );\n\t\t\tthis.domElement.removeEventListener( 'mousewheel', onMouseWheel, false );\n\t\t\tthis.domElement.removeEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox\n\n\t\t\tthis.domElement.removeEventListener( 'touchstart', touchstart, false );\n\t\t\tthis.domElement.removeEventListener( 'touchend', touchend, false );\n\t\t\tthis.domElement.removeEventListener( 'touchmove', touchmove, false );\n\n\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\n\t\t\twindow.removeEventListener( 'keydown', onKeyDown, false );\n\n\t\t}\n\n\t\tthis.domElement.addEventListener( 'contextmenu', contextmenu, false );\n\n\t\tthis.domElement.addEventListener( 'mousedown', onMouseDown, false );\n\t\tthis.domElement.addEventListener( 'mousewheel', onMouseWheel, false );\n\t\tthis.domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox\n\n\t\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\t\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\t\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\n\t\twindow.addEventListener( 'keydown', onKeyDown, false );\n\n\t\t// force an update at start\n\t\tthis.update();\n\n\t};\n\n\tOrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n\tOrbitControls.prototype.constructor = OrbitControls;\n\n\tObject.defineProperties( OrbitControls.prototype, {\n\n\t\tobject: {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.object;\n\n\t\t\t}\n\n\t\t},\n\n\t\ttarget: {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.target;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: target is now immutable. Use target.set() instead.' );\n\t\t\t\tthis.constraint.target.copy( value );\n\n\t\t\t}\n\n\t\t},\n\n\t\tminDistance : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.minDistance;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.minDistance = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tmaxDistance : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.maxDistance;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.maxDistance = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tminZoom : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.minZoom;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.minZoom = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tmaxZoom : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.maxZoom;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.maxZoom = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tminPolarAngle : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.minPolarAngle;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.minPolarAngle = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tmaxPolarAngle : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.maxPolarAngle;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.maxPolarAngle = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tminAzimuthAngle : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.minAzimuthAngle;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.minAzimuthAngle = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tmaxAzimuthAngle : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.maxAzimuthAngle;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.maxAzimuthAngle = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tenableDamping : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.enableDamping;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.enableDamping = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdampingFactor : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.dampingFactor;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.dampingFactor = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\t// backward compatibility\n\n\t\tnoZoom: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n\t\t\t\treturn ! this.enableZoom;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n\t\t\t\tthis.enableZoom = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tnoRotate: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n\t\t\t\treturn ! this.enableRotate;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n\t\t\t\tthis.enableRotate = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tnoPan: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n\t\t\t\treturn ! this.enablePan;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n\t\t\t\tthis.enablePan = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tnoKeys: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n\t\t\t\treturn ! this.enableKeys;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n\t\t\t\tthis.enableKeys = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tstaticMoving : {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n\t\t\t\treturn ! this.constraint.enableDamping;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n\t\t\t\tthis.constraint.enableDamping = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdynamicDampingFactor : {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n\t\t\t\treturn this.constraint.dampingFactor;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n\t\t\t\tthis.constraint.dampingFactor = value;\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\treturn OrbitControls;\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/three-orbit-controls/index.js\n ** module id = 30\n ** module chunks = 0\n **/","import Layer from '../Layer';\nimport THREE from 'three';\n\nclass EnvironmentLayer extends Layer {\n constructor() {\n super();\n\n this._initLights();\n this._initGrid();\n }\n\n _onAdd() {}\n\n // Not fleshed out or thought through yet\n //\n // Lights could potentially be put it their own 'layer' to keep this class\n // much simpler and less messy\n _initLights() {\n // Position doesn't really matter (the angle is important), however it's\n // used here so the helpers look more natural.\n\n var directionalLight = new THREE.DirectionalLight(0x999999);\n directionalLight.intesity = 0.1;\n directionalLight.position.x = 100;\n directionalLight.position.y = 100;\n directionalLight.position.z = 100;\n\n var directionalLight2 = new THREE.DirectionalLight(0x999999);\n directionalLight2.intesity = 0.1;\n directionalLight2.position.x = -100;\n directionalLight2.position.y = 100;\n directionalLight2.position.z = -100;\n\n var helper = new THREE.DirectionalLightHelper(directionalLight, 10);\n var helper2 = new THREE.DirectionalLightHelper(directionalLight2, 10);\n\n this._layer.add(directionalLight);\n this._layer.add(directionalLight2);\n\n this._layer.add(helper);\n this._layer.add(helper2);\n }\n\n // Add grid helper for context during initial development\n _initGrid() {\n var size = 4000;\n var step = 100;\n\n var gridHelper = new THREE.GridHelper(size, step);\n this._layer.add(gridHelper);\n }\n}\n\n// Initialise without requiring new keyword\nexport default function() {\n return new EnvironmentLayer();\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/layer/environment/EnvironmentLayer.js\n **/","import EventEmitter from 'eventemitter3';\nimport THREE from 'three';\nimport Scene from '../engine/Scene';\n\nclass Layer extends EventEmitter {\n constructor() {\n super();\n\n this._layer = new THREE.Object3D();\n }\n\n // Add layer to world instance and store world reference\n addTo(world) {\n world.addLayer(this);\n return this;\n }\n\n // Internal method called by World.addLayer to actually add the layer\n _addToWorld(world) {\n this._world = world;\n this._onAdd(world);\n this.emit('added');\n }\n}\n\nexport default Layer;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/layer/Layer.js\n **/","import Layer from '../Layer';\nimport Surface from './Surface';\nimport THREE from 'three';\n\n// TODO: Prevent tiles from being loaded if they are further than a certain\n// distance from the camera and are unlikely to be seen anyway\n\nclass GridLayer extends Layer {\n constructor() {\n super();\n\n this._minLOD = 3;\n this._maxLOD = 18;\n this._frustum = new THREE.Frustum();\n }\n\n _onAdd(world) {\n this._initEvents();\n\n // Trigger initial quadtree calculation on the next frame\n //\n // TODO: This is a hack to ensure the camera is all set up - a better\n // solution should be found\n setTimeout(() => {\n this._calculateLOD();\n }, 0);\n }\n\n _initEvents() {\n this._world.on('move', latlon => {\n this._calculateLOD();\n });\n }\n\n _updateFrustum() {\n var camera = this._world.getCamera();\n var projScreenMatrix = new THREE.Matrix4();\n projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);\n\n this._frustum.setFromMatrix(camera.projectionMatrix);\n this._frustum.setFromMatrix(new THREE.Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse));\n }\n\n _surfaceInFrustum(surface) {\n return this._frustum.intersectsBox(new THREE.Box3(new THREE.Vector3(surface.bounds[0], 0, surface.bounds[3]), new THREE.Vector3(surface.bounds[2], 0, surface.bounds[1])));\n }\n\n _calculateLOD() {\n var camera = this._world.getCamera();\n\n // 1. Update and retrieve camera frustum\n this._updateFrustum(this._frustum, camera);\n\n // 2. Add the four root items of the quadtree to a check list\n var checkList = this._checklist;\n checkList = [];\n checkList.push(Surface('0', this._world));\n checkList.push(Surface('1', this._world));\n checkList.push(Surface('2', this._world));\n checkList.push(Surface('3', this._world));\n\n // 3. Call Divide, passing in the check list\n this._divide(checkList);\n\n // 4. Render the quadtree items remaining in the check list\n checkList.forEach((surface, index) => {\n if (!this._surfaceInFrustum(surface)) {\n return;\n }\n\n // console.log(surface);\n\n // surface.render();\n this._layer.add(surface.mesh);\n });\n }\n\n _divide(checkList) {\n var count = 0;\n var currentItem;\n var quadkey;\n\n // 1. Loop until count equals check list length\n while (count != checkList.length) {\n currentItem = checkList[count];\n quadkey = currentItem.quadkey;\n\n // 2. Increase count and continue loop if quadkey equals max LOD / zoom\n if (currentItem.length === this._maxLOD) {\n count++;\n continue;\n }\n\n // 3. Else, calculate screen-space error metric for quadkey\n if (this._screenSpaceError(currentItem)) {\n // 4. If error is sufficient...\n\n // 4a. Remove parent item from the check list\n checkList.splice(count, 1);\n\n // 4b. Add 4 child items to the check list\n checkList.push(Surface(quadkey + '0', this._world));\n checkList.push(Surface(quadkey + '1', this._world));\n checkList.push(Surface(quadkey + '2', this._world));\n checkList.push(Surface(quadkey + '3', this._world));\n\n // 4d. Continue the loop without increasing count\n continue;\n } else {\n // 5. Else, increase count and continue loop\n count++;\n }\n }\n }\n\n _screenSpaceError(surface) {\n var minDepth = this._minLOD;\n var maxDepth = this._maxLOD;\n\n var camera = this._world.getCamera();\n\n // Tweak this value to refine specific point that each quad is subdivided\n //\n // It's used to multiple the dimensions of the surface sides before\n // comparing against the surface distance from camera\n var quality = 3.0;\n\n // 1. Return false if quadkey length is greater than maxDepth\n if (surface.quadkey.length > maxDepth) {\n return false;\n }\n\n // 2. Return true if quadkey length is less than minDepth\n if (surface.quadkey.length < minDepth) {\n return true;\n }\n\n // 3. Return false if quadkey bounds are not in view frustum\n if (!this._surfaceInFrustum(surface)) {\n return false;\n }\n\n // 4. Calculate screen-space error metric\n // TODO: Use closest distance to one of the 4 surface corners\n var dist = (new THREE.Vector3(surface.center[0], 0, surface.center[1])).sub(camera.position).length();\n\n // console.log(surface, dist);\n\n var error = quality * surface.side / dist;\n\n // 5. Return true if error is greater than 1.0, else return false\n return (error > 1.0);\n }\n}\n\n// Initialise without requiring new keyword\nexport default function() {\n return new GridLayer();\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/layer/tile/GridLayer.js\n **/","import LatLon from '../../geo/LatLon';\nimport THREE from 'three';\n\nvar r2d = 180 / Math.PI;\n\nvar loader = new THREE.TextureLoader();\nloader.setCrossOrigin('');\n\nclass Surface {\n constructor(quadkey, world) {\n this.world = world;\n this.quadkey = quadkey;\n this.tile = this._quadkeyToTile(quadkey);\n this.bounds = this._tileBounds(this.tile);\n this.center = this._boundsToCenter(this.bounds);\n this.side = (new THREE.Vector3(this.bounds[0], 0, this.bounds[3])).sub(new THREE.Vector3(this.bounds[0], 0, this.bounds[1])).length();\n\n this.mesh = this._createMesh();\n }\n\n _createDebugMesh() {\n var canvas = document.createElement('canvas');\n canvas.width = 256;\n canvas.height = 256;\n\n var context = canvas.getContext('2d');\n context.font = 'Bold 20px Helvetica Neue, Verdana, Arial';\n context.fillStyle = 'rgba(255,0,0,1)';\n context.fillText(this.quadkey, 20, canvas.width / 2 + 10);\n\n var texture = new THREE.Texture(canvas);\n\n // Silky smooth images when tilted\n texture.magFilter = THREE.LinearFilter;\n texture.minFilter = THREE.LinearMipMapLinearFilter;\n\n // TODO: Set this to renderer.getMaxAnisotropy() / 4\n texture.anisotropy = 4;\n\n texture.needsUpdate = true;\n\n var material = new THREE.MeshBasicMaterial({\n map: texture,\n transparent: true\n });\n\n var geom = new THREE.PlaneGeometry(this.side, this.side, 1);\n var mesh = new THREE.Mesh(geom, material);\n\n mesh.rotation.x = -90 * Math.PI / 180;\n mesh.position.y = 0.1;\n\n return mesh;\n }\n\n _createMesh() {\n var mesh = new THREE.Object3D();\n var geom = new THREE.PlaneGeometry(this.side, this.side, 1);\n\n var material = new THREE.MeshBasicMaterial();\n\n var localMesh = new THREE.Mesh(geom, material);\n localMesh.rotation.x = -90 * Math.PI / 180;\n\n mesh.add(localMesh);\n\n mesh.position.x = this.center[0];\n mesh.position.z = this.center[1];\n\n var box = new THREE.BoxHelper(localMesh);\n mesh.add(box);\n\n mesh.add(this._createDebugMesh());\n\n // var letter = String.fromCharCode(97 + Math.floor(Math.random() * 26));\n // var url = 'http://' + letter + '.basemaps.cartocdn.com/light_nolabels/';\n // // var url = 'http://tile.stamen.com/toner-lite/';\n //\n // loader.load(url + this.tile[2] + '/' + this.tile[0] + '/' + this.tile[1] + '@2x.png', texture => {\n // console.log('Loaded');\n // // Silky smooth images when tilted\n // texture.magFilter = THREE.LinearFilter;\n // texture.minFilter = THREE.LinearMipMapLinearFilter;\n //\n // // TODO: Set this to renderer.getMaxAnisotropy() / 4\n // texture.anisotropy = 4;\n //\n // texture.needsUpdate = true;\n //\n // var material = new THREE.MeshBasicMaterial({map: texture});\n //\n // var localMesh = new THREE.Mesh(geom, material);\n // localMesh.rotation.x = -90 * Math.PI / 180;\n //\n // // Sometimes tiles don't appear, even though the images have loaded ok\n // // This helps a little but it's a total hack and the real solution needs\n // // to be found.\n // setTimeout(function() {\n // mesh.add(localMesh);\n // }, 2000);\n //\n // mesh.position.x = this.center[0];\n // mesh.position.z = this.center[1];\n //\n // var box = new THREE.BoxHelper(localMesh);\n // mesh.add(box);\n //\n // this._createDebugMesh();\n // });\n\n return mesh;\n }\n\n _quadkeyToTile(quadkey) {\n var x = 0;\n var y = 0;\n var z = quadkey.length;\n\n for (var i = z; i > 0; i--) {\n var mask = 1 << (i - 1);\n var q = +quadkey[z - i];\n if (q === 1) {\n x |= mask;\n }\n if (q === 2) {\n y |= mask;\n }\n if (q === 3) {\n x |= mask;\n y |= mask;\n }\n }\n\n return [x, y, z];\n }\n\n _boundsToCenter(bounds) {\n var x = bounds[0] + (bounds[2] - bounds[0]) / 2;\n var y = bounds[1] + (bounds[3] - bounds[1]) / 2;\n\n return [x, y];\n }\n\n _tileBounds(tile) {\n var boundsWGS84 = this._tileBoundsWGS84(tile);\n\n var sw = this.world.latLonToPoint(LatLon(boundsWGS84[1], boundsWGS84[0]));\n var ne = this.world.latLonToPoint(LatLon(boundsWGS84[3], boundsWGS84[2]));\n\n return [sw.x, sw.y, ne.x, ne.y];\n // return [swMerc[0], -swMerc[1], neMerc[0], -neMerc[1]];\n }\n\n _tileBoundsWGS84(tile) {\n var e = this._tile2lon(tile[0] + 1, tile[2]);\n var w = this._tile2lon(tile[0], tile[2]);\n var s = this._tile2lat(tile[1] + 1, tile[2]);\n var n = this._tile2lat(tile[1], tile[2]);\n return [w, s, e, n];\n }\n\n _tile2lon(x, z) {\n return x / Math.pow(2, z) * 360 - 180;\n }\n\n _tile2lat(y, z) {\n var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z);\n return r2d * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n }\n}\n\n// Initialise without requiring new keyword\nexport default function(quadkey, world) {\n return new Surface(quadkey, world);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/layer/tile/Surface.js\n **/"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","vizicities.min.js","webpack:/webpack/bootstrap 9d157dc3471a8e598d99","webpack:///src/vizicities.js","webpack:///src/World.js","webpack:///~/eventemitter3/index.js","webpack:///~/lodash.assign/index.js","webpack:///~/lodash.keys/index.js","webpack:///~/lodash.rest/index.js","webpack:///src/geo/CRS/index.js","webpack:///src/geo/CRS/CRS.EPSG3857.js","webpack:///src/geo/CRS/CRS.Earth.js","webpack:///src/geo/CRS/CRS.js","webpack:///src/geo/LatLon.js","webpack:///src/geo/Point.js","webpack:///src/util/wrapNum.js","webpack:///src/geo/projection/Projection.SphericalMercator.js","webpack:///src/util/Transformation.js","webpack:///src/geo/CRS/CRS.EPSG3395.js","webpack:///src/geo/projection/Projection.Mercator.js","webpack:///src/geo/CRS/CRS.EPSG4326.js","webpack:///src/geo/projection/Projection.LatLon.js","webpack:///src/geo/CRS/CRS.Simple.js","webpack:///src/geo/CRS/CRS.Proj4.js","webpack:///src/geo/projection/Projection.Proj4.js","webpack:/external \"proj4\"","webpack:///src/engine/Engine.js","webpack:/external \"THREE\"","webpack:///src/engine/Scene.js","webpack:///src/engine/Renderer.js","webpack:///src/engine/Camera.js","webpack:///src/controls/index.js","webpack:///src/controls/Controls.Orbit.js","webpack:///~/three-orbit-controls/index.js","webpack:///src/layer/environment/EnvironmentLayer.js","webpack:///src/layer/Layer.js","webpack:///src/layer/tile/GridLayer.js","webpack:///src/layer/tile/TileCache.js","webpack:///~/lru-cache/lib/lru-cache.js","webpack:///~/pseudomap/map.js","webpack:///~/process/browser.js","webpack:///~/pseudomap/pseudomap.js","webpack:///~/util/util.js","webpack:///~/util/support/isBufferBrowser.js","webpack:///~/inherits/inherits_browser.js","webpack:///~/yallist/yallist.js","webpack:///src/layer/tile/Tile.js","webpack:///~/lodash.throttle/index.js","webpack:///~/lodash.throttle/~/lodash.debounce/index.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_22__","__WEBPACK_EXTERNAL_MODULE_24__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","_World","_World2","_controlsIndex","_controlsIndex2","_layerEnvironmentEnvironmentLayer","_layerEnvironmentEnvironmentLayer2","_layerTileGridLayer","_layerTileGridLayer2","_geoPoint","_geoPoint2","_geoLatLon","_geoLatLon2","VIZI","version","World","Controls","EnvironmentLayer","GridLayer","Point","LatLon","_classCallCheck","instance","Constructor","TypeError","_inherits","subClass","superClass","prototype","create","constructor","enumerable","writable","configurable","setPrototypeOf","__proto__","_createClass","defineProperties","target","props","i","length","descriptor","key","protoProps","staticProps","_get","_x","_x2","_x3","_again","object","property","receiver","Function","desc","getOwnPropertyDescriptor","undefined","getter","get","parent","getPrototypeOf","_eventemitter3","_eventemitter32","_lodashAssign","_lodashAssign2","_geoCRSIndex","_geoCRSIndex2","_engineEngine","_engineEngine2","_EventEmitter","domId","options","defaults","crs","EPSG3857","_layers","_controls","_initContainer","_initEngine","_initEvents","_update","_container","document","getElementById","_engine","on","_onControlsMoveEnd","point","_point","x","z","_resetView","pointToLatLon","latlon","emit","_moveStart","_move","_moveEnd","_lastPosition","delta","clock","getDelta","window","requestAnimationFrame","bind","forEach","controls","update","_originLatlon","_originPoint","project","latLonToPoint","projectedPoint","_subtract","add","unproject","_camera","layer","_addToWorld","push","_scene","_layer","EE","fn","context","once","EventEmitter","prefix","_events","listeners","event","exists","evt","available","l","ee","Array","a1","a2","a3","a4","a5","args","len","arguments","removeListener","apply","j","listener","events","removeAllListeners","off","addListener","setMaxListeners","prefixed","isIndex","reIsUint","test","MAX_SAFE_INTEGER","assignValue","objValue","eq","objectProto","hasOwnProperty","baseProperty","copyObject","source","copyObjectWith","customizer","index","newValue","createAssigner","assigner","rest","sources","guard","isIterateeCall","isObject","type","isArrayLike","other","isFunction","isLength","getLength","tag","objectToString","funcTag","genTag","keys","toString","assign","baseTimes","n","iteratee","result","baseHas","baseKeys","nativeKeys","indexKeys","isArray","isString","isArguments","String","isPrototype","Ctor","proto","isArrayLikeObject","propertyIsEnumerable","argsTag","isObjectLike","stringTag","isProto","indexes","skipIndexes","func","thisArg","start","FUNC_ERROR_TEXT","nativeMax","toInteger","array","otherArgs","toNumber","INFINITY","sign","MAX_INTEGER","remainder","valueOf","replace","reTrim","isBinary","reIsBinary","reIsOctal","freeParseInt","slice","reIsBadHex","NAN","parseInt","Math","max","_CRSEPSG3857","_CRSEPSG38572","_CRSEPSG3395","_CRSEPSG33952","_CRSEPSG4326","_CRSEPSG43262","_CRSSimple","_CRSSimple2","_CRSProj4","_CRSProj42","CRS","EPSG900913","EPSG3395","EPSG4326","Simple","Proj4","_CRSEarth","_CRSEarth2","_projectionProjectionSphericalMercator","_projectionProjectionSphericalMercator2","_utilTransformation","_utilTransformation2","_EPSG3857","code","projection","transformScale","PI","R","transformation","scale","_CRS","_CRS2","_LatLon","Earth","wrapLon","distance","latlon1","latlon2","accurate","lat1","lat2","a","rad","lat","lon1","lon","lon2","deltaLat","deltaLon","halfDeltaLat","halfDeltaLon","sin","cos","atan2","sqrt","acos","min","pointScale","metresToProjected","metres","projectedToMetres","projectedUnits","metresToWorld","zoom","projectedMetres","scaledMetres","worldToMetres","worldUnits","realMetres","_LatLon2","_Point","_Point2","_utilWrapNum","_utilWrapNum2","scaleFactor","_transform","untransformedPoint","untransform","pow","log","LN2","getProjectedBounds","infinite","b","bounds","s","transform","wrapLatLon","wrapLat","alt","isNaN","Error","lng","y","round","clone","_add","wrapNum","range","includeMax","d","SphericalMercator","MAX_LATITUDE","ECC","ECC2","atan","exp","k","sinLat","sinLat2","cosLat","v","h","Transformation","_a","_b","_c","_d","_projectionProjectionMercator","_projectionProjectionMercator2","_EPSG3395","Mercator","R_MINOR","r","tmp","e","con","ts","tan","phi","dphi","abs","_projectionProjectionLatLon","_projectionProjectionLatLon2","_EPSG4326","ProjectionLatLon","m1","m2","m3","m4","p1","p2","p3","latlen","lonlen","_Simple","dx","dy","_projectionProjectionProj4","_projectionProjectionProj42","_Proj4","def","diffX","diffY","halfX","halfY","scaleX","scaleY","offsetX","offsetY","_proj4","_proj42","proj","forward","inverse","bottomLeft","topRight","_three","_three2","_Scene","_Scene2","_Renderer","_Renderer2","_Camera","_Camera2","Engine","container","console","_renderer","Clock","_frustum","Frustum","render","scene","Scene","fog","Fog","renderer","WebGLRenderer","antialias","setClearColor","color","gammaInput","gammaOutput","appendChild","domElement","updateSize","setSize","clientWidth","clientHeight","addEventListener","camera","PerspectiveCamera","position","aspect","updateProjectionMatrix","_ControlsOrbit","_ControlsOrbit2","Orbit","_threeOrbitControls","_threeOrbitControls2","_OrbitControls","_this","_world","center","animate","pointDelta","metresDelta","angle","angleDelta","noZoom","world","addControls","maxPolarAngle","THREE","OrbitConstraint","Vector3","minDistance","maxDistance","Infinity","minZoom","maxZoom","minPolarAngle","minAzimuthAngle","maxAzimuthAngle","enableDamping","dampingFactor","theta","scope","EPS","phiDelta","thetaDelta","panOffset","zoomChanged","getPolarAngle","getAzimuthalAngle","rotateLeft","rotateUp","panLeft","te","matrix","elements","adjDist","set","normalize","multiplyScalar","panUp","pan","deltaX","deltaY","screenWidth","screenHeight","offset","sub","targetDistance","fov","OrthographicCamera","right","left","top","bottom","warn","dollyIn","dollyScale","dollyOut","quat","Quaternion","setFromUnitVectors","up","quatInverse","lastPosition","lastQuaternion","copy","applyQuaternion","radius","lookAt","distanceToSquared","dot","quaternion","OrbitControls","element","body","constraint","getAutoRotationAngle","autoRotateSpeed","getZoomScale","zoomSpeed","onMouseDown","enabled","preventDefault","button","mouseButtons","ORBIT","enableRotate","state","STATE","ROTATE","rotateStart","clientX","clientY","ZOOM","enableZoom","DOLLY","dollyStart","PAN","enablePan","panStart","NONE","onMouseMove","onMouseUp","dispatchEvent","startEvent","rotateEnd","rotateDelta","subVectors","rotateSpeed","dollyEnd","dollyDelta","panEnd","panDelta","removeEventListener","endEvent","onMouseWheel","stopPropagation","wheelDelta","detail","onKeyDown","enableKeys","keyCode","UP","keyPanSpeed","BOTTOM","LEFT","RIGHT","touchstart","touches","TOUCH_ROTATE","pageX","pageY","TOUCH_DOLLY","TOUCH_PAN","touchmove","touchend","contextmenu","autoRotate","MOUSE","MIDDLE","Vector2","target0","position0","zoom0","changeEvent","reset","dispose","EventDispatcher","noRotate","noPan","noKeys","staticMoving","dynamicDampingFactor","_Layer2","_Layer3","_Layer","_initLights","_initGrid","directionalLight","DirectionalLight","intesity","directionalLight2","helper","DirectionalLightHelper","helper2","size","step","gridHelper","GridHelper","_engineScene","Layer","Object3D","addLayer","_onAdd","_TileCache","_TileCache2","_lodashThrottle","_lodashThrottle2","_tileCache","_minLOD","_maxLOD","setTimeout","_calculateLOD","_this2","getCamera","projScreenMatrix","Matrix4","multiplyMatrices","projectionMatrix","matrixWorldInverse","setFromMatrix","tile","getBounds","intersectsBox","Box3","_this3","_stop","_updateFrustum","checkList","_checklist","requestTile","_divide","_removeTiles","tileCount","_tileInFrustum","getCenter","dist","getMesh","isReady","requestTileAsync","currentItem","quadcode","count","getQuadcode","_screenSpaceError","splice","minDepth","maxDepth","quality","error","getSide","children","remove","_lruCache","_lruCache2","_Tile","_Tile2","TileCache","cacheLimit","_cache","priv","val","sym","symbols","makeSymbol","naiveLength","LRUCache","lc","stale","maxAge","forEachStep","self","node","thisp","hit","isStale","del","doUse","unshiftNode","diff","Date","now","trim","walker","tail","prev","removeNode","Entry","Map","util","Yallist","hasSymbol","Symbol","mL","allowStale","mA","lC","rforEach","head","next","toArray","map","values","dump","filter","dumpLru","inspect","opts","str","extras","as","didFirst","item","split","join","has","unshift","peek","pop","load","arr","expiresAt","prune","process","env","npm_package_name","npm_lifecycle_script","TEST_PSEUDOMAP","cleanUpNextTick","draining","currentQueue","queue","concat","queueIndex","drainQueue","timeout","run","clearTimeout","Item","fun","noop","nextTick","title","browser","argv","versions","binding","name","cwd","chdir","dir","umask","PseudoMap","clear","kv","same","_index","find","data","_data","res","entries","global","ctx","seen","stylize","stylizeNoColor","depth","colors","isBoolean","showHidden","_extend","isUndefined","customInspect","stylizeWithColor","formatValue","styleType","style","styles","arrayToHash","hash","idx","recurseTimes","ret","primitive","formatPrimitive","visibleKeys","getOwnPropertyNames","isError","indexOf","formatError","isRegExp","RegExp","isDate","base","braces","toUTCString","output","formatArray","formatProperty","reduceToSingleString","simple","JSON","stringify","isNumber","isNull","match","line","substr","numLinesEst","reduce","cur","ar","arg","isNullOrUndefined","isSymbol","re","isPrimitive","o","pad","timestamp","time","getHours","getMinutes","getSeconds","getDate","months","getMonth","prop","formatRegExp","format","f","objects","Number","_","deprecate","msg","deprecated","warned","throwDeprecation","traceDeprecation","trace","noDeprecation","debugEnviron","debugs","debuglog","NODE_DEBUG","toUpperCase","pid","bold","italic","underline","white","grey","black","blue","cyan","green","magenta","red","yellow","special","number","boolean","null","string","date","regexp","isBuffer","inherits","origin","fill","readUInt8","ctor","superCtor","super_","TempCtor","list","Node","pushNode","shift","forEachReverse","getReverse","mapReverse","initial","acc","reduceReverse","toArrayReverse","from","to","sliceReverse","reverse","r2d","loader","TextureLoader","setCrossOrigin","Tile","_quadcode","_ready","_tile","_quadcodeToTile","_boundsLatLon","_tileBoundsWGS84","_boundsWorld","_tileBoundsFromWGS84","_center","_boundsToCenter","_side","_getSide","imageProviders","_mesh","_createMesh","_requestTextureAsync","mesh","geom","PlaneGeometry","material","MeshBasicMaterial","localMesh","Mesh","rotation","box","BoxHelper","letter","fromCharCode","floor","random","url","texture","magFilter","LinearFilter","minFilter","LinearMipMapLinearFilter","anisotropy","needsUpdate","xhr","mask","q","boundsWGS84","sw","ne","_tile2lon","w","_tile2lat","throttle","wait","leading","trailing","debounce","maxWait","cancel","timeoutId","maxTimeoutId","lastCalled","trailingCall","complete","isCalled","delayed","remaining","stamp","flush","maxDelayed","debounced","leadingCall"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,SAAAA,QAAA,UACA,kBAAAC,SAAAA,OAAAC,IACAD,QAAA,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,KAAAD,EAAAG,QAAA,SAAAA,QAAA,UAEAJ,EAAA,KAAAC,EAAAD,EAAA,MAAAA,EAAA,QACCO,KAAA,SAAAC,EAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,qBAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAV,OAGA,IAAAC,GAAAU,EAAAD,IACAV,WACAY,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAb,EAAAD,QAAAC,EAAAA,EAAAD,QAAAS,qBAGAR,EAAAY,QAAA,EAGAZ,EAAAD,QAvBA,GAAAW,KAqCA,OATAF,qBAAAM,EAAAP,EAGAC,oBAAAO,EAAAL,EAGAF,oBAAAQ,EAAA,GAGAR,oBAAA,KDgBM,SAASR,EAAQD,EAASS,GAM/B,QAASS,wBAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,UAAWF,GAJzFG,OAAOC,eAAevB,EAAS,cAC7BwB,OAAO,GAKT,IAAIC,GAAShB,EE9DI,GFgEbiB,EAAUR,uBAAuBO,GAEjCE,EAAiBlB,EEjED,IFmEhBmB,EAAkBV,uBAAuBS,GAEzCE,EAAoCpB,EEpEZ,IFsExBqB,EAAqCZ,uBAAuBW,GAE5DE,EAAsBtB,EEvEL,IFyEjBuB,EAAuBd,uBAAuBa,GAE9CE,EAAYxB,EE1EC,IF4EbyB,EAAahB,uBAAuBe,GAEpCE,EAAa1B,EE7EC,IF+Ed2B,EAAclB,uBAAuBiB,GE7EpCE,GAC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BAGAmB,EAAA,IAGAlD,EAAA,oBACAC,EAAA,6BAGA0C,EAAA,aAGAM,EAAA,qBAGAJ,EAAA,aAGAC,EAAA,cAGAC,EAAAI,SAGA3E,EAAArK,OAAA8B,UAMA8J,EAAAvB,EAAA2B,SAGA6B,EAAAoB,KAAAC,IAkBAqd,EAAAD,KAAAC,GA+PA5tB,GAAAD,QAAAw+B","file":"vizicities.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"proj4\"), require(\"THREE\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"proj4\", \"THREE\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VIZI\"] = factory(require(\"proj4\"), require(\"THREE\"));\n\telse\n\t\troot[\"VIZI\"] = factory(root[\"proj4\"], root[\"THREE\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_22__, __WEBPACK_EXTERNAL_MODULE_24__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"proj4\"), require(\"THREE\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"proj4\", \"THREE\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VIZI\"] = factory(require(\"proj4\"), require(\"THREE\"));\n\telse\n\t\troot[\"VIZI\"] = factory(root[\"proj4\"], root[\"THREE\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_22__, __WEBPACK_EXTERNAL_MODULE_24__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _World = __webpack_require__(1);\n\t\n\tvar _World2 = _interopRequireDefault(_World);\n\t\n\tvar _controlsIndex = __webpack_require__(28);\n\t\n\tvar _controlsIndex2 = _interopRequireDefault(_controlsIndex);\n\t\n\tvar _layerEnvironmentEnvironmentLayer = __webpack_require__(31);\n\t\n\tvar _layerEnvironmentEnvironmentLayer2 = _interopRequireDefault(_layerEnvironmentEnvironmentLayer);\n\t\n\tvar _layerTileGridLayer = __webpack_require__(33);\n\t\n\tvar _layerTileGridLayer2 = _interopRequireDefault(_layerTileGridLayer);\n\t\n\tvar _geoPoint = __webpack_require__(11);\n\t\n\tvar _geoPoint2 = _interopRequireDefault(_geoPoint);\n\t\n\tvar _geoLatLon = __webpack_require__(10);\n\t\n\tvar _geoLatLon2 = _interopRequireDefault(_geoLatLon);\n\t\n\tvar VIZI = {\n\t version: '0.3',\n\t\n\t // Public API\n\t World: _World2['default'],\n\t Controls: _controlsIndex2['default'],\n\t EnvironmentLayer: _layerEnvironmentEnvironmentLayer2['default'],\n\t GridLayer: _layerTileGridLayer2['default'],\n\t Point: _geoPoint2['default'],\n\t LatLon: _geoLatLon2['default']\n\t};\n\t\n\texports['default'] = VIZI;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _eventemitter3 = __webpack_require__(2);\n\t\n\tvar _eventemitter32 = _interopRequireDefault(_eventemitter3);\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _geoCRSIndex = __webpack_require__(6);\n\t\n\tvar _geoCRSIndex2 = _interopRequireDefault(_geoCRSIndex);\n\t\n\tvar _geoPoint = __webpack_require__(11);\n\t\n\tvar _geoPoint2 = _interopRequireDefault(_geoPoint);\n\t\n\tvar _geoLatLon = __webpack_require__(10);\n\t\n\tvar _geoLatLon2 = _interopRequireDefault(_geoLatLon);\n\t\n\tvar _engineEngine = __webpack_require__(23);\n\t\n\tvar _engineEngine2 = _interopRequireDefault(_engineEngine);\n\t\n\t// Pretty much any event someone using ViziCities would need will be emitted or\n\t// proxied by World (eg. render events, etc)\n\t\n\tvar World = (function (_EventEmitter) {\n\t _inherits(World, _EventEmitter);\n\t\n\t function World(domId, options) {\n\t _classCallCheck(this, World);\n\t\n\t _get(Object.getPrototypeOf(World.prototype), 'constructor', this).call(this);\n\t\n\t var defaults = {\n\t crs: _geoCRSIndex2['default'].EPSG3857\n\t };\n\t\n\t this.options = (0, _lodashAssign2['default'])(defaults, options);\n\t\n\t this._layers = [];\n\t this._controls = [];\n\t\n\t this._initContainer(domId);\n\t this._initEngine();\n\t this._initEvents();\n\t\n\t // Kick off the update and render loop\n\t this._update();\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t _createClass(World, [{\n\t key: '_initContainer',\n\t value: function _initContainer(domId) {\n\t this._container = document.getElementById(domId);\n\t }\n\t }, {\n\t key: '_initEngine',\n\t value: function _initEngine() {\n\t this._engine = (0, _engineEngine2['default'])(this._container);\n\t\n\t // Engine events\n\t //\n\t // Consider proxying these through events on World for public access\n\t // this._engine.on('preRender', () => {});\n\t // this._engine.on('postRender', () => {});\n\t }\n\t }, {\n\t key: '_initEvents',\n\t value: function _initEvents() {\n\t this.on('controlsMoveEnd', this._onControlsMoveEnd);\n\t }\n\t }, {\n\t key: '_onControlsMoveEnd',\n\t value: function _onControlsMoveEnd(point) {\n\t var _point = (0, _geoPoint2['default'])(point.x, point.z);\n\t this._resetView(this.pointToLatLon(_point));\n\t }\n\t\n\t // Reset world view\n\t }, {\n\t key: '_resetView',\n\t value: function _resetView(latlon) {\n\t this.emit('preResetView');\n\t\n\t this._moveStart();\n\t this._move(latlon);\n\t this._moveEnd();\n\t\n\t this.emit('postResetView');\n\t }\n\t }, {\n\t key: '_moveStart',\n\t value: function _moveStart() {\n\t this.emit('moveStart');\n\t }\n\t }, {\n\t key: '_move',\n\t value: function _move(latlon) {\n\t this._lastPosition = latlon;\n\t this.emit('move', latlon);\n\t }\n\t }, {\n\t key: '_moveEnd',\n\t value: function _moveEnd() {\n\t this.emit('moveEnd');\n\t }\n\t }, {\n\t key: '_update',\n\t value: function _update() {\n\t var delta = this._engine.clock.getDelta();\n\t\n\t // Once _update is called it will run forever, for now\n\t window.requestAnimationFrame(this._update.bind(this));\n\t\n\t // Update controls\n\t this._controls.forEach(function (controls) {\n\t controls.update();\n\t });\n\t\n\t this.emit('preUpdate');\n\t this._engine.update(delta);\n\t this.emit('postUpdate');\n\t }\n\t\n\t // Set world view\n\t }, {\n\t key: 'setView',\n\t value: function setView(latlon) {\n\t // Store initial geographic coordinate for the [0,0,0] world position\n\t //\n\t // The origin point doesn't move in three.js / 3D space so only set it once\n\t // here instead of every time _resetView is called\n\t //\n\t // If it was updated every time then coorindates would shift over time and\n\t // would be out of place / context with previously-placed points (0,0 would\n\t // refer to a different point each time)\n\t this._originLatlon = latlon;\n\t this._originPoint = this.project(latlon);\n\t\n\t this._resetView(latlon);\n\t return this;\n\t }\n\t\n\t // Return world geographic position\n\t }, {\n\t key: 'getPosition',\n\t value: function getPosition() {\n\t return this._lastPosition;\n\t }\n\t\n\t // Transform geographic coordinate to world point\n\t //\n\t // This doesn't take into account the origin offset\n\t //\n\t // For example, this takes a geographic coordinate and returns a point\n\t // relative to the origin point of the projection (not the world)\n\t }, {\n\t key: 'project',\n\t value: function project(latlon) {\n\t return this.options.crs.latLonToPoint((0, _geoLatLon2['default'])(latlon));\n\t }\n\t\n\t // Transform world point to geographic coordinate\n\t //\n\t // This doesn't take into account the origin offset\n\t //\n\t // For example, this takes a point relative to the origin point of the\n\t // projection (not the world) and returns a geographic coordinate\n\t }, {\n\t key: 'unproject',\n\t value: function unproject(point) {\n\t return this.options.crs.pointToLatLon((0, _geoPoint2['default'])(point));\n\t }\n\t\n\t // Takes into account the origin offset\n\t //\n\t // For example, this takes a geographic coordinate and returns a point\n\t // relative to the three.js / 3D origin (0,0)\n\t }, {\n\t key: 'latLonToPoint',\n\t value: function latLonToPoint(latlon) {\n\t var projectedPoint = this.project((0, _geoLatLon2['default'])(latlon));\n\t return projectedPoint._subtract(this._originPoint);\n\t }\n\t\n\t // Takes into account the origin offset\n\t //\n\t // For example, this takes a point relative to the three.js / 3D origin (0,0)\n\t // and returns the exact geographic coordinate at that point\n\t }, {\n\t key: 'pointToLatLon',\n\t value: function pointToLatLon(point) {\n\t var projectedPoint = (0, _geoPoint2['default'])(point).add(this._originPoint);\n\t return this.unproject(projectedPoint);\n\t }\n\t\n\t // Unsure if it's a good idea to expose this here for components like\n\t // GridLayer to use (eg. to keep track of a frustum)\n\t }, {\n\t key: 'getCamera',\n\t value: function getCamera() {\n\t return this._engine._camera;\n\t }\n\t }, {\n\t key: 'addLayer',\n\t value: function addLayer(layer) {\n\t layer._addToWorld(this);\n\t\n\t this._layers.push(layer);\n\t\n\t // Could move this into Layer but it'll do here for now\n\t this._engine._scene.add(layer._layer);\n\t\n\t this.emit('layerAdded', layer);\n\t return this;\n\t }\n\t\n\t // Remove layer and perform clean up operations\n\t }, {\n\t key: 'removeLayer',\n\t value: function removeLayer(layer) {}\n\t }, {\n\t key: 'addControls',\n\t value: function addControls(controls) {\n\t controls._addToWorld(this);\n\t\n\t this._controls.push(controls);\n\t\n\t this.emit('controlsAdded', controls);\n\t return this;\n\t }\n\t }, {\n\t key: 'removeControls',\n\t value: function removeControls(controls) {}\n\t }]);\n\t\n\t return World;\n\t})(_eventemitter32['default']);\n\t\n\texports['default'] = function (domId, options) {\n\t return new World(domId, options);\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t//\n\t// We store our EE objects in a plain object whose properties are event names.\n\t// If `Object.create(null)` is not supported we prefix the event names with a\n\t// `~` to make sure that the built-in object properties are not overridden or\n\t// used as an attack vector.\n\t// We also assume that `Object.create(null)` is available when the event name\n\t// is an ES6 Symbol.\n\t//\n\tvar prefix = typeof Object.create !== 'function' ? '~' : false;\n\t\n\t/**\n\t * Representation of a single EventEmitter function.\n\t *\n\t * @param {Function} fn Event handler to be called.\n\t * @param {Mixed} context Context for function execution.\n\t * @param {Boolean} once Only emit once\n\t * @api private\n\t */\n\tfunction EE(fn, context, once) {\n\t this.fn = fn;\n\t this.context = context;\n\t this.once = once || false;\n\t}\n\t\n\t/**\n\t * Minimal EventEmitter interface that is molded against the Node.js\n\t * EventEmitter interface.\n\t *\n\t * @constructor\n\t * @api public\n\t */\n\tfunction EventEmitter() { /* Nothing to set */ }\n\t\n\t/**\n\t * Holds the assigned EventEmitters by name.\n\t *\n\t * @type {Object}\n\t * @private\n\t */\n\tEventEmitter.prototype._events = undefined;\n\t\n\t/**\n\t * Return a list of assigned event listeners.\n\t *\n\t * @param {String} event The events that should be listed.\n\t * @param {Boolean} exists We only need to know if there are listeners.\n\t * @returns {Array|Boolean}\n\t * @api public\n\t */\n\tEventEmitter.prototype.listeners = function listeners(event, exists) {\n\t var evt = prefix ? prefix + event : event\n\t , available = this._events && this._events[evt];\n\t\n\t if (exists) return !!available;\n\t if (!available) return [];\n\t if (available.fn) return [available.fn];\n\t\n\t for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n\t ee[i] = available[i].fn;\n\t }\n\t\n\t return ee;\n\t};\n\t\n\t/**\n\t * Emit an event to all registered event listeners.\n\t *\n\t * @param {String} event The name of the event.\n\t * @returns {Boolean} Indication if we've emitted an event.\n\t * @api public\n\t */\n\tEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n\t var evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events || !this._events[evt]) return false;\n\t\n\t var listeners = this._events[evt]\n\t , len = arguments.length\n\t , args\n\t , i;\n\t\n\t if ('function' === typeof listeners.fn) {\n\t if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\t\n\t switch (len) {\n\t case 1: return listeners.fn.call(listeners.context), true;\n\t case 2: return listeners.fn.call(listeners.context, a1), true;\n\t case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n\t case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n\t case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n\t case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n\t }\n\t\n\t for (i = 1, args = new Array(len -1); i < len; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t\n\t listeners.fn.apply(listeners.context, args);\n\t } else {\n\t var length = listeners.length\n\t , j;\n\t\n\t for (i = 0; i < length; i++) {\n\t if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\t\n\t switch (len) {\n\t case 1: listeners[i].fn.call(listeners[i].context); break;\n\t case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n\t case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n\t default:\n\t if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n\t args[j - 1] = arguments[j];\n\t }\n\t\n\t listeners[i].fn.apply(listeners[i].context, args);\n\t }\n\t }\n\t }\n\t\n\t return true;\n\t};\n\t\n\t/**\n\t * Register a new EventListener for the given event.\n\t *\n\t * @param {String} event Name of the event.\n\t * @param {Functon} fn Callback function.\n\t * @param {Mixed} context The context of the function.\n\t * @api public\n\t */\n\tEventEmitter.prototype.on = function on(event, fn, context) {\n\t var listener = new EE(fn, context || this)\n\t , evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events) this._events = prefix ? {} : Object.create(null);\n\t if (!this._events[evt]) this._events[evt] = listener;\n\t else {\n\t if (!this._events[evt].fn) this._events[evt].push(listener);\n\t else this._events[evt] = [\n\t this._events[evt], listener\n\t ];\n\t }\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Add an EventListener that's only called once.\n\t *\n\t * @param {String} event Name of the event.\n\t * @param {Function} fn Callback function.\n\t * @param {Mixed} context The context of the function.\n\t * @api public\n\t */\n\tEventEmitter.prototype.once = function once(event, fn, context) {\n\t var listener = new EE(fn, context || this, true)\n\t , evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events) this._events = prefix ? {} : Object.create(null);\n\t if (!this._events[evt]) this._events[evt] = listener;\n\t else {\n\t if (!this._events[evt].fn) this._events[evt].push(listener);\n\t else this._events[evt] = [\n\t this._events[evt], listener\n\t ];\n\t }\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Remove event listeners.\n\t *\n\t * @param {String} event The event we want to remove.\n\t * @param {Function} fn The listener that we need to find.\n\t * @param {Mixed} context Only remove listeners matching this context.\n\t * @param {Boolean} once Only remove once listeners.\n\t * @api public\n\t */\n\tEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n\t var evt = prefix ? prefix + event : event;\n\t\n\t if (!this._events || !this._events[evt]) return this;\n\t\n\t var listeners = this._events[evt]\n\t , events = [];\n\t\n\t if (fn) {\n\t if (listeners.fn) {\n\t if (\n\t listeners.fn !== fn\n\t || (once && !listeners.once)\n\t || (context && listeners.context !== context)\n\t ) {\n\t events.push(listeners);\n\t }\n\t } else {\n\t for (var i = 0, length = listeners.length; i < length; i++) {\n\t if (\n\t listeners[i].fn !== fn\n\t || (once && !listeners[i].once)\n\t || (context && listeners[i].context !== context)\n\t ) {\n\t events.push(listeners[i]);\n\t }\n\t }\n\t }\n\t }\n\t\n\t //\n\t // Reset the array, or remove it completely if we have no more listeners.\n\t //\n\t if (events.length) {\n\t this._events[evt] = events.length === 1 ? events[0] : events;\n\t } else {\n\t delete this._events[evt];\n\t }\n\t\n\t return this;\n\t};\n\t\n\t/**\n\t * Remove all listeners or only the listeners for the specified event.\n\t *\n\t * @param {String} event The event want to remove all listeners for.\n\t * @api public\n\t */\n\tEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n\t if (!this._events) return this;\n\t\n\t if (event) delete this._events[prefix ? prefix + event : event];\n\t else this._events = prefix ? {} : Object.create(null);\n\t\n\t return this;\n\t};\n\t\n\t//\n\t// Alias methods names because people roll like that.\n\t//\n\tEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\tEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\t\n\t//\n\t// This function doesn't apply anymore.\n\t//\n\tEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n\t return this;\n\t};\n\t\n\t//\n\t// Expose the prefix.\n\t//\n\tEventEmitter.prefixed = prefix;\n\t\n\t//\n\t// Expose the module.\n\t//\n\tif (true) {\n\t module.exports = EventEmitter;\n\t}\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/**\n\t * lodash 4.0.2 (Custom Build) \n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright 2012-2016 The Dojo Foundation \n\t * Based on Underscore.js 1.8.3 \n\t * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t * Available under MIT license \n\t */\n\tvar keys = __webpack_require__(4),\n\t rest = __webpack_require__(5);\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar MAX_SAFE_INTEGER = 9007199254740991;\n\t\n\t/** `Object#toString` result references. */\n\tvar funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]';\n\t\n\t/** Used to detect unsigned integer values. */\n\tvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\t\n\t/**\n\t * Checks if `value` is a valid array-like index.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n\t * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n\t */\n\tfunction isIndex(value, length) {\n\t value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n\t length = length == null ? MAX_SAFE_INTEGER : length;\n\t return value > -1 && value % 1 == 0 && value < length;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/**\n\t * Assigns `value` to `key` of `object` if the existing value is not equivalent\n\t * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n\t * for equality comparisons.\n\t *\n\t * @private\n\t * @param {Object} object The object to modify.\n\t * @param {string} key The key of the property to assign.\n\t * @param {*} value The value to assign.\n\t */\n\tfunction assignValue(object, key, value) {\n\t var objValue = object[key];\n\t if ((!eq(objValue, value) ||\n\t (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||\n\t (value === undefined && !(key in object))) {\n\t object[key] = value;\n\t }\n\t}\n\t\n\t/**\n\t * The base implementation of `_.property` without support for deep paths.\n\t *\n\t * @private\n\t * @param {string} key The key of the property to get.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction baseProperty(key) {\n\t return function(object) {\n\t return object == null ? undefined : object[key];\n\t };\n\t}\n\t\n\t/**\n\t * Copies properties of `source` to `object`.\n\t *\n\t * @private\n\t * @param {Object} source The object to copy properties from.\n\t * @param {Array} props The property names to copy.\n\t * @param {Object} [object={}] The object to copy properties to.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction copyObject(source, props, object) {\n\t return copyObjectWith(source, props, object);\n\t}\n\t\n\t/**\n\t * This function is like `copyObject` except that it accepts a function to\n\t * customize copied values.\n\t *\n\t * @private\n\t * @param {Object} source The object to copy properties from.\n\t * @param {Array} props The property names to copy.\n\t * @param {Object} [object={}] The object to copy properties to.\n\t * @param {Function} [customizer] The function to customize copied values.\n\t * @returns {Object} Returns `object`.\n\t */\n\tfunction copyObjectWith(source, props, object, customizer) {\n\t object || (object = {});\n\t\n\t var index = -1,\n\t length = props.length;\n\t\n\t while (++index < length) {\n\t var key = props[index],\n\t newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key];\n\t\n\t assignValue(object, key, newValue);\n\t }\n\t return object;\n\t}\n\t\n\t/**\n\t * Creates a function like `_.assign`.\n\t *\n\t * @private\n\t * @param {Function} assigner The function to assign values.\n\t * @returns {Function} Returns the new assigner function.\n\t */\n\tfunction createAssigner(assigner) {\n\t return rest(function(object, sources) {\n\t var index = -1,\n\t length = sources.length,\n\t customizer = length > 1 ? sources[length - 1] : undefined,\n\t guard = length > 2 ? sources[2] : undefined;\n\t\n\t customizer = typeof customizer == 'function' ? (length--, customizer) : undefined;\n\t if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n\t customizer = length < 3 ? undefined : customizer;\n\t length = 1;\n\t }\n\t object = Object(object);\n\t while (++index < length) {\n\t var source = sources[index];\n\t if (source) {\n\t assigner(object, source, index, customizer);\n\t }\n\t }\n\t return object;\n\t });\n\t}\n\t\n\t/**\n\t * Gets the \"length\" property value of `object`.\n\t *\n\t * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n\t * that affects Safari on at least iOS 8.1-8.3 ARM64.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {*} Returns the \"length\" value.\n\t */\n\tvar getLength = baseProperty('length');\n\t\n\t/**\n\t * Checks if the provided arguments are from an iteratee call.\n\t *\n\t * @private\n\t * @param {*} value The potential iteratee value argument.\n\t * @param {*} index The potential iteratee index or key argument.\n\t * @param {*} object The potential iteratee object argument.\n\t * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n\t */\n\tfunction isIterateeCall(value, index, object) {\n\t if (!isObject(object)) {\n\t return false;\n\t }\n\t var type = typeof index;\n\t if (type == 'number'\n\t ? (isArrayLike(object) && isIndex(index, object.length))\n\t : (type == 'string' && index in object)) {\n\t return eq(object[index], value);\n\t }\n\t return false;\n\t}\n\t\n\t/**\n\t * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n\t * comparison between two values to determine if they are equivalent.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to compare.\n\t * @param {*} other The other value to compare.\n\t * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n\t * @example\n\t *\n\t * var object = { 'user': 'fred' };\n\t * var other = { 'user': 'fred' };\n\t *\n\t * _.eq(object, object);\n\t * // => true\n\t *\n\t * _.eq(object, other);\n\t * // => false\n\t *\n\t * _.eq('a', 'a');\n\t * // => true\n\t *\n\t * _.eq('a', Object('a'));\n\t * // => false\n\t *\n\t * _.eq(NaN, NaN);\n\t * // => true\n\t */\n\tfunction eq(value, other) {\n\t return value === other || (value !== value && other !== other);\n\t}\n\t\n\t/**\n\t * Checks if `value` is array-like. A value is considered array-like if it's\n\t * not a function and has a `value.length` that's an integer greater than or\n\t * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @type Function\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n\t * @example\n\t *\n\t * _.isArrayLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLike(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLike('abc');\n\t * // => true\n\t *\n\t * _.isArrayLike(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLike(value) {\n\t return value != null &&\n\t !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8 which returns 'object' for typed array constructors, and\n\t // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like length.\n\t *\n\t * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n\t * @example\n\t *\n\t * _.isLength(3);\n\t * // => true\n\t *\n\t * _.isLength(Number.MIN_VALUE);\n\t * // => false\n\t *\n\t * _.isLength(Infinity);\n\t * // => false\n\t *\n\t * _.isLength('3');\n\t * // => false\n\t */\n\tfunction isLength(value) {\n\t return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n\t * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Assigns own enumerable properties of source objects to the destination\n\t * object. Source objects are applied from left to right. Subsequent sources\n\t * overwrite property assignments of previous sources.\n\t *\n\t * **Note:** This method mutates `object` and is loosely based on\n\t * [`Object.assign`](https://mdn.io/Object/assign).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The destination object.\n\t * @param {...Object} [sources] The source objects.\n\t * @returns {Object} Returns `object`.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.c = 3;\n\t * }\n\t *\n\t * function Bar() {\n\t * this.e = 5;\n\t * }\n\t *\n\t * Foo.prototype.d = 4;\n\t * Bar.prototype.f = 6;\n\t *\n\t * _.assign({ 'a': 1 }, new Foo, new Bar);\n\t * // => { 'a': 1, 'c': 3, 'e': 5 }\n\t */\n\tvar assign = createAssigner(function(object, source) {\n\t copyObject(source, keys(source), object);\n\t});\n\t\n\tmodule.exports = assign;\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t/**\n\t * lodash 4.0.2 (Custom Build) \n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright 2012-2016 The Dojo Foundation \n\t * Based on Underscore.js 1.8.3 \n\t * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t * Available under MIT license \n\t */\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar MAX_SAFE_INTEGER = 9007199254740991;\n\t\n\t/** `Object#toString` result references. */\n\tvar argsTag = '[object Arguments]',\n\t funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]',\n\t stringTag = '[object String]';\n\t\n\t/** Used to detect unsigned integer values. */\n\tvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\t\n\t/**\n\t * The base implementation of `_.times` without support for iteratee shorthands\n\t * or max array length checks.\n\t *\n\t * @private\n\t * @param {number} n The number of times to invoke `iteratee`.\n\t * @param {Function} iteratee The function invoked per iteration.\n\t * @returns {Array} Returns the array of results.\n\t */\n\tfunction baseTimes(n, iteratee) {\n\t var index = -1,\n\t result = Array(n);\n\t\n\t while (++index < n) {\n\t result[index] = iteratee(index);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like index.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n\t * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n\t */\n\tfunction isIndex(value, length) {\n\t value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n\t length = length == null ? MAX_SAFE_INTEGER : length;\n\t return value > -1 && value % 1 == 0 && value < length;\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/** Used to check objects for own properties. */\n\tvar hasOwnProperty = objectProto.hasOwnProperty;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/** Built-in value references. */\n\tvar getPrototypeOf = Object.getPrototypeOf,\n\t propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeKeys = Object.keys;\n\t\n\t/**\n\t * The base implementation of `_.has` without support for deep paths.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @param {Array|string} key The key to check.\n\t * @returns {boolean} Returns `true` if `key` exists, else `false`.\n\t */\n\tfunction baseHas(object, key) {\n\t // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,\n\t // that are composed entirely of index properties, return `false` for\n\t // `hasOwnProperty` checks of them.\n\t return hasOwnProperty.call(object, key) ||\n\t (typeof object == 'object' && key in object && getPrototypeOf(object) === null);\n\t}\n\t\n\t/**\n\t * The base implementation of `_.keys` which doesn't skip the constructor\n\t * property of prototypes or treat sparse arrays as dense.\n\t *\n\t * @private\n\t * @type Function\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t */\n\tfunction baseKeys(object) {\n\t return nativeKeys(Object(object));\n\t}\n\t\n\t/**\n\t * The base implementation of `_.property` without support for deep paths.\n\t *\n\t * @private\n\t * @param {string} key The key of the property to get.\n\t * @returns {Function} Returns the new function.\n\t */\n\tfunction baseProperty(key) {\n\t return function(object) {\n\t return object == null ? undefined : object[key];\n\t };\n\t}\n\t\n\t/**\n\t * Gets the \"length\" property value of `object`.\n\t *\n\t * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n\t * that affects Safari on at least iOS 8.1-8.3 ARM64.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {*} Returns the \"length\" value.\n\t */\n\tvar getLength = baseProperty('length');\n\t\n\t/**\n\t * Creates an array of index keys for `object` values of arrays,\n\t * `arguments` objects, and strings, otherwise `null` is returned.\n\t *\n\t * @private\n\t * @param {Object} object The object to query.\n\t * @returns {Array|null} Returns index keys, else `null`.\n\t */\n\tfunction indexKeys(object) {\n\t var length = object ? object.length : undefined;\n\t if (isLength(length) &&\n\t (isArray(object) || isString(object) || isArguments(object))) {\n\t return baseTimes(length, String);\n\t }\n\t return null;\n\t}\n\t\n\t/**\n\t * Checks if `value` is likely a prototype object.\n\t *\n\t * @private\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n\t */\n\tfunction isPrototype(value) {\n\t var Ctor = value && value.constructor,\n\t proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\t\n\t return value === proto;\n\t}\n\t\n\t/**\n\t * Checks if `value` is likely an `arguments` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isArguments(function() { return arguments; }());\n\t * // => true\n\t *\n\t * _.isArguments([1, 2, 3]);\n\t * // => false\n\t */\n\tfunction isArguments(value) {\n\t // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n\t return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n\t (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as an `Array` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @type Function\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isArray([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArray(document.body.children);\n\t * // => false\n\t *\n\t * _.isArray('abc');\n\t * // => false\n\t *\n\t * _.isArray(_.noop);\n\t * // => false\n\t */\n\tvar isArray = Array.isArray;\n\t\n\t/**\n\t * Checks if `value` is array-like. A value is considered array-like if it's\n\t * not a function and has a `value.length` that's an integer greater than or\n\t * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @type Function\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n\t * @example\n\t *\n\t * _.isArrayLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLike(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLike('abc');\n\t * // => true\n\t *\n\t * _.isArrayLike(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLike(value) {\n\t return value != null &&\n\t !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));\n\t}\n\t\n\t/**\n\t * This method is like `_.isArrayLike` except that it also checks if `value`\n\t * is an object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @type Function\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n\t * @example\n\t *\n\t * _.isArrayLikeObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isArrayLikeObject(document.body.children);\n\t * // => true\n\t *\n\t * _.isArrayLikeObject('abc');\n\t * // => false\n\t *\n\t * _.isArrayLikeObject(_.noop);\n\t * // => false\n\t */\n\tfunction isArrayLikeObject(value) {\n\t return isObjectLike(value) && isArrayLike(value);\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8 which returns 'object' for typed array constructors, and\n\t // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is a valid array-like length.\n\t *\n\t * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n\t * @example\n\t *\n\t * _.isLength(3);\n\t * // => true\n\t *\n\t * _.isLength(Number.MIN_VALUE);\n\t * // => false\n\t *\n\t * _.isLength(Infinity);\n\t * // => false\n\t *\n\t * _.isLength('3');\n\t * // => false\n\t */\n\tfunction isLength(value) {\n\t return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n\t * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Checks if `value` is object-like. A value is object-like if it's not `null`\n\t * and has a `typeof` result of \"object\".\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n\t * @example\n\t *\n\t * _.isObjectLike({});\n\t * // => true\n\t *\n\t * _.isObjectLike([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObjectLike(_.noop);\n\t * // => false\n\t *\n\t * _.isObjectLike(null);\n\t * // => false\n\t */\n\tfunction isObjectLike(value) {\n\t return !!value && typeof value == 'object';\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `String` primitive or object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isString('abc');\n\t * // => true\n\t *\n\t * _.isString(1);\n\t * // => false\n\t */\n\tfunction isString(value) {\n\t return typeof value == 'string' ||\n\t (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n\t}\n\t\n\t/**\n\t * Creates an array of the own enumerable property names of `object`.\n\t *\n\t * **Note:** Non-object values are coerced to objects. See the\n\t * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n\t * for more details.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Object\n\t * @param {Object} object The object to query.\n\t * @returns {Array} Returns the array of property names.\n\t * @example\n\t *\n\t * function Foo() {\n\t * this.a = 1;\n\t * this.b = 2;\n\t * }\n\t *\n\t * Foo.prototype.c = 3;\n\t *\n\t * _.keys(new Foo);\n\t * // => ['a', 'b'] (iteration order is not guaranteed)\n\t *\n\t * _.keys('hi');\n\t * // => ['0', '1']\n\t */\n\tfunction keys(object) {\n\t var isProto = isPrototype(object);\n\t if (!(isProto || isArrayLike(object))) {\n\t return baseKeys(object);\n\t }\n\t var indexes = indexKeys(object),\n\t skipIndexes = !!indexes,\n\t result = indexes || [],\n\t length = result.length;\n\t\n\t for (var key in object) {\n\t if (baseHas(object, key) &&\n\t !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n\t !(isProto && key == 'constructor')) {\n\t result.push(key);\n\t }\n\t }\n\t return result;\n\t}\n\t\n\tmodule.exports = keys;\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t/**\n\t * lodash 4.0.1 (Custom Build) \n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright 2012-2016 The Dojo Foundation \n\t * Based on Underscore.js 1.8.3 \n\t * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t * Available under MIT license \n\t */\n\t\n\t/** Used as the `TypeError` message for \"Functions\" methods. */\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar INFINITY = 1 / 0,\n\t MAX_INTEGER = 1.7976931348623157e+308,\n\t NAN = 0 / 0;\n\t\n\t/** `Object#toString` result references. */\n\tvar funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]';\n\t\n\t/** Used to match leading and trailing whitespace. */\n\tvar reTrim = /^\\s+|\\s+$/g;\n\t\n\t/** Used to detect bad signed hexadecimal string values. */\n\tvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\t\n\t/** Used to detect binary string values. */\n\tvar reIsBinary = /^0b[01]+$/i;\n\t\n\t/** Used to detect octal string values. */\n\tvar reIsOctal = /^0o[0-7]+$/i;\n\t\n\t/** Built-in method references without a dependency on `root`. */\n\tvar freeParseInt = parseInt;\n\t\n\t/**\n\t * A faster alternative to `Function#apply`, this function invokes `func`\n\t * with the `this` binding of `thisArg` and the arguments of `args`.\n\t *\n\t * @private\n\t * @param {Function} func The function to invoke.\n\t * @param {*} thisArg The `this` binding of `func`.\n\t * @param {...*} args The arguments to invoke `func` with.\n\t * @returns {*} Returns the result of `func`.\n\t */\n\tfunction apply(func, thisArg, args) {\n\t var length = args.length;\n\t switch (length) {\n\t case 0: return func.call(thisArg);\n\t case 1: return func.call(thisArg, args[0]);\n\t case 2: return func.call(thisArg, args[0], args[1]);\n\t case 3: return func.call(thisArg, args[0], args[1], args[2]);\n\t }\n\t return func.apply(thisArg, args);\n\t}\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeMax = Math.max;\n\t\n\t/**\n\t * Creates a function that invokes `func` with the `this` binding of the\n\t * created function and arguments from `start` and beyond provided as an array.\n\t *\n\t * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Function\n\t * @param {Function} func The function to apply a rest parameter to.\n\t * @param {number} [start=func.length-1] The start position of the rest parameter.\n\t * @returns {Function} Returns the new function.\n\t * @example\n\t *\n\t * var say = _.rest(function(what, names) {\n\t * return what + ' ' + _.initial(names).join(', ') +\n\t * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n\t * });\n\t *\n\t * say('hello', 'fred', 'barney', 'pebbles');\n\t * // => 'hello fred, barney, & pebbles'\n\t */\n\tfunction rest(func, start) {\n\t if (typeof func != 'function') {\n\t throw new TypeError(FUNC_ERROR_TEXT);\n\t }\n\t start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);\n\t return function() {\n\t var args = arguments,\n\t index = -1,\n\t length = nativeMax(args.length - start, 0),\n\t array = Array(length);\n\t\n\t while (++index < length) {\n\t array[index] = args[start + index];\n\t }\n\t switch (start) {\n\t case 0: return func.call(this, array);\n\t case 1: return func.call(this, args[0], array);\n\t case 2: return func.call(this, args[0], args[1], array);\n\t }\n\t var otherArgs = Array(start + 1);\n\t index = -1;\n\t while (++index < start) {\n\t otherArgs[index] = args[index];\n\t }\n\t otherArgs[start] = array;\n\t return apply(func, this, otherArgs);\n\t };\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8 which returns 'object' for typed array constructors, and\n\t // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n\t * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Converts `value` to an integer.\n\t *\n\t * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to convert.\n\t * @returns {number} Returns the converted integer.\n\t * @example\n\t *\n\t * _.toInteger(3);\n\t * // => 3\n\t *\n\t * _.toInteger(Number.MIN_VALUE);\n\t * // => 0\n\t *\n\t * _.toInteger(Infinity);\n\t * // => 1.7976931348623157e+308\n\t *\n\t * _.toInteger('3');\n\t * // => 3\n\t */\n\tfunction toInteger(value) {\n\t if (!value) {\n\t return value === 0 ? value : 0;\n\t }\n\t value = toNumber(value);\n\t if (value === INFINITY || value === -INFINITY) {\n\t var sign = (value < 0 ? -1 : 1);\n\t return sign * MAX_INTEGER;\n\t }\n\t var remainder = value % 1;\n\t return value === value ? (remainder ? value - remainder : value) : 0;\n\t}\n\t\n\t/**\n\t * Converts `value` to a number.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to process.\n\t * @returns {number} Returns the number.\n\t * @example\n\t *\n\t * _.toNumber(3);\n\t * // => 3\n\t *\n\t * _.toNumber(Number.MIN_VALUE);\n\t * // => 5e-324\n\t *\n\t * _.toNumber(Infinity);\n\t * // => Infinity\n\t *\n\t * _.toNumber('3');\n\t * // => 3\n\t */\n\tfunction toNumber(value) {\n\t if (isObject(value)) {\n\t var other = isFunction(value.valueOf) ? value.valueOf() : value;\n\t value = isObject(other) ? (other + '') : other;\n\t }\n\t if (typeof value != 'string') {\n\t return value === 0 ? value : +value;\n\t }\n\t value = value.replace(reTrim, '');\n\t var isBinary = reIsBinary.test(value);\n\t return (isBinary || reIsOctal.test(value))\n\t ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n\t : (reIsBadHex.test(value) ? NAN : +value);\n\t}\n\t\n\tmodule.exports = rest;\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _CRSEPSG3857 = __webpack_require__(7);\n\t\n\tvar _CRSEPSG38572 = _interopRequireDefault(_CRSEPSG3857);\n\t\n\tvar _CRSEPSG3395 = __webpack_require__(15);\n\t\n\tvar _CRSEPSG33952 = _interopRequireDefault(_CRSEPSG3395);\n\t\n\tvar _CRSEPSG4326 = __webpack_require__(17);\n\t\n\tvar _CRSEPSG43262 = _interopRequireDefault(_CRSEPSG4326);\n\t\n\tvar _CRSSimple = __webpack_require__(19);\n\t\n\tvar _CRSSimple2 = _interopRequireDefault(_CRSSimple);\n\t\n\tvar _CRSProj4 = __webpack_require__(20);\n\t\n\tvar _CRSProj42 = _interopRequireDefault(_CRSProj4);\n\t\n\tvar CRS = {};\n\t\n\tCRS.EPSG3857 = _CRSEPSG38572['default'];\n\tCRS.EPSG900913 = _CRSEPSG3857.EPSG900913;\n\tCRS.EPSG3395 = _CRSEPSG33952['default'];\n\tCRS.EPSG4326 = _CRSEPSG43262['default'];\n\tCRS.Simple = _CRSSimple2['default'];\n\tCRS.Proj4 = _CRSProj42['default'];\n\t\n\texports['default'] = CRS;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS.EPSG3857 (WGS 84 / Pseudo-Mercator) CRS implementation.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG3857.js\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRSEarth = __webpack_require__(8);\n\t\n\tvar _CRSEarth2 = _interopRequireDefault(_CRSEarth);\n\t\n\tvar _projectionProjectionSphericalMercator = __webpack_require__(13);\n\t\n\tvar _projectionProjectionSphericalMercator2 = _interopRequireDefault(_projectionProjectionSphericalMercator);\n\t\n\tvar _utilTransformation = __webpack_require__(14);\n\t\n\tvar _utilTransformation2 = _interopRequireDefault(_utilTransformation);\n\t\n\tvar _EPSG3857 = {\n\t code: 'EPSG:3857',\n\t projection: _projectionProjectionSphericalMercator2['default'],\n\t\n\t // Work out how to de-dupe this (scoping issue)\n\t transformScale: 1 / (Math.PI * _projectionProjectionSphericalMercator2['default'].R),\n\t\n\t // Scale and transformation inputs changed to account for central origin in\n\t // WebGL, instead of top-left origin used in Leaflet\n\t transformation: (function () {\n\t // TODO: Cannot use this.transformScale due to scope\n\t var scale = 1 / (Math.PI * _projectionProjectionSphericalMercator2['default'].R);\n\t\n\t return new _utilTransformation2['default'](scale, 0, -scale, 0);\n\t })()\n\t};\n\t\n\tvar EPSG3857 = (0, _lodashAssign2['default'])({}, _CRSEarth2['default'], _EPSG3857);\n\t\n\tvar EPSG900913 = (0, _lodashAssign2['default'])({}, EPSG3857, {\n\t code: 'EPSG:900913'\n\t});\n\t\n\texports.EPSG900913 = EPSG900913;\n\texports['default'] = EPSG3857;\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS.Earth is the base class for all CRS representing Earth.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.Earth.js\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRS = __webpack_require__(9);\n\t\n\tvar _CRS2 = _interopRequireDefault(_CRS);\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar Earth = {\n\t wrapLon: [-180, 180],\n\t\n\t R: 6378137,\n\t\n\t // Distance between two geographical points using spherical law of cosines\n\t // approximation or Haversine\n\t //\n\t // See: http://www.movable-type.co.uk/scripts/latlong.html\n\t distance: function distance(latlon1, latlon2, accurate) {\n\t var rad = Math.PI / 180;\n\t\n\t var lat1;\n\t var lat2;\n\t\n\t var a;\n\t\n\t if (!accurate) {\n\t lat1 = latlon1.lat * rad;\n\t lat2 = latlon2.lat * rad;\n\t\n\t a = Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos((latlon2.lon - latlon1.lon) * rad);\n\t\n\t return this.R * Math.acos(Math.min(a, 1));\n\t } else {\n\t lat1 = latlon1.lat * rad;\n\t lat2 = latlon2.lat * rad;\n\t\n\t var lon1 = latlon1.lon * rad;\n\t var lon2 = latlon2.lon * rad;\n\t\n\t var deltaLat = lat2 - lat1;\n\t var deltaLon = lon2 - lon1;\n\t\n\t var halfDeltaLat = deltaLat / 2;\n\t var halfDeltaLon = deltaLon / 2;\n\t\n\t a = Math.sin(halfDeltaLat) * Math.sin(halfDeltaLat) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(halfDeltaLon) * Math.sin(halfDeltaLon);\n\t\n\t var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t\n\t return this.R * c;\n\t }\n\t },\n\t\n\t // Scale factor for converting between real metres and projected metres\n\t //\n\t // projectedMetres = realMetres * pointScale\n\t // realMetres = projectedMetres / pointScale\n\t //\n\t // Defaults to a scale factor of 1 if no calculation method exists\n\t //\n\t // Probably need to run this through the CRS transformation or similar so the\n\t // resulting scale is relative to the dimensions of the world space\n\t // Eg. 1 metre in projected space is likly scaled up or down to some other\n\t // number\n\t pointScale: function pointScale(latlon, accurate) {\n\t return this.projection.pointScale ? this.projection.pointScale(latlon, accurate) : [1, 1];\n\t },\n\t\n\t // Convert real metres to projected units\n\t //\n\t // Latitude scale is chosen because it fluctuates more than longitude\n\t metresToProjected: function metresToProjected(metres, pointScale) {\n\t return metres * pointScale[1];\n\t },\n\t\n\t // Convert projected units to real metres\n\t //\n\t // Latitude scale is chosen because it fluctuates more than longitude\n\t projectedToMetres: function projectedToMetres(projectedUnits, pointScale) {\n\t return projectedUnits / pointScale[1];\n\t },\n\t\n\t // Convert real metres to a value in world (WebGL) units\n\t metresToWorld: function metresToWorld(metres, pointScale, zoom) {\n\t // Transform metres to projected metres using the latitude point scale\n\t //\n\t // Latitude scale is chosen because it fluctuates more than longitude\n\t var projectedMetres = this.metresToProjected(metres, pointScale);\n\t\n\t var scale = this.scale(zoom);\n\t\n\t // Half scale if using zoom as WebGL origin is in the centre, not top left\n\t if (zoom) {\n\t scale /= 2;\n\t }\n\t\n\t // Scale projected metres\n\t var scaledMetres = scale * (this.transformScale * projectedMetres) / pointScale[1];\n\t\n\t return scaledMetres;\n\t },\n\t\n\t // Convert world (WebGL) units to a value in real metres\n\t worldToMetres: function worldToMetres(worldUnits, pointScale, zoom) {\n\t var scale = this.scale(zoom);\n\t\n\t // Half scale if using zoom as WebGL origin is in the centre, not top left\n\t if (zoom) {\n\t scale /= 2;\n\t }\n\t\n\t var projectedUnits = worldUnits / scale / this.transformScale * pointScale[1];\n\t var realMetres = this.projectedToMetres(projectedUnits, pointScale);\n\t\n\t return realMetres;\n\t }\n\t};\n\t\n\texports['default'] = (0, _lodashAssign2['default'])({}, _CRS2['default'], Earth);\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS is the base object for all defined CRS (Coordinate Reference Systems)\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.js\n\t */\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar _Point = __webpack_require__(11);\n\t\n\tvar _Point2 = _interopRequireDefault(_Point);\n\t\n\tvar _utilWrapNum = __webpack_require__(12);\n\t\n\tvar _utilWrapNum2 = _interopRequireDefault(_utilWrapNum);\n\t\n\tvar CRS = {\n\t // Scale factor determines final dimensions of world space\n\t //\n\t // Projection transformation in range -1 to 1 is multiplied by scale factor to\n\t // find final world coordinates\n\t //\n\t // Scale factor can be considered as half the amount of the desired dimension\n\t // for the largest side when transformation is equal to 1 or -1, or as the\n\t // distance between 0 and 1 on the largest side\n\t //\n\t // For example, if you want the world dimensions to be between -1000 and 1000\n\t // then the scale factor will be 1000\n\t scaleFactor: 1000000,\n\t\n\t // Converts geo coords to pixel / WebGL ones\n\t latLonToPoint: function latLonToPoint(latlon, zoom) {\n\t var projectedPoint = this.projection.project(latlon);\n\t var scale = this.scale(zoom);\n\t\n\t // Half scale if using zoom as WebGL origin is in the centre, not top left\n\t if (zoom) {\n\t scale /= 2;\n\t }\n\t\n\t return this.transformation._transform(projectedPoint, scale);\n\t },\n\t\n\t // Converts pixel / WebGL coords to geo coords\n\t pointToLatLon: function pointToLatLon(point, zoom) {\n\t var scale = this.scale(zoom);\n\t\n\t // Half scale if using zoom as WebGL origin is in the centre, not top left\n\t if (zoom) {\n\t scale /= 2;\n\t }\n\t\n\t var untransformedPoint = this.transformation.untransform(point, scale);\n\t\n\t return this.projection.unproject(untransformedPoint);\n\t },\n\t\n\t // Converts geo coords to projection-specific coords (e.g. in meters)\n\t project: function project(latlon) {\n\t return this.projection.project(latlon);\n\t },\n\t\n\t // Converts projected coords to geo coords\n\t unproject: function unproject(point) {\n\t return this.projection.unproject(point);\n\t },\n\t\n\t // If zoom is provided, returns the map width in pixels for a given zoom\n\t // Else, provides fixed scale value\n\t scale: function scale(zoom) {\n\t // If zoom is provided then return scale based on map tile zoom\n\t if (zoom >= 0) {\n\t return 256 * Math.pow(2, zoom);\n\t // Else, return fixed scale value to expand projected coordinates from\n\t // their 0 to 1 range into something more practical\n\t } else {\n\t return this.scaleFactor;\n\t }\n\t },\n\t\n\t // Returns zoom level for a given scale value\n\t // This only works with a scale value that is based on map pixel width\n\t zoom: function zoom(scale) {\n\t return Math.log(scale / 256) / Math.LN2;\n\t },\n\t\n\t // Returns the bounds of the world in projected coords if applicable\n\t getProjectedBounds: function getProjectedBounds(zoom) {\n\t if (this.infinite) {\n\t return null;\n\t }\n\t\n\t var b = this.projection.bounds;\n\t var s = this.scale(zoom);\n\t\n\t // Half scale if using zoom as WebGL origin is in the centre, not top left\n\t if (zoom) {\n\t s /= 2;\n\t }\n\t\n\t // Bottom left\n\t var min = this.transformation.transform((0, _Point2['default'])(b[0]), s);\n\t\n\t // Top right\n\t var max = this.transformation.transform((0, _Point2['default'])(b[1]), s);\n\t\n\t return [min, max];\n\t },\n\t\n\t // Whether a coordinate axis wraps in a given range (e.g. longitude from -180 to 180); depends on CRS\n\t // wrapLon: [min, max],\n\t // wrapLat: [min, max],\n\t\n\t // If true, the coordinate space will be unbounded (infinite in all directions)\n\t // infinite: false,\n\t\n\t // Wraps geo coords in certain ranges if applicable\n\t wrapLatLon: function wrapLatLon(latlon) {\n\t var lat = this.wrapLat ? (0, _utilWrapNum2['default'])(latlon.lat, this.wrapLat, true) : latlon.lat;\n\t var lon = this.wrapLon ? (0, _utilWrapNum2['default'])(latlon.lon, this.wrapLon, true) : latlon.lon;\n\t var alt = latlon.alt;\n\t\n\t return (0, _LatLon2['default'])(lat, lon, alt);\n\t }\n\t};\n\t\n\texports['default'] = CRS;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\t/*\n\t * LatLon is a helper class for ensuring consistent geographic coordinates.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/LatLng.js\n\t */\n\t\n\tvar LatLon = (function () {\n\t function LatLon(lat, lon, alt) {\n\t _classCallCheck(this, LatLon);\n\t\n\t if (isNaN(lat) || isNaN(lon)) {\n\t throw new Error('Invalid LatLon object: (' + lat + ', ' + lon + ')');\n\t }\n\t\n\t this.lat = +lat;\n\t this.lon = +lon;\n\t\n\t if (alt !== undefined) {\n\t this.alt = +alt;\n\t }\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t //\n\t // Accepts (LatLon), ([lat, lon, alt]), ([lat, lon]) and (lat, lon, alt)\n\t // Also converts between lng and lon\n\t\n\t _createClass(LatLon, [{\n\t key: 'clone',\n\t value: function clone() {\n\t return new LatLon(this.lat, this.lon, this.alt);\n\t }\n\t }]);\n\t\n\t return LatLon;\n\t})();\n\t\n\texports['default'] = function (a, b, c) {\n\t if (a instanceof LatLon) {\n\t return a;\n\t }\n\t if (Array.isArray(a) && typeof a[0] !== 'object') {\n\t if (a.length === 3) {\n\t return new LatLon(a[0], a[1], a[2]);\n\t }\n\t if (a.length === 2) {\n\t return new LatLon(a[0], a[1]);\n\t }\n\t return null;\n\t }\n\t if (a === undefined || a === null) {\n\t return a;\n\t }\n\t if (typeof a === 'object' && 'lat' in a) {\n\t return new LatLon(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);\n\t }\n\t if (b === undefined) {\n\t return null;\n\t }\n\t return new LatLon(a, b, c);\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 11 */\n/***/ function(module, exports) {\n\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\t/*\n\t * Point is a helper class for ensuring consistent world positions.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/Point.js\n\t */\n\t\n\tvar Point = (function () {\n\t function Point(x, y, round) {\n\t _classCallCheck(this, Point);\n\t\n\t this.x = round ? Math.round(x) : x;\n\t this.y = round ? Math.round(y) : y;\n\t }\n\t\n\t // Accepts (point), ([x, y]) and (x, y, round)\n\t\n\t _createClass(Point, [{\n\t key: \"clone\",\n\t value: function clone() {\n\t return new Point(this.x, this.y);\n\t }\n\t\n\t // Non-destructive\n\t }, {\n\t key: \"add\",\n\t value: function add(point) {\n\t return this.clone()._add(_point(point));\n\t }\n\t\n\t // Destructive\n\t }, {\n\t key: \"_add\",\n\t value: function _add(point) {\n\t this.x += point.x;\n\t this.y += point.y;\n\t return this;\n\t }\n\t\n\t // Non-destructive\n\t }, {\n\t key: \"subtract\",\n\t value: function subtract(point) {\n\t return this.clone()._subtract(_point(point));\n\t }\n\t\n\t // Destructive\n\t }, {\n\t key: \"_subtract\",\n\t value: function _subtract(point) {\n\t this.x -= point.x;\n\t this.y -= point.y;\n\t return this;\n\t }\n\t }]);\n\t\n\t return Point;\n\t})();\n\t\n\tvar _point = function _point(x, y, round) {\n\t if (x instanceof Point) {\n\t return x;\n\t }\n\t if (Array.isArray(x)) {\n\t return new Point(x[0], x[1]);\n\t }\n\t if (x === undefined || x === null) {\n\t return x;\n\t }\n\t return new Point(x, y, round);\n\t};\n\t\n\t// Initialise without requiring new keyword\n\texports[\"default\"] = _point;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 12 */\n/***/ function(module, exports) {\n\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t/*\n\t * Wrap the given number to lie within a certain range (eg. longitude)\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/core/Util.js\n\t */\n\t\n\tvar wrapNum = function wrapNum(x, range, includeMax) {\n\t var max = range[1];\n\t var min = range[0];\n\t var d = max - min;\n\t return x === max && includeMax ? x : ((x - min) % d + d) % d + min;\n\t};\n\t\n\texports[\"default\"] = wrapNum;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * Spherical Mercator is the most popular map projection, used by EPSG:3857 CRS\n\t * used by default.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.SphericalMercator.js\n\t */\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar _Point = __webpack_require__(11);\n\t\n\tvar _Point2 = _interopRequireDefault(_Point);\n\t\n\tvar SphericalMercator = {\n\t // Radius / WGS84 semi-major axis\n\t R: 6378137,\n\t MAX_LATITUDE: 85.0511287798,\n\t\n\t // WGS84 eccentricity\n\t ECC: 0.081819191,\n\t ECC2: 0.081819191 * 0.081819191,\n\t\n\t project: function project(latlon) {\n\t var d = Math.PI / 180;\n\t var max = this.MAX_LATITUDE;\n\t var lat = Math.max(Math.min(max, latlon.lat), -max);\n\t var sin = Math.sin(lat * d);\n\t\n\t return (0, _Point2['default'])(this.R * latlon.lon * d, this.R * Math.log((1 + sin) / (1 - sin)) / 2);\n\t },\n\t\n\t unproject: function unproject(point) {\n\t var d = 180 / Math.PI;\n\t\n\t return (0, _LatLon2['default'])((2 * Math.atan(Math.exp(point.y / this.R)) - Math.PI / 2) * d, point.x * d / this.R);\n\t },\n\t\n\t // Scale factor for converting between real metres and projected metres\n\t //\n\t // projectedMetres = realMetres * pointScale\n\t // realMetres = projectedMetres / pointScale\n\t //\n\t // Accurate scale factor uses proper Web Mercator scaling\n\t // See pg.9: http://www.hydrometronics.com/downloads/Web%20Mercator%20-%20Non-Conformal,%20Non-Mercator%20(notes).pdf\n\t // See: http://jsfiddle.net/robhawkes/yws924cf/\n\t pointScale: function pointScale(latlon, accurate) {\n\t var rad = Math.PI / 180;\n\t\n\t var k;\n\t\n\t if (!accurate) {\n\t k = 1 / Math.cos(latlon.lat * rad);\n\t\n\t // [scaleX, scaleY]\n\t return [k, k];\n\t } else {\n\t var lat = latlon.lat * rad;\n\t var lon = latlon.lon * rad;\n\t\n\t var a = this.R;\n\t\n\t var sinLat = Math.sin(lat);\n\t var sinLat2 = sinLat * sinLat;\n\t\n\t var cosLat = Math.cos(lat);\n\t\n\t // Radius meridian\n\t var p = a * (1 - this.ECC2) / Math.pow(1 - this.ECC2 * sinLat2, 3 / 2);\n\t\n\t // Radius prime meridian\n\t var v = a / Math.sqrt(1 - this.ECC2 * sinLat2);\n\t\n\t // Scale N/S\n\t var h = a / p / cosLat;\n\t\n\t // Scale E/W\n\t k = a / v / cosLat;\n\t\n\t // [scaleX, scaleY]\n\t return [k, h];\n\t }\n\t },\n\t\n\t // Not using this.R due to scoping\n\t bounds: (function () {\n\t var d = 6378137 * Math.PI;\n\t return [[-d, -d], [d, d]];\n\t })()\n\t};\n\t\n\texports['default'] = SphericalMercator;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\t/*\n\t * Transformation is an utility class to perform simple point transformations\n\t * through a 2d-matrix.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geometry/Transformation.js\n\t */\n\t\n\tvar _geoPoint = __webpack_require__(11);\n\t\n\tvar _geoPoint2 = _interopRequireDefault(_geoPoint);\n\t\n\tvar Transformation = (function () {\n\t function Transformation(a, b, c, d) {\n\t _classCallCheck(this, Transformation);\n\t\n\t this._a = a;\n\t this._b = b;\n\t this._c = c;\n\t this._d = d;\n\t }\n\t\n\t _createClass(Transformation, [{\n\t key: 'transform',\n\t value: function transform(point, scale) {\n\t // Copy input point as to not destroy the original data\n\t return this._transform(point.clone(), scale);\n\t }\n\t\n\t // Destructive transform (faster)\n\t }, {\n\t key: '_transform',\n\t value: function _transform(point, scale) {\n\t scale = scale || 1;\n\t\n\t point.x = scale * (this._a * point.x + this._b);\n\t point.y = scale * (this._c * point.y + this._d);\n\t return point;\n\t }\n\t }, {\n\t key: 'untransform',\n\t value: function untransform(point, scale) {\n\t scale = scale || 1;\n\t return (0, _geoPoint2['default'])((point.x / scale - this._b) / this._a, (point.y / scale - this._d) / this._c);\n\t }\n\t }]);\n\t\n\t return Transformation;\n\t})();\n\t\n\texports['default'] = Transformation;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS.EPSG3395 (WGS 84 / World Mercator) CRS implementation.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG3395.js\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRSEarth = __webpack_require__(8);\n\t\n\tvar _CRSEarth2 = _interopRequireDefault(_CRSEarth);\n\t\n\tvar _projectionProjectionMercator = __webpack_require__(16);\n\t\n\tvar _projectionProjectionMercator2 = _interopRequireDefault(_projectionProjectionMercator);\n\t\n\tvar _utilTransformation = __webpack_require__(14);\n\t\n\tvar _utilTransformation2 = _interopRequireDefault(_utilTransformation);\n\t\n\tvar _EPSG3395 = {\n\t code: 'EPSG:3395',\n\t projection: _projectionProjectionMercator2['default'],\n\t\n\t // Work out how to de-dupe this (scoping issue)\n\t transformScale: 1 / (Math.PI * _projectionProjectionMercator2['default'].R),\n\t\n\t // Scale and transformation inputs changed to account for central origin in\n\t // WebGL, instead of top-left origin used in Leaflet\n\t transformation: (function () {\n\t // TODO: Cannot use this.transformScale due to scope\n\t var scale = 1 / (Math.PI * _projectionProjectionMercator2['default'].R);\n\t\n\t return new _utilTransformation2['default'](scale, 0, -scale, 0);\n\t })()\n\t};\n\t\n\tvar EPSG3395 = (0, _lodashAssign2['default'])({}, _CRSEarth2['default'], _EPSG3395);\n\t\n\texports['default'] = EPSG3395;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * Mercator projection that takes into account that the Earth is not a perfect\n\t * sphere. Less popular than spherical mercator; used by projections like\n\t * EPSG:3395.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.Mercator.js\n\t */\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar _Point = __webpack_require__(11);\n\t\n\tvar _Point2 = _interopRequireDefault(_Point);\n\t\n\tvar Mercator = {\n\t // Radius / WGS84 semi-major axis\n\t R: 6378137,\n\t R_MINOR: 6356752.314245179,\n\t\n\t // WGS84 eccentricity\n\t ECC: 0.081819191,\n\t ECC2: 0.081819191 * 0.081819191,\n\t\n\t project: function project(latlon) {\n\t var d = Math.PI / 180;\n\t var r = this.R;\n\t var y = latlon.lat * d;\n\t var tmp = this.R_MINOR / r;\n\t var e = Math.sqrt(1 - tmp * tmp);\n\t var con = e * Math.sin(y);\n\t\n\t var ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2);\n\t y = -r * Math.log(Math.max(ts, 1E-10));\n\t\n\t return (0, _Point2['default'])(latlon.lon * d * r, y);\n\t },\n\t\n\t unproject: function unproject(point) {\n\t var d = 180 / Math.PI;\n\t var r = this.R;\n\t var tmp = this.R_MINOR / r;\n\t var e = Math.sqrt(1 - tmp * tmp);\n\t var ts = Math.exp(-point.y / r);\n\t var phi = Math.PI / 2 - 2 * Math.atan(ts);\n\t\n\t for (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {\n\t con = e * Math.sin(phi);\n\t con = Math.pow((1 - con) / (1 + con), e / 2);\n\t dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;\n\t phi += dphi;\n\t }\n\t\n\t return (0, _LatLon2['default'])(phi * d, point.x * d / r);\n\t },\n\t\n\t // Scale factor for converting between real metres and projected metres\n\t //\n\t // projectedMetres = realMetres * pointScale\n\t // realMetres = projectedMetres / pointScale\n\t //\n\t // See pg.8: http://www.hydrometronics.com/downloads/Web%20Mercator%20-%20Non-Conformal,%20Non-Mercator%20(notes).pdf\n\t pointScale: function pointScale(latlon) {\n\t var rad = Math.PI / 180;\n\t var lat = latlon.lat * rad;\n\t var sinLat = Math.sin(lat);\n\t var sinLat2 = sinLat * sinLat;\n\t var cosLat = Math.cos(lat);\n\t\n\t var k = Math.sqrt(1 - this.ECC2 * sinLat2) / cosLat;\n\t\n\t // [scaleX, scaleY]\n\t return [k, k];\n\t },\n\t\n\t bounds: [[-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]]\n\t};\n\t\n\texports['default'] = Mercator;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS.EPSG4326 is a CRS popular among advanced GIS specialists.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG4326.js\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRSEarth = __webpack_require__(8);\n\t\n\tvar _CRSEarth2 = _interopRequireDefault(_CRSEarth);\n\t\n\tvar _projectionProjectionLatLon = __webpack_require__(18);\n\t\n\tvar _projectionProjectionLatLon2 = _interopRequireDefault(_projectionProjectionLatLon);\n\t\n\tvar _utilTransformation = __webpack_require__(14);\n\t\n\tvar _utilTransformation2 = _interopRequireDefault(_utilTransformation);\n\t\n\tvar _EPSG4326 = {\n\t code: 'EPSG:4326',\n\t projection: _projectionProjectionLatLon2['default'],\n\t\n\t // Work out how to de-dupe this (scoping issue)\n\t transformScale: 1 / 180,\n\t\n\t // Scale and transformation inputs changed to account for central origin in\n\t // WebGL, instead of top-left origin used in Leaflet\n\t //\n\t // TODO: Cannot use this.transformScale due to scope\n\t transformation: new _utilTransformation2['default'](1 / 180, 0, -1 / 180, 0)\n\t};\n\t\n\tvar EPSG4326 = (0, _lodashAssign2['default'])({}, _CRSEarth2['default'], _EPSG4326);\n\t\n\texports['default'] = EPSG4326;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * Simple equirectangular (Plate Carree) projection, used by CRS like EPSG:4326\n\t * and Simple.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.LonLat.js\n\t */\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar _Point = __webpack_require__(11);\n\t\n\tvar _Point2 = _interopRequireDefault(_Point);\n\t\n\tvar ProjectionLatLon = {\n\t project: function project(latlon) {\n\t return (0, _Point2['default'])(latlon.lon, latlon.lat);\n\t },\n\t\n\t unproject: function unproject(point) {\n\t return (0, _LatLon2['default'])(point.y, point.x);\n\t },\n\t\n\t // Scale factor for converting between real metres and degrees\n\t //\n\t // degrees = realMetres * pointScale\n\t // realMetres = degrees / pointScale\n\t //\n\t // See: http://stackoverflow.com/questions/639695/how-to-convert-latitude-or-longitude-to-meters\n\t // See: http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from\n\t pointScale: function pointScale(latlon) {\n\t var m1 = 111132.92;\n\t var m2 = -559.82;\n\t var m3 = 1.175;\n\t var m4 = -0.0023;\n\t var p1 = 111412.84;\n\t var p2 = -93.5;\n\t var p3 = 0.118;\n\t\n\t var rad = Math.PI / 180;\n\t var lat = latlon.lat * rad;\n\t\n\t var latlen = m1 + m2 * Math.cos(2 * lat) + m3 * Math.cos(4 * lat) + m4 * Math.cos(6 * lat);\n\t var lonlen = p1 * Math.cos(lat) + p2 * Math.cos(3 * lat) + p3 * Math.cos(5 * lat);\n\t\n\t return [1 / latlen, 1 / lonlen];\n\t },\n\t\n\t bounds: [[-180, -90], [180, 90]]\n\t};\n\t\n\texports['default'] = ProjectionLatLon;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * A simple CRS that can be used for flat non-Earth maps like panoramas or game\n\t * maps.\n\t *\n\t * Based on:\n\t * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.Simple.js\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRS = __webpack_require__(9);\n\t\n\tvar _CRS2 = _interopRequireDefault(_CRS);\n\t\n\tvar _projectionProjectionLatLon = __webpack_require__(18);\n\t\n\tvar _projectionProjectionLatLon2 = _interopRequireDefault(_projectionProjectionLatLon);\n\t\n\tvar _utilTransformation = __webpack_require__(14);\n\t\n\tvar _utilTransformation2 = _interopRequireDefault(_utilTransformation);\n\t\n\tvar _Simple = {\n\t projection: _projectionProjectionLatLon2['default'],\n\t\n\t // Straight 1:1 mapping (-1, -1 would be top-left)\n\t transformation: new _utilTransformation2['default'](1, 0, 1, 0),\n\t\n\t scale: function scale(zoom) {\n\t // If zoom is provided then return scale based on map tile zoom\n\t if (zoom) {\n\t return Math.pow(2, zoom);\n\t // Else, make no change to scale – may need to increase this or make it a\n\t // user-definable variable\n\t } else {\n\t return 1;\n\t }\n\t },\n\t\n\t zoom: function zoom(scale) {\n\t return Math.log(scale) / Math.LN2;\n\t },\n\t\n\t distance: function distance(latlon1, latlon2) {\n\t var dx = latlon2.lon - latlon1.lon;\n\t var dy = latlon2.lat - latlon1.lat;\n\t\n\t return Math.sqrt(dx * dx + dy * dy);\n\t },\n\t\n\t infinite: true\n\t};\n\t\n\tvar Simple = (0, _lodashAssign2['default'])({}, _CRS2['default'], _Simple);\n\t\n\texports['default'] = Simple;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * CRS.Proj4 for any Proj4-supported CRS.\n\t */\n\t\n\tvar _lodashAssign = __webpack_require__(3);\n\t\n\tvar _lodashAssign2 = _interopRequireDefault(_lodashAssign);\n\t\n\tvar _CRSEarth = __webpack_require__(8);\n\t\n\tvar _CRSEarth2 = _interopRequireDefault(_CRSEarth);\n\t\n\tvar _projectionProjectionProj4 = __webpack_require__(21);\n\t\n\tvar _projectionProjectionProj42 = _interopRequireDefault(_projectionProjectionProj4);\n\t\n\tvar _utilTransformation = __webpack_require__(14);\n\t\n\tvar _utilTransformation2 = _interopRequireDefault(_utilTransformation);\n\t\n\tvar _Proj4 = function _Proj4(code, def, bounds) {\n\t var projection = (0, _projectionProjectionProj42['default'])(def, bounds);\n\t\n\t // Transformation calcuations\n\t var diffX = projection.bounds[1][0] - projection.bounds[0][0];\n\t var diffY = projection.bounds[1][1] - projection.bounds[0][1];\n\t\n\t var halfX = diffX / 2;\n\t var halfY = diffY / 2;\n\t\n\t // This is the raw scale factor\n\t var scaleX = 1 / halfX;\n\t var scaleY = 1 / halfY;\n\t\n\t // Find the minimum scale factor\n\t //\n\t // The minimum scale factor comes from the largest side and is the one\n\t // you want to use for both axis so they stay relative in dimension\n\t var scale = Math.min(scaleX, scaleY);\n\t\n\t // Find amount to offset each axis by to make the central point lie on\n\t // the [0,0] origin\n\t var offsetX = scale * (projection.bounds[0][0] + halfX);\n\t var offsetY = scale * (projection.bounds[0][1] + halfY);\n\t\n\t return {\n\t code: code,\n\t projection: projection,\n\t\n\t transformScale: scale,\n\t\n\t // Map the input to a [-1,1] range with [0,0] in the centre\n\t transformation: new _utilTransformation2['default'](scale, -offsetX, -scale, offsetY)\n\t };\n\t};\n\t\n\tvar Proj4 = function Proj4(code, def, bounds) {\n\t return (0, _lodashAssign2['default'])({}, _CRSEarth2['default'], _Proj4(code, def, bounds));\n\t};\n\t\n\texports['default'] = Proj4;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 21 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t/*\n\t * Proj4 support for any projection.\n\t */\n\t\n\tvar _proj4 = __webpack_require__(22);\n\t\n\tvar _proj42 = _interopRequireDefault(_proj4);\n\t\n\tvar _LatLon = __webpack_require__(10);\n\t\n\tvar _LatLon2 = _interopRequireDefault(_LatLon);\n\t\n\tvar _Point = __webpack_require__(11);\n\t\n\tvar _Point2 = _interopRequireDefault(_Point);\n\t\n\tvar Proj4 = function Proj4(def, bounds) {\n\t var proj = (0, _proj42['default'])(def);\n\t\n\t var project = function project(latlon) {\n\t return (0, _Point2['default'])(proj.forward([latlon.lon, latlon.lat]));\n\t };\n\t\n\t var unproject = function unproject(point) {\n\t var inverse = proj.inverse([point.x, point.y]);\n\t return (0, _LatLon2['default'])(inverse[1], inverse[0]);\n\t };\n\t\n\t return {\n\t project: project,\n\t unproject: unproject,\n\t\n\t // Scale factor for converting between real metres and projected metres\\\n\t //\n\t // Need to work out the best way to provide the pointScale calculations\n\t // for custom, unknown projections (if wanting to override default)\n\t //\n\t // For now, user can manually override crs.pointScale or\n\t // crs.projection.pointScale\n\t //\n\t // projectedMetres = realMetres * pointScale\n\t // realMetres = projectedMetres / pointScale\n\t pointScale: function pointScale(latlon, accurate) {\n\t return [1, 1];\n\t },\n\t\n\t // Try and calculate bounds if none are provided\n\t //\n\t // This will provide incorrect bounds for some projections, so perhaps make\n\t // bounds a required input instead\n\t bounds: (function () {\n\t if (bounds) {\n\t return bounds;\n\t } else {\n\t var bottomLeft = project([-90, -180]);\n\t var topRight = project([90, 180]);\n\t\n\t return [bottomLeft, topRight];\n\t }\n\t })()\n\t };\n\t};\n\t\n\texports['default'] = Proj4;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 22 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_22__;\n\n/***/ },\n/* 23 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _eventemitter3 = __webpack_require__(2);\n\t\n\tvar _eventemitter32 = _interopRequireDefault(_eventemitter3);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _Scene = __webpack_require__(25);\n\t\n\tvar _Scene2 = _interopRequireDefault(_Scene);\n\t\n\tvar _Renderer = __webpack_require__(26);\n\t\n\tvar _Renderer2 = _interopRequireDefault(_Renderer);\n\t\n\tvar _Camera = __webpack_require__(27);\n\t\n\tvar _Camera2 = _interopRequireDefault(_Camera);\n\t\n\tvar Engine = (function (_EventEmitter) {\n\t _inherits(Engine, _EventEmitter);\n\t\n\t function Engine(container) {\n\t _classCallCheck(this, Engine);\n\t\n\t console.log('Init Engine');\n\t\n\t _get(Object.getPrototypeOf(Engine.prototype), 'constructor', this).call(this);\n\t\n\t this._scene = _Scene2['default'];\n\t this._renderer = (0, _Renderer2['default'])(container);\n\t this._camera = (0, _Camera2['default'])(container);\n\t this.clock = new _three2['default'].Clock();\n\t\n\t this._frustum = new _three2['default'].Frustum();\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t _createClass(Engine, [{\n\t key: 'update',\n\t value: function update(delta) {\n\t this.emit('preRender');\n\t this._renderer.render(this._scene, this._camera);\n\t this.emit('postRender');\n\t }\n\t }]);\n\t\n\t return Engine;\n\t})(_eventemitter32['default']);\n\t\n\texports['default'] = function (container) {\n\t return new Engine(container);\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_24__;\n\n/***/ },\n/* 25 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\t// This can be imported from anywhere and will still reference the same scene,\n\t// though there is a helper reference in Engine.scene\n\t\n\texports['default'] = (function () {\n\t var scene = new _three2['default'].Scene();\n\t scene.fog = new _three2['default'].Fog(0xffffff, 1, 15000);\n\t return scene;\n\t})();\n\t\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 26 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _Scene = __webpack_require__(25);\n\t\n\tvar _Scene2 = _interopRequireDefault(_Scene);\n\t\n\t// This can only be accessed from Engine.renderer if you want to reference the\n\t// same scene in multiple places\n\t\n\texports['default'] = function (container) {\n\t var renderer = new _three2['default'].WebGLRenderer({\n\t antialias: true\n\t });\n\t\n\t renderer.setClearColor(_Scene2['default'].fog.color, 1);\n\t\n\t // Gamma settings make things look nicer\n\t renderer.gammaInput = true;\n\t renderer.gammaOutput = true;\n\t\n\t container.appendChild(renderer.domElement);\n\t\n\t var updateSize = function updateSize() {\n\t renderer.setSize(container.clientWidth, container.clientHeight);\n\t };\n\t\n\t window.addEventListener('resize', updateSize, false);\n\t updateSize();\n\t\n\t return renderer;\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 27 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\t// This can only be accessed from Engine.camera if you want to reference the\n\t// same scene in multiple places\n\t\n\texports['default'] = function (container) {\n\t var camera = new _three2['default'].PerspectiveCamera(40, 1, 1, 40000);\n\t camera.position.y = 400;\n\t camera.position.z = 400;\n\t\n\t var updateSize = function updateSize() {\n\t camera.aspect = container.clientWidth / container.clientHeight;\n\t camera.updateProjectionMatrix();\n\t };\n\t\n\t window.addEventListener('resize', updateSize, false);\n\t updateSize();\n\t\n\t return camera;\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 28 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _ControlsOrbit = __webpack_require__(29);\n\t\n\tvar _ControlsOrbit2 = _interopRequireDefault(_ControlsOrbit);\n\t\n\tvar Controls = {\n\t Orbit: _ControlsOrbit2['default']\n\t};\n\t\n\texports['default'] = Controls;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 29 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _eventemitter3 = __webpack_require__(2);\n\t\n\tvar _eventemitter32 = _interopRequireDefault(_eventemitter3);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _threeOrbitControls = __webpack_require__(30);\n\t\n\tvar _threeOrbitControls2 = _interopRequireDefault(_threeOrbitControls);\n\t\n\tvar _OrbitControls = (0, _threeOrbitControls2['default'])(_three2['default']);\n\t\n\tvar Orbit = (function (_EventEmitter) {\n\t _inherits(Orbit, _EventEmitter);\n\t\n\t function Orbit() {\n\t _classCallCheck(this, Orbit);\n\t\n\t _get(Object.getPrototypeOf(Orbit.prototype), 'constructor', this).call(this);\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t // Proxy control events\n\t //\n\t // There's currently no distinction between pan, orbit and zoom events\n\t\n\t _createClass(Orbit, [{\n\t key: '_initEvents',\n\t value: function _initEvents() {\n\t var _this = this;\n\t\n\t this._controls.addEventListener('start', function (event) {\n\t _this._world.emit('controlsMoveStart', event.target.center);\n\t });\n\t\n\t this._controls.addEventListener('change', function (event) {\n\t _this._world.emit('controlsMove', event.target.center);\n\t });\n\t\n\t this._controls.addEventListener('end', function (event) {\n\t _this._world.emit('controlsMoveEnd', event.target.center);\n\t });\n\t }\n\t\n\t // Moving the camera along the [x,y,z] axis based on a target position\n\t }, {\n\t key: '_panTo',\n\t value: function _panTo(point, animate) {}\n\t }, {\n\t key: '_panBy',\n\t value: function _panBy(pointDelta, animate) {}\n\t\n\t // Zooming the camera in and out\n\t }, {\n\t key: '_zoomTo',\n\t value: function _zoomTo(metres, animate) {}\n\t }, {\n\t key: '_zoomBy',\n\t value: function _zoomBy(metresDelta, animate) {}\n\t\n\t // Force camera to look at something other than the target\n\t }, {\n\t key: '_lookAt',\n\t value: function _lookAt(point, animate) {}\n\t\n\t // Make camera look at the target\n\t }, {\n\t key: '_lookAtTarget',\n\t value: function _lookAtTarget() {}\n\t\n\t // Tilt (up and down)\n\t }, {\n\t key: '_tiltTo',\n\t value: function _tiltTo(angle, animate) {}\n\t }, {\n\t key: '_tiltBy',\n\t value: function _tiltBy(angleDelta, animate) {}\n\t\n\t // Rotate (left and right)\n\t }, {\n\t key: '_rotateTo',\n\t value: function _rotateTo(angle, animate) {}\n\t }, {\n\t key: '_rotateBy',\n\t value: function _rotateBy(angleDelta, animate) {}\n\t\n\t // Fly to the given point, animating pan and tilt/rotation to final position\n\t // with nice zoom out and in\n\t //\n\t // Calling flyTo a second time before the previous animation has completed\n\t // will immediately start the new animation from wherever the previous one\n\t // has got to\n\t }, {\n\t key: '_flyTo',\n\t value: function _flyTo(point, noZoom) {}\n\t\n\t // Proxy to OrbitControls.update()\n\t }, {\n\t key: 'update',\n\t value: function update() {\n\t this._controls.update();\n\t }\n\t\n\t // Add controls to world instance and store world reference\n\t }, {\n\t key: 'addTo',\n\t value: function addTo(world) {\n\t world.addControls(this);\n\t return this;\n\t }\n\t\n\t // Internal method called by World.addControls to actually add the controls\n\t }, {\n\t key: '_addToWorld',\n\t value: function _addToWorld(world) {\n\t this._world = world;\n\t\n\t // TODO: Override panLeft and panUp methods to prevent panning on Y axis\n\t // See: http://stackoverflow.com/a/26188674/997339\n\t this._controls = new _OrbitControls(world._engine._camera, world._container);\n\t\n\t // Disable keys for now as no events are fired for them anyway\n\t this._controls.keys = false;\n\t\n\t // 89 degrees\n\t this._controls.maxPolarAngle = 1.5533;\n\t\n\t // this._controls.enableDamping = true;\n\t // this._controls.dampingFactor = 0.25;\n\t\n\t this._initEvents();\n\t\n\t this.emit('added');\n\t }\n\t }]);\n\t\n\t return Orbit;\n\t})(_eventemitter32['default']);\n\t\n\texports['default'] = function () {\n\t return new Orbit();\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 30 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(THREE) {\n\t\tvar MOUSE = THREE.MOUSE\n\t\tif (!MOUSE)\n\t\t\tMOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };\n\t\n\t\t/**\n\t\t * @author qiao / https://github.com/qiao\n\t\t * @author mrdoob / http://mrdoob.com\n\t\t * @author alteredq / http://alteredqualia.com/\n\t\t * @author WestLangley / http://github.com/WestLangley\n\t\t * @author erich666 / http://erichaines.com\n\t\t */\n\t\t/*global THREE, console */\n\t\n\t\tfunction OrbitConstraint ( object ) {\n\t\n\t\t\tthis.object = object;\n\t\n\t\t\t// \"target\" sets the location of focus, where the object orbits around\n\t\t\t// and where it pans with respect to.\n\t\t\tthis.target = new THREE.Vector3();\n\t\n\t\t\t// Limits to how far you can dolly in and out ( PerspectiveCamera only )\n\t\t\tthis.minDistance = 0;\n\t\t\tthis.maxDistance = Infinity;\n\t\n\t\t\t// Limits to how far you can zoom in and out ( OrthographicCamera only )\n\t\t\tthis.minZoom = 0;\n\t\t\tthis.maxZoom = Infinity;\n\t\n\t\t\t// How far you can orbit vertically, upper and lower limits.\n\t\t\t// Range is 0 to Math.PI radians.\n\t\t\tthis.minPolarAngle = 0; // radians\n\t\t\tthis.maxPolarAngle = Math.PI; // radians\n\t\n\t\t\t// How far you can orbit horizontally, upper and lower limits.\n\t\t\t// If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].\n\t\t\tthis.minAzimuthAngle = - Infinity; // radians\n\t\t\tthis.maxAzimuthAngle = Infinity; // radians\n\t\n\t\t\t// Set to true to enable damping (inertia)\n\t\t\t// If damping is enabled, you must call controls.update() in your animation loop\n\t\t\tthis.enableDamping = false;\n\t\t\tthis.dampingFactor = 0.25;\n\t\n\t\t\t////////////\n\t\t\t// internals\n\t\n\t\t\tvar scope = this;\n\t\n\t\t\tvar EPS = 0.000001;\n\t\n\t\t\t// Current position in spherical coordinate system.\n\t\t\tvar theta;\n\t\t\tvar phi;\n\t\n\t\t\t// Pending changes\n\t\t\tvar phiDelta = 0;\n\t\t\tvar thetaDelta = 0;\n\t\t\tvar scale = 1;\n\t\t\tvar panOffset = new THREE.Vector3();\n\t\t\tvar zoomChanged = false;\n\t\n\t\t\t// API\n\t\n\t\t\tthis.getPolarAngle = function () {\n\t\n\t\t\t\treturn phi;\n\t\n\t\t\t};\n\t\n\t\t\tthis.getAzimuthalAngle = function () {\n\t\n\t\t\t\treturn theta;\n\t\n\t\t\t};\n\t\n\t\t\tthis.rotateLeft = function ( angle ) {\n\t\n\t\t\t\tthetaDelta -= angle;\n\t\n\t\t\t};\n\t\n\t\t\tthis.rotateUp = function ( angle ) {\n\t\n\t\t\t\tphiDelta -= angle;\n\t\n\t\t\t};\n\t\n\t\t\t// pass in distance in world space to move left\n\t\t\tthis.panLeft = function() {\n\t\n\t\t\t\tvar v = new THREE.Vector3();\n\t\n\t\t\t return function panLeft(distance) {\n\t\t\t var te = this.object.matrix.elements;\n\t\t\t var adjDist = distance / Math.cos(phi);\n\t\n\t\t\t v.set(te[ 0 ], 0, te[ 2 ]).normalize();\n\t\t\t v.multiplyScalar(-adjDist);\n\t\n\t\t\t panOffset.add(v);\n\t\t\t };\n\t\n\t\t\t}();\n\t\n\t\t\t// pass in distance in world space to move up\n\t\t\tthis.panUp = function() {\n\t\n\t\t\t\tvar v = new THREE.Vector3();\n\t\n\t\t\t return function panUp(distance) {\n\t\t\t var te = this.object.matrix.elements;\n\t\t\t var adjDist = distance / Math.cos(phi);\n\t\n\t\t\t v.set(te[ 8 ], 0, te[ 10 ]).normalize();\n\t\t\t v.multiplyScalar(-adjDist);\n\t\n\t\t\t panOffset.add(v);\n\t\t\t };\n\t\n\t\t\t}();\n\t\n\t\t\t// pass in x,y of change desired in pixel space,\n\t\t\t// right and down are positive\n\t\t\tthis.pan = function ( deltaX, deltaY, screenWidth, screenHeight ) {\n\t\n\t\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\t\n\t\t\t\t\t// perspective\n\t\t\t\t\tvar position = scope.object.position;\n\t\t\t\t\tvar offset = position.clone().sub( scope.target );\n\t\t\t\t\tvar targetDistance = offset.length();\n\t\n\t\t\t\t\t// half of the fov is center to top of screen\n\t\t\t\t\ttargetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );\n\t\n\t\t\t\t\t// we actually don't use screenWidth, since perspective camera is fixed to screen height\n\t\t\t\t\tscope.panLeft( 2 * deltaX * targetDistance / screenHeight );\n\t\t\t\t\tscope.panUp( 2 * deltaY * targetDistance / screenHeight );\n\t\n\t\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\t\n\t\t\t\t\t// orthographic\n\t\t\t\t\tscope.panLeft( deltaX * ( scope.object.right - scope.object.left ) / screenWidth );\n\t\t\t\t\tscope.panUp( deltaY * ( scope.object.top - scope.object.bottom ) / screenHeight );\n\t\n\t\t\t\t} else {\n\t\n\t\t\t\t\t// camera neither orthographic or perspective\n\t\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n\t\n\t\t\t\t}\n\t\n\t\t\t};\n\t\n\t\t\tthis.dollyIn = function ( dollyScale ) {\n\t\n\t\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\t\n\t\t\t\t\tscale /= dollyScale;\n\t\n\t\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\t\n\t\t\t\t\tscope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom * dollyScale ) );\n\t\t\t\t\tscope.object.updateProjectionMatrix();\n\t\t\t\t\tzoomChanged = true;\n\t\n\t\t\t\t} else {\n\t\n\t\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\t\n\t\t\t\t}\n\t\n\t\t\t};\n\t\n\t\t\tthis.dollyOut = function ( dollyScale ) {\n\t\n\t\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\t\n\t\t\t\t\tscale *= dollyScale;\n\t\n\t\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\t\n\t\t\t\t\tscope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / dollyScale ) );\n\t\t\t\t\tscope.object.updateProjectionMatrix();\n\t\t\t\t\tzoomChanged = true;\n\t\n\t\t\t\t} else {\n\t\n\t\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\t\n\t\t\t\t}\n\t\n\t\t\t};\n\t\n\t\t\tthis.update = function() {\n\t\n\t\t\t\tvar offset = new THREE.Vector3();\n\t\n\t\t\t\t// so camera.up is the orbit axis\n\t\t\t\tvar quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );\n\t\t\t\tvar quatInverse = quat.clone().inverse();\n\t\n\t\t\t\tvar lastPosition = new THREE.Vector3();\n\t\t\t\tvar lastQuaternion = new THREE.Quaternion();\n\t\n\t\t\t\treturn function () {\n\t\n\t\t\t\t\tvar position = this.object.position;\n\t\n\t\t\t\t\toffset.copy( position ).sub( this.target );\n\t\n\t\t\t\t\t// rotate offset to \"y-axis-is-up\" space\n\t\t\t\t\toffset.applyQuaternion( quat );\n\t\n\t\t\t\t\t// angle from z-axis around y-axis\n\t\n\t\t\t\t\ttheta = Math.atan2( offset.x, offset.z );\n\t\n\t\t\t\t\t// angle from y-axis\n\t\n\t\t\t\t\tphi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y );\n\t\n\t\t\t\t\ttheta += thetaDelta;\n\t\t\t\t\tphi += phiDelta;\n\t\n\t\t\t\t\t// restrict theta to be between desired limits\n\t\t\t\t\ttheta = Math.max( this.minAzimuthAngle, Math.min( this.maxAzimuthAngle, theta ) );\n\t\n\t\t\t\t\t// restrict phi to be between desired limits\n\t\t\t\t\tphi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );\n\t\n\t\t\t\t\t// restrict phi to be betwee EPS and PI-EPS\n\t\t\t\t\tphi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\t\n\t\t\t\t\tvar radius = offset.length() * scale;\n\t\n\t\t\t\t\t// restrict radius to be between desired limits\n\t\t\t\t\tradius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) );\n\t\n\t\t\t\t\t// move target to panned location\n\t\t\t\t\tthis.target.add( panOffset );\n\t\n\t\t\t\t\toffset.x = radius * Math.sin( phi ) * Math.sin( theta );\n\t\t\t\t\toffset.y = radius * Math.cos( phi );\n\t\t\t\t\toffset.z = radius * Math.sin( phi ) * Math.cos( theta );\n\t\n\t\t\t\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\t\t\t\toffset.applyQuaternion( quatInverse );\n\t\n\t\t\t\t\tposition.copy( this.target ).add( offset );\n\t\n\t\t\t\t\tthis.object.lookAt( this.target );\n\t\n\t\t\t\t\tif ( this.enableDamping === true ) {\n\t\n\t\t\t\t\t\tthetaDelta *= ( 1 - this.dampingFactor );\n\t\t\t\t\t\tphiDelta *= ( 1 - this.dampingFactor );\n\t\n\t\t\t\t\t} else {\n\t\n\t\t\t\t\t\tthetaDelta = 0;\n\t\t\t\t\t\tphiDelta = 0;\n\t\n\t\t\t\t\t}\n\t\n\t\t\t\t\tscale = 1;\n\t\t\t\t\tpanOffset.set( 0, 0, 0 );\n\t\n\t\t\t\t\t// update condition is:\n\t\t\t\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t\t\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\t\n\t\t\t\t\tif ( zoomChanged ||\n\t\t\t\t\t\t lastPosition.distanceToSquared( this.object.position ) > EPS ||\n\t\t\t\t\t\t8 * ( 1 - lastQuaternion.dot( this.object.quaternion ) ) > EPS ) {\n\t\n\t\t\t\t\t\tlastPosition.copy( this.object.position );\n\t\t\t\t\t\tlastQuaternion.copy( this.object.quaternion );\n\t\t\t\t\t\tzoomChanged = false;\n\t\n\t\t\t\t\t\treturn true;\n\t\n\t\t\t\t\t}\n\t\n\t\t\t\t\treturn false;\n\t\n\t\t\t\t};\n\t\n\t\t\t}();\n\t\n\t\t};\n\t\n\t\n\t\t// This set of controls performs orbiting, dollying (zooming), and panning. It maintains\n\t\t// the \"up\" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is\n\t\t// supported.\n\t\t//\n\t\t// Orbit - left mouse / touch: one finger move\n\t\t// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n\t\t// Pan - right mouse, or arrow keys / touch: three finter swipe\n\t\n\t\tfunction OrbitControls ( object, domElement ) {\n\t\n\t\t\tvar constraint = new OrbitConstraint( object );\n\t\n\t\t\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\t\n\t\t\t// API\n\t\n\t\t\tObject.defineProperty( this, 'constraint', {\n\t\n\t\t\t\tget: function() {\n\t\n\t\t\t\t\treturn constraint;\n\t\n\t\t\t\t}\n\t\n\t\t\t} );\n\t\n\t\t\tthis.getPolarAngle = function () {\n\t\n\t\t\t\treturn constraint.getPolarAngle();\n\t\n\t\t\t};\n\t\n\t\t\tthis.getAzimuthalAngle = function () {\n\t\n\t\t\t\treturn constraint.getAzimuthalAngle();\n\t\n\t\t\t};\n\t\n\t\t\t// Set to false to disable this control\n\t\t\tthis.enabled = true;\n\t\n\t\t\t// center is old, deprecated; use \"target\" instead\n\t\t\tthis.center = this.target;\n\t\n\t\t\t// This option actually enables dollying in and out; left as \"zoom\" for\n\t\t\t// backwards compatibility.\n\t\t\t// Set to false to disable zooming\n\t\t\tthis.enableZoom = true;\n\t\t\tthis.zoomSpeed = 1.0;\n\t\n\t\t\t// Set to false to disable rotating\n\t\t\tthis.enableRotate = true;\n\t\t\tthis.rotateSpeed = 1.0;\n\t\n\t\t\t// Set to false to disable panning\n\t\t\tthis.enablePan = true;\n\t\t\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\t\n\t\t\t// Set to true to automatically rotate around the target\n\t\t\t// If auto-rotate is enabled, you must call controls.update() in your animation loop\n\t\t\tthis.autoRotate = false;\n\t\t\tthis.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\t\n\t\t\t// Set to false to disable use of the keys\n\t\t\tthis.enableKeys = true;\n\t\n\t\t\t// The four arrow keys\n\t\t\tthis.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\t\n\t\t\t// Mouse buttons\n\t\t\tthis.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };\n\t\n\t\t\t////////////\n\t\t\t// internals\n\t\n\t\t\tvar scope = this;\n\t\n\t\t\tvar rotateStart = new THREE.Vector2();\n\t\t\tvar rotateEnd = new THREE.Vector2();\n\t\t\tvar rotateDelta = new THREE.Vector2();\n\t\n\t\t\tvar panStart = new THREE.Vector2();\n\t\t\tvar panEnd = new THREE.Vector2();\n\t\t\tvar panDelta = new THREE.Vector2();\n\t\n\t\t\tvar dollyStart = new THREE.Vector2();\n\t\t\tvar dollyEnd = new THREE.Vector2();\n\t\t\tvar dollyDelta = new THREE.Vector2();\n\t\n\t\t\tvar STATE = { NONE : - 1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };\n\t\n\t\t\tvar state = STATE.NONE;\n\t\n\t\t\t// for reset\n\t\n\t\t\tthis.target0 = this.target.clone();\n\t\t\tthis.position0 = this.object.position.clone();\n\t\t\tthis.zoom0 = this.object.zoom;\n\t\n\t\t\t// events\n\t\n\t\t\tvar changeEvent = { type: 'change' };\n\t\t\tvar startEvent = { type: 'start' };\n\t\t\tvar endEvent = { type: 'end' };\n\t\n\t\t\t// pass in x,y of change desired in pixel space,\n\t\t\t// right and down are positive\n\t\t\tfunction pan( deltaX, deltaY ) {\n\t\n\t\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\t\n\t\t\t\tconstraint.pan( deltaX, deltaY, element.clientWidth, element.clientHeight );\n\t\n\t\t\t}\n\t\n\t\t\tthis.update = function () {\n\t\n\t\t\t\tif ( this.autoRotate && state === STATE.NONE ) {\n\t\n\t\t\t\t\tconstraint.rotateLeft( getAutoRotationAngle() );\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( constraint.update() === true ) {\n\t\n\t\t\t\t\tthis.dispatchEvent( changeEvent );\n\t\n\t\t\t\t}\n\t\n\t\t\t};\n\t\n\t\t\tthis.reset = function () {\n\t\n\t\t\t\tstate = STATE.NONE;\n\t\n\t\t\t\tthis.target.copy( this.target0 );\n\t\t\t\tthis.object.position.copy( this.position0 );\n\t\t\t\tthis.object.zoom = this.zoom0;\n\t\n\t\t\t\tthis.object.updateProjectionMatrix();\n\t\t\t\tthis.dispatchEvent( changeEvent );\n\t\n\t\t\t\tthis.update();\n\t\n\t\t\t};\n\t\n\t\t\tfunction getAutoRotationAngle() {\n\t\n\t\t\t\treturn 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\t\n\t\t\t}\n\t\n\t\t\tfunction getZoomScale() {\n\t\n\t\t\t\treturn Math.pow( 0.95, scope.zoomSpeed );\n\t\n\t\t\t}\n\t\n\t\t\tfunction onMouseDown( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tevent.preventDefault();\n\t\n\t\t\t\tif ( event.button === scope.mouseButtons.ORBIT ) {\n\t\n\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\n\t\t\t\t\tstate = STATE.ROTATE;\n\t\n\t\t\t\t\trotateStart.set( event.clientX, event.clientY );\n\t\n\t\t\t\t} else if ( event.button === scope.mouseButtons.ZOOM ) {\n\t\n\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\n\t\t\t\t\tstate = STATE.DOLLY;\n\t\n\t\t\t\t\tdollyStart.set( event.clientX, event.clientY );\n\t\n\t\t\t\t} else if ( event.button === scope.mouseButtons.PAN ) {\n\t\n\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\n\t\t\t\t\tstate = STATE.PAN;\n\t\n\t\t\t\t\tpanStart.set( event.clientX, event.clientY );\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( state !== STATE.NONE ) {\n\t\n\t\t\t\t\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\t\t\t\t\tdocument.addEventListener( 'mouseup', onMouseUp, false );\n\t\t\t\t\tscope.dispatchEvent( startEvent );\n\t\n\t\t\t\t}\n\t\n\t\t\t}\n\t\n\t\t\tfunction onMouseMove( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tevent.preventDefault();\n\t\n\t\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\t\n\t\t\t\tif ( state === STATE.ROTATE ) {\n\t\n\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\n\t\t\t\t\trotateEnd.set( event.clientX, event.clientY );\n\t\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\t\n\t\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\t\tconstraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\t\n\t\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\t\tconstraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\t\n\t\t\t\t\trotateStart.copy( rotateEnd );\n\t\n\t\t\t\t} else if ( state === STATE.DOLLY ) {\n\t\n\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\n\t\t\t\t\tdollyEnd.set( event.clientX, event.clientY );\n\t\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\t\n\t\t\t\t\tif ( dollyDelta.y > 0 ) {\n\t\n\t\t\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\t\n\t\t\t\t\t} else if ( dollyDelta.y < 0 ) {\n\t\n\t\t\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\t\n\t\t\t\t\t}\n\t\n\t\t\t\t\tdollyStart.copy( dollyEnd );\n\t\n\t\t\t\t} else if ( state === STATE.PAN ) {\n\t\n\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\n\t\t\t\t\tpanEnd.set( event.clientX, event.clientY );\n\t\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\n\t\t\t\t\tpan( panDelta.x, panDelta.y );\n\t\n\t\t\t\t\tpanStart.copy( panEnd );\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( state !== STATE.NONE ) scope.update();\n\t\n\t\t\t}\n\t\n\t\t\tfunction onMouseUp( /* event */ ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\t\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\t\t\t\tscope.dispatchEvent( endEvent );\n\t\t\t\tstate = STATE.NONE;\n\t\n\t\t\t}\n\t\n\t\t\tfunction onMouseWheel( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE ) return;\n\t\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\n\t\t\t\tvar delta = 0;\n\t\n\t\t\t\tif ( event.wheelDelta !== undefined ) {\n\t\n\t\t\t\t\t// WebKit / Opera / Explorer 9\n\t\n\t\t\t\t\tdelta = event.wheelDelta;\n\t\n\t\t\t\t} else if ( event.detail !== undefined ) {\n\t\n\t\t\t\t\t// Firefox\n\t\n\t\t\t\t\tdelta = - event.detail;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( delta > 0 ) {\n\t\n\t\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\t\n\t\t\t\t} else if ( delta < 0 ) {\n\t\n\t\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\t\n\t\t\t\t}\n\t\n\t\t\t\tscope.update();\n\t\t\t\tscope.dispatchEvent( startEvent );\n\t\t\t\tscope.dispatchEvent( endEvent );\n\t\n\t\t\t}\n\t\n\t\t\tfunction onKeyDown( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return;\n\t\n\t\t\t\tswitch ( event.keyCode ) {\n\t\n\t\t\t\t\tcase scope.keys.UP:\n\t\t\t\t\t\tpan( 0, scope.keyPanSpeed );\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase scope.keys.BOTTOM:\n\t\t\t\t\t\tpan( 0, - scope.keyPanSpeed );\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase scope.keys.LEFT:\n\t\t\t\t\t\tpan( scope.keyPanSpeed, 0 );\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase scope.keys.RIGHT:\n\t\t\t\t\t\tpan( - scope.keyPanSpeed, 0 );\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t}\n\t\n\t\t\t}\n\t\n\t\t\tfunction touchstart( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tswitch ( event.touches.length ) {\n\t\n\t\t\t\t\tcase 1:\t// one-fingered touch: rotate\n\t\n\t\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\n\t\t\t\t\t\tstate = STATE.TOUCH_ROTATE;\n\t\n\t\t\t\t\t\trotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 2:\t// two-fingered touch: dolly\n\t\n\t\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\n\t\t\t\t\t\tstate = STATE.TOUCH_DOLLY;\n\t\n\t\t\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\t\t\t\t\t\tdollyStart.set( 0, distance );\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 3: // three-fingered touch: pan\n\t\n\t\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\n\t\t\t\t\t\tstate = STATE.TOUCH_PAN;\n\t\n\t\t\t\t\t\tpanStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tdefault:\n\t\n\t\t\t\t\t\tstate = STATE.NONE;\n\t\n\t\t\t\t}\n\t\n\t\t\t\tif ( state !== STATE.NONE ) scope.dispatchEvent( startEvent );\n\t\n\t\t\t}\n\t\n\t\t\tfunction touchmove( event ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\n\t\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\t\n\t\t\t\tswitch ( event.touches.length ) {\n\t\n\t\t\t\t\tcase 1: // one-fingered touch: rotate\n\t\n\t\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\t\t\t\t\tif ( state !== STATE.TOUCH_ROTATE ) return;\n\t\n\t\t\t\t\t\trotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\t\n\t\t\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\t\t\tconstraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\t\t\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\t\t\tconstraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\t\n\t\t\t\t\t\trotateStart.copy( rotateEnd );\n\t\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 2: // two-fingered touch: dolly\n\t\n\t\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\t\t\t\t\tif ( state !== STATE.TOUCH_DOLLY ) return;\n\t\n\t\t\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\t\n\t\t\t\t\t\tdollyEnd.set( 0, distance );\n\t\t\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\t\n\t\t\t\t\t\tif ( dollyDelta.y > 0 ) {\n\t\n\t\t\t\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\t\n\t\t\t\t\t\t} else if ( dollyDelta.y < 0 ) {\n\t\n\t\t\t\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\t\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tdollyStart.copy( dollyEnd );\n\t\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tcase 3: // three-fingered touch: pan\n\t\n\t\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\t\t\t\t\tif ( state !== STATE.TOUCH_PAN ) return;\n\t\n\t\t\t\t\t\tpanEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\t\n\t\t\t\t\t\tpan( panDelta.x, panDelta.y );\n\t\n\t\t\t\t\t\tpanStart.copy( panEnd );\n\t\n\t\t\t\t\t\tscope.update();\n\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\tdefault:\n\t\n\t\t\t\t\t\tstate = STATE.NONE;\n\t\n\t\t\t\t}\n\t\n\t\t\t}\n\t\n\t\t\tfunction touchend( /* event */ ) {\n\t\n\t\t\t\tif ( scope.enabled === false ) return;\n\t\n\t\t\t\tscope.dispatchEvent( endEvent );\n\t\t\t\tstate = STATE.NONE;\n\t\n\t\t\t}\n\t\n\t\t\tfunction contextmenu( event ) {\n\t\n\t\t\t\tevent.preventDefault();\n\t\n\t\t\t}\n\t\n\t\t\tthis.dispose = function() {\n\t\n\t\t\t\tthis.domElement.removeEventListener( 'contextmenu', contextmenu, false );\n\t\t\t\tthis.domElement.removeEventListener( 'mousedown', onMouseDown, false );\n\t\t\t\tthis.domElement.removeEventListener( 'mousewheel', onMouseWheel, false );\n\t\t\t\tthis.domElement.removeEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox\n\t\n\t\t\t\tthis.domElement.removeEventListener( 'touchstart', touchstart, false );\n\t\t\t\tthis.domElement.removeEventListener( 'touchend', touchend, false );\n\t\t\t\tthis.domElement.removeEventListener( 'touchmove', touchmove, false );\n\t\n\t\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\t\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\t\n\t\t\t\twindow.removeEventListener( 'keydown', onKeyDown, false );\n\t\n\t\t\t}\n\t\n\t\t\tthis.domElement.addEventListener( 'contextmenu', contextmenu, false );\n\t\n\t\t\tthis.domElement.addEventListener( 'mousedown', onMouseDown, false );\n\t\t\tthis.domElement.addEventListener( 'mousewheel', onMouseWheel, false );\n\t\t\tthis.domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox\n\t\n\t\t\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\t\t\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\t\t\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\t\n\t\t\twindow.addEventListener( 'keydown', onKeyDown, false );\n\t\n\t\t\t// force an update at start\n\t\t\tthis.update();\n\t\n\t\t};\n\t\n\t\tOrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n\t\tOrbitControls.prototype.constructor = OrbitControls;\n\t\n\t\tObject.defineProperties( OrbitControls.prototype, {\n\t\n\t\t\tobject: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.object;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\ttarget: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.target;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: target is now immutable. Use target.set() instead.' );\n\t\t\t\t\tthis.constraint.target.copy( value );\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tminDistance : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.minDistance;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.minDistance = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tmaxDistance : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.maxDistance;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.maxDistance = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tminZoom : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.minZoom;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.minZoom = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tmaxZoom : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.maxZoom;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.maxZoom = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tminPolarAngle : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.minPolarAngle;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.minPolarAngle = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tmaxPolarAngle : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.maxPolarAngle;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.maxPolarAngle = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tminAzimuthAngle : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.minAzimuthAngle;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.minAzimuthAngle = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tmaxAzimuthAngle : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.maxAzimuthAngle;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.maxAzimuthAngle = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tenableDamping : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.enableDamping;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.enableDamping = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tdampingFactor : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\treturn this.constraint.dampingFactor;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tthis.constraint.dampingFactor = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\t// backward compatibility\n\t\n\t\t\tnoZoom: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n\t\t\t\t\treturn ! this.enableZoom;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n\t\t\t\t\tthis.enableZoom = ! value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tnoRotate: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n\t\t\t\t\treturn ! this.enableRotate;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n\t\t\t\t\tthis.enableRotate = ! value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tnoPan: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n\t\t\t\t\treturn ! this.enablePan;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n\t\t\t\t\tthis.enablePan = ! value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tnoKeys: {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n\t\t\t\t\treturn ! this.enableKeys;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n\t\t\t\t\tthis.enableKeys = ! value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tstaticMoving : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n\t\t\t\t\treturn ! this.constraint.enableDamping;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n\t\t\t\t\tthis.constraint.enableDamping = ! value;\n\t\n\t\t\t\t}\n\t\n\t\t\t},\n\t\n\t\t\tdynamicDampingFactor : {\n\t\n\t\t\t\tget: function () {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n\t\t\t\t\treturn this.constraint.dampingFactor;\n\t\n\t\t\t\t},\n\t\n\t\t\t\tset: function ( value ) {\n\t\n\t\t\t\t\tconsole.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n\t\t\t\t\tthis.constraint.dampingFactor = value;\n\t\n\t\t\t\t}\n\t\n\t\t\t}\n\t\n\t\t} );\n\t\n\t\treturn OrbitControls;\n\t}\n\n\n/***/ },\n/* 31 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Layer2 = __webpack_require__(32);\n\t\n\tvar _Layer3 = _interopRequireDefault(_Layer2);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar EnvironmentLayer = (function (_Layer) {\n\t _inherits(EnvironmentLayer, _Layer);\n\t\n\t function EnvironmentLayer() {\n\t _classCallCheck(this, EnvironmentLayer);\n\t\n\t _get(Object.getPrototypeOf(EnvironmentLayer.prototype), 'constructor', this).call(this);\n\t\n\t this._initLights();\n\t this._initGrid();\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t _createClass(EnvironmentLayer, [{\n\t key: '_onAdd',\n\t value: function _onAdd() {}\n\t\n\t // Not fleshed out or thought through yet\n\t //\n\t // Lights could potentially be put it their own 'layer' to keep this class\n\t // much simpler and less messy\n\t }, {\n\t key: '_initLights',\n\t value: function _initLights() {\n\t // Position doesn't really matter (the angle is important), however it's\n\t // used here so the helpers look more natural.\n\t\n\t var directionalLight = new _three2['default'].DirectionalLight(0x999999);\n\t directionalLight.intesity = 0.1;\n\t directionalLight.position.x = 100;\n\t directionalLight.position.y = 100;\n\t directionalLight.position.z = 100;\n\t\n\t var directionalLight2 = new _three2['default'].DirectionalLight(0x999999);\n\t directionalLight2.intesity = 0.1;\n\t directionalLight2.position.x = -100;\n\t directionalLight2.position.y = 100;\n\t directionalLight2.position.z = -100;\n\t\n\t var helper = new _three2['default'].DirectionalLightHelper(directionalLight, 10);\n\t var helper2 = new _three2['default'].DirectionalLightHelper(directionalLight2, 10);\n\t\n\t this._layer.add(directionalLight);\n\t this._layer.add(directionalLight2);\n\t\n\t this._layer.add(helper);\n\t this._layer.add(helper2);\n\t }\n\t\n\t // Add grid helper for context during initial development\n\t }, {\n\t key: '_initGrid',\n\t value: function _initGrid() {\n\t var size = 4000;\n\t var step = 100;\n\t\n\t var gridHelper = new _three2['default'].GridHelper(size, step);\n\t this._layer.add(gridHelper);\n\t }\n\t }]);\n\t\n\t return EnvironmentLayer;\n\t})(_Layer3['default']);\n\t\n\texports['default'] = function () {\n\t return new EnvironmentLayer();\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 32 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _eventemitter3 = __webpack_require__(2);\n\t\n\tvar _eventemitter32 = _interopRequireDefault(_eventemitter3);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\tvar _engineScene = __webpack_require__(25);\n\t\n\tvar _engineScene2 = _interopRequireDefault(_engineScene);\n\t\n\tvar Layer = (function (_EventEmitter) {\n\t _inherits(Layer, _EventEmitter);\n\t\n\t function Layer() {\n\t _classCallCheck(this, Layer);\n\t\n\t _get(Object.getPrototypeOf(Layer.prototype), 'constructor', this).call(this);\n\t\n\t this._layer = new _three2['default'].Object3D();\n\t }\n\t\n\t // Add layer to world instance and store world reference\n\t\n\t _createClass(Layer, [{\n\t key: 'addTo',\n\t value: function addTo(world) {\n\t world.addLayer(this);\n\t return this;\n\t }\n\t\n\t // Internal method called by World.addLayer to actually add the layer\n\t }, {\n\t key: '_addToWorld',\n\t value: function _addToWorld(world) {\n\t this._world = world;\n\t this._onAdd(world);\n\t this.emit('added');\n\t }\n\t }]);\n\t\n\t return Layer;\n\t})(_eventemitter32['default']);\n\t\n\texports['default'] = Layer;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 33 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tvar _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _Layer2 = __webpack_require__(32);\n\t\n\tvar _Layer3 = _interopRequireDefault(_Layer2);\n\t\n\tvar _TileCache = __webpack_require__(34);\n\t\n\tvar _TileCache2 = _interopRequireDefault(_TileCache);\n\t\n\tvar _lodashThrottle = __webpack_require__(44);\n\t\n\tvar _lodashThrottle2 = _interopRequireDefault(_lodashThrottle);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\t// TODO: Prevent tiles from being loaded if they are further than a certain\n\t// distance from the camera and are unlikely to be seen anyway\n\t\n\tvar GridLayer = (function (_Layer) {\n\t _inherits(GridLayer, _Layer);\n\t\n\t function GridLayer() {\n\t _classCallCheck(this, GridLayer);\n\t\n\t _get(Object.getPrototypeOf(GridLayer.prototype), 'constructor', this).call(this);\n\t\n\t this._tileCache = new _TileCache2['default'](1000);\n\t\n\t // TODO: Work out why changing the minLOD causes loads of issues\n\t this._minLOD = 3;\n\t this._maxLOD = 18;\n\t\n\t this._frustum = new _three2['default'].Frustum();\n\t }\n\t\n\t // Initialise without requiring new keyword\n\t\n\t _createClass(GridLayer, [{\n\t key: '_onAdd',\n\t value: function _onAdd(world) {\n\t var _this = this;\n\t\n\t this._initEvents();\n\t\n\t // Trigger initial quadtree calculation on the next frame\n\t //\n\t // TODO: This is a hack to ensure the camera is all set up - a better\n\t // solution should be found\n\t setTimeout(function () {\n\t _this._calculateLOD();\n\t }, 0);\n\t }\n\t }, {\n\t key: '_initEvents',\n\t value: function _initEvents() {\n\t var _this2 = this;\n\t\n\t // Run LOD calculations based on render calls\n\t //\n\t // TODO: Perhaps don't perform a calculation if nothing has changed in a\n\t // frame and there are no tiles waiting to be loaded.\n\t this._world.on('preUpdate', (0, _lodashThrottle2['default'])(function () {\n\t _this2._calculateLOD();\n\t }, 100));\n\t }\n\t }, {\n\t key: '_updateFrustum',\n\t value: function _updateFrustum() {\n\t var camera = this._world.getCamera();\n\t var projScreenMatrix = new _three2['default'].Matrix4();\n\t projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);\n\t\n\t this._frustum.setFromMatrix(camera.projectionMatrix);\n\t this._frustum.setFromMatrix(new _three2['default'].Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse));\n\t }\n\t }, {\n\t key: '_tileInFrustum',\n\t value: function _tileInFrustum(tile) {\n\t var bounds = tile.getBounds();\n\t return this._frustum.intersectsBox(new _three2['default'].Box3(new _three2['default'].Vector3(bounds[0], 0, bounds[3]), new _three2['default'].Vector3(bounds[2], 0, bounds[1])));\n\t }\n\t }, {\n\t key: '_calculateLOD',\n\t value: function _calculateLOD() {\n\t var _this3 = this;\n\t\n\t if (this._stop) {\n\t return;\n\t }\n\t\n\t // var start = performance.now();\n\t\n\t var camera = this._world.getCamera();\n\t\n\t // 1. Update and retrieve camera frustum\n\t this._updateFrustum(this._frustum, camera);\n\t\n\t // 2. Add the four root items of the quadtree to a check list\n\t var checkList = this._checklist;\n\t checkList = [];\n\t checkList.push(this._tileCache.requestTile('0', this));\n\t checkList.push(this._tileCache.requestTile('1', this));\n\t checkList.push(this._tileCache.requestTile('2', this));\n\t checkList.push(this._tileCache.requestTile('3', this));\n\t\n\t // 3. Call Divide, passing in the check list\n\t this._divide(checkList);\n\t\n\t // 4. Remove all tiles from layer\n\t this._removeTiles();\n\t\n\t var tileCount = 0;\n\t\n\t // 5. Render the tiles remaining in the check list\n\t checkList.forEach(function (tile, index) {\n\t // Skip tile if it's not in the current view frustum\n\t if (!_this3._tileInFrustum(tile)) {\n\t return;\n\t }\n\t\n\t // TODO: Can probably speed this up\n\t var center = tile.getCenter();\n\t var dist = new _three2['default'].Vector3(center[0], 0, center[1]).sub(camera.position).length();\n\t\n\t // Manual distance limit to cut down on tiles so far away\n\t if (dist > 8000) {\n\t return;\n\t }\n\t\n\t // Does the tile have a mesh?\n\t //\n\t // If yes, continue\n\t // If no, generate tile mesh, request texture and skip\n\t if (!tile.getMesh()) {\n\t tile.requestTileAsync();\n\t return;\n\t }\n\t\n\t // Are the mesh and texture ready?\n\t //\n\t // If yes, continue\n\t // If no, skip\n\t if (!tile.isReady()) {\n\t return;\n\t }\n\t\n\t // Add tile to layer (and to scene)\n\t _this3._layer.add(tile.getMesh());\n\t\n\t // Output added tile (for debugging)\n\t // console.log(tile);\n\t\n\t tileCount++;\n\t });\n\t\n\t // console.log(tileCount);\n\t // console.log(performance.now() - start);\n\t }\n\t }, {\n\t key: '_divide',\n\t value: function _divide(checkList) {\n\t var count = 0;\n\t var currentItem;\n\t var quadcode;\n\t\n\t // 1. Loop until count equals check list length\n\t while (count != checkList.length) {\n\t currentItem = checkList[count];\n\t quadcode = currentItem.getQuadcode();\n\t\n\t // 2. Increase count and continue loop if quadcode equals max LOD / zoom\n\t if (currentItem.length === this._maxLOD) {\n\t count++;\n\t continue;\n\t }\n\t\n\t // 3. Else, calculate screen-space error metric for quadcode\n\t if (this._screenSpaceError(currentItem)) {\n\t // 4. If error is sufficient...\n\t\n\t // 4a. Remove parent item from the check list\n\t checkList.splice(count, 1);\n\t\n\t // 4b. Add 4 child items to the check list\n\t checkList.push(this._tileCache.requestTile(quadcode + '0', this));\n\t checkList.push(this._tileCache.requestTile(quadcode + '1', this));\n\t checkList.push(this._tileCache.requestTile(quadcode + '2', this));\n\t checkList.push(this._tileCache.requestTile(quadcode + '3', this));\n\t\n\t // 4d. Continue the loop without increasing count\n\t continue;\n\t } else {\n\t // 5. Else, increase count and continue loop\n\t count++;\n\t }\n\t }\n\t }\n\t }, {\n\t key: '_screenSpaceError',\n\t value: function _screenSpaceError(tile) {\n\t var minDepth = this._minLOD;\n\t var maxDepth = this._maxLOD;\n\t\n\t var quadcode = tile.getQuadcode();\n\t\n\t var camera = this._world.getCamera();\n\t\n\t // Tweak this value to refine specific point that each quad is subdivided\n\t //\n\t // It's used to multiple the dimensions of the tile sides before\n\t // comparing against the tile distance from camera\n\t var quality = 3.0;\n\t\n\t // 1. Return false if quadcode length is greater than maxDepth\n\t if (quadcode.length > maxDepth) {\n\t return false;\n\t }\n\t\n\t // 2. Return true if quadcode length is less than minDepth\n\t if (quadcode.length < minDepth) {\n\t return true;\n\t }\n\t\n\t // 3. Return false if quadcode bounds are not in view frustum\n\t if (!this._tileInFrustum(tile)) {\n\t return false;\n\t }\n\t\n\t var center = tile.getCenter();\n\t\n\t // 4. Calculate screen-space error metric\n\t // TODO: Use closest distance to one of the 4 tile corners\n\t var dist = new _three2['default'].Vector3(center[0], 0, center[1]).sub(camera.position).length();\n\t\n\t var error = quality * tile.getSide() / dist;\n\t\n\t // 5. Return true if error is greater than 1.0, else return false\n\t return error > 1.0;\n\t }\n\t }, {\n\t key: '_removeTiles',\n\t value: function _removeTiles() {\n\t // console.log('Pre:', this._layer.children.length);\n\t for (var i = this._layer.children.length - 1; i >= 0; i--) {\n\t this._layer.remove(this._layer.children[i]);\n\t }\n\t // console.log('Post:', this._layer.children.length);\n\t }\n\t }]);\n\t\n\t return GridLayer;\n\t})(_Layer3['default']);\n\t\n\texports['default'] = function () {\n\t return new GridLayer();\n\t};\n\t\n\t;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 34 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tvar _lruCache = __webpack_require__(35);\n\t\n\tvar _lruCache2 = _interopRequireDefault(_lruCache);\n\t\n\tvar _Tile = __webpack_require__(43);\n\t\n\tvar _Tile2 = _interopRequireDefault(_Tile);\n\t\n\t// This process is based on a similar approach taken by OpenWebGlobe\n\t// See: https://github.com/OpenWebGlobe/WebViewer/blob/master/source/core/globecache.js\n\t\n\tvar TileCache = (function () {\n\t function TileCache(cacheLimit) {\n\t _classCallCheck(this, TileCache);\n\t\n\t this._cache = (0, _lruCache2['default'])(cacheLimit);\n\t }\n\t\n\t // Returns true if all specified tile providers are ready to be used\n\t // Otherwise, returns false\n\t\n\t _createClass(TileCache, [{\n\t key: 'isReady',\n\t value: function isReady() {\n\t return false;\n\t }\n\t\n\t // Get a cached tile or request a new one if not in cache\n\t }, {\n\t key: 'requestTile',\n\t value: function requestTile(quadcode, layer) {\n\t var tile = this._cache.get(quadcode);\n\t\n\t if (!tile) {\n\t // Set up a brand new tile\n\t tile = new _Tile2['default'](quadcode, layer);\n\t\n\t // Request data for various tile providers\n\t // tile.requestData(imageProviders);\n\t\n\t // Add tile to cache, though it won't be ready yet as the data is being\n\t // requested from various places asynchronously\n\t this._cache.set(quadcode, tile);\n\t }\n\t\n\t return tile;\n\t }\n\t\n\t // Get a cached tile without requesting a new one\n\t }, {\n\t key: 'getTile',\n\t value: function getTile(quadcode) {\n\t return this._cache.get(quadcode);\n\t }\n\t\n\t // Destroy the cache and remove it from memory\n\t //\n\t // TODO: Call destroy method on items in cache\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {\n\t this._cache.reset();\n\t }\n\t }]);\n\t\n\t return TileCache;\n\t})();\n\t\n\texports['default'] = TileCache;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 35 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = LRUCache\n\t\n\t// This will be a proper iterable 'Map' in engines that support it,\n\t// or a fakey-fake PseudoMap in older versions.\n\tvar Map = __webpack_require__(36)\n\tvar util = __webpack_require__(39)\n\t\n\t// A linked list to keep track of recently-used-ness\n\tvar Yallist = __webpack_require__(42)\n\t\n\t// use symbols if possible, otherwise just _props\n\tvar symbols = {}\n\tvar hasSymbol = typeof Symbol === 'function'\n\tvar makeSymbol\n\tif (hasSymbol) {\n\t makeSymbol = function (key) {\n\t return Symbol.for(key)\n\t }\n\t} else {\n\t makeSymbol = function (key) {\n\t return '_' + key\n\t }\n\t}\n\t\n\tfunction priv (obj, key, val) {\n\t var sym\n\t if (symbols[key]) {\n\t sym = symbols[key]\n\t } else {\n\t sym = makeSymbol(key)\n\t symbols[key] = sym\n\t }\n\t if (arguments.length === 2) {\n\t return obj[sym]\n\t } else {\n\t obj[sym] = val\n\t return val\n\t }\n\t}\n\t\n\tfunction naiveLength () { return 1 }\n\t\n\t// lruList is a yallist where the head is the youngest\n\t// item, and the tail is the oldest. the list contains the Hit\n\t// objects as the entries.\n\t// Each Hit object has a reference to its Yallist.Node. This\n\t// never changes.\n\t//\n\t// cache is a Map (or PseudoMap) that matches the keys to\n\t// the Yallist.Node object.\n\tfunction LRUCache (options) {\n\t if (!(this instanceof LRUCache)) {\n\t return new LRUCache(options)\n\t }\n\t\n\t if (typeof options === 'number') {\n\t options = { max: options }\n\t }\n\t\n\t if (!options) {\n\t options = {}\n\t }\n\t\n\t var max = priv(this, 'max', options.max)\n\t // Kind of weird to have a default max of Infinity, but oh well.\n\t if (!max ||\n\t !(typeof max === 'number') ||\n\t max <= 0) {\n\t priv(this, 'max', Infinity)\n\t }\n\t\n\t var lc = options.length || naiveLength\n\t if (typeof lc !== 'function') {\n\t lc = naiveLength\n\t }\n\t priv(this, 'lengthCalculator', lc)\n\t\n\t priv(this, 'allowStale', options.stale || false)\n\t priv(this, 'maxAge', options.maxAge || 0)\n\t priv(this, 'dispose', options.dispose)\n\t this.reset()\n\t}\n\t\n\t// resize the cache when the max changes.\n\tObject.defineProperty(LRUCache.prototype, 'max', {\n\t set: function (mL) {\n\t if (!mL || !(typeof mL === 'number') || mL <= 0) {\n\t mL = Infinity\n\t }\n\t priv(this, 'max', mL)\n\t trim(this)\n\t },\n\t get: function () {\n\t return priv(this, 'max')\n\t },\n\t enumerable: true\n\t})\n\t\n\tObject.defineProperty(LRUCache.prototype, 'allowStale', {\n\t set: function (allowStale) {\n\t priv(this, 'allowStale', !!allowStale)\n\t },\n\t get: function () {\n\t return priv(this, 'allowStale')\n\t },\n\t enumerable: true\n\t})\n\t\n\tObject.defineProperty(LRUCache.prototype, 'maxAge', {\n\t set: function (mA) {\n\t if (!mA || !(typeof mA === 'number') || mA < 0) {\n\t mA = 0\n\t }\n\t priv(this, 'maxAge', mA)\n\t trim(this)\n\t },\n\t get: function () {\n\t return priv(this, 'maxAge')\n\t },\n\t enumerable: true\n\t})\n\t\n\t// resize the cache when the lengthCalculator changes.\n\tObject.defineProperty(LRUCache.prototype, 'lengthCalculator', {\n\t set: function (lC) {\n\t if (typeof lC !== 'function') {\n\t lC = naiveLength\n\t }\n\t if (lC !== priv(this, 'lengthCalculator')) {\n\t priv(this, 'lengthCalculator', lC)\n\t priv(this, 'length', 0)\n\t priv(this, 'lruList').forEach(function (hit) {\n\t hit.length = priv(this, 'lengthCalculator').call(this, hit.value, hit.key)\n\t priv(this, 'length', priv(this, 'length') + hit.length)\n\t }, this)\n\t }\n\t trim(this)\n\t },\n\t get: function () { return priv(this, 'lengthCalculator') },\n\t enumerable: true\n\t})\n\t\n\tObject.defineProperty(LRUCache.prototype, 'length', {\n\t get: function () { return priv(this, 'length') },\n\t enumerable: true\n\t})\n\t\n\tObject.defineProperty(LRUCache.prototype, 'itemCount', {\n\t get: function () { return priv(this, 'lruList').length },\n\t enumerable: true\n\t})\n\t\n\tLRUCache.prototype.rforEach = function (fn, thisp) {\n\t thisp = thisp || this\n\t for (var walker = priv(this, 'lruList').tail; walker !== null;) {\n\t var prev = walker.prev\n\t forEachStep(this, fn, walker, thisp)\n\t walker = prev\n\t }\n\t}\n\t\n\tfunction forEachStep (self, fn, node, thisp) {\n\t var hit = node.value\n\t if (isStale(self, hit)) {\n\t del(self, node)\n\t if (!priv(self, 'allowStale')) {\n\t hit = undefined\n\t }\n\t }\n\t if (hit) {\n\t fn.call(thisp, hit.value, hit.key, self)\n\t }\n\t}\n\t\n\tLRUCache.prototype.forEach = function (fn, thisp) {\n\t thisp = thisp || this\n\t for (var walker = priv(this, 'lruList').head; walker !== null;) {\n\t var next = walker.next\n\t forEachStep(this, fn, walker, thisp)\n\t walker = next\n\t }\n\t}\n\t\n\tLRUCache.prototype.keys = function () {\n\t return priv(this, 'lruList').toArray().map(function (k) {\n\t return k.key\n\t }, this)\n\t}\n\t\n\tLRUCache.prototype.values = function () {\n\t return priv(this, 'lruList').toArray().map(function (k) {\n\t return k.value\n\t }, this)\n\t}\n\t\n\tLRUCache.prototype.reset = function () {\n\t if (priv(this, 'dispose') &&\n\t priv(this, 'lruList') &&\n\t priv(this, 'lruList').length) {\n\t priv(this, 'lruList').forEach(function (hit) {\n\t priv(this, 'dispose').call(this, hit.key, hit.value)\n\t }, this)\n\t }\n\t\n\t priv(this, 'cache', new Map()) // hash of items by key\n\t priv(this, 'lruList', new Yallist()) // list of items in order of use recency\n\t priv(this, 'length', 0) // length of items in the list\n\t}\n\t\n\tLRUCache.prototype.dump = function () {\n\t return priv(this, 'lruList').map(function (hit) {\n\t if (!isStale(this, hit)) {\n\t return {\n\t k: hit.key,\n\t v: hit.value,\n\t e: hit.now + (hit.maxAge || 0)\n\t }\n\t }\n\t }, this).toArray().filter(function (h) {\n\t return h\n\t })\n\t}\n\t\n\tLRUCache.prototype.dumpLru = function () {\n\t return priv(this, 'lruList')\n\t}\n\t\n\tLRUCache.prototype.inspect = function (n, opts) {\n\t var str = 'LRUCache {'\n\t var extras = false\n\t\n\t var as = priv(this, 'allowStale')\n\t if (as) {\n\t str += '\\n allowStale: true'\n\t extras = true\n\t }\n\t\n\t var max = priv(this, 'max')\n\t if (max && max !== Infinity) {\n\t if (extras) {\n\t str += ','\n\t }\n\t str += '\\n max: ' + util.inspect(max, opts)\n\t extras = true\n\t }\n\t\n\t var maxAge = priv(this, 'maxAge')\n\t if (maxAge) {\n\t if (extras) {\n\t str += ','\n\t }\n\t str += '\\n maxAge: ' + util.inspect(maxAge, opts)\n\t extras = true\n\t }\n\t\n\t var lc = priv(this, 'lengthCalculator')\n\t if (lc && lc !== naiveLength) {\n\t if (extras) {\n\t str += ','\n\t }\n\t str += '\\n length: ' + util.inspect(priv(this, 'length'), opts)\n\t extras = true\n\t }\n\t\n\t var didFirst = false\n\t priv(this, 'lruList').forEach(function (item) {\n\t if (didFirst) {\n\t str += ',\\n '\n\t } else {\n\t if (extras) {\n\t str += ',\\n'\n\t }\n\t didFirst = true\n\t str += '\\n '\n\t }\n\t var key = util.inspect(item.key).split('\\n').join('\\n ')\n\t var val = { value: item.value }\n\t if (item.maxAge !== maxAge) {\n\t val.maxAge = item.maxAge\n\t }\n\t if (lc !== naiveLength) {\n\t val.length = item.length\n\t }\n\t if (isStale(this, item)) {\n\t val.stale = true\n\t }\n\t\n\t val = util.inspect(val, opts).split('\\n').join('\\n ')\n\t str += key + ' => ' + val\n\t })\n\t\n\t if (didFirst || extras) {\n\t str += '\\n'\n\t }\n\t str += '}'\n\t\n\t return str\n\t}\n\t\n\tLRUCache.prototype.set = function (key, value, maxAge) {\n\t maxAge = maxAge || priv(this, 'maxAge')\n\t\n\t var now = maxAge ? Date.now() : 0\n\t var len = priv(this, 'lengthCalculator').call(this, value, key)\n\t\n\t if (priv(this, 'cache').has(key)) {\n\t if (len > priv(this, 'max')) {\n\t del(this, priv(this, 'cache').get(key))\n\t return false\n\t }\n\t\n\t var node = priv(this, 'cache').get(key)\n\t var item = node.value\n\t\n\t // dispose of the old one before overwriting\n\t if (priv(this, 'dispose')) {\n\t priv(this, 'dispose').call(this, key, item.value)\n\t }\n\t\n\t item.now = now\n\t item.maxAge = maxAge\n\t item.value = value\n\t priv(this, 'length', priv(this, 'length') + (len - item.length))\n\t item.length = len\n\t this.get(key)\n\t trim(this)\n\t return true\n\t }\n\t\n\t var hit = new Entry(key, value, len, now, maxAge)\n\t\n\t // oversized objects fall out of cache automatically.\n\t if (hit.length > priv(this, 'max')) {\n\t if (priv(this, 'dispose')) {\n\t priv(this, 'dispose').call(this, key, value)\n\t }\n\t return false\n\t }\n\t\n\t priv(this, 'length', priv(this, 'length') + hit.length)\n\t priv(this, 'lruList').unshift(hit)\n\t priv(this, 'cache').set(key, priv(this, 'lruList').head)\n\t trim(this)\n\t return true\n\t}\n\t\n\tLRUCache.prototype.has = function (key) {\n\t if (!priv(this, 'cache').has(key)) return false\n\t var hit = priv(this, 'cache').get(key).value\n\t if (isStale(this, hit)) {\n\t return false\n\t }\n\t return true\n\t}\n\t\n\tLRUCache.prototype.get = function (key) {\n\t return get(this, key, true)\n\t}\n\t\n\tLRUCache.prototype.peek = function (key) {\n\t return get(this, key, false)\n\t}\n\t\n\tLRUCache.prototype.pop = function () {\n\t var node = priv(this, 'lruList').tail\n\t if (!node) return null\n\t del(this, node)\n\t return node.value\n\t}\n\t\n\tLRUCache.prototype.del = function (key) {\n\t del(this, priv(this, 'cache').get(key))\n\t}\n\t\n\tLRUCache.prototype.load = function (arr) {\n\t // reset the cache\n\t this.reset()\n\t\n\t var now = Date.now()\n\t // A previous serialized cache has the most recent items first\n\t for (var l = arr.length - 1; l >= 0; l--) {\n\t var hit = arr[l]\n\t var expiresAt = hit.e || 0\n\t if (expiresAt === 0) {\n\t // the item was created without expiration in a non aged cache\n\t this.set(hit.k, hit.v)\n\t } else {\n\t var maxAge = expiresAt - now\n\t // dont add already expired items\n\t if (maxAge > 0) {\n\t this.set(hit.k, hit.v, maxAge)\n\t }\n\t }\n\t }\n\t}\n\t\n\tLRUCache.prototype.prune = function () {\n\t var self = this\n\t priv(this, 'cache').forEach(function (value, key) {\n\t get(self, key, false)\n\t })\n\t}\n\t\n\tfunction get (self, key, doUse) {\n\t var node = priv(self, 'cache').get(key)\n\t if (node) {\n\t var hit = node.value\n\t if (isStale(self, hit)) {\n\t del(self, node)\n\t if (!priv(self, 'allowStale')) hit = undefined\n\t } else {\n\t if (doUse) {\n\t priv(self, 'lruList').unshiftNode(node)\n\t }\n\t }\n\t if (hit) hit = hit.value\n\t }\n\t return hit\n\t}\n\t\n\tfunction isStale (self, hit) {\n\t if (!hit || (!hit.maxAge && !priv(self, 'maxAge'))) {\n\t return false\n\t }\n\t var stale = false\n\t var diff = Date.now() - hit.now\n\t if (hit.maxAge) {\n\t stale = diff > hit.maxAge\n\t } else {\n\t stale = priv(self, 'maxAge') && (diff > priv(self, 'maxAge'))\n\t }\n\t return stale\n\t}\n\t\n\tfunction trim (self) {\n\t if (priv(self, 'length') > priv(self, 'max')) {\n\t for (var walker = priv(self, 'lruList').tail;\n\t priv(self, 'length') > priv(self, 'max') && walker !== null;) {\n\t // We know that we're about to delete this one, and also\n\t // what the next least recently used key will be, so just\n\t // go ahead and set it now.\n\t var prev = walker.prev\n\t del(self, walker)\n\t walker = prev\n\t }\n\t }\n\t}\n\t\n\tfunction del (self, node) {\n\t if (node) {\n\t var hit = node.value\n\t if (priv(self, 'dispose')) {\n\t priv(self, 'dispose').call(this, hit.key, hit.value)\n\t }\n\t priv(self, 'length', priv(self, 'length') - hit.length)\n\t priv(self, 'cache').delete(hit.key)\n\t priv(self, 'lruList').removeNode(node)\n\t }\n\t}\n\t\n\t// classy, since V8 prefers predictable objects.\n\tfunction Entry (key, value, length, now, maxAge) {\n\t this.key = key\n\t this.value = value\n\t this.length = length\n\t this.now = now\n\t this.maxAge = maxAge || 0\n\t}\n\n\n/***/ },\n/* 36 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {if (process.env.npm_package_name === 'pseudomap' &&\n\t process.env.npm_lifecycle_script === 'test')\n\t process.env.TEST_PSEUDOMAP = 'true'\n\t\n\tif (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) {\n\t module.exports = Map\n\t} else {\n\t module.exports = __webpack_require__(38)\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(37)))\n\n/***/ },\n/* 37 */\n/***/ function(module, exports) {\n\n\t// shim for using process in browser\n\t\n\tvar process = module.exports = {};\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\t\n\tfunction cleanUpNextTick() {\n\t draining = false;\n\t if (currentQueue.length) {\n\t queue = currentQueue.concat(queue);\n\t } else {\n\t queueIndex = -1;\n\t }\n\t if (queue.length) {\n\t drainQueue();\n\t }\n\t}\n\t\n\tfunction drainQueue() {\n\t if (draining) {\n\t return;\n\t }\n\t var timeout = setTimeout(cleanUpNextTick);\n\t draining = true;\n\t\n\t var len = queue.length;\n\t while(len) {\n\t currentQueue = queue;\n\t queue = [];\n\t while (++queueIndex < len) {\n\t if (currentQueue) {\n\t currentQueue[queueIndex].run();\n\t }\n\t }\n\t queueIndex = -1;\n\t len = queue.length;\n\t }\n\t currentQueue = null;\n\t draining = false;\n\t clearTimeout(timeout);\n\t}\n\t\n\tprocess.nextTick = function (fun) {\n\t var args = new Array(arguments.length - 1);\n\t if (arguments.length > 1) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t }\n\t queue.push(new Item(fun, args));\n\t if (queue.length === 1 && !draining) {\n\t setTimeout(drainQueue, 0);\n\t }\n\t};\n\t\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\t\n\tfunction noop() {}\n\t\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\t\n\tprocess.binding = function (name) {\n\t throw new Error('process.binding is not supported');\n\t};\n\t\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ },\n/* 38 */\n/***/ function(module, exports) {\n\n\tvar hasOwnProperty = Object.prototype.hasOwnProperty\n\t\n\tmodule.exports = PseudoMap\n\t\n\tfunction PseudoMap (set) {\n\t if (!(this instanceof PseudoMap)) // whyyyyyyy\n\t throw new TypeError(\"Constructor PseudoMap requires 'new'\")\n\t\n\t this.clear()\n\t\n\t if (set) {\n\t if ((set instanceof PseudoMap) ||\n\t (typeof Map === 'function' && set instanceof Map))\n\t set.forEach(function (value, key) {\n\t this.set(key, value)\n\t }, this)\n\t else if (Array.isArray(set))\n\t set.forEach(function (kv) {\n\t this.set(kv[0], kv[1])\n\t }, this)\n\t else\n\t throw new TypeError('invalid argument')\n\t }\n\t}\n\t\n\tPseudoMap.prototype.forEach = function (fn, thisp) {\n\t thisp = thisp || this\n\t Object.keys(this._data).forEach(function (k) {\n\t if (k !== 'size')\n\t fn.call(thisp, this._data[k].value, this._data[k].key)\n\t }, this)\n\t}\n\t\n\tPseudoMap.prototype.has = function (k) {\n\t return !!find(this._data, k)\n\t}\n\t\n\tPseudoMap.prototype.get = function (k) {\n\t var res = find(this._data, k)\n\t return res && res.value\n\t}\n\t\n\tPseudoMap.prototype.set = function (k, v) {\n\t set(this._data, k, v)\n\t}\n\t\n\tPseudoMap.prototype.delete = function (k) {\n\t var res = find(this._data, k)\n\t if (res) {\n\t delete this._data[res._index]\n\t this._data.size--\n\t }\n\t}\n\t\n\tPseudoMap.prototype.clear = function () {\n\t var data = Object.create(null)\n\t data.size = 0\n\t\n\t Object.defineProperty(this, '_data', {\n\t value: data,\n\t enumerable: false,\n\t configurable: true,\n\t writable: false\n\t })\n\t}\n\t\n\tObject.defineProperty(PseudoMap.prototype, 'size', {\n\t get: function () {\n\t return this._data.size\n\t },\n\t set: function (n) {},\n\t enumerable: true,\n\t configurable: true\n\t})\n\t\n\tPseudoMap.prototype.values =\n\tPseudoMap.prototype.keys =\n\tPseudoMap.prototype.entries = function () {\n\t throw new Error('iterators are not implemented in this version')\n\t}\n\t\n\t// Either identical, or both NaN\n\tfunction same (a, b) {\n\t return a === b || a !== a && b !== b\n\t}\n\t\n\tfunction Entry (k, v, i) {\n\t this.key = k\n\t this.value = v\n\t this._index = i\n\t}\n\t\n\tfunction find (data, k) {\n\t for (var i = 0, s = '_' + k, key = s;\n\t hasOwnProperty.call(data, key);\n\t key = s + i++) {\n\t if (same(data[key].key, k))\n\t return data[key]\n\t }\n\t}\n\t\n\tfunction set (data, k, v) {\n\t for (var i = 0, s = '_' + k, key = s;\n\t hasOwnProperty.call(data, key);\n\t key = s + i++) {\n\t if (same(data[key].key, k)) {\n\t data[key].value = v\n\t return\n\t }\n\t }\n\t data.size++\n\t data[key] = new Entry(k, v, key)\n\t}\n\n\n/***/ },\n/* 39 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\tvar formatRegExp = /%[sdj%]/g;\n\texports.format = function(f) {\n\t if (!isString(f)) {\n\t var objects = [];\n\t for (var i = 0; i < arguments.length; i++) {\n\t objects.push(inspect(arguments[i]));\n\t }\n\t return objects.join(' ');\n\t }\n\t\n\t var i = 1;\n\t var args = arguments;\n\t var len = args.length;\n\t var str = String(f).replace(formatRegExp, function(x) {\n\t if (x === '%%') return '%';\n\t if (i >= len) return x;\n\t switch (x) {\n\t case '%s': return String(args[i++]);\n\t case '%d': return Number(args[i++]);\n\t case '%j':\n\t try {\n\t return JSON.stringify(args[i++]);\n\t } catch (_) {\n\t return '[Circular]';\n\t }\n\t default:\n\t return x;\n\t }\n\t });\n\t for (var x = args[i]; i < len; x = args[++i]) {\n\t if (isNull(x) || !isObject(x)) {\n\t str += ' ' + x;\n\t } else {\n\t str += ' ' + inspect(x);\n\t }\n\t }\n\t return str;\n\t};\n\t\n\t\n\t// Mark that a method should not be used.\n\t// Returns a modified function which warns once by default.\n\t// If --no-deprecation is set, then it is a no-op.\n\texports.deprecate = function(fn, msg) {\n\t // Allow for deprecating things in the process of starting up.\n\t if (isUndefined(global.process)) {\n\t return function() {\n\t return exports.deprecate(fn, msg).apply(this, arguments);\n\t };\n\t }\n\t\n\t if (process.noDeprecation === true) {\n\t return fn;\n\t }\n\t\n\t var warned = false;\n\t function deprecated() {\n\t if (!warned) {\n\t if (process.throwDeprecation) {\n\t throw new Error(msg);\n\t } else if (process.traceDeprecation) {\n\t console.trace(msg);\n\t } else {\n\t console.error(msg);\n\t }\n\t warned = true;\n\t }\n\t return fn.apply(this, arguments);\n\t }\n\t\n\t return deprecated;\n\t};\n\t\n\t\n\tvar debugs = {};\n\tvar debugEnviron;\n\texports.debuglog = function(set) {\n\t if (isUndefined(debugEnviron))\n\t debugEnviron = process.env.NODE_DEBUG || '';\n\t set = set.toUpperCase();\n\t if (!debugs[set]) {\n\t if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n\t var pid = process.pid;\n\t debugs[set] = function() {\n\t var msg = exports.format.apply(exports, arguments);\n\t console.error('%s %d: %s', set, pid, msg);\n\t };\n\t } else {\n\t debugs[set] = function() {};\n\t }\n\t }\n\t return debugs[set];\n\t};\n\t\n\t\n\t/**\n\t * Echos the value of a value. Trys to print the value out\n\t * in the best way possible given the different types.\n\t *\n\t * @param {Object} obj The object to print out.\n\t * @param {Object} opts Optional options object that alters the output.\n\t */\n\t/* legacy: obj, showHidden, depth, colors*/\n\tfunction inspect(obj, opts) {\n\t // default options\n\t var ctx = {\n\t seen: [],\n\t stylize: stylizeNoColor\n\t };\n\t // legacy...\n\t if (arguments.length >= 3) ctx.depth = arguments[2];\n\t if (arguments.length >= 4) ctx.colors = arguments[3];\n\t if (isBoolean(opts)) {\n\t // legacy...\n\t ctx.showHidden = opts;\n\t } else if (opts) {\n\t // got an \"options\" object\n\t exports._extend(ctx, opts);\n\t }\n\t // set default options\n\t if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n\t if (isUndefined(ctx.depth)) ctx.depth = 2;\n\t if (isUndefined(ctx.colors)) ctx.colors = false;\n\t if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n\t if (ctx.colors) ctx.stylize = stylizeWithColor;\n\t return formatValue(ctx, obj, ctx.depth);\n\t}\n\texports.inspect = inspect;\n\t\n\t\n\t// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\n\tinspect.colors = {\n\t 'bold' : [1, 22],\n\t 'italic' : [3, 23],\n\t 'underline' : [4, 24],\n\t 'inverse' : [7, 27],\n\t 'white' : [37, 39],\n\t 'grey' : [90, 39],\n\t 'black' : [30, 39],\n\t 'blue' : [34, 39],\n\t 'cyan' : [36, 39],\n\t 'green' : [32, 39],\n\t 'magenta' : [35, 39],\n\t 'red' : [31, 39],\n\t 'yellow' : [33, 39]\n\t};\n\t\n\t// Don't use 'blue' not visible on cmd.exe\n\tinspect.styles = {\n\t 'special': 'cyan',\n\t 'number': 'yellow',\n\t 'boolean': 'yellow',\n\t 'undefined': 'grey',\n\t 'null': 'bold',\n\t 'string': 'green',\n\t 'date': 'magenta',\n\t // \"name\": intentionally not styling\n\t 'regexp': 'red'\n\t};\n\t\n\t\n\tfunction stylizeWithColor(str, styleType) {\n\t var style = inspect.styles[styleType];\n\t\n\t if (style) {\n\t return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n\t '\\u001b[' + inspect.colors[style][1] + 'm';\n\t } else {\n\t return str;\n\t }\n\t}\n\t\n\t\n\tfunction stylizeNoColor(str, styleType) {\n\t return str;\n\t}\n\t\n\t\n\tfunction arrayToHash(array) {\n\t var hash = {};\n\t\n\t array.forEach(function(val, idx) {\n\t hash[val] = true;\n\t });\n\t\n\t return hash;\n\t}\n\t\n\t\n\tfunction formatValue(ctx, value, recurseTimes) {\n\t // Provide a hook for user-specified inspect functions.\n\t // Check that value is an object with an inspect function on it\n\t if (ctx.customInspect &&\n\t value &&\n\t isFunction(value.inspect) &&\n\t // Filter out the util module, it's inspect function is special\n\t value.inspect !== exports.inspect &&\n\t // Also filter out any prototype objects using the circular check.\n\t !(value.constructor && value.constructor.prototype === value)) {\n\t var ret = value.inspect(recurseTimes, ctx);\n\t if (!isString(ret)) {\n\t ret = formatValue(ctx, ret, recurseTimes);\n\t }\n\t return ret;\n\t }\n\t\n\t // Primitive types cannot have properties\n\t var primitive = formatPrimitive(ctx, value);\n\t if (primitive) {\n\t return primitive;\n\t }\n\t\n\t // Look up the keys of the object.\n\t var keys = Object.keys(value);\n\t var visibleKeys = arrayToHash(keys);\n\t\n\t if (ctx.showHidden) {\n\t keys = Object.getOwnPropertyNames(value);\n\t }\n\t\n\t // IE doesn't make error fields non-enumerable\n\t // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n\t if (isError(value)\n\t && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n\t return formatError(value);\n\t }\n\t\n\t // Some type of object without properties can be shortcutted.\n\t if (keys.length === 0) {\n\t if (isFunction(value)) {\n\t var name = value.name ? ': ' + value.name : '';\n\t return ctx.stylize('[Function' + name + ']', 'special');\n\t }\n\t if (isRegExp(value)) {\n\t return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n\t }\n\t if (isDate(value)) {\n\t return ctx.stylize(Date.prototype.toString.call(value), 'date');\n\t }\n\t if (isError(value)) {\n\t return formatError(value);\n\t }\n\t }\n\t\n\t var base = '', array = false, braces = ['{', '}'];\n\t\n\t // Make Array say that they are Array\n\t if (isArray(value)) {\n\t array = true;\n\t braces = ['[', ']'];\n\t }\n\t\n\t // Make functions say that they are functions\n\t if (isFunction(value)) {\n\t var n = value.name ? ': ' + value.name : '';\n\t base = ' [Function' + n + ']';\n\t }\n\t\n\t // Make RegExps say that they are RegExps\n\t if (isRegExp(value)) {\n\t base = ' ' + RegExp.prototype.toString.call(value);\n\t }\n\t\n\t // Make dates with properties first say the date\n\t if (isDate(value)) {\n\t base = ' ' + Date.prototype.toUTCString.call(value);\n\t }\n\t\n\t // Make error with message first say the error\n\t if (isError(value)) {\n\t base = ' ' + formatError(value);\n\t }\n\t\n\t if (keys.length === 0 && (!array || value.length == 0)) {\n\t return braces[0] + base + braces[1];\n\t }\n\t\n\t if (recurseTimes < 0) {\n\t if (isRegExp(value)) {\n\t return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n\t } else {\n\t return ctx.stylize('[Object]', 'special');\n\t }\n\t }\n\t\n\t ctx.seen.push(value);\n\t\n\t var output;\n\t if (array) {\n\t output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n\t } else {\n\t output = keys.map(function(key) {\n\t return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n\t });\n\t }\n\t\n\t ctx.seen.pop();\n\t\n\t return reduceToSingleString(output, base, braces);\n\t}\n\t\n\t\n\tfunction formatPrimitive(ctx, value) {\n\t if (isUndefined(value))\n\t return ctx.stylize('undefined', 'undefined');\n\t if (isString(value)) {\n\t var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n\t .replace(/'/g, \"\\\\'\")\n\t .replace(/\\\\\"/g, '\"') + '\\'';\n\t return ctx.stylize(simple, 'string');\n\t }\n\t if (isNumber(value))\n\t return ctx.stylize('' + value, 'number');\n\t if (isBoolean(value))\n\t return ctx.stylize('' + value, 'boolean');\n\t // For some reason typeof null is \"object\", so special case here.\n\t if (isNull(value))\n\t return ctx.stylize('null', 'null');\n\t}\n\t\n\t\n\tfunction formatError(value) {\n\t return '[' + Error.prototype.toString.call(value) + ']';\n\t}\n\t\n\t\n\tfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n\t var output = [];\n\t for (var i = 0, l = value.length; i < l; ++i) {\n\t if (hasOwnProperty(value, String(i))) {\n\t output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n\t String(i), true));\n\t } else {\n\t output.push('');\n\t }\n\t }\n\t keys.forEach(function(key) {\n\t if (!key.match(/^\\d+$/)) {\n\t output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n\t key, true));\n\t }\n\t });\n\t return output;\n\t}\n\t\n\t\n\tfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n\t var name, str, desc;\n\t desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n\t if (desc.get) {\n\t if (desc.set) {\n\t str = ctx.stylize('[Getter/Setter]', 'special');\n\t } else {\n\t str = ctx.stylize('[Getter]', 'special');\n\t }\n\t } else {\n\t if (desc.set) {\n\t str = ctx.stylize('[Setter]', 'special');\n\t }\n\t }\n\t if (!hasOwnProperty(visibleKeys, key)) {\n\t name = '[' + key + ']';\n\t }\n\t if (!str) {\n\t if (ctx.seen.indexOf(desc.value) < 0) {\n\t if (isNull(recurseTimes)) {\n\t str = formatValue(ctx, desc.value, null);\n\t } else {\n\t str = formatValue(ctx, desc.value, recurseTimes - 1);\n\t }\n\t if (str.indexOf('\\n') > -1) {\n\t if (array) {\n\t str = str.split('\\n').map(function(line) {\n\t return ' ' + line;\n\t }).join('\\n').substr(2);\n\t } else {\n\t str = '\\n' + str.split('\\n').map(function(line) {\n\t return ' ' + line;\n\t }).join('\\n');\n\t }\n\t }\n\t } else {\n\t str = ctx.stylize('[Circular]', 'special');\n\t }\n\t }\n\t if (isUndefined(name)) {\n\t if (array && key.match(/^\\d+$/)) {\n\t return str;\n\t }\n\t name = JSON.stringify('' + key);\n\t if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n\t name = name.substr(1, name.length - 2);\n\t name = ctx.stylize(name, 'name');\n\t } else {\n\t name = name.replace(/'/g, \"\\\\'\")\n\t .replace(/\\\\\"/g, '\"')\n\t .replace(/(^\"|\"$)/g, \"'\");\n\t name = ctx.stylize(name, 'string');\n\t }\n\t }\n\t\n\t return name + ': ' + str;\n\t}\n\t\n\t\n\tfunction reduceToSingleString(output, base, braces) {\n\t var numLinesEst = 0;\n\t var length = output.reduce(function(prev, cur) {\n\t numLinesEst++;\n\t if (cur.indexOf('\\n') >= 0) numLinesEst++;\n\t return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n\t }, 0);\n\t\n\t if (length > 60) {\n\t return braces[0] +\n\t (base === '' ? '' : base + '\\n ') +\n\t ' ' +\n\t output.join(',\\n ') +\n\t ' ' +\n\t braces[1];\n\t }\n\t\n\t return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n\t}\n\t\n\t\n\t// NOTE: These type checking functions intentionally don't use `instanceof`\n\t// because it is fragile and can be easily faked with `Object.create()`.\n\tfunction isArray(ar) {\n\t return Array.isArray(ar);\n\t}\n\texports.isArray = isArray;\n\t\n\tfunction isBoolean(arg) {\n\t return typeof arg === 'boolean';\n\t}\n\texports.isBoolean = isBoolean;\n\t\n\tfunction isNull(arg) {\n\t return arg === null;\n\t}\n\texports.isNull = isNull;\n\t\n\tfunction isNullOrUndefined(arg) {\n\t return arg == null;\n\t}\n\texports.isNullOrUndefined = isNullOrUndefined;\n\t\n\tfunction isNumber(arg) {\n\t return typeof arg === 'number';\n\t}\n\texports.isNumber = isNumber;\n\t\n\tfunction isString(arg) {\n\t return typeof arg === 'string';\n\t}\n\texports.isString = isString;\n\t\n\tfunction isSymbol(arg) {\n\t return typeof arg === 'symbol';\n\t}\n\texports.isSymbol = isSymbol;\n\t\n\tfunction isUndefined(arg) {\n\t return arg === void 0;\n\t}\n\texports.isUndefined = isUndefined;\n\t\n\tfunction isRegExp(re) {\n\t return isObject(re) && objectToString(re) === '[object RegExp]';\n\t}\n\texports.isRegExp = isRegExp;\n\t\n\tfunction isObject(arg) {\n\t return typeof arg === 'object' && arg !== null;\n\t}\n\texports.isObject = isObject;\n\t\n\tfunction isDate(d) {\n\t return isObject(d) && objectToString(d) === '[object Date]';\n\t}\n\texports.isDate = isDate;\n\t\n\tfunction isError(e) {\n\t return isObject(e) &&\n\t (objectToString(e) === '[object Error]' || e instanceof Error);\n\t}\n\texports.isError = isError;\n\t\n\tfunction isFunction(arg) {\n\t return typeof arg === 'function';\n\t}\n\texports.isFunction = isFunction;\n\t\n\tfunction isPrimitive(arg) {\n\t return arg === null ||\n\t typeof arg === 'boolean' ||\n\t typeof arg === 'number' ||\n\t typeof arg === 'string' ||\n\t typeof arg === 'symbol' || // ES6 symbol\n\t typeof arg === 'undefined';\n\t}\n\texports.isPrimitive = isPrimitive;\n\t\n\texports.isBuffer = __webpack_require__(40);\n\t\n\tfunction objectToString(o) {\n\t return Object.prototype.toString.call(o);\n\t}\n\t\n\t\n\tfunction pad(n) {\n\t return n < 10 ? '0' + n.toString(10) : n.toString(10);\n\t}\n\t\n\t\n\tvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n\t 'Oct', 'Nov', 'Dec'];\n\t\n\t// 26 Feb 16:19:34\n\tfunction timestamp() {\n\t var d = new Date();\n\t var time = [pad(d.getHours()),\n\t pad(d.getMinutes()),\n\t pad(d.getSeconds())].join(':');\n\t return [d.getDate(), months[d.getMonth()], time].join(' ');\n\t}\n\t\n\t\n\t// log is just a thin wrapper to console.log that prepends a timestamp\n\texports.log = function() {\n\t console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n\t};\n\t\n\t\n\t/**\n\t * Inherit the prototype methods from one constructor into another.\n\t *\n\t * The Function.prototype.inherits from lang.js rewritten as a standalone\n\t * function (not on Function.prototype). NOTE: If this file is to be loaded\n\t * during bootstrapping this function needs to be rewritten using some native\n\t * functions as prototype setup using normal JavaScript does not work as\n\t * expected during bootstrapping (see mirror.js in r114903).\n\t *\n\t * @param {function} ctor Constructor function which needs to inherit the\n\t * prototype.\n\t * @param {function} superCtor Constructor function to inherit prototype from.\n\t */\n\texports.inherits = __webpack_require__(41);\n\t\n\texports._extend = function(origin, add) {\n\t // Don't do anything if add isn't an object\n\t if (!add || !isObject(add)) return origin;\n\t\n\t var keys = Object.keys(add);\n\t var i = keys.length;\n\t while (i--) {\n\t origin[keys[i]] = add[keys[i]];\n\t }\n\t return origin;\n\t};\n\t\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(37)))\n\n/***/ },\n/* 40 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function isBuffer(arg) {\n\t return arg && typeof arg === 'object'\n\t && typeof arg.copy === 'function'\n\t && typeof arg.fill === 'function'\n\t && typeof arg.readUInt8 === 'function';\n\t}\n\n/***/ },\n/* 41 */\n/***/ function(module, exports) {\n\n\tif (typeof Object.create === 'function') {\n\t // implementation from standard node.js 'util' module\n\t module.exports = function inherits(ctor, superCtor) {\n\t ctor.super_ = superCtor\n\t ctor.prototype = Object.create(superCtor.prototype, {\n\t constructor: {\n\t value: ctor,\n\t enumerable: false,\n\t writable: true,\n\t configurable: true\n\t }\n\t });\n\t };\n\t} else {\n\t // old school shim for old browsers\n\t module.exports = function inherits(ctor, superCtor) {\n\t ctor.super_ = superCtor\n\t var TempCtor = function () {}\n\t TempCtor.prototype = superCtor.prototype\n\t ctor.prototype = new TempCtor()\n\t ctor.prototype.constructor = ctor\n\t }\n\t}\n\n\n/***/ },\n/* 42 */\n/***/ function(module, exports) {\n\n\tmodule.exports = Yallist\n\t\n\tYallist.Node = Node\n\tYallist.create = Yallist\n\t\n\tfunction Yallist (list) {\n\t var self = this\n\t if (!(self instanceof Yallist)) {\n\t self = new Yallist()\n\t }\n\t\n\t self.tail = null\n\t self.head = null\n\t self.length = 0\n\t\n\t if (list && typeof list.forEach === 'function') {\n\t list.forEach(function (item) {\n\t self.push(item)\n\t })\n\t } else if (arguments.length > 0) {\n\t for (var i = 0, l = arguments.length; i < l; i++) {\n\t self.push(arguments[i])\n\t }\n\t }\n\t\n\t return self\n\t}\n\t\n\tYallist.prototype.removeNode = function (node) {\n\t if (node.list !== this) {\n\t throw new Error('removing node which does not belong to this list')\n\t }\n\t\n\t var next = node.next\n\t var prev = node.prev\n\t\n\t if (next) {\n\t next.prev = prev\n\t }\n\t\n\t if (prev) {\n\t prev.next = next\n\t }\n\t\n\t if (node === this.head) {\n\t this.head = next\n\t }\n\t if (node === this.tail) {\n\t this.tail = prev\n\t }\n\t\n\t node.list.length --\n\t node.next = null\n\t node.prev = null\n\t node.list = null\n\t}\n\t\n\tYallist.prototype.unshiftNode = function (node) {\n\t if (node === this.head) {\n\t return\n\t }\n\t\n\t if (node.list) {\n\t node.list.removeNode(node)\n\t }\n\t\n\t var head = this.head\n\t node.list = this\n\t node.next = head\n\t if (head) {\n\t head.prev = node\n\t }\n\t\n\t this.head = node\n\t if (!this.tail) {\n\t this.tail = node\n\t }\n\t this.length ++\n\t}\n\t\n\tYallist.prototype.pushNode = function (node) {\n\t if (node === this.tail) {\n\t return\n\t }\n\t\n\t if (node.list) {\n\t node.list.removeNode(node)\n\t }\n\t\n\t var tail = this.tail\n\t node.list = this\n\t node.prev = tail\n\t if (tail) {\n\t tail.next = node\n\t }\n\t\n\t this.tail = node\n\t if (!this.head) {\n\t this.head = node\n\t }\n\t this.length ++\n\t}\n\t\n\tYallist.prototype.push = function () {\n\t for (var i = 0, l = arguments.length; i < l; i++) {\n\t push(this, arguments[i])\n\t }\n\t return this.length\n\t}\n\t\n\tYallist.prototype.unshift = function () {\n\t for (var i = 0, l = arguments.length; i < l; i++) {\n\t unshift(this, arguments[i])\n\t }\n\t return this.length\n\t}\n\t\n\tYallist.prototype.pop = function () {\n\t if (!this.tail)\n\t return undefined\n\t\n\t var res = this.tail.value\n\t this.tail = this.tail.prev\n\t this.tail.next = null\n\t this.length --\n\t return res\n\t}\n\t\n\tYallist.prototype.shift = function () {\n\t if (!this.head)\n\t return undefined\n\t\n\t var res = this.head.value\n\t this.head = this.head.next\n\t this.head.prev = null\n\t this.length --\n\t return res\n\t}\n\t\n\tYallist.prototype.forEach = function (fn, thisp) {\n\t thisp = thisp || this\n\t for (var walker = this.head, i = 0; walker !== null; i++) {\n\t fn.call(thisp, walker.value, i, this)\n\t walker = walker.next\n\t }\n\t}\n\t\n\tYallist.prototype.forEachReverse = function (fn, thisp) {\n\t thisp = thisp || this\n\t for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {\n\t fn.call(thisp, walker.value, i, this)\n\t walker = walker.prev\n\t }\n\t}\n\t\n\tYallist.prototype.get = function (n) {\n\t for (var i = 0, walker = this.head; walker !== null && i < n; i++) {\n\t // abort out of the list early if we hit a cycle\n\t walker = walker.next\n\t }\n\t if (i === n && walker !== null) {\n\t return walker.value\n\t }\n\t}\n\t\n\tYallist.prototype.getReverse = function (n) {\n\t for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {\n\t // abort out of the list early if we hit a cycle\n\t walker = walker.prev\n\t }\n\t if (i === n && walker !== null) {\n\t return walker.value\n\t }\n\t}\n\t\n\tYallist.prototype.map = function (fn, thisp) {\n\t thisp = thisp || this\n\t var res = new Yallist()\n\t for (var walker = this.head; walker !== null; ) {\n\t res.push(fn.call(thisp, walker.value, this))\n\t walker = walker.next\n\t }\n\t return res\n\t}\n\t\n\tYallist.prototype.mapReverse = function (fn, thisp) {\n\t thisp = thisp || this\n\t var res = new Yallist()\n\t for (var walker = this.tail; walker !== null;) {\n\t res.push(fn.call(thisp, walker.value, this))\n\t walker = walker.prev\n\t }\n\t return res\n\t}\n\t\n\tYallist.prototype.reduce = function (fn, initial) {\n\t var acc\n\t var walker = this.head\n\t if (arguments.length > 1) {\n\t acc = initial\n\t } else if (this.head) {\n\t walker = this.head.next\n\t acc = this.head.value\n\t } else {\n\t throw new TypeError('Reduce of empty list with no initial value')\n\t }\n\t\n\t for (var i = 0; walker !== null; i++) {\n\t acc = fn(acc, walker.value, i)\n\t walker = walker.next\n\t }\n\t\n\t return acc\n\t}\n\t\n\tYallist.prototype.reduceReverse = function (fn, initial) {\n\t var acc\n\t var walker = this.tail\n\t if (arguments.length > 1) {\n\t acc = initial\n\t } else if (this.tail) {\n\t walker = this.tail.prev\n\t acc = this.tail.value\n\t } else {\n\t throw new TypeError('Reduce of empty list with no initial value')\n\t }\n\t\n\t for (var i = this.length - 1; walker !== null; i--) {\n\t acc = fn(acc, walker.value, i)\n\t walker = walker.prev\n\t }\n\t\n\t return acc\n\t}\n\t\n\tYallist.prototype.toArray = function () {\n\t var arr = new Array(this.length)\n\t for (var i = 0, walker = this.head; walker !== null; i++) {\n\t arr[i] = walker.value\n\t walker = walker.next\n\t }\n\t return arr\n\t}\n\t\n\tYallist.prototype.toArrayReverse = function () {\n\t var arr = new Array(this.length)\n\t for (var i = 0, walker = this.tail; walker !== null; i++) {\n\t arr[i] = walker.value\n\t walker = walker.prev\n\t }\n\t return arr\n\t}\n\t\n\tYallist.prototype.slice = function (from, to) {\n\t to = to || this.length\n\t if (to < 0) {\n\t to += this.length\n\t }\n\t from = from || 0\n\t if (from < 0) {\n\t from += this.length\n\t }\n\t var ret = new Yallist()\n\t if (to < from || to < 0) {\n\t return ret\n\t }\n\t if (from < 0) {\n\t from = 0\n\t }\n\t if (to > this.length) {\n\t to = this.length\n\t }\n\t for (var i = 0, walker = this.head; walker !== null && i < from; i++) {\n\t walker = walker.next\n\t }\n\t for (; walker !== null && i < to; i++, walker = walker.next) {\n\t ret.push(walker.value)\n\t }\n\t return ret\n\t}\n\t\n\tYallist.prototype.sliceReverse = function (from, to) {\n\t to = to || this.length\n\t if (to < 0) {\n\t to += this.length\n\t }\n\t from = from || 0\n\t if (from < 0) {\n\t from += this.length\n\t }\n\t var ret = new Yallist()\n\t if (to < from || to < 0) {\n\t return ret\n\t }\n\t if (from < 0) {\n\t from = 0\n\t }\n\t if (to > this.length) {\n\t to = this.length\n\t }\n\t for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {\n\t walker = walker.prev\n\t }\n\t for (; walker !== null && i > from; i--, walker = walker.prev) {\n\t ret.push(walker.value)\n\t }\n\t return ret\n\t}\n\t\n\tYallist.prototype.reverse = function () {\n\t var head = this.head\n\t var tail = this.tail\n\t for (var walker = head; walker !== null; walker = walker.prev) {\n\t var p = walker.prev\n\t walker.prev = walker.next\n\t walker.next = p\n\t }\n\t this.head = tail\n\t this.tail = head\n\t return this\n\t}\n\t\n\tfunction push (self, item) {\n\t self.tail = new Node(item, self.tail, null, self)\n\t if (!self.head) {\n\t self.head = self.tail\n\t }\n\t self.length ++\n\t}\n\t\n\tfunction unshift (self, item) {\n\t self.head = new Node(item, null, self.head, self)\n\t if (!self.tail) {\n\t self.tail = self.head\n\t }\n\t self.length ++\n\t}\n\t\n\tfunction Node (value, prev, next, list) {\n\t if (!(this instanceof Node)) {\n\t return new Node(value, prev, next, list)\n\t }\n\t\n\t this.list = list\n\t this.value = value\n\t\n\t if (prev) {\n\t prev.next = this\n\t this.prev = prev\n\t } else {\n\t this.prev = null\n\t }\n\t\n\t if (next) {\n\t next.prev = this\n\t this.next = next\n\t } else {\n\t this.next = null\n\t }\n\t}\n\n\n/***/ },\n/* 43 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\t\n\tvar _geoLatLon = __webpack_require__(10);\n\t\n\tvar _geoLatLon2 = _interopRequireDefault(_geoLatLon);\n\t\n\tvar _three = __webpack_require__(24);\n\t\n\tvar _three2 = _interopRequireDefault(_three);\n\t\n\t// Manages a single tile and its layers\n\t\n\tvar r2d = 180 / Math.PI;\n\t\n\tvar loader = new _three2['default'].TextureLoader();\n\tloader.setCrossOrigin('');\n\t\n\tvar Tile = (function () {\n\t function Tile(quadcode, layer) {\n\t _classCallCheck(this, Tile);\n\t\n\t this._layer = layer;\n\t this._quadcode = quadcode;\n\t\n\t this._ready = false;\n\t\n\t this._tile = this._quadcodeToTile(quadcode);\n\t\n\t // Bottom-left and top-right bounds in WGS84 coordinates\n\t this._boundsLatLon = this._tileBoundsWGS84(this._tile);\n\t\n\t // Bottom-left and top-right bounds in world coordinates\n\t this._boundsWorld = this._tileBoundsFromWGS84(this._boundsLatLon);\n\t\n\t // Tile center in world coordinates\n\t this._center = this._boundsToCenter(this._boundsWorld);\n\t\n\t // Length of a tile side in world coorindates\n\t this._side = this._getSide(this._boundsWorld);\n\t }\n\t\n\t // Returns true if the tile mesh and texture are ready to be used\n\t // Otherwise, returns false\n\t\n\t _createClass(Tile, [{\n\t key: 'isReady',\n\t value: function isReady() {\n\t return this._ready;\n\t }\n\t\n\t // Request data for the various tile providers\n\t //\n\t // Providers are provided here and not on instantiation of the class so that\n\t // providers can be easily changed in subsequent requests without heavy\n\t // management\n\t //\n\t // If requestData is called more than once then the provider data will be\n\t // re-downloaded and the mesh output will be changed\n\t //\n\t // Being able to update tile data and output like this on-the-fly makes it\n\t // appealing for situations where tile data may be dynamic / realtime\n\t // (eg. realtime traffic tiles)\n\t //\n\t // May need to be intelligent about what exactly is updated each time\n\t // requestData is called as it doesn't make sense to re-request and\n\t // re-generate a mesh each time when only the image provider needs updating,\n\t // and likewise it doesn't make sense to update the imagery when only terrain\n\t // provider changes\n\t }, {\n\t key: 'requestTileAsync',\n\t value: function requestTileAsync(imageProviders) {\n\t var _this = this;\n\t\n\t // Making this asynchronous really speeds up the LOD framerate\n\t setTimeout(function () {\n\t if (!_this._mesh) {\n\t _this._mesh = _this._createMesh();\n\t _this._requestTextureAsync();\n\t }\n\t }, 0);\n\t }\n\t }, {\n\t key: 'getQuadcode',\n\t value: function getQuadcode() {\n\t return this._quadcode;\n\t }\n\t }, {\n\t key: 'getBounds',\n\t value: function getBounds() {\n\t return this._boundsWorld;\n\t }\n\t }, {\n\t key: 'getCenter',\n\t value: function getCenter() {\n\t return this._center;\n\t }\n\t }, {\n\t key: 'getSide',\n\t value: function getSide() {\n\t return this._side;\n\t }\n\t }, {\n\t key: 'getMesh',\n\t value: function getMesh() {\n\t return this._mesh;\n\t }\n\t\n\t // Destroys the tile and removes it from the layer and memory\n\t //\n\t // Ensure that this leaves no trace of the tile – no textures, no meshes,\n\t // nothing in memory or the GPU\n\t }, {\n\t key: 'destroy',\n\t value: function destroy() {}\n\t }, {\n\t key: '_createMesh',\n\t value: function _createMesh() {\n\t var mesh = new _three2['default'].Object3D();\n\t var geom = new _three2['default'].PlaneGeometry(this._side, this._side, 1);\n\t\n\t var material = new _three2['default'].MeshBasicMaterial();\n\t\n\t var localMesh = new _three2['default'].Mesh(geom, material);\n\t localMesh.rotation.x = -90 * Math.PI / 180;\n\t\n\t mesh.add(localMesh);\n\t\n\t mesh.position.x = this._center[0];\n\t mesh.position.z = this._center[1];\n\t\n\t var box = new _three2['default'].BoxHelper(localMesh);\n\t mesh.add(box);\n\t\n\t // mesh.add(this._createDebugMesh());\n\t\n\t return mesh;\n\t }\n\t }, {\n\t key: '_requestTextureAsync',\n\t value: function _requestTextureAsync() {\n\t var _this2 = this;\n\t\n\t var letter = String.fromCharCode(97 + Math.floor(Math.random() * 26));\n\t var url = 'http://' + letter + '.basemaps.cartocdn.com/light_nolabels/';\n\t // var url = 'http://tile.stamen.com/toner-lite/';\n\t\n\t loader.load(url + this._tile[2] + '/' + this._tile[0] + '/' + this._tile[1] + '.png', function (texture) {\n\t // console.log('Loaded');\n\t // Silky smooth images when tilted\n\t texture.magFilter = _three2['default'].LinearFilter;\n\t texture.minFilter = _three2['default'].LinearMipMapLinearFilter;\n\t\n\t // TODO: Set this to renderer.getMaxAnisotropy() / 4\n\t texture.anisotropy = 4;\n\t\n\t texture.needsUpdate = true;\n\t\n\t _this2._mesh.children[0].material.map = texture;\n\t _this2._mesh.children[0].material.needsUpdate = true;\n\t _this2._ready = true;\n\t }, null, function (xhr) {\n\t console.log(xhr);\n\t });\n\t }\n\t\n\t // Convert from quadcode to TMS tile coordinates\n\t }, {\n\t key: '_quadcodeToTile',\n\t value: function _quadcodeToTile(quadcode) {\n\t var x = 0;\n\t var y = 0;\n\t var z = quadcode.length;\n\t\n\t for (var i = z; i > 0; i--) {\n\t var mask = 1 << i - 1;\n\t var q = +quadcode[z - i];\n\t if (q === 1) {\n\t x |= mask;\n\t }\n\t if (q === 2) {\n\t y |= mask;\n\t }\n\t if (q === 3) {\n\t x |= mask;\n\t y |= mask;\n\t }\n\t }\n\t\n\t return [x, y, z];\n\t }\n\t\n\t // Convert WGS84 tile bounds to world coordinates\n\t }, {\n\t key: '_tileBoundsFromWGS84',\n\t value: function _tileBoundsFromWGS84(boundsWGS84) {\n\t var sw = this._layer._world.latLonToPoint((0, _geoLatLon2['default'])(boundsWGS84[1], boundsWGS84[0]));\n\t var ne = this._layer._world.latLonToPoint((0, _geoLatLon2['default'])(boundsWGS84[3], boundsWGS84[2]));\n\t\n\t return [sw.x, sw.y, ne.x, ne.y];\n\t }\n\t\n\t // Get tile bounds in WGS84 coordinates\n\t }, {\n\t key: '_tileBoundsWGS84',\n\t value: function _tileBoundsWGS84(tile) {\n\t var e = this._tile2lon(tile[0] + 1, tile[2]);\n\t var w = this._tile2lon(tile[0], tile[2]);\n\t var s = this._tile2lat(tile[1] + 1, tile[2]);\n\t var n = this._tile2lat(tile[1], tile[2]);\n\t return [w, s, e, n];\n\t }\n\t }, {\n\t key: '_tile2lon',\n\t value: function _tile2lon(x, z) {\n\t return x / Math.pow(2, z) * 360 - 180;\n\t }\n\t }, {\n\t key: '_tile2lat',\n\t value: function _tile2lat(y, z) {\n\t var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z);\n\t return r2d * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n\t }\n\t }, {\n\t key: '_boundsToCenter',\n\t value: function _boundsToCenter(bounds) {\n\t var x = bounds[0] + (bounds[2] - bounds[0]) / 2;\n\t var y = bounds[1] + (bounds[3] - bounds[1]) / 2;\n\t\n\t return [x, y];\n\t }\n\t }, {\n\t key: '_getSide',\n\t value: function _getSide(bounds) {\n\t return new _three2['default'].Vector3(bounds[0], 0, bounds[3]).sub(new _three2['default'].Vector3(bounds[0], 0, bounds[1])).length();\n\t }\n\t }]);\n\t\n\t return Tile;\n\t})();\n\t\n\texports['default'] = Tile;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 44 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/**\n\t * lodash 4.0.0 (Custom Build) \n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright 2012-2016 The Dojo Foundation \n\t * Based on Underscore.js 1.8.3 \n\t * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t * Available under MIT license \n\t */\n\tvar debounce = __webpack_require__(45);\n\t\n\t/** Used as the `TypeError` message for \"Functions\" methods. */\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\t\n\t/**\n\t * Creates a throttled function that only invokes `func` at most once per\n\t * every `wait` milliseconds. The throttled function comes with a `cancel`\n\t * method to cancel delayed `func` invocations and a `flush` method to\n\t * immediately invoke them. Provide an options object to indicate whether\n\t * `func` should be invoked on the leading and/or trailing edge of the `wait`\n\t * timeout. The `func` is invoked with the last arguments provided to the\n\t * throttled function. Subsequent calls to the throttled function return the\n\t * result of the last `func` invocation.\n\t *\n\t * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n\t * on the trailing edge of the timeout only if the the throttled function is\n\t * invoked more than once during the `wait` timeout.\n\t *\n\t * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n\t * for details over the differences between `_.throttle` and `_.debounce`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Function\n\t * @param {Function} func The function to throttle.\n\t * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n\t * @param {Object} [options] The options object.\n\t * @param {boolean} [options.leading=true] Specify invoking on the leading\n\t * edge of the timeout.\n\t * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n\t * edge of the timeout.\n\t * @returns {Function} Returns the new throttled function.\n\t * @example\n\t *\n\t * // avoid excessively updating the position while scrolling\n\t * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n\t *\n\t * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes\n\t * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n\t * jQuery(element).on('click', throttled);\n\t *\n\t * // cancel a trailing throttled invocation\n\t * jQuery(window).on('popstate', throttled.cancel);\n\t */\n\tfunction throttle(func, wait, options) {\n\t var leading = true,\n\t trailing = true;\n\t\n\t if (typeof func != 'function') {\n\t throw new TypeError(FUNC_ERROR_TEXT);\n\t }\n\t if (isObject(options)) {\n\t leading = 'leading' in options ? !!options.leading : leading;\n\t trailing = 'trailing' in options ? !!options.trailing : trailing;\n\t }\n\t return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing });\n\t}\n\t\n\t/**\n\t * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n\t * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t // Avoid a V8 JIT bug in Chrome 19-20.\n\t // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\tmodule.exports = throttle;\n\n\n/***/ },\n/* 45 */\n/***/ function(module, exports) {\n\n\t/**\n\t * lodash 4.0.1 (Custom Build) \n\t * Build: `lodash modularize exports=\"npm\" -o ./`\n\t * Copyright 2012-2016 The Dojo Foundation \n\t * Based on Underscore.js 1.8.3 \n\t * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t * Available under MIT license \n\t */\n\t\n\t/** Used as the `TypeError` message for \"Functions\" methods. */\n\tvar FUNC_ERROR_TEXT = 'Expected a function';\n\t\n\t/** Used as references for various `Number` constants. */\n\tvar NAN = 0 / 0;\n\t\n\t/** `Object#toString` result references. */\n\tvar funcTag = '[object Function]',\n\t genTag = '[object GeneratorFunction]';\n\t\n\t/** Used to match leading and trailing whitespace. */\n\tvar reTrim = /^\\s+|\\s+$/g;\n\t\n\t/** Used to detect bad signed hexadecimal string values. */\n\tvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\t\n\t/** Used to detect binary string values. */\n\tvar reIsBinary = /^0b[01]+$/i;\n\t\n\t/** Used to detect octal string values. */\n\tvar reIsOctal = /^0o[0-7]+$/i;\n\t\n\t/** Built-in method references without a dependency on `root`. */\n\tvar freeParseInt = parseInt;\n\t\n\t/** Used for built-in method references. */\n\tvar objectProto = Object.prototype;\n\t\n\t/**\n\t * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n\t * of values.\n\t */\n\tvar objectToString = objectProto.toString;\n\t\n\t/* Built-in method references for those with the same name as other `lodash` methods. */\n\tvar nativeMax = Math.max;\n\t\n\t/**\n\t * Gets the timestamp of the number of milliseconds that have elapsed since\n\t * the Unix epoch (1 January 1970 00:00:00 UTC).\n\t *\n\t * @static\n\t * @memberOf _\n\t * @type Function\n\t * @category Date\n\t * @returns {number} Returns the timestamp.\n\t * @example\n\t *\n\t * _.defer(function(stamp) {\n\t * console.log(_.now() - stamp);\n\t * }, _.now());\n\t * // => logs the number of milliseconds it took for the deferred function to be invoked\n\t */\n\tvar now = Date.now;\n\t\n\t/**\n\t * Creates a debounced function that delays invoking `func` until after `wait`\n\t * milliseconds have elapsed since the last time the debounced function was\n\t * invoked. The debounced function comes with a `cancel` method to cancel\n\t * delayed `func` invocations and a `flush` method to immediately invoke them.\n\t * Provide an options object to indicate whether `func` should be invoked on\n\t * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n\t * with the last arguments provided to the debounced function. Subsequent calls\n\t * to the debounced function return the result of the last `func` invocation.\n\t *\n\t * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n\t * on the trailing edge of the timeout only if the the debounced function is\n\t * invoked more than once during the `wait` timeout.\n\t *\n\t * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n\t * for details over the differences between `_.debounce` and `_.throttle`.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Function\n\t * @param {Function} func The function to debounce.\n\t * @param {number} [wait=0] The number of milliseconds to delay.\n\t * @param {Object} [options] The options object.\n\t * @param {boolean} [options.leading=false] Specify invoking on the leading\n\t * edge of the timeout.\n\t * @param {number} [options.maxWait] The maximum time `func` is allowed to be\n\t * delayed before it's invoked.\n\t * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n\t * edge of the timeout.\n\t * @returns {Function} Returns the new debounced function.\n\t * @example\n\t *\n\t * // Avoid costly calculations while the window size is in flux.\n\t * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n\t *\n\t * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n\t * jQuery(element).on('click', _.debounce(sendMail, 300, {\n\t * 'leading': true,\n\t * 'trailing': false\n\t * }));\n\t *\n\t * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n\t * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n\t * var source = new EventSource('/stream');\n\t * jQuery(source).on('message', debounced);\n\t *\n\t * // Cancel the trailing debounced invocation.\n\t * jQuery(window).on('popstate', debounced.cancel);\n\t */\n\tfunction debounce(func, wait, options) {\n\t var args,\n\t maxTimeoutId,\n\t result,\n\t stamp,\n\t thisArg,\n\t timeoutId,\n\t trailingCall,\n\t lastCalled = 0,\n\t leading = false,\n\t maxWait = false,\n\t trailing = true;\n\t\n\t if (typeof func != 'function') {\n\t throw new TypeError(FUNC_ERROR_TEXT);\n\t }\n\t wait = toNumber(wait) || 0;\n\t if (isObject(options)) {\n\t leading = !!options.leading;\n\t maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait);\n\t trailing = 'trailing' in options ? !!options.trailing : trailing;\n\t }\n\t\n\t function cancel() {\n\t if (timeoutId) {\n\t clearTimeout(timeoutId);\n\t }\n\t if (maxTimeoutId) {\n\t clearTimeout(maxTimeoutId);\n\t }\n\t lastCalled = 0;\n\t args = maxTimeoutId = thisArg = timeoutId = trailingCall = undefined;\n\t }\n\t\n\t function complete(isCalled, id) {\n\t if (id) {\n\t clearTimeout(id);\n\t }\n\t maxTimeoutId = timeoutId = trailingCall = undefined;\n\t if (isCalled) {\n\t lastCalled = now();\n\t result = func.apply(thisArg, args);\n\t if (!timeoutId && !maxTimeoutId) {\n\t args = thisArg = undefined;\n\t }\n\t }\n\t }\n\t\n\t function delayed() {\n\t var remaining = wait - (now() - stamp);\n\t if (remaining <= 0 || remaining > wait) {\n\t complete(trailingCall, maxTimeoutId);\n\t } else {\n\t timeoutId = setTimeout(delayed, remaining);\n\t }\n\t }\n\t\n\t function flush() {\n\t if ((timeoutId && trailingCall) || (maxTimeoutId && trailing)) {\n\t result = func.apply(thisArg, args);\n\t }\n\t cancel();\n\t return result;\n\t }\n\t\n\t function maxDelayed() {\n\t complete(trailing, timeoutId);\n\t }\n\t\n\t function debounced() {\n\t args = arguments;\n\t stamp = now();\n\t thisArg = this;\n\t trailingCall = trailing && (timeoutId || !leading);\n\t\n\t if (maxWait === false) {\n\t var leadingCall = leading && !timeoutId;\n\t } else {\n\t if (!maxTimeoutId && !leading) {\n\t lastCalled = stamp;\n\t }\n\t var remaining = maxWait - (stamp - lastCalled),\n\t isCalled = remaining <= 0 || remaining > maxWait;\n\t\n\t if (isCalled) {\n\t if (maxTimeoutId) {\n\t maxTimeoutId = clearTimeout(maxTimeoutId);\n\t }\n\t lastCalled = stamp;\n\t result = func.apply(thisArg, args);\n\t }\n\t else if (!maxTimeoutId) {\n\t maxTimeoutId = setTimeout(maxDelayed, remaining);\n\t }\n\t }\n\t if (isCalled && timeoutId) {\n\t timeoutId = clearTimeout(timeoutId);\n\t }\n\t else if (!timeoutId && wait !== maxWait) {\n\t timeoutId = setTimeout(delayed, wait);\n\t }\n\t if (leadingCall) {\n\t isCalled = true;\n\t result = func.apply(thisArg, args);\n\t }\n\t if (isCalled && !timeoutId && !maxTimeoutId) {\n\t args = thisArg = undefined;\n\t }\n\t return result;\n\t }\n\t debounced.cancel = cancel;\n\t debounced.flush = flush;\n\t return debounced;\n\t}\n\t\n\t/**\n\t * Checks if `value` is classified as a `Function` object.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n\t * @example\n\t *\n\t * _.isFunction(_);\n\t * // => true\n\t *\n\t * _.isFunction(/abc/);\n\t * // => false\n\t */\n\tfunction isFunction(value) {\n\t // The use of `Object#toString` avoids issues with the `typeof` operator\n\t // in Safari 8 which returns 'object' for typed array constructors, and\n\t // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n\t var tag = isObject(value) ? objectToString.call(value) : '';\n\t return tag == funcTag || tag == genTag;\n\t}\n\t\n\t/**\n\t * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n\t * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to check.\n\t * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n\t * @example\n\t *\n\t * _.isObject({});\n\t * // => true\n\t *\n\t * _.isObject([1, 2, 3]);\n\t * // => true\n\t *\n\t * _.isObject(_.noop);\n\t * // => true\n\t *\n\t * _.isObject(null);\n\t * // => false\n\t */\n\tfunction isObject(value) {\n\t var type = typeof value;\n\t return !!value && (type == 'object' || type == 'function');\n\t}\n\t\n\t/**\n\t * Converts `value` to a number.\n\t *\n\t * @static\n\t * @memberOf _\n\t * @category Lang\n\t * @param {*} value The value to process.\n\t * @returns {number} Returns the number.\n\t * @example\n\t *\n\t * _.toNumber(3);\n\t * // => 3\n\t *\n\t * _.toNumber(Number.MIN_VALUE);\n\t * // => 5e-324\n\t *\n\t * _.toNumber(Infinity);\n\t * // => Infinity\n\t *\n\t * _.toNumber('3');\n\t * // => 3\n\t */\n\tfunction toNumber(value) {\n\t if (isObject(value)) {\n\t var other = isFunction(value.valueOf) ? value.valueOf() : value;\n\t value = isObject(other) ? (other + '') : other;\n\t }\n\t if (typeof value != 'string') {\n\t return value === 0 ? value : +value;\n\t }\n\t value = value.replace(reTrim, '');\n\t var isBinary = reIsBinary.test(value);\n\t return (isBinary || reIsOctal.test(value))\n\t ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n\t : (reIsBadHex.test(value) ? NAN : +value);\n\t}\n\t\n\tmodule.exports = debounce;\n\n\n/***/ }\n/******/ ])\n});\n;"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 9d157dc3471a8e598d99\n **/","import World from './World';\nimport Controls from './controls/index';\nimport EnvironmentLayer from './layer/environment/EnvironmentLayer';\nimport GridLayer from './layer/tile/GridLayer';\nimport Point from './geo/Point';\nimport LatLon from './geo/LatLon';\n\nconst VIZI = {\n version: '0.3',\n\n // Public API\n World: World,\n Controls: Controls,\n EnvironmentLayer: EnvironmentLayer,\n GridLayer: GridLayer,\n Point: Point,\n LatLon: LatLon\n};\n\nexport default VIZI;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/vizicities.js\n **/","import EventEmitter from 'eventemitter3';\nimport extend from 'lodash.assign';\nimport CRS from './geo/CRS/index';\nimport Point from './geo/Point';\nimport LatLon from './geo/LatLon';\nimport Engine from './engine/Engine';\n\n// Pretty much any event someone using ViziCities would need will be emitted or\n// proxied by World (eg. render events, etc)\n\nclass World extends EventEmitter {\n constructor(domId, options) {\n super();\n\n var defaults = {\n crs: CRS.EPSG3857\n };\n\n this.options = extend(defaults, options);\n\n this._layers = [];\n this._controls = [];\n\n this._initContainer(domId);\n this._initEngine();\n this._initEvents();\n\n // Kick off the update and render loop\n this._update();\n }\n\n _initContainer(domId) {\n this._container = document.getElementById(domId);\n }\n\n _initEngine() {\n this._engine = Engine(this._container);\n\n // Engine events\n //\n // Consider proxying these through events on World for public access\n // this._engine.on('preRender', () => {});\n // this._engine.on('postRender', () => {});\n }\n\n _initEvents() {\n this.on('controlsMoveEnd', this._onControlsMoveEnd);\n }\n\n _onControlsMoveEnd(point) {\n var _point = Point(point.x, point.z);\n this._resetView(this.pointToLatLon(_point));\n }\n\n // Reset world view\n _resetView(latlon) {\n this.emit('preResetView');\n\n this._moveStart();\n this._move(latlon);\n this._moveEnd();\n\n this.emit('postResetView');\n }\n\n _moveStart() {\n this.emit('moveStart');\n }\n\n _move(latlon) {\n this._lastPosition = latlon;\n this.emit('move', latlon);\n }\n _moveEnd() {\n this.emit('moveEnd');\n }\n\n _update() {\n var delta = this._engine.clock.getDelta();\n\n // Once _update is called it will run forever, for now\n window.requestAnimationFrame(this._update.bind(this));\n\n // Update controls\n this._controls.forEach(controls => {\n controls.update();\n });\n\n this.emit('preUpdate');\n this._engine.update(delta);\n this.emit('postUpdate');\n }\n\n // Set world view\n setView(latlon) {\n // Store initial geographic coordinate for the [0,0,0] world position\n //\n // The origin point doesn't move in three.js / 3D space so only set it once\n // here instead of every time _resetView is called\n //\n // If it was updated every time then coorindates would shift over time and\n // would be out of place / context with previously-placed points (0,0 would\n // refer to a different point each time)\n this._originLatlon = latlon;\n this._originPoint = this.project(latlon);\n\n this._resetView(latlon);\n return this;\n }\n\n // Return world geographic position\n getPosition() {\n return this._lastPosition;\n }\n\n // Transform geographic coordinate to world point\n //\n // This doesn't take into account the origin offset\n //\n // For example, this takes a geographic coordinate and returns a point\n // relative to the origin point of the projection (not the world)\n project(latlon) {\n return this.options.crs.latLonToPoint(LatLon(latlon));\n }\n\n // Transform world point to geographic coordinate\n //\n // This doesn't take into account the origin offset\n //\n // For example, this takes a point relative to the origin point of the\n // projection (not the world) and returns a geographic coordinate\n unproject(point) {\n return this.options.crs.pointToLatLon(Point(point));\n }\n\n // Takes into account the origin offset\n //\n // For example, this takes a geographic coordinate and returns a point\n // relative to the three.js / 3D origin (0,0)\n latLonToPoint(latlon) {\n var projectedPoint = this.project(LatLon(latlon));\n return projectedPoint._subtract(this._originPoint);\n }\n\n // Takes into account the origin offset\n //\n // For example, this takes a point relative to the three.js / 3D origin (0,0)\n // and returns the exact geographic coordinate at that point\n pointToLatLon(point) {\n var projectedPoint = Point(point).add(this._originPoint);\n return this.unproject(projectedPoint);\n }\n\n // Unsure if it's a good idea to expose this here for components like\n // GridLayer to use (eg. to keep track of a frustum)\n getCamera() {\n return this._engine._camera;\n }\n\n addLayer(layer) {\n layer._addToWorld(this);\n\n this._layers.push(layer);\n\n // Could move this into Layer but it'll do here for now\n this._engine._scene.add(layer._layer);\n\n this.emit('layerAdded', layer);\n return this;\n }\n\n // Remove layer and perform clean up operations\n removeLayer(layer) {}\n\n addControls(controls) {\n controls._addToWorld(this);\n\n this._controls.push(controls);\n\n this.emit('controlsAdded', controls);\n return this;\n }\n\n removeControls(controls) {}\n}\n\n// Initialise without requiring new keyword\nexport default function(domId, options) {\n return new World(domId, options);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/World.js\n **/","'use strict';\n\n//\n// We store our EE objects in a plain object whose properties are event names.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// `~` to make sure that the built-in object properties are not overridden or\n// used as an attack vector.\n// We also assume that `Object.create(null)` is available when the event name\n// is an ES6 Symbol.\n//\nvar prefix = typeof Object.create !== 'function' ? '~' : false;\n\n/**\n * Representation of a single EventEmitter function.\n *\n * @param {Function} fn Event handler to be called.\n * @param {Mixed} context Context for function execution.\n * @param {Boolean} once Only emit once\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal EventEmitter interface that is molded against the Node.js\n * EventEmitter interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() { /* Nothing to set */ }\n\n/**\n * Holds the assigned EventEmitters by name.\n *\n * @type {Object}\n * @private\n */\nEventEmitter.prototype._events = undefined;\n\n/**\n * Return a list of assigned event listeners.\n *\n * @param {String} event The events that should be listed.\n * @param {Boolean} exists We only need to know if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events && this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Emit an event to all registered event listeners.\n *\n * @param {String} event The name of the event.\n * @returns {Boolean} Indication if we've emitted an event.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events || !this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if ('function' === typeof listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Register a new EventListener for the given event.\n *\n * @param {String} event Name of the event.\n * @param {Functon} fn Callback function.\n * @param {Mixed} context The context of the function.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events) this._events = prefix ? {} : Object.create(null);\n if (!this._events[evt]) this._events[evt] = listener;\n else {\n if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [\n this._events[evt], listener\n ];\n }\n\n return this;\n};\n\n/**\n * Add an EventListener that's only called once.\n *\n * @param {String} event Name of the event.\n * @param {Function} fn Callback function.\n * @param {Mixed} context The context of the function.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events) this._events = prefix ? {} : Object.create(null);\n if (!this._events[evt]) this._events[evt] = listener;\n else {\n if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [\n this._events[evt], listener\n ];\n }\n\n return this;\n};\n\n/**\n * Remove event listeners.\n *\n * @param {String} event The event we want to remove.\n * @param {Function} fn The listener that we need to find.\n * @param {Mixed} context Only remove listeners matching this context.\n * @param {Boolean} once Only remove once listeners.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events || !this._events[evt]) return this;\n\n var listeners = this._events[evt]\n , events = [];\n\n if (fn) {\n if (listeners.fn) {\n if (\n listeners.fn !== fn\n || (once && !listeners.once)\n || (context && listeners.context !== context)\n ) {\n events.push(listeners);\n }\n } else {\n for (var i = 0, length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) {\n this._events[evt] = events.length === 1 ? events[0] : events;\n } else {\n delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners or only the listeners for the specified event.\n *\n * @param {String} event The event want to remove all listeners for.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n if (!this._events) return this;\n\n if (event) delete this._events[prefix ? prefix + event : event];\n else this._events = prefix ? {} : Object.create(null);\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/eventemitter3/index.js\n ** module id = 2\n ** module chunks = 0\n **/","/**\n * lodash 4.0.2 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar keys = require('lodash.keys'),\n rest = require('lodash.rest');\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if ((!eq(objValue, value) ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object) {\n return copyObjectWith(source, props, object);\n}\n\n/**\n * This function is like `copyObject` except that it accepts a function to\n * customize copied values.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property names to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObjectWith(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index],\n newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key];\n\n assignValue(object, key, newValue);\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return rest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = typeof customizer == 'function' ? (length--, customizer) : undefined;\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\n/**\n * Checks if the provided arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'user': 'fred' };\n * var other = { 'user': 'fred' };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @type Function\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null &&\n !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array constructors, and\n // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Assigns own enumerable properties of source objects to the destination\n * object. Source objects are applied from left to right. Subsequent sources\n * overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function Foo() {\n * this.c = 3;\n * }\n *\n * function Bar() {\n * this.e = 5;\n * }\n *\n * Foo.prototype.d = 4;\n * Bar.prototype.f = 6;\n *\n * _.assign({ 'a': 1 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3, 'e': 5 }\n */\nvar assign = createAssigner(function(object, source) {\n copyObject(source, keys(source), object);\n});\n\nmodule.exports = assign;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash.assign/index.js\n ** module id = 3\n ** module chunks = 0\n **/","/**\n * lodash 4.0.2 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n stringTag = '[object String]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n length = length == null ? MAX_SAFE_INTEGER : length;\n return value > -1 && value % 1 == 0 && value < length;\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar getPrototypeOf = Object.getPrototypeOf,\n propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = Object.keys;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,\n // that are composed entirely of index properties, return `false` for\n // `hasOwnProperty` checks of them.\n return hasOwnProperty.call(object, key) ||\n (typeof object == 'object' && key in object && getPrototypeOf(object) === null);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't skip the constructor\n * property of prototypes or treat sparse arrays as dense.\n *\n * @private\n * @type Function\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n return nativeKeys(Object(object));\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * Gets the \"length\" property value of `object`.\n *\n * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n * that affects Safari on at least iOS 8.1-8.3 ARM64.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {*} Returns the \"length\" value.\n */\nvar getLength = baseProperty('length');\n\n/**\n * Creates an array of index keys for `object` values of arrays,\n * `arguments` objects, and strings, otherwise `null` is returned.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array|null} Returns index keys, else `null`.\n */\nfunction indexKeys(object) {\n var length = object ? object.length : undefined;\n if (isLength(length) &&\n (isArray(object) || isString(object) || isArguments(object))) {\n return baseTimes(length, String);\n }\n return null;\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @type Function\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @type Function\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null &&\n !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value));\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @type Function\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array constructors, and\n // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n var isProto = isPrototype(object);\n if (!(isProto || isArrayLike(object))) {\n return baseKeys(object);\n }\n var indexes = indexKeys(object),\n skipIndexes = !!indexes,\n result = indexes || [],\n length = result.length;\n\n for (var key in object) {\n if (baseHas(object, key) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length))) &&\n !(isProto && key == 'constructor')) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = keys;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash.keys/index.js\n ** module id = 4\n ** module chunks = 0\n **/","/**\n * lodash 4.0.1 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n var length = args.length;\n switch (length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as an array.\n *\n * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n switch (start) {\n case 0: return func.call(this, array);\n case 1: return func.call(this, args[0], array);\n case 2: return func.call(this, args[0], args[1], array);\n }\n var otherArgs = Array(start + 1);\n index = -1;\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array constructors, and\n // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3');\n * // => 3\n */\nfunction toInteger(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n var remainder = value % 1;\n return value === value ? (remainder ? value - remainder : value) : 0;\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3);\n * // => 3\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3');\n * // => 3\n */\nfunction toNumber(value) {\n if (isObject(value)) {\n var other = isFunction(value.valueOf) ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = rest;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash.rest/index.js\n ** module id = 5\n ** module chunks = 0\n **/","import EPSG3857 from './CRS.EPSG3857';\nimport {EPSG900913} from './CRS.EPSG3857';\nimport EPSG3395 from './CRS.EPSG3395';\nimport EPSG4326 from './CRS.EPSG4326';\nimport Simple from './CRS.Simple';\nimport Proj4 from './CRS.Proj4';\n\nconst CRS = {};\n\nCRS.EPSG3857 = EPSG3857;\nCRS.EPSG900913 = EPSG900913;\nCRS.EPSG3395 = EPSG3395;\nCRS.EPSG4326 = EPSG4326;\nCRS.Simple = Simple;\nCRS.Proj4 = Proj4;\n\nexport default CRS;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/index.js\n **/","/*\n * CRS.EPSG3857 (WGS 84 / Pseudo-Mercator) CRS implementation.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG3857.js\n */\n\nimport extend from 'lodash.assign';\nimport Earth from './CRS.Earth';\nimport SphericalMercator from '../projection/Projection.SphericalMercator';\nimport Transformation from '../../util/Transformation';\n\nvar _EPSG3857 = {\n code: 'EPSG:3857',\n projection: SphericalMercator,\n\n // Work out how to de-dupe this (scoping issue)\n transformScale: 1 / (Math.PI * SphericalMercator.R),\n\n // Scale and transformation inputs changed to account for central origin in\n // WebGL, instead of top-left origin used in Leaflet\n transformation: (function() {\n // TODO: Cannot use this.transformScale due to scope\n var scale = 1 / (Math.PI * SphericalMercator.R);\n\n return new Transformation(scale, 0, -scale, 0);\n }())\n};\n\nconst EPSG3857 = extend({}, Earth, _EPSG3857);\n\nconst EPSG900913 = extend({}, EPSG3857, {\n code: 'EPSG:900913'\n});\n\nexport {EPSG900913};\n\nexport default EPSG3857;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.EPSG3857.js\n **/","/*\n * CRS.Earth is the base class for all CRS representing Earth.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.Earth.js\n */\n\nimport extend from 'lodash.assign';\nimport CRS from './CRS';\nimport LatLon from '../LatLon';\n\nconst Earth = {\n wrapLon: [-180, 180],\n\n R: 6378137,\n\n // Distance between two geographical points using spherical law of cosines\n // approximation or Haversine\n //\n // See: http://www.movable-type.co.uk/scripts/latlong.html\n distance: function(latlon1, latlon2, accurate) {\n var rad = Math.PI / 180;\n\n var lat1;\n var lat2;\n\n var a;\n\n if (!accurate) {\n lat1 = latlon1.lat * rad;\n lat2 = latlon2.lat * rad;\n\n a = Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos((latlon2.lon - latlon1.lon) * rad);\n\n return this.R * Math.acos(Math.min(a, 1));\n } else {\n lat1 = latlon1.lat * rad;\n lat2 = latlon2.lat * rad;\n\n var lon1 = latlon1.lon * rad;\n var lon2 = latlon2.lon * rad;\n\n var deltaLat = lat2 - lat1;\n var deltaLon = lon2 - lon1;\n\n var halfDeltaLat = deltaLat / 2;\n var halfDeltaLon = deltaLon / 2;\n\n a = Math.sin(halfDeltaLat) * Math.sin(halfDeltaLat) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(halfDeltaLon) * Math.sin(halfDeltaLon);\n\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\n return this.R * c;\n }\n },\n\n // Scale factor for converting between real metres and projected metres\n //\n // projectedMetres = realMetres * pointScale\n // realMetres = projectedMetres / pointScale\n //\n // Defaults to a scale factor of 1 if no calculation method exists\n //\n // Probably need to run this through the CRS transformation or similar so the\n // resulting scale is relative to the dimensions of the world space\n // Eg. 1 metre in projected space is likly scaled up or down to some other\n // number\n pointScale: function(latlon, accurate) {\n return (this.projection.pointScale) ? this.projection.pointScale(latlon, accurate) : [1, 1];\n },\n\n // Convert real metres to projected units\n //\n // Latitude scale is chosen because it fluctuates more than longitude\n metresToProjected: function(metres, pointScale) {\n return metres * pointScale[1];\n },\n\n // Convert projected units to real metres\n //\n // Latitude scale is chosen because it fluctuates more than longitude\n projectedToMetres: function(projectedUnits, pointScale) {\n return projectedUnits / pointScale[1];\n },\n\n // Convert real metres to a value in world (WebGL) units\n metresToWorld: function(metres, pointScale, zoom) {\n // Transform metres to projected metres using the latitude point scale\n //\n // Latitude scale is chosen because it fluctuates more than longitude\n var projectedMetres = this.metresToProjected(metres, pointScale);\n\n var scale = this.scale(zoom);\n\n // Half scale if using zoom as WebGL origin is in the centre, not top left\n if (zoom) {\n scale /= 2;\n }\n\n // Scale projected metres\n var scaledMetres = (scale * (this.transformScale * projectedMetres)) / pointScale[1];\n\n return scaledMetres;\n },\n\n // Convert world (WebGL) units to a value in real metres\n worldToMetres: function(worldUnits, pointScale, zoom) {\n var scale = this.scale(zoom);\n\n // Half scale if using zoom as WebGL origin is in the centre, not top left\n if (zoom) {\n scale /= 2;\n }\n\n var projectedUnits = ((worldUnits / scale) / this.transformScale) * pointScale[1];\n var realMetres = this.projectedToMetres(projectedUnits, pointScale);\n\n return realMetres;\n }\n};\n\nexport default extend({}, CRS, Earth);\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.Earth.js\n **/","/*\n * CRS is the base object for all defined CRS (Coordinate Reference Systems)\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.js\n */\n\nimport LatLon from '../LatLon';\nimport Point from '../Point';\nimport wrapNum from '../../util/wrapNum';\n\nconst CRS = {\n // Scale factor determines final dimensions of world space\n //\n // Projection transformation in range -1 to 1 is multiplied by scale factor to\n // find final world coordinates\n //\n // Scale factor can be considered as half the amount of the desired dimension\n // for the largest side when transformation is equal to 1 or -1, or as the\n // distance between 0 and 1 on the largest side\n //\n // For example, if you want the world dimensions to be between -1000 and 1000\n // then the scale factor will be 1000\n scaleFactor: 1000000,\n\n // Converts geo coords to pixel / WebGL ones\n latLonToPoint: function(latlon, zoom) {\n var projectedPoint = this.projection.project(latlon);\n var scale = this.scale(zoom);\n\n // Half scale if using zoom as WebGL origin is in the centre, not top left\n if (zoom) {\n scale /= 2;\n }\n\n return this.transformation._transform(projectedPoint, scale);\n },\n\n // Converts pixel / WebGL coords to geo coords\n pointToLatLon: function(point, zoom) {\n var scale = this.scale(zoom);\n\n // Half scale if using zoom as WebGL origin is in the centre, not top left\n if (zoom) {\n scale /= 2;\n }\n\n var untransformedPoint = this.transformation.untransform(point, scale);\n\n return this.projection.unproject(untransformedPoint);\n },\n\n // Converts geo coords to projection-specific coords (e.g. in meters)\n project: function(latlon) {\n return this.projection.project(latlon);\n },\n\n // Converts projected coords to geo coords\n unproject: function(point) {\n return this.projection.unproject(point);\n },\n\n // If zoom is provided, returns the map width in pixels for a given zoom\n // Else, provides fixed scale value\n scale: function(zoom) {\n // If zoom is provided then return scale based on map tile zoom\n if (zoom >= 0) {\n return 256 * Math.pow(2, zoom);\n // Else, return fixed scale value to expand projected coordinates from\n // their 0 to 1 range into something more practical\n } else {\n return this.scaleFactor;\n }\n },\n\n // Returns zoom level for a given scale value\n // This only works with a scale value that is based on map pixel width\n zoom: function(scale) {\n return Math.log(scale / 256) / Math.LN2;\n },\n\n // Returns the bounds of the world in projected coords if applicable\n getProjectedBounds: function(zoom) {\n if (this.infinite) { return null; }\n\n var b = this.projection.bounds;\n var s = this.scale(zoom);\n\n // Half scale if using zoom as WebGL origin is in the centre, not top left\n if (zoom) {\n s /= 2;\n }\n\n // Bottom left\n var min = this.transformation.transform(Point(b[0]), s);\n\n // Top right\n var max = this.transformation.transform(Point(b[1]), s);\n\n return [min, max];\n },\n\n // Whether a coordinate axis wraps in a given range (e.g. longitude from -180 to 180); depends on CRS\n // wrapLon: [min, max],\n // wrapLat: [min, max],\n\n // If true, the coordinate space will be unbounded (infinite in all directions)\n // infinite: false,\n\n // Wraps geo coords in certain ranges if applicable\n wrapLatLon: function(latlon) {\n var lat = this.wrapLat ? wrapNum(latlon.lat, this.wrapLat, true) : latlon.lat;\n var lon = this.wrapLon ? wrapNum(latlon.lon, this.wrapLon, true) : latlon.lon;\n var alt = latlon.alt;\n\n return LatLon(lat, lon, alt);\n }\n};\n\nexport default CRS;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.js\n **/","/*\n * LatLon is a helper class for ensuring consistent geographic coordinates.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/LatLng.js\n */\n\nclass LatLon {\n constructor(lat, lon, alt) {\n if (isNaN(lat) || isNaN(lon)) {\n throw new Error('Invalid LatLon object: (' + lat + ', ' + lon + ')');\n }\n\n this.lat = +lat;\n this.lon = +lon;\n\n if (alt !== undefined) {\n this.alt = +alt;\n }\n }\n\n clone() {\n return new LatLon(this.lat, this.lon, this.alt);\n }\n}\n\n// Initialise without requiring new keyword\n//\n// Accepts (LatLon), ([lat, lon, alt]), ([lat, lon]) and (lat, lon, alt)\n// Also converts between lng and lon\nexport default function(a, b, c) {\n if (a instanceof LatLon) {\n return a;\n }\n if (Array.isArray(a) && typeof a[0] !== 'object') {\n if (a.length === 3) {\n return new LatLon(a[0], a[1], a[2]);\n }\n if (a.length === 2) {\n return new LatLon(a[0], a[1]);\n }\n return null;\n }\n if (a === undefined || a === null) {\n return a;\n }\n if (typeof a === 'object' && 'lat' in a) {\n return new LatLon(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);\n }\n if (b === undefined) {\n return null;\n }\n return new LatLon(a, b, c);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/LatLon.js\n **/","/*\n * Point is a helper class for ensuring consistent world positions.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/Point.js\n */\n\nclass Point {\n constructor(x, y, round) {\n this.x = (round ? Math.round(x) : x);\n this.y = (round ? Math.round(y) : y);\n }\n\n clone() {\n return new Point(this.x, this.y);\n }\n\n // Non-destructive\n add(point) {\n return this.clone()._add(_point(point));\n }\n\n // Destructive\n _add(point) {\n this.x += point.x;\n this.y += point.y;\n return this;\n }\n\n // Non-destructive\n subtract(point) {\n return this.clone()._subtract(_point(point));\n }\n\n // Destructive\n _subtract(point) {\n this.x -= point.x;\n this.y -= point.y;\n return this;\n }\n}\n\n// Accepts (point), ([x, y]) and (x, y, round)\nvar _point = function(x, y, round) {\n if (x instanceof Point) {\n return x;\n }\n if (Array.isArray(x)) {\n return new Point(x[0], x[1]);\n }\n if (x === undefined || x === null) {\n return x;\n }\n return new Point(x, y, round);\n};\n\n// Initialise without requiring new keyword\nexport default _point;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/Point.js\n **/","/*\n * Wrap the given number to lie within a certain range (eg. longitude)\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/core/Util.js\n */\n\nconst wrapNum = function(x, range, includeMax) {\n var max = range[1];\n var min = range[0];\n var d = max - min;\n return x === max && includeMax ? x : ((x - min) % d + d) % d + min;\n};\n\nexport default wrapNum;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/util/wrapNum.js\n **/","/*\n * Spherical Mercator is the most popular map projection, used by EPSG:3857 CRS\n * used by default.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.SphericalMercator.js\n */\n\nimport LatLon from '../LatLon';\nimport Point from '../Point';\n\nconst SphericalMercator = {\n // Radius / WGS84 semi-major axis\n R: 6378137,\n MAX_LATITUDE: 85.0511287798,\n\n // WGS84 eccentricity\n ECC: 0.081819191,\n ECC2: 0.081819191 * 0.081819191,\n\n project: function(latlon) {\n var d = Math.PI / 180;\n var max = this.MAX_LATITUDE;\n var lat = Math.max(Math.min(max, latlon.lat), -max);\n var sin = Math.sin(lat * d);\n\n return Point(\n this.R * latlon.lon * d,\n this.R * Math.log((1 + sin) / (1 - sin)) / 2\n );\n },\n\n unproject: function(point) {\n var d = 180 / Math.PI;\n\n return LatLon(\n (2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\n point.x * d / this.R\n );\n },\n\n // Scale factor for converting between real metres and projected metres\n //\n // projectedMetres = realMetres * pointScale\n // realMetres = projectedMetres / pointScale\n //\n // Accurate scale factor uses proper Web Mercator scaling\n // See pg.9: http://www.hydrometronics.com/downloads/Web%20Mercator%20-%20Non-Conformal,%20Non-Mercator%20(notes).pdf\n // See: http://jsfiddle.net/robhawkes/yws924cf/\n pointScale: function(latlon, accurate) {\n var rad = Math.PI / 180;\n\n var k;\n\n if (!accurate) {\n k = 1 / Math.cos(latlon.lat * rad);\n\n // [scaleX, scaleY]\n return [k, k];\n } else {\n var lat = latlon.lat * rad;\n var lon = latlon.lon * rad;\n\n var a = this.R;\n\n var sinLat = Math.sin(lat);\n var sinLat2 = sinLat * sinLat;\n\n var cosLat = Math.cos(lat);\n\n // Radius meridian\n var p = a * (1 - this.ECC2) / Math.pow(1 - this.ECC2 * sinLat2, 3 / 2);\n\n // Radius prime meridian\n var v = a / Math.sqrt(1 - this.ECC2 * sinLat2);\n\n // Scale N/S\n var h = (a / p) / cosLat;\n\n // Scale E/W\n k = (a / v) / cosLat;\n\n // [scaleX, scaleY]\n return [k, h];\n }\n },\n\n // Not using this.R due to scoping\n bounds: (function() {\n var d = 6378137 * Math.PI;\n return [[-d, -d], [d, d]];\n })()\n};\n\nexport default SphericalMercator;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/projection/Projection.SphericalMercator.js\n **/","/*\n * Transformation is an utility class to perform simple point transformations\n * through a 2d-matrix.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geometry/Transformation.js\n */\n\nimport Point from '../geo/Point';\n\nclass Transformation {\n constructor(a, b, c, d) {\n this._a = a;\n this._b = b;\n this._c = c;\n this._d = d;\n }\n\n transform(point, scale) {\n // Copy input point as to not destroy the original data\n return this._transform(point.clone(), scale);\n }\n\n // Destructive transform (faster)\n _transform(point, scale) {\n scale = scale || 1;\n\n point.x = scale * (this._a * point.x + this._b);\n point.y = scale * (this._c * point.y + this._d);\n return point;\n }\n\n untransform(point, scale) {\n scale = scale || 1;\n return Point(\n (point.x / scale - this._b) / this._a,\n (point.y / scale - this._d) / this._c\n );\n }\n}\n\nexport default Transformation;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/util/Transformation.js\n **/","/*\n * CRS.EPSG3395 (WGS 84 / World Mercator) CRS implementation.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG3395.js\n */\n\nimport extend from 'lodash.assign';\nimport Earth from './CRS.Earth';\nimport Mercator from '../projection/Projection.Mercator';\nimport Transformation from '../../util/Transformation';\n\nvar _EPSG3395 = {\n code: 'EPSG:3395',\n projection: Mercator,\n\n // Work out how to de-dupe this (scoping issue)\n transformScale: 1 / (Math.PI * Mercator.R),\n\n // Scale and transformation inputs changed to account for central origin in\n // WebGL, instead of top-left origin used in Leaflet\n transformation: (function() {\n // TODO: Cannot use this.transformScale due to scope\n var scale = 1 / (Math.PI * Mercator.R);\n\n return new Transformation(scale, 0, -scale, 0);\n }())\n};\n\nconst EPSG3395 = extend({}, Earth, _EPSG3395);\n\nexport default EPSG3395;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.EPSG3395.js\n **/","/*\n * Mercator projection that takes into account that the Earth is not a perfect\n * sphere. Less popular than spherical mercator; used by projections like\n * EPSG:3395.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.Mercator.js\n */\n\nimport LatLon from '../LatLon';\nimport Point from '../Point';\n\nconst Mercator = {\n // Radius / WGS84 semi-major axis\n R: 6378137,\n R_MINOR: 6356752.314245179,\n\n // WGS84 eccentricity\n ECC: 0.081819191,\n ECC2: 0.081819191 * 0.081819191,\n\n project: function(latlon) {\n var d = Math.PI / 180;\n var r = this.R;\n var y = latlon.lat * d;\n var tmp = this.R_MINOR / r;\n var e = Math.sqrt(1 - tmp * tmp);\n var con = e * Math.sin(y);\n\n var ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2);\n y = -r * Math.log(Math.max(ts, 1E-10));\n\n return Point(latlon.lon * d * r, y);\n },\n\n unproject: function(point) {\n var d = 180 / Math.PI;\n var r = this.R;\n var tmp = this.R_MINOR / r;\n var e = Math.sqrt(1 - tmp * tmp);\n var ts = Math.exp(-point.y / r);\n var phi = Math.PI / 2 - 2 * Math.atan(ts);\n\n for (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {\n con = e * Math.sin(phi);\n con = Math.pow((1 - con) / (1 + con), e / 2);\n dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;\n phi += dphi;\n }\n\n return LatLon(phi * d, point.x * d / r);\n },\n\n // Scale factor for converting between real metres and projected metres\n //\n // projectedMetres = realMetres * pointScale\n // realMetres = projectedMetres / pointScale\n //\n // See pg.8: http://www.hydrometronics.com/downloads/Web%20Mercator%20-%20Non-Conformal,%20Non-Mercator%20(notes).pdf\n pointScale: function(latlon) {\n var rad = Math.PI / 180;\n var lat = latlon.lat * rad;\n var sinLat = Math.sin(lat);\n var sinLat2 = sinLat * sinLat;\n var cosLat = Math.cos(lat);\n\n var k = Math.sqrt(1 - this.ECC2 * sinLat2) / cosLat;\n\n // [scaleX, scaleY]\n return [k, k];\n },\n\n bounds: [[-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]]\n};\n\nexport default Mercator;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/projection/Projection.Mercator.js\n **/","/*\n * CRS.EPSG4326 is a CRS popular among advanced GIS specialists.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.EPSG4326.js\n */\n\nimport extend from 'lodash.assign';\nimport Earth from './CRS.Earth';\nimport LatLonProjection from '../projection/Projection.LatLon';\nimport Transformation from '../../util/Transformation';\n\nvar _EPSG4326 = {\n code: 'EPSG:4326',\n projection: LatLonProjection,\n\n // Work out how to de-dupe this (scoping issue)\n transformScale: 1 / 180,\n\n // Scale and transformation inputs changed to account for central origin in\n // WebGL, instead of top-left origin used in Leaflet\n //\n // TODO: Cannot use this.transformScale due to scope\n transformation: new Transformation(1 / 180, 0, -1 / 180, 0)\n};\n\nconst EPSG4326 = extend({}, Earth, _EPSG4326);\n\nexport default EPSG4326;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.EPSG4326.js\n **/","/*\n * Simple equirectangular (Plate Carree) projection, used by CRS like EPSG:4326\n * and Simple.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/projection/Projection.LonLat.js\n */\n\nimport LatLon from '../LatLon';\nimport Point from '../Point';\n\nconst ProjectionLatLon = {\n project: function(latlon) {\n return Point(latlon.lon, latlon.lat);\n },\n\n unproject: function(point) {\n return LatLon(point.y, point.x);\n },\n\n // Scale factor for converting between real metres and degrees\n //\n // degrees = realMetres * pointScale\n // realMetres = degrees / pointScale\n //\n // See: http://stackoverflow.com/questions/639695/how-to-convert-latitude-or-longitude-to-meters\n // See: http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from\n pointScale: function(latlon) {\n var m1 = 111132.92;\n var m2 = -559.82;\n var m3 = 1.175;\n var m4 = -0.0023;\n var p1 = 111412.84;\n var p2 = -93.5;\n var p3 = 0.118;\n\n var rad = Math.PI / 180;\n var lat = latlon.lat * rad;\n\n var latlen = m1 + m2 * Math.cos(2 * lat) + m3 * Math.cos(4 * lat) + m4 * Math.cos(6 * lat);\n var lonlen = p1 * Math.cos(lat) + p2 * Math.cos(3 * lat) + p3 * Math.cos(5 * lat);\n\n return [1 / latlen, 1 / lonlen];\n },\n\n bounds: [[-180, -90], [180, 90]]\n};\n\nexport default ProjectionLatLon;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/projection/Projection.LatLon.js\n **/","/*\n * A simple CRS that can be used for flat non-Earth maps like panoramas or game\n * maps.\n *\n * Based on:\n * https://github.com/Leaflet/Leaflet/blob/master/src/geo/crs/CRS.Simple.js\n */\n\nimport extend from 'lodash.assign';\nimport CRS from './CRS';\nimport LatLonProjection from '../projection/Projection.LatLon';\nimport Transformation from '../../util/Transformation';\n\nvar _Simple = {\n projection: LatLonProjection,\n\n // Straight 1:1 mapping (-1, -1 would be top-left)\n transformation: new Transformation(1, 0, 1, 0),\n\n scale: function(zoom) {\n // If zoom is provided then return scale based on map tile zoom\n if (zoom) {\n return Math.pow(2, zoom);\n // Else, make no change to scale – may need to increase this or make it a\n // user-definable variable\n } else {\n return 1;\n }\n },\n\n zoom: function(scale) {\n return Math.log(scale) / Math.LN2;\n },\n\n distance: function(latlon1, latlon2) {\n var dx = latlon2.lon - latlon1.lon;\n var dy = latlon2.lat - latlon1.lat;\n\n return Math.sqrt(dx * dx + dy * dy);\n },\n\n infinite: true\n};\n\nconst Simple = extend({}, CRS, _Simple);\n\nexport default Simple;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.Simple.js\n **/","/*\n * CRS.Proj4 for any Proj4-supported CRS.\n */\n\nimport extend from 'lodash.assign';\nimport Earth from './CRS.Earth';\nimport Proj4Projection from '../projection/Projection.Proj4';\nimport Transformation from '../../util/Transformation';\n\nvar _Proj4 = function(code, def, bounds) {\n var projection = Proj4Projection(def, bounds);\n\n // Transformation calcuations\n var diffX = projection.bounds[1][0] - projection.bounds[0][0];\n var diffY = projection.bounds[1][1] - projection.bounds[0][1];\n\n var halfX = diffX / 2;\n var halfY = diffY / 2;\n\n // This is the raw scale factor\n var scaleX = 1 / halfX;\n var scaleY = 1 / halfY;\n\n // Find the minimum scale factor\n //\n // The minimum scale factor comes from the largest side and is the one\n // you want to use for both axis so they stay relative in dimension\n var scale = Math.min(scaleX, scaleY);\n\n // Find amount to offset each axis by to make the central point lie on\n // the [0,0] origin\n var offsetX = scale * (projection.bounds[0][0] + halfX);\n var offsetY = scale * (projection.bounds[0][1] + halfY);\n\n return {\n code: code,\n projection: projection,\n\n transformScale: scale,\n\n // Map the input to a [-1,1] range with [0,0] in the centre\n transformation: new Transformation(scale, -offsetX, -scale, offsetY)\n };\n};\n\nconst Proj4 = function(code, def, bounds) {\n return extend({}, Earth, _Proj4(code, def, bounds));\n};\n\nexport default Proj4;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/CRS/CRS.Proj4.js\n **/","/*\n * Proj4 support for any projection.\n */\n\nimport proj4 from 'proj4';\nimport LatLon from '../LatLon';\nimport Point from '../Point';\n\nconst Proj4 = function(def, bounds) {\n var proj = proj4(def);\n\n var project = function(latlon) {\n return Point(proj.forward([latlon.lon, latlon.lat]));\n };\n\n var unproject = function(point) {\n var inverse = proj.inverse([point.x, point.y]);\n return LatLon(inverse[1], inverse[0]);\n };\n\n return {\n project: project,\n unproject: unproject,\n\n // Scale factor for converting between real metres and projected metres\\\n //\n // Need to work out the best way to provide the pointScale calculations\n // for custom, unknown projections (if wanting to override default)\n //\n // For now, user can manually override crs.pointScale or\n // crs.projection.pointScale\n //\n // projectedMetres = realMetres * pointScale\n // realMetres = projectedMetres / pointScale\n pointScale: function(latlon, accurate) {\n return [1, 1];\n },\n\n // Try and calculate bounds if none are provided\n //\n // This will provide incorrect bounds for some projections, so perhaps make\n // bounds a required input instead\n bounds: (function() {\n if (bounds) {\n return bounds;\n } else {\n var bottomLeft = project([-90, -180]);\n var topRight = project([90, 180]);\n\n return [bottomLeft, topRight];\n }\n })()\n };\n};\n\nexport default Proj4;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/geo/projection/Projection.Proj4.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_22__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"proj4\"\n ** module id = 22\n ** module chunks = 0\n **/","import EventEmitter from 'eventemitter3';\nimport THREE from 'three';\nimport Scene from './Scene';\nimport Renderer from './Renderer';\nimport Camera from './Camera';\n\nclass Engine extends EventEmitter {\n constructor(container) {\n console.log('Init Engine');\n\n super();\n\n this._scene = Scene;\n this._renderer = Renderer(container);\n this._camera = Camera(container);\n this.clock = new THREE.Clock();\n\n this._frustum = new THREE.Frustum();\n }\n\n update(delta) {\n this.emit('preRender');\n this._renderer.render(this._scene, this._camera);\n this.emit('postRender');\n }\n}\n\n// Initialise without requiring new keyword\nexport default function(container) {\n return new Engine(container);\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/engine/Engine.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_24__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"THREE\"\n ** module id = 24\n ** module chunks = 0\n **/","import THREE from 'three';\n\n// This can be imported from anywhere and will still reference the same scene,\n// though there is a helper reference in Engine.scene\n\nexport default (function() {\n var scene = new THREE.Scene();\n scene.fog = new THREE.Fog(0xffffff, 1, 15000);\n return scene;\n})();\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/engine/Scene.js\n **/","import THREE from 'three';\nimport Scene from './Scene';\n\n// This can only be accessed from Engine.renderer if you want to reference the\n// same scene in multiple places\n\nexport default function(container) {\n var renderer = new THREE.WebGLRenderer({\n antialias: true\n });\n\n renderer.setClearColor(Scene.fog.color, 1);\n\n // Gamma settings make things look nicer\n renderer.gammaInput = true;\n renderer.gammaOutput = true;\n\n container.appendChild(renderer.domElement);\n\n var updateSize = function() {\n renderer.setSize(container.clientWidth, container.clientHeight);\n };\n\n window.addEventListener('resize', updateSize, false);\n updateSize();\n\n return renderer;\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/engine/Renderer.js\n **/","import THREE from 'three';\n\n// This can only be accessed from Engine.camera if you want to reference the\n// same scene in multiple places\n\nexport default function(container) {\n var camera = new THREE.PerspectiveCamera(40, 1, 1, 40000);\n camera.position.y = 400;\n camera.position.z = 400;\n\n var updateSize = function() {\n camera.aspect = container.clientWidth / container.clientHeight;\n camera.updateProjectionMatrix();\n };\n\n window.addEventListener('resize', updateSize, false);\n updateSize();\n\n return camera;\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/engine/Camera.js\n **/","import Orbit from './Controls.Orbit';\n\nconst Controls = {\n Orbit: Orbit\n};\n\nexport default Controls;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/controls/index.js\n **/","import EventEmitter from 'eventemitter3';\nimport THREE from 'three';\nimport OrbitControls from 'three-orbit-controls';\n\nvar _OrbitControls = OrbitControls(THREE);\n\nclass Orbit extends EventEmitter {\n constructor() {\n super();\n }\n\n // Proxy control events\n //\n // There's currently no distinction between pan, orbit and zoom events\n _initEvents() {\n this._controls.addEventListener('start', (event) => {\n this._world.emit('controlsMoveStart', event.target.center);\n });\n\n this._controls.addEventListener('change', (event) => {\n this._world.emit('controlsMove', event.target.center);\n });\n\n this._controls.addEventListener('end', (event) => {\n this._world.emit('controlsMoveEnd', event.target.center);\n });\n }\n\n // Moving the camera along the [x,y,z] axis based on a target position\n _panTo(point, animate) {}\n _panBy(pointDelta, animate) {}\n\n // Zooming the camera in and out\n _zoomTo(metres, animate) {}\n _zoomBy(metresDelta, animate) {}\n\n // Force camera to look at something other than the target\n _lookAt(point, animate) {}\n\n // Make camera look at the target\n _lookAtTarget() {}\n\n // Tilt (up and down)\n _tiltTo(angle, animate) {}\n _tiltBy(angleDelta, animate) {}\n\n // Rotate (left and right)\n _rotateTo(angle, animate) {}\n _rotateBy(angleDelta, animate) {}\n\n // Fly to the given point, animating pan and tilt/rotation to final position\n // with nice zoom out and in\n //\n // Calling flyTo a second time before the previous animation has completed\n // will immediately start the new animation from wherever the previous one\n // has got to\n _flyTo(point, noZoom) {}\n\n // Proxy to OrbitControls.update()\n update() {\n this._controls.update();\n }\n\n // Add controls to world instance and store world reference\n addTo(world) {\n world.addControls(this);\n return this;\n }\n\n // Internal method called by World.addControls to actually add the controls\n _addToWorld(world) {\n this._world = world;\n\n // TODO: Override panLeft and panUp methods to prevent panning on Y axis\n // See: http://stackoverflow.com/a/26188674/997339\n this._controls = new _OrbitControls(world._engine._camera, world._container);\n\n // Disable keys for now as no events are fired for them anyway\n this._controls.keys = false;\n\n // 89 degrees\n this._controls.maxPolarAngle = 1.5533;\n\n // this._controls.enableDamping = true;\n // this._controls.dampingFactor = 0.25;\n\n this._initEvents();\n\n this.emit('added');\n }\n}\n\n// Initialise without requiring new keyword\nexport default function() {\n return new Orbit();\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/controls/Controls.Orbit.js\n **/","module.exports = function(THREE) {\n\tvar MOUSE = THREE.MOUSE\n\tif (!MOUSE)\n\t\tMOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };\n\n\t/**\n\t * @author qiao / https://github.com/qiao\n\t * @author mrdoob / http://mrdoob.com\n\t * @author alteredq / http://alteredqualia.com/\n\t * @author WestLangley / http://github.com/WestLangley\n\t * @author erich666 / http://erichaines.com\n\t */\n\t/*global THREE, console */\n\n\tfunction OrbitConstraint ( object ) {\n\n\t\tthis.object = object;\n\n\t\t// \"target\" sets the location of focus, where the object orbits around\n\t\t// and where it pans with respect to.\n\t\tthis.target = new THREE.Vector3();\n\n\t\t// Limits to how far you can dolly in and out ( PerspectiveCamera only )\n\t\tthis.minDistance = 0;\n\t\tthis.maxDistance = Infinity;\n\n\t\t// Limits to how far you can zoom in and out ( OrthographicCamera only )\n\t\tthis.minZoom = 0;\n\t\tthis.maxZoom = Infinity;\n\n\t\t// How far you can orbit vertically, upper and lower limits.\n\t\t// Range is 0 to Math.PI radians.\n\t\tthis.minPolarAngle = 0; // radians\n\t\tthis.maxPolarAngle = Math.PI; // radians\n\n\t\t// How far you can orbit horizontally, upper and lower limits.\n\t\t// If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].\n\t\tthis.minAzimuthAngle = - Infinity; // radians\n\t\tthis.maxAzimuthAngle = Infinity; // radians\n\n\t\t// Set to true to enable damping (inertia)\n\t\t// If damping is enabled, you must call controls.update() in your animation loop\n\t\tthis.enableDamping = false;\n\t\tthis.dampingFactor = 0.25;\n\n\t\t////////////\n\t\t// internals\n\n\t\tvar scope = this;\n\n\t\tvar EPS = 0.000001;\n\n\t\t// Current position in spherical coordinate system.\n\t\tvar theta;\n\t\tvar phi;\n\n\t\t// Pending changes\n\t\tvar phiDelta = 0;\n\t\tvar thetaDelta = 0;\n\t\tvar scale = 1;\n\t\tvar panOffset = new THREE.Vector3();\n\t\tvar zoomChanged = false;\n\n\t\t// API\n\n\t\tthis.getPolarAngle = function () {\n\n\t\t\treturn phi;\n\n\t\t};\n\n\t\tthis.getAzimuthalAngle = function () {\n\n\t\t\treturn theta;\n\n\t\t};\n\n\t\tthis.rotateLeft = function ( angle ) {\n\n\t\t\tthetaDelta -= angle;\n\n\t\t};\n\n\t\tthis.rotateUp = function ( angle ) {\n\n\t\t\tphiDelta -= angle;\n\n\t\t};\n\n\t\t// pass in distance in world space to move left\n\t\tthis.panLeft = function() {\n\n\t\t\tvar v = new THREE.Vector3();\n\n\t\t return function panLeft(distance) {\n\t\t var te = this.object.matrix.elements;\n\t\t var adjDist = distance / Math.cos(phi);\n\n\t\t v.set(te[ 0 ], 0, te[ 2 ]).normalize();\n\t\t v.multiplyScalar(-adjDist);\n\n\t\t panOffset.add(v);\n\t\t };\n\n\t\t}();\n\n\t\t// pass in distance in world space to move up\n\t\tthis.panUp = function() {\n\n\t\t\tvar v = new THREE.Vector3();\n\n\t\t return function panUp(distance) {\n\t\t var te = this.object.matrix.elements;\n\t\t var adjDist = distance / Math.cos(phi);\n\n\t\t v.set(te[ 8 ], 0, te[ 10 ]).normalize();\n\t\t v.multiplyScalar(-adjDist);\n\n\t\t panOffset.add(v);\n\t\t };\n\n\t\t}();\n\n\t\t// pass in x,y of change desired in pixel space,\n\t\t// right and down are positive\n\t\tthis.pan = function ( deltaX, deltaY, screenWidth, screenHeight ) {\n\n\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\t// perspective\n\t\t\t\tvar position = scope.object.position;\n\t\t\t\tvar offset = position.clone().sub( scope.target );\n\t\t\t\tvar targetDistance = offset.length();\n\n\t\t\t\t// half of the fov is center to top of screen\n\t\t\t\ttargetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );\n\n\t\t\t\t// we actually don't use screenWidth, since perspective camera is fixed to screen height\n\t\t\t\tscope.panLeft( 2 * deltaX * targetDistance / screenHeight );\n\t\t\t\tscope.panUp( 2 * deltaY * targetDistance / screenHeight );\n\n\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\t// orthographic\n\t\t\t\tscope.panLeft( deltaX * ( scope.object.right - scope.object.left ) / screenWidth );\n\t\t\t\tscope.panUp( deltaY * ( scope.object.top - scope.object.bottom ) / screenHeight );\n\n\t\t\t} else {\n\n\t\t\t\t// camera neither orthographic or perspective\n\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.dollyIn = function ( dollyScale ) {\n\n\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\tscale /= dollyScale;\n\n\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\tscope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom * dollyScale ) );\n\t\t\t\tscope.object.updateProjectionMatrix();\n\t\t\t\tzoomChanged = true;\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.dollyOut = function ( dollyScale ) {\n\n\t\t\tif ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n\t\t\t\tscale *= dollyScale;\n\n\t\t\t} else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n\t\t\t\tscope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / dollyScale ) );\n\t\t\t\tscope.object.updateProjectionMatrix();\n\t\t\t\tzoomChanged = true;\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.update = function() {\n\n\t\t\tvar offset = new THREE.Vector3();\n\n\t\t\t// so camera.up is the orbit axis\n\t\t\tvar quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );\n\t\t\tvar quatInverse = quat.clone().inverse();\n\n\t\t\tvar lastPosition = new THREE.Vector3();\n\t\t\tvar lastQuaternion = new THREE.Quaternion();\n\n\t\t\treturn function () {\n\n\t\t\t\tvar position = this.object.position;\n\n\t\t\t\toffset.copy( position ).sub( this.target );\n\n\t\t\t\t// rotate offset to \"y-axis-is-up\" space\n\t\t\t\toffset.applyQuaternion( quat );\n\n\t\t\t\t// angle from z-axis around y-axis\n\n\t\t\t\ttheta = Math.atan2( offset.x, offset.z );\n\n\t\t\t\t// angle from y-axis\n\n\t\t\t\tphi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y );\n\n\t\t\t\ttheta += thetaDelta;\n\t\t\t\tphi += phiDelta;\n\n\t\t\t\t// restrict theta to be between desired limits\n\t\t\t\ttheta = Math.max( this.minAzimuthAngle, Math.min( this.maxAzimuthAngle, theta ) );\n\n\t\t\t\t// restrict phi to be between desired limits\n\t\t\t\tphi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );\n\n\t\t\t\t// restrict phi to be betwee EPS and PI-EPS\n\t\t\t\tphi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\n\t\t\t\tvar radius = offset.length() * scale;\n\n\t\t\t\t// restrict radius to be between desired limits\n\t\t\t\tradius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) );\n\n\t\t\t\t// move target to panned location\n\t\t\t\tthis.target.add( panOffset );\n\n\t\t\t\toffset.x = radius * Math.sin( phi ) * Math.sin( theta );\n\t\t\t\toffset.y = radius * Math.cos( phi );\n\t\t\t\toffset.z = radius * Math.sin( phi ) * Math.cos( theta );\n\n\t\t\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\t\t\toffset.applyQuaternion( quatInverse );\n\n\t\t\t\tposition.copy( this.target ).add( offset );\n\n\t\t\t\tthis.object.lookAt( this.target );\n\n\t\t\t\tif ( this.enableDamping === true ) {\n\n\t\t\t\t\tthetaDelta *= ( 1 - this.dampingFactor );\n\t\t\t\t\tphiDelta *= ( 1 - this.dampingFactor );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthetaDelta = 0;\n\t\t\t\t\tphiDelta = 0;\n\n\t\t\t\t}\n\n\t\t\t\tscale = 1;\n\t\t\t\tpanOffset.set( 0, 0, 0 );\n\n\t\t\t\t// update condition is:\n\t\t\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n\t\t\t\tif ( zoomChanged ||\n\t\t\t\t\t lastPosition.distanceToSquared( this.object.position ) > EPS ||\n\t\t\t\t\t8 * ( 1 - lastQuaternion.dot( this.object.quaternion ) ) > EPS ) {\n\n\t\t\t\t\tlastPosition.copy( this.object.position );\n\t\t\t\t\tlastQuaternion.copy( this.object.quaternion );\n\t\t\t\t\tzoomChanged = false;\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\n\t\t\t};\n\n\t\t}();\n\n\t};\n\n\n\t// This set of controls performs orbiting, dollying (zooming), and panning. It maintains\n\t// the \"up\" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is\n\t// supported.\n\t//\n\t// Orbit - left mouse / touch: one finger move\n\t// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n\t// Pan - right mouse, or arrow keys / touch: three finter swipe\n\n\tfunction OrbitControls ( object, domElement ) {\n\n\t\tvar constraint = new OrbitConstraint( object );\n\n\t\tthis.domElement = ( domElement !== undefined ) ? domElement : document;\n\n\t\t// API\n\n\t\tObject.defineProperty( this, 'constraint', {\n\n\t\t\tget: function() {\n\n\t\t\t\treturn constraint;\n\n\t\t\t}\n\n\t\t} );\n\n\t\tthis.getPolarAngle = function () {\n\n\t\t\treturn constraint.getPolarAngle();\n\n\t\t};\n\n\t\tthis.getAzimuthalAngle = function () {\n\n\t\t\treturn constraint.getAzimuthalAngle();\n\n\t\t};\n\n\t\t// Set to false to disable this control\n\t\tthis.enabled = true;\n\n\t\t// center is old, deprecated; use \"target\" instead\n\t\tthis.center = this.target;\n\n\t\t// This option actually enables dollying in and out; left as \"zoom\" for\n\t\t// backwards compatibility.\n\t\t// Set to false to disable zooming\n\t\tthis.enableZoom = true;\n\t\tthis.zoomSpeed = 1.0;\n\n\t\t// Set to false to disable rotating\n\t\tthis.enableRotate = true;\n\t\tthis.rotateSpeed = 1.0;\n\n\t\t// Set to false to disable panning\n\t\tthis.enablePan = true;\n\t\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\n\t\t// Set to true to automatically rotate around the target\n\t\t// If auto-rotate is enabled, you must call controls.update() in your animation loop\n\t\tthis.autoRotate = false;\n\t\tthis.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\n\t\t// Set to false to disable use of the keys\n\t\tthis.enableKeys = true;\n\n\t\t// The four arrow keys\n\t\tthis.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\n\t\t// Mouse buttons\n\t\tthis.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };\n\n\t\t////////////\n\t\t// internals\n\n\t\tvar scope = this;\n\n\t\tvar rotateStart = new THREE.Vector2();\n\t\tvar rotateEnd = new THREE.Vector2();\n\t\tvar rotateDelta = new THREE.Vector2();\n\n\t\tvar panStart = new THREE.Vector2();\n\t\tvar panEnd = new THREE.Vector2();\n\t\tvar panDelta = new THREE.Vector2();\n\n\t\tvar dollyStart = new THREE.Vector2();\n\t\tvar dollyEnd = new THREE.Vector2();\n\t\tvar dollyDelta = new THREE.Vector2();\n\n\t\tvar STATE = { NONE : - 1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };\n\n\t\tvar state = STATE.NONE;\n\n\t\t// for reset\n\n\t\tthis.target0 = this.target.clone();\n\t\tthis.position0 = this.object.position.clone();\n\t\tthis.zoom0 = this.object.zoom;\n\n\t\t// events\n\n\t\tvar changeEvent = { type: 'change' };\n\t\tvar startEvent = { type: 'start' };\n\t\tvar endEvent = { type: 'end' };\n\n\t\t// pass in x,y of change desired in pixel space,\n\t\t// right and down are positive\n\t\tfunction pan( deltaX, deltaY ) {\n\n\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\t\tconstraint.pan( deltaX, deltaY, element.clientWidth, element.clientHeight );\n\n\t\t}\n\n\t\tthis.update = function () {\n\n\t\t\tif ( this.autoRotate && state === STATE.NONE ) {\n\n\t\t\t\tconstraint.rotateLeft( getAutoRotationAngle() );\n\n\t\t\t}\n\n\t\t\tif ( constraint.update() === true ) {\n\n\t\t\t\tthis.dispatchEvent( changeEvent );\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.reset = function () {\n\n\t\t\tstate = STATE.NONE;\n\n\t\t\tthis.target.copy( this.target0 );\n\t\t\tthis.object.position.copy( this.position0 );\n\t\t\tthis.object.zoom = this.zoom0;\n\n\t\t\tthis.object.updateProjectionMatrix();\n\t\t\tthis.dispatchEvent( changeEvent );\n\n\t\t\tthis.update();\n\n\t\t};\n\n\t\tfunction getAutoRotationAngle() {\n\n\t\t\treturn 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\n\t\t}\n\n\t\tfunction getZoomScale() {\n\n\t\t\treturn Math.pow( 0.95, scope.zoomSpeed );\n\n\t\t}\n\n\t\tfunction onMouseDown( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tevent.preventDefault();\n\n\t\t\tif ( event.button === scope.mouseButtons.ORBIT ) {\n\n\t\t\t\tif ( scope.enableRotate === false ) return;\n\n\t\t\t\tstate = STATE.ROTATE;\n\n\t\t\t\trotateStart.set( event.clientX, event.clientY );\n\n\t\t\t} else if ( event.button === scope.mouseButtons.ZOOM ) {\n\n\t\t\t\tif ( scope.enableZoom === false ) return;\n\n\t\t\t\tstate = STATE.DOLLY;\n\n\t\t\t\tdollyStart.set( event.clientX, event.clientY );\n\n\t\t\t} else if ( event.button === scope.mouseButtons.PAN ) {\n\n\t\t\t\tif ( scope.enablePan === false ) return;\n\n\t\t\t\tstate = STATE.PAN;\n\n\t\t\t\tpanStart.set( event.clientX, event.clientY );\n\n\t\t\t}\n\n\t\t\tif ( state !== STATE.NONE ) {\n\n\t\t\t\tdocument.addEventListener( 'mousemove', onMouseMove, false );\n\t\t\t\tdocument.addEventListener( 'mouseup', onMouseUp, false );\n\t\t\t\tscope.dispatchEvent( startEvent );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onMouseMove( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tevent.preventDefault();\n\n\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\t\tif ( state === STATE.ROTATE ) {\n\n\t\t\t\tif ( scope.enableRotate === false ) return;\n\n\t\t\t\trotateEnd.set( event.clientX, event.clientY );\n\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\tconstraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\n\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\tconstraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\t\trotateStart.copy( rotateEnd );\n\n\t\t\t} else if ( state === STATE.DOLLY ) {\n\n\t\t\t\tif ( scope.enableZoom === false ) return;\n\n\t\t\t\tdollyEnd.set( event.clientX, event.clientY );\n\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\n\t\t\t\t} else if ( dollyDelta.y < 0 ) {\n\n\t\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\n\t\t\t\t}\n\n\t\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t\t} else if ( state === STATE.PAN ) {\n\n\t\t\t\tif ( scope.enablePan === false ) return;\n\n\t\t\t\tpanEnd.set( event.clientX, event.clientY );\n\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\n\t\t\t\tpan( panDelta.x, panDelta.y );\n\n\t\t\t\tpanStart.copy( panEnd );\n\n\t\t\t}\n\n\t\t\tif ( state !== STATE.NONE ) scope.update();\n\n\t\t}\n\n\t\tfunction onMouseUp( /* event */ ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\t\t\tscope.dispatchEvent( endEvent );\n\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t\tfunction onMouseWheel( event ) {\n\n\t\t\tif ( scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE ) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tvar delta = 0;\n\n\t\t\tif ( event.wheelDelta !== undefined ) {\n\n\t\t\t\t// WebKit / Opera / Explorer 9\n\n\t\t\t\tdelta = event.wheelDelta;\n\n\t\t\t} else if ( event.detail !== undefined ) {\n\n\t\t\t\t// Firefox\n\n\t\t\t\tdelta = - event.detail;\n\n\t\t\t}\n\n\t\t\tif ( delta > 0 ) {\n\n\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\n\t\t\t} else if ( delta < 0 ) {\n\n\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\n\t\t\t}\n\n\t\t\tscope.update();\n\t\t\tscope.dispatchEvent( startEvent );\n\t\t\tscope.dispatchEvent( endEvent );\n\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\n\t\t\tif ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return;\n\n\t\t\tswitch ( event.keyCode ) {\n\n\t\t\t\tcase scope.keys.UP:\n\t\t\t\t\tpan( 0, scope.keyPanSpeed );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase scope.keys.BOTTOM:\n\t\t\t\t\tpan( 0, - scope.keyPanSpeed );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase scope.keys.LEFT:\n\t\t\t\t\tpan( scope.keyPanSpeed, 0 );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase scope.keys.RIGHT:\n\t\t\t\t\tpan( - scope.keyPanSpeed, 0 );\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction touchstart( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tswitch ( event.touches.length ) {\n\n\t\t\t\tcase 1:\t// one-fingered touch: rotate\n\n\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\n\t\t\t\t\tstate = STATE.TOUCH_ROTATE;\n\n\t\t\t\t\trotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\t// two-fingered touch: dolly\n\n\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\n\t\t\t\t\tstate = STATE.TOUCH_DOLLY;\n\n\t\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\t\t\t\t\tdollyStart.set( 0, distance );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\t\tif ( scope.enablePan === false ) return;\n\n\t\t\t\t\tstate = STATE.TOUCH_PAN;\n\n\t\t\t\t\tpanStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tstate = STATE.NONE;\n\n\t\t\t}\n\n\t\t\tif ( state !== STATE.NONE ) scope.dispatchEvent( startEvent );\n\n\t\t}\n\n\t\tfunction touchmove( event ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\n\t\t\tvar element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n\t\t\tswitch ( event.touches.length ) {\n\n\t\t\t\tcase 1: // one-fingered touch: rotate\n\n\t\t\t\t\tif ( scope.enableRotate === false ) return;\n\t\t\t\t\tif ( state !== STATE.TOUCH_ROTATE ) return;\n\n\t\t\t\t\trotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\trotateDelta.subVectors( rotateEnd, rotateStart );\n\n\t\t\t\t\t// rotating across whole screen goes 360 degrees around\n\t\t\t\t\tconstraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\t\t\t\t\t// rotating up and down along whole screen attempts to go 360, but limited to 180\n\t\t\t\t\tconstraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n\t\t\t\t\trotateStart.copy( rotateEnd );\n\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2: // two-fingered touch: dolly\n\n\t\t\t\t\tif ( scope.enableZoom === false ) return;\n\t\t\t\t\tif ( state !== STATE.TOUCH_DOLLY ) return;\n\n\t\t\t\t\tvar dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n\t\t\t\t\tvar dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n\t\t\t\t\tvar distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\t\t\t\tdollyEnd.set( 0, distance );\n\t\t\t\t\tdollyDelta.subVectors( dollyEnd, dollyStart );\n\n\t\t\t\t\tif ( dollyDelta.y > 0 ) {\n\n\t\t\t\t\t\tconstraint.dollyOut( getZoomScale() );\n\n\t\t\t\t\t} else if ( dollyDelta.y < 0 ) {\n\n\t\t\t\t\t\tconstraint.dollyIn( getZoomScale() );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tdollyStart.copy( dollyEnd );\n\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3: // three-fingered touch: pan\n\n\t\t\t\t\tif ( scope.enablePan === false ) return;\n\t\t\t\t\tif ( state !== STATE.TOUCH_PAN ) return;\n\n\t\t\t\t\tpanEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n\t\t\t\t\tpanDelta.subVectors( panEnd, panStart );\n\n\t\t\t\t\tpan( panDelta.x, panDelta.y );\n\n\t\t\t\t\tpanStart.copy( panEnd );\n\n\t\t\t\t\tscope.update();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tstate = STATE.NONE;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction touchend( /* event */ ) {\n\n\t\t\tif ( scope.enabled === false ) return;\n\n\t\t\tscope.dispatchEvent( endEvent );\n\t\t\tstate = STATE.NONE;\n\n\t\t}\n\n\t\tfunction contextmenu( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t}\n\n\t\tthis.dispose = function() {\n\n\t\t\tthis.domElement.removeEventListener( 'contextmenu', contextmenu, false );\n\t\t\tthis.domElement.removeEventListener( 'mousedown', onMouseDown, false );\n\t\t\tthis.domElement.removeEventListener( 'mousewheel', onMouseWheel, false );\n\t\t\tthis.domElement.removeEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox\n\n\t\t\tthis.domElement.removeEventListener( 'touchstart', touchstart, false );\n\t\t\tthis.domElement.removeEventListener( 'touchend', touchend, false );\n\t\t\tthis.domElement.removeEventListener( 'touchmove', touchmove, false );\n\n\t\t\tdocument.removeEventListener( 'mousemove', onMouseMove, false );\n\t\t\tdocument.removeEventListener( 'mouseup', onMouseUp, false );\n\n\t\t\twindow.removeEventListener( 'keydown', onKeyDown, false );\n\n\t\t}\n\n\t\tthis.domElement.addEventListener( 'contextmenu', contextmenu, false );\n\n\t\tthis.domElement.addEventListener( 'mousedown', onMouseDown, false );\n\t\tthis.domElement.addEventListener( 'mousewheel', onMouseWheel, false );\n\t\tthis.domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox\n\n\t\tthis.domElement.addEventListener( 'touchstart', touchstart, false );\n\t\tthis.domElement.addEventListener( 'touchend', touchend, false );\n\t\tthis.domElement.addEventListener( 'touchmove', touchmove, false );\n\n\t\twindow.addEventListener( 'keydown', onKeyDown, false );\n\n\t\t// force an update at start\n\t\tthis.update();\n\n\t};\n\n\tOrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n\tOrbitControls.prototype.constructor = OrbitControls;\n\n\tObject.defineProperties( OrbitControls.prototype, {\n\n\t\tobject: {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.object;\n\n\t\t\t}\n\n\t\t},\n\n\t\ttarget: {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.target;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: target is now immutable. Use target.set() instead.' );\n\t\t\t\tthis.constraint.target.copy( value );\n\n\t\t\t}\n\n\t\t},\n\n\t\tminDistance : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.minDistance;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.minDistance = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tmaxDistance : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.maxDistance;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.maxDistance = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tminZoom : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.minZoom;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.minZoom = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tmaxZoom : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.maxZoom;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.maxZoom = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tminPolarAngle : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.minPolarAngle;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.minPolarAngle = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tmaxPolarAngle : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.maxPolarAngle;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.maxPolarAngle = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tminAzimuthAngle : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.minAzimuthAngle;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.minAzimuthAngle = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tmaxAzimuthAngle : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.maxAzimuthAngle;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.maxAzimuthAngle = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tenableDamping : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.enableDamping;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.enableDamping = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdampingFactor : {\n\n\t\t\tget: function () {\n\n\t\t\t\treturn this.constraint.dampingFactor;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tthis.constraint.dampingFactor = value;\n\n\t\t\t}\n\n\t\t},\n\n\t\t// backward compatibility\n\n\t\tnoZoom: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n\t\t\t\treturn ! this.enableZoom;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n\t\t\t\tthis.enableZoom = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tnoRotate: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n\t\t\t\treturn ! this.enableRotate;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n\t\t\t\tthis.enableRotate = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tnoPan: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n\t\t\t\treturn ! this.enablePan;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n\t\t\t\tthis.enablePan = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tnoKeys: {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n\t\t\t\treturn ! this.enableKeys;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n\t\t\t\tthis.enableKeys = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tstaticMoving : {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n\t\t\t\treturn ! this.constraint.enableDamping;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n\t\t\t\tthis.constraint.enableDamping = ! value;\n\n\t\t\t}\n\n\t\t},\n\n\t\tdynamicDampingFactor : {\n\n\t\t\tget: function () {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n\t\t\t\treturn this.constraint.dampingFactor;\n\n\t\t\t},\n\n\t\t\tset: function ( value ) {\n\n\t\t\t\tconsole.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n\t\t\t\tthis.constraint.dampingFactor = value;\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\treturn OrbitControls;\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/three-orbit-controls/index.js\n ** module id = 30\n ** module chunks = 0\n **/","import Layer from '../Layer';\nimport THREE from 'three';\n\nclass EnvironmentLayer extends Layer {\n constructor() {\n super();\n\n this._initLights();\n this._initGrid();\n }\n\n _onAdd() {}\n\n // Not fleshed out or thought through yet\n //\n // Lights could potentially be put it their own 'layer' to keep this class\n // much simpler and less messy\n _initLights() {\n // Position doesn't really matter (the angle is important), however it's\n // used here so the helpers look more natural.\n\n var directionalLight = new THREE.DirectionalLight(0x999999);\n directionalLight.intesity = 0.1;\n directionalLight.position.x = 100;\n directionalLight.position.y = 100;\n directionalLight.position.z = 100;\n\n var directionalLight2 = new THREE.DirectionalLight(0x999999);\n directionalLight2.intesity = 0.1;\n directionalLight2.position.x = -100;\n directionalLight2.position.y = 100;\n directionalLight2.position.z = -100;\n\n var helper = new THREE.DirectionalLightHelper(directionalLight, 10);\n var helper2 = new THREE.DirectionalLightHelper(directionalLight2, 10);\n\n this._layer.add(directionalLight);\n this._layer.add(directionalLight2);\n\n this._layer.add(helper);\n this._layer.add(helper2);\n }\n\n // Add grid helper for context during initial development\n _initGrid() {\n var size = 4000;\n var step = 100;\n\n var gridHelper = new THREE.GridHelper(size, step);\n this._layer.add(gridHelper);\n }\n}\n\n// Initialise without requiring new keyword\nexport default function() {\n return new EnvironmentLayer();\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/layer/environment/EnvironmentLayer.js\n **/","import EventEmitter from 'eventemitter3';\nimport THREE from 'three';\nimport Scene from '../engine/Scene';\n\nclass Layer extends EventEmitter {\n constructor() {\n super();\n\n this._layer = new THREE.Object3D();\n }\n\n // Add layer to world instance and store world reference\n addTo(world) {\n world.addLayer(this);\n return this;\n }\n\n // Internal method called by World.addLayer to actually add the layer\n _addToWorld(world) {\n this._world = world;\n this._onAdd(world);\n this.emit('added');\n }\n}\n\nexport default Layer;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/layer/Layer.js\n **/","import Layer from '../Layer';\nimport TileCache from './TileCache';\nimport throttle from 'lodash.throttle';\nimport THREE from 'three';\n\n// TODO: Prevent tiles from being loaded if they are further than a certain\n// distance from the camera and are unlikely to be seen anyway\n\nclass GridLayer extends Layer {\n constructor() {\n super();\n\n this._tileCache = new TileCache(1000);\n\n // TODO: Work out why changing the minLOD causes loads of issues\n this._minLOD = 3;\n this._maxLOD = 18;\n\n this._frustum = new THREE.Frustum();\n }\n\n _onAdd(world) {\n this._initEvents();\n\n // Trigger initial quadtree calculation on the next frame\n //\n // TODO: This is a hack to ensure the camera is all set up - a better\n // solution should be found\n setTimeout(() => {\n this._calculateLOD();\n }, 0);\n }\n\n _initEvents() {\n // Run LOD calculations based on render calls\n //\n // TODO: Perhaps don't perform a calculation if nothing has changed in a\n // frame and there are no tiles waiting to be loaded.\n this._world.on('preUpdate', throttle(() => {\n this._calculateLOD();\n }, 100));\n }\n\n _updateFrustum() {\n var camera = this._world.getCamera();\n var projScreenMatrix = new THREE.Matrix4();\n projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);\n\n this._frustum.setFromMatrix(camera.projectionMatrix);\n this._frustum.setFromMatrix(new THREE.Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse));\n }\n\n _tileInFrustum(tile) {\n var bounds = tile.getBounds();\n return this._frustum.intersectsBox(new THREE.Box3(new THREE.Vector3(bounds[0], 0, bounds[3]), new THREE.Vector3(bounds[2], 0, bounds[1])));\n }\n\n _calculateLOD() {\n if (this._stop) {\n return;\n }\n\n // var start = performance.now();\n\n var camera = this._world.getCamera();\n\n // 1. Update and retrieve camera frustum\n this._updateFrustum(this._frustum, camera);\n\n // 2. Add the four root items of the quadtree to a check list\n var checkList = this._checklist;\n checkList = [];\n checkList.push(this._tileCache.requestTile('0', this));\n checkList.push(this._tileCache.requestTile('1', this));\n checkList.push(this._tileCache.requestTile('2', this));\n checkList.push(this._tileCache.requestTile('3', this));\n\n // 3. Call Divide, passing in the check list\n this._divide(checkList);\n\n // 4. Remove all tiles from layer\n this._removeTiles();\n\n var tileCount = 0;\n\n // 5. Render the tiles remaining in the check list\n checkList.forEach((tile, index) => {\n // Skip tile if it's not in the current view frustum\n if (!this._tileInFrustum(tile)) {\n return;\n }\n\n // TODO: Can probably speed this up\n var center = tile.getCenter();\n var dist = (new THREE.Vector3(center[0], 0, center[1])).sub(camera.position).length();\n\n // Manual distance limit to cut down on tiles so far away\n if (dist > 8000) {\n return;\n }\n\n // Does the tile have a mesh?\n //\n // If yes, continue\n // If no, generate tile mesh, request texture and skip\n if (!tile.getMesh()) {\n tile.requestTileAsync();\n return;\n }\n\n // Are the mesh and texture ready?\n //\n // If yes, continue\n // If no, skip\n if (!tile.isReady()) {\n return;\n }\n\n // Add tile to layer (and to scene)\n this._layer.add(tile.getMesh());\n\n // Output added tile (for debugging)\n // console.log(tile);\n\n tileCount++;\n });\n\n // console.log(tileCount);\n // console.log(performance.now() - start);\n }\n\n _divide(checkList) {\n var count = 0;\n var currentItem;\n var quadcode;\n\n // 1. Loop until count equals check list length\n while (count != checkList.length) {\n currentItem = checkList[count];\n quadcode = currentItem.getQuadcode();\n\n // 2. Increase count and continue loop if quadcode equals max LOD / zoom\n if (currentItem.length === this._maxLOD) {\n count++;\n continue;\n }\n\n // 3. Else, calculate screen-space error metric for quadcode\n if (this._screenSpaceError(currentItem)) {\n // 4. If error is sufficient...\n\n // 4a. Remove parent item from the check list\n checkList.splice(count, 1);\n\n // 4b. Add 4 child items to the check list\n checkList.push(this._tileCache.requestTile(quadcode + '0', this));\n checkList.push(this._tileCache.requestTile(quadcode + '1', this));\n checkList.push(this._tileCache.requestTile(quadcode + '2', this));\n checkList.push(this._tileCache.requestTile(quadcode + '3', this));\n\n // 4d. Continue the loop without increasing count\n continue;\n } else {\n // 5. Else, increase count and continue loop\n count++;\n }\n }\n }\n\n _screenSpaceError(tile) {\n var minDepth = this._minLOD;\n var maxDepth = this._maxLOD;\n\n var quadcode = tile.getQuadcode();\n\n var camera = this._world.getCamera();\n\n // Tweak this value to refine specific point that each quad is subdivided\n //\n // It's used to multiple the dimensions of the tile sides before\n // comparing against the tile distance from camera\n var quality = 3.0;\n\n // 1. Return false if quadcode length is greater than maxDepth\n if (quadcode.length > maxDepth) {\n return false;\n }\n\n // 2. Return true if quadcode length is less than minDepth\n if (quadcode.length < minDepth) {\n return true;\n }\n\n // 3. Return false if quadcode bounds are not in view frustum\n if (!this._tileInFrustum(tile)) {\n return false;\n }\n\n var center = tile.getCenter();\n\n // 4. Calculate screen-space error metric\n // TODO: Use closest distance to one of the 4 tile corners\n var dist = (new THREE.Vector3(center[0], 0, center[1])).sub(camera.position).length();\n\n var error = quality * tile.getSide() / dist;\n\n // 5. Return true if error is greater than 1.0, else return false\n return (error > 1.0);\n }\n\n _removeTiles() {\n // console.log('Pre:', this._layer.children.length);\n for (var i = this._layer.children.length - 1; i >= 0; i--) {\n this._layer.remove(this._layer.children[i]);\n }\n // console.log('Post:', this._layer.children.length);\n }\n}\n\n// Initialise without requiring new keyword\nexport default function() {\n return new GridLayer();\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/layer/tile/GridLayer.js\n **/","import LRUCache from 'lru-cache';\nimport Tile from './Tile';\n\n// This process is based on a similar approach taken by OpenWebGlobe\n// See: https://github.com/OpenWebGlobe/WebViewer/blob/master/source/core/globecache.js\n\nclass TileCache {\n constructor(cacheLimit) {\n this._cache = LRUCache(cacheLimit);\n }\n\n // Returns true if all specified tile providers are ready to be used\n // Otherwise, returns false\n isReady() {\n return false;\n }\n\n // Get a cached tile or request a new one if not in cache\n requestTile(quadcode, layer) {\n var tile = this._cache.get(quadcode);\n\n if (!tile) {\n // Set up a brand new tile\n tile = new Tile(quadcode, layer);\n\n // Request data for various tile providers\n // tile.requestData(imageProviders);\n\n // Add tile to cache, though it won't be ready yet as the data is being\n // requested from various places asynchronously\n this._cache.set(quadcode, tile);\n }\n\n return tile;\n }\n\n // Get a cached tile without requesting a new one\n getTile(quadcode) {\n return this._cache.get(quadcode);\n }\n\n // Destroy the cache and remove it from memory\n //\n // TODO: Call destroy method on items in cache\n destroy() {\n this._cache.reset();\n }\n}\n\nexport default TileCache;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/layer/tile/TileCache.js\n **/","module.exports = LRUCache\n\n// This will be a proper iterable 'Map' in engines that support it,\n// or a fakey-fake PseudoMap in older versions.\nvar Map = require('pseudomap')\nvar util = require('util')\n\n// A linked list to keep track of recently-used-ness\nvar Yallist = require('yallist')\n\n// use symbols if possible, otherwise just _props\nvar symbols = {}\nvar hasSymbol = typeof Symbol === 'function'\nvar makeSymbol\nif (hasSymbol) {\n makeSymbol = function (key) {\n return Symbol.for(key)\n }\n} else {\n makeSymbol = function (key) {\n return '_' + key\n }\n}\n\nfunction priv (obj, key, val) {\n var sym\n if (symbols[key]) {\n sym = symbols[key]\n } else {\n sym = makeSymbol(key)\n symbols[key] = sym\n }\n if (arguments.length === 2) {\n return obj[sym]\n } else {\n obj[sym] = val\n return val\n }\n}\n\nfunction naiveLength () { return 1 }\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nfunction LRUCache (options) {\n if (!(this instanceof LRUCache)) {\n return new LRUCache(options)\n }\n\n if (typeof options === 'number') {\n options = { max: options }\n }\n\n if (!options) {\n options = {}\n }\n\n var max = priv(this, 'max', options.max)\n // Kind of weird to have a default max of Infinity, but oh well.\n if (!max ||\n !(typeof max === 'number') ||\n max <= 0) {\n priv(this, 'max', Infinity)\n }\n\n var lc = options.length || naiveLength\n if (typeof lc !== 'function') {\n lc = naiveLength\n }\n priv(this, 'lengthCalculator', lc)\n\n priv(this, 'allowStale', options.stale || false)\n priv(this, 'maxAge', options.maxAge || 0)\n priv(this, 'dispose', options.dispose)\n this.reset()\n}\n\n// resize the cache when the max changes.\nObject.defineProperty(LRUCache.prototype, 'max', {\n set: function (mL) {\n if (!mL || !(typeof mL === 'number') || mL <= 0) {\n mL = Infinity\n }\n priv(this, 'max', mL)\n trim(this)\n },\n get: function () {\n return priv(this, 'max')\n },\n enumerable: true\n})\n\nObject.defineProperty(LRUCache.prototype, 'allowStale', {\n set: function (allowStale) {\n priv(this, 'allowStale', !!allowStale)\n },\n get: function () {\n return priv(this, 'allowStale')\n },\n enumerable: true\n})\n\nObject.defineProperty(LRUCache.prototype, 'maxAge', {\n set: function (mA) {\n if (!mA || !(typeof mA === 'number') || mA < 0) {\n mA = 0\n }\n priv(this, 'maxAge', mA)\n trim(this)\n },\n get: function () {\n return priv(this, 'maxAge')\n },\n enumerable: true\n})\n\n// resize the cache when the lengthCalculator changes.\nObject.defineProperty(LRUCache.prototype, 'lengthCalculator', {\n set: function (lC) {\n if (typeof lC !== 'function') {\n lC = naiveLength\n }\n if (lC !== priv(this, 'lengthCalculator')) {\n priv(this, 'lengthCalculator', lC)\n priv(this, 'length', 0)\n priv(this, 'lruList').forEach(function (hit) {\n hit.length = priv(this, 'lengthCalculator').call(this, hit.value, hit.key)\n priv(this, 'length', priv(this, 'length') + hit.length)\n }, this)\n }\n trim(this)\n },\n get: function () { return priv(this, 'lengthCalculator') },\n enumerable: true\n})\n\nObject.defineProperty(LRUCache.prototype, 'length', {\n get: function () { return priv(this, 'length') },\n enumerable: true\n})\n\nObject.defineProperty(LRUCache.prototype, 'itemCount', {\n get: function () { return priv(this, 'lruList').length },\n enumerable: true\n})\n\nLRUCache.prototype.rforEach = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = priv(this, 'lruList').tail; walker !== null;) {\n var prev = walker.prev\n forEachStep(this, fn, walker, thisp)\n walker = prev\n }\n}\n\nfunction forEachStep (self, fn, node, thisp) {\n var hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!priv(self, 'allowStale')) {\n hit = undefined\n }\n }\n if (hit) {\n fn.call(thisp, hit.value, hit.key, self)\n }\n}\n\nLRUCache.prototype.forEach = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = priv(this, 'lruList').head; walker !== null;) {\n var next = walker.next\n forEachStep(this, fn, walker, thisp)\n walker = next\n }\n}\n\nLRUCache.prototype.keys = function () {\n return priv(this, 'lruList').toArray().map(function (k) {\n return k.key\n }, this)\n}\n\nLRUCache.prototype.values = function () {\n return priv(this, 'lruList').toArray().map(function (k) {\n return k.value\n }, this)\n}\n\nLRUCache.prototype.reset = function () {\n if (priv(this, 'dispose') &&\n priv(this, 'lruList') &&\n priv(this, 'lruList').length) {\n priv(this, 'lruList').forEach(function (hit) {\n priv(this, 'dispose').call(this, hit.key, hit.value)\n }, this)\n }\n\n priv(this, 'cache', new Map()) // hash of items by key\n priv(this, 'lruList', new Yallist()) // list of items in order of use recency\n priv(this, 'length', 0) // length of items in the list\n}\n\nLRUCache.prototype.dump = function () {\n return priv(this, 'lruList').map(function (hit) {\n if (!isStale(this, hit)) {\n return {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }\n }\n }, this).toArray().filter(function (h) {\n return h\n })\n}\n\nLRUCache.prototype.dumpLru = function () {\n return priv(this, 'lruList')\n}\n\nLRUCache.prototype.inspect = function (n, opts) {\n var str = 'LRUCache {'\n var extras = false\n\n var as = priv(this, 'allowStale')\n if (as) {\n str += '\\n allowStale: true'\n extras = true\n }\n\n var max = priv(this, 'max')\n if (max && max !== Infinity) {\n if (extras) {\n str += ','\n }\n str += '\\n max: ' + util.inspect(max, opts)\n extras = true\n }\n\n var maxAge = priv(this, 'maxAge')\n if (maxAge) {\n if (extras) {\n str += ','\n }\n str += '\\n maxAge: ' + util.inspect(maxAge, opts)\n extras = true\n }\n\n var lc = priv(this, 'lengthCalculator')\n if (lc && lc !== naiveLength) {\n if (extras) {\n str += ','\n }\n str += '\\n length: ' + util.inspect(priv(this, 'length'), opts)\n extras = true\n }\n\n var didFirst = false\n priv(this, 'lruList').forEach(function (item) {\n if (didFirst) {\n str += ',\\n '\n } else {\n if (extras) {\n str += ',\\n'\n }\n didFirst = true\n str += '\\n '\n }\n var key = util.inspect(item.key).split('\\n').join('\\n ')\n var val = { value: item.value }\n if (item.maxAge !== maxAge) {\n val.maxAge = item.maxAge\n }\n if (lc !== naiveLength) {\n val.length = item.length\n }\n if (isStale(this, item)) {\n val.stale = true\n }\n\n val = util.inspect(val, opts).split('\\n').join('\\n ')\n str += key + ' => ' + val\n })\n\n if (didFirst || extras) {\n str += '\\n'\n }\n str += '}'\n\n return str\n}\n\nLRUCache.prototype.set = function (key, value, maxAge) {\n maxAge = maxAge || priv(this, 'maxAge')\n\n var now = maxAge ? Date.now() : 0\n var len = priv(this, 'lengthCalculator').call(this, value, key)\n\n if (priv(this, 'cache').has(key)) {\n if (len > priv(this, 'max')) {\n del(this, priv(this, 'cache').get(key))\n return false\n }\n\n var node = priv(this, 'cache').get(key)\n var item = node.value\n\n // dispose of the old one before overwriting\n if (priv(this, 'dispose')) {\n priv(this, 'dispose').call(this, key, item.value)\n }\n\n item.now = now\n item.maxAge = maxAge\n item.value = value\n priv(this, 'length', priv(this, 'length') + (len - item.length))\n item.length = len\n this.get(key)\n trim(this)\n return true\n }\n\n var hit = new Entry(key, value, len, now, maxAge)\n\n // oversized objects fall out of cache automatically.\n if (hit.length > priv(this, 'max')) {\n if (priv(this, 'dispose')) {\n priv(this, 'dispose').call(this, key, value)\n }\n return false\n }\n\n priv(this, 'length', priv(this, 'length') + hit.length)\n priv(this, 'lruList').unshift(hit)\n priv(this, 'cache').set(key, priv(this, 'lruList').head)\n trim(this)\n return true\n}\n\nLRUCache.prototype.has = function (key) {\n if (!priv(this, 'cache').has(key)) return false\n var hit = priv(this, 'cache').get(key).value\n if (isStale(this, hit)) {\n return false\n }\n return true\n}\n\nLRUCache.prototype.get = function (key) {\n return get(this, key, true)\n}\n\nLRUCache.prototype.peek = function (key) {\n return get(this, key, false)\n}\n\nLRUCache.prototype.pop = function () {\n var node = priv(this, 'lruList').tail\n if (!node) return null\n del(this, node)\n return node.value\n}\n\nLRUCache.prototype.del = function (key) {\n del(this, priv(this, 'cache').get(key))\n}\n\nLRUCache.prototype.load = function (arr) {\n // reset the cache\n this.reset()\n\n var now = Date.now()\n // A previous serialized cache has the most recent items first\n for (var l = arr.length - 1; l >= 0; l--) {\n var hit = arr[l]\n var expiresAt = hit.e || 0\n if (expiresAt === 0) {\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v)\n } else {\n var maxAge = expiresAt - now\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge)\n }\n }\n }\n}\n\nLRUCache.prototype.prune = function () {\n var self = this\n priv(this, 'cache').forEach(function (value, key) {\n get(self, key, false)\n })\n}\n\nfunction get (self, key, doUse) {\n var node = priv(self, 'cache').get(key)\n if (node) {\n var hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!priv(self, 'allowStale')) hit = undefined\n } else {\n if (doUse) {\n priv(self, 'lruList').unshiftNode(node)\n }\n }\n if (hit) hit = hit.value\n }\n return hit\n}\n\nfunction isStale (self, hit) {\n if (!hit || (!hit.maxAge && !priv(self, 'maxAge'))) {\n return false\n }\n var stale = false\n var diff = Date.now() - hit.now\n if (hit.maxAge) {\n stale = diff > hit.maxAge\n } else {\n stale = priv(self, 'maxAge') && (diff > priv(self, 'maxAge'))\n }\n return stale\n}\n\nfunction trim (self) {\n if (priv(self, 'length') > priv(self, 'max')) {\n for (var walker = priv(self, 'lruList').tail;\n priv(self, 'length') > priv(self, 'max') && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n var prev = walker.prev\n del(self, walker)\n walker = prev\n }\n }\n}\n\nfunction del (self, node) {\n if (node) {\n var hit = node.value\n if (priv(self, 'dispose')) {\n priv(self, 'dispose').call(this, hit.key, hit.value)\n }\n priv(self, 'length', priv(self, 'length') - hit.length)\n priv(self, 'cache').delete(hit.key)\n priv(self, 'lruList').removeNode(node)\n }\n}\n\n// classy, since V8 prefers predictable objects.\nfunction Entry (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lru-cache/lib/lru-cache.js\n ** module id = 35\n ** module chunks = 0\n **/","if (process.env.npm_package_name === 'pseudomap' &&\n process.env.npm_lifecycle_script === 'test')\n process.env.TEST_PSEUDOMAP = 'true'\n\nif (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) {\n module.exports = Map\n} else {\n module.exports = require('./pseudomap')\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/pseudomap/map.js\n ** module id = 36\n ** module chunks = 0\n **/","// shim for using process in browser\n\nvar process = module.exports = {};\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = setTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n clearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n setTimeout(drainQueue, 0);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/process/browser.js\n ** module id = 37\n ** module chunks = 0\n **/","var hasOwnProperty = Object.prototype.hasOwnProperty\n\nmodule.exports = PseudoMap\n\nfunction PseudoMap (set) {\n if (!(this instanceof PseudoMap)) // whyyyyyyy\n throw new TypeError(\"Constructor PseudoMap requires 'new'\")\n\n this.clear()\n\n if (set) {\n if ((set instanceof PseudoMap) ||\n (typeof Map === 'function' && set instanceof Map))\n set.forEach(function (value, key) {\n this.set(key, value)\n }, this)\n else if (Array.isArray(set))\n set.forEach(function (kv) {\n this.set(kv[0], kv[1])\n }, this)\n else\n throw new TypeError('invalid argument')\n }\n}\n\nPseudoMap.prototype.forEach = function (fn, thisp) {\n thisp = thisp || this\n Object.keys(this._data).forEach(function (k) {\n if (k !== 'size')\n fn.call(thisp, this._data[k].value, this._data[k].key)\n }, this)\n}\n\nPseudoMap.prototype.has = function (k) {\n return !!find(this._data, k)\n}\n\nPseudoMap.prototype.get = function (k) {\n var res = find(this._data, k)\n return res && res.value\n}\n\nPseudoMap.prototype.set = function (k, v) {\n set(this._data, k, v)\n}\n\nPseudoMap.prototype.delete = function (k) {\n var res = find(this._data, k)\n if (res) {\n delete this._data[res._index]\n this._data.size--\n }\n}\n\nPseudoMap.prototype.clear = function () {\n var data = Object.create(null)\n data.size = 0\n\n Object.defineProperty(this, '_data', {\n value: data,\n enumerable: false,\n configurable: true,\n writable: false\n })\n}\n\nObject.defineProperty(PseudoMap.prototype, 'size', {\n get: function () {\n return this._data.size\n },\n set: function (n) {},\n enumerable: true,\n configurable: true\n})\n\nPseudoMap.prototype.values =\nPseudoMap.prototype.keys =\nPseudoMap.prototype.entries = function () {\n throw new Error('iterators are not implemented in this version')\n}\n\n// Either identical, or both NaN\nfunction same (a, b) {\n return a === b || a !== a && b !== b\n}\n\nfunction Entry (k, v, i) {\n this.key = k\n this.value = v\n this._index = i\n}\n\nfunction find (data, k) {\n for (var i = 0, s = '_' + k, key = s;\n hasOwnProperty.call(data, key);\n key = s + i++) {\n if (same(data[key].key, k))\n return data[key]\n }\n}\n\nfunction set (data, k, v) {\n for (var i = 0, s = '_' + k, key = s;\n hasOwnProperty.call(data, key);\n key = s + i++) {\n if (same(data[key].key, k)) {\n data[key].value = v\n return\n }\n }\n data.size++\n data[key] = new Entry(k, v, key)\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/pseudomap/pseudomap.js\n ** module id = 38\n ** module chunks = 0\n **/","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/util/util.js\n ** module id = 39\n ** module chunks = 0\n **/","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/util/support/isBufferBrowser.js\n ** module id = 40\n ** module chunks = 0\n **/","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/inherits/inherits_browser.js\n ** module id = 41\n ** module chunks = 0\n **/","module.exports = Yallist\n\nYallist.Node = Node\nYallist.create = Yallist\n\nfunction Yallist (list) {\n var self = this\n if (!(self instanceof Yallist)) {\n self = new Yallist()\n }\n\n self.tail = null\n self.head = null\n self.length = 0\n\n if (list && typeof list.forEach === 'function') {\n list.forEach(function (item) {\n self.push(item)\n })\n } else if (arguments.length > 0) {\n for (var i = 0, l = arguments.length; i < l; i++) {\n self.push(arguments[i])\n }\n }\n\n return self\n}\n\nYallist.prototype.removeNode = function (node) {\n if (node.list !== this) {\n throw new Error('removing node which does not belong to this list')\n }\n\n var next = node.next\n var prev = node.prev\n\n if (next) {\n next.prev = prev\n }\n\n if (prev) {\n prev.next = next\n }\n\n if (node === this.head) {\n this.head = next\n }\n if (node === this.tail) {\n this.tail = prev\n }\n\n node.list.length --\n node.next = null\n node.prev = null\n node.list = null\n}\n\nYallist.prototype.unshiftNode = function (node) {\n if (node === this.head) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var head = this.head\n node.list = this\n node.next = head\n if (head) {\n head.prev = node\n }\n\n this.head = node\n if (!this.tail) {\n this.tail = node\n }\n this.length ++\n}\n\nYallist.prototype.pushNode = function (node) {\n if (node === this.tail) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var tail = this.tail\n node.list = this\n node.prev = tail\n if (tail) {\n tail.next = node\n }\n\n this.tail = node\n if (!this.head) {\n this.head = node\n }\n this.length ++\n}\n\nYallist.prototype.push = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n push(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.unshift = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n unshift(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.pop = function () {\n if (!this.tail)\n return undefined\n\n var res = this.tail.value\n this.tail = this.tail.prev\n this.tail.next = null\n this.length --\n return res\n}\n\nYallist.prototype.shift = function () {\n if (!this.head)\n return undefined\n\n var res = this.head.value\n this.head = this.head.next\n this.head.prev = null\n this.length --\n return res\n}\n\nYallist.prototype.forEach = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.head, i = 0; walker !== null; i++) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.next\n }\n}\n\nYallist.prototype.forEachReverse = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.prev\n }\n}\n\nYallist.prototype.get = function (n) {\n for (var i = 0, walker = this.head; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.next\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.getReverse = function (n) {\n for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.prev\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.map = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.head; walker !== null; ) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.next\n }\n return res\n}\n\nYallist.prototype.mapReverse = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.tail; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.prev\n }\n return res\n}\n\nYallist.prototype.reduce = function (fn, initial) {\n var acc\n var walker = this.head\n if (arguments.length > 1) {\n acc = initial\n } else if (this.head) {\n walker = this.head.next\n acc = this.head.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = 0; walker !== null; i++) {\n acc = fn(acc, walker.value, i)\n walker = walker.next\n }\n\n return acc\n}\n\nYallist.prototype.reduceReverse = function (fn, initial) {\n var acc\n var walker = this.tail\n if (arguments.length > 1) {\n acc = initial\n } else if (this.tail) {\n walker = this.tail.prev\n acc = this.tail.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = this.length - 1; walker !== null; i--) {\n acc = fn(acc, walker.value, i)\n walker = walker.prev\n }\n\n return acc\n}\n\nYallist.prototype.toArray = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.head; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.next\n }\n return arr\n}\n\nYallist.prototype.toArrayReverse = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.tail; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.prev\n }\n return arr\n}\n\nYallist.prototype.slice = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = 0, walker = this.head; walker !== null && i < from; i++) {\n walker = walker.next\n }\n for (; walker !== null && i < to; i++, walker = walker.next) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.sliceReverse = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {\n walker = walker.prev\n }\n for (; walker !== null && i > from; i--, walker = walker.prev) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.reverse = function () {\n var head = this.head\n var tail = this.tail\n for (var walker = head; walker !== null; walker = walker.prev) {\n var p = walker.prev\n walker.prev = walker.next\n walker.next = p\n }\n this.head = tail\n this.tail = head\n return this\n}\n\nfunction push (self, item) {\n self.tail = new Node(item, self.tail, null, self)\n if (!self.head) {\n self.head = self.tail\n }\n self.length ++\n}\n\nfunction unshift (self, item) {\n self.head = new Node(item, null, self.head, self)\n if (!self.tail) {\n self.tail = self.head\n }\n self.length ++\n}\n\nfunction Node (value, prev, next, list) {\n if (!(this instanceof Node)) {\n return new Node(value, prev, next, list)\n }\n\n this.list = list\n this.value = value\n\n if (prev) {\n prev.next = this\n this.prev = prev\n } else {\n this.prev = null\n }\n\n if (next) {\n next.prev = this\n this.next = next\n } else {\n this.next = null\n }\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/yallist/yallist.js\n ** module id = 42\n ** module chunks = 0\n **/","import LatLon from '../../geo/LatLon';\nimport THREE from 'three';\n\n// Manages a single tile and its layers\n\nvar r2d = 180 / Math.PI;\n\nvar loader = new THREE.TextureLoader();\nloader.setCrossOrigin('');\n\nclass Tile {\n constructor(quadcode, layer) {\n this._layer = layer;\n this._quadcode = quadcode;\n\n this._ready = false;\n\n this._tile = this._quadcodeToTile(quadcode);\n\n // Bottom-left and top-right bounds in WGS84 coordinates\n this._boundsLatLon = this._tileBoundsWGS84(this._tile);\n\n // Bottom-left and top-right bounds in world coordinates\n this._boundsWorld = this._tileBoundsFromWGS84(this._boundsLatLon);\n\n // Tile center in world coordinates\n this._center = this._boundsToCenter(this._boundsWorld);\n\n // Length of a tile side in world coorindates\n this._side = this._getSide(this._boundsWorld);\n }\n\n // Returns true if the tile mesh and texture are ready to be used\n // Otherwise, returns false\n isReady() {\n return this._ready;\n }\n\n // Request data for the various tile providers\n //\n // Providers are provided here and not on instantiation of the class so that\n // providers can be easily changed in subsequent requests without heavy\n // management\n //\n // If requestData is called more than once then the provider data will be\n // re-downloaded and the mesh output will be changed\n //\n // Being able to update tile data and output like this on-the-fly makes it\n // appealing for situations where tile data may be dynamic / realtime\n // (eg. realtime traffic tiles)\n //\n // May need to be intelligent about what exactly is updated each time\n // requestData is called as it doesn't make sense to re-request and\n // re-generate a mesh each time when only the image provider needs updating,\n // and likewise it doesn't make sense to update the imagery when only terrain\n // provider changes\n requestTileAsync(imageProviders) {\n // Making this asynchronous really speeds up the LOD framerate\n setTimeout(() => {\n if (!this._mesh) {\n this._mesh = this._createMesh();\n this._requestTextureAsync();\n }\n }, 0);\n }\n\n getQuadcode() {\n return this._quadcode;\n }\n\n getBounds() {\n return this._boundsWorld;\n }\n\n getCenter() {\n return this._center;\n }\n\n getSide() {\n return this._side;\n }\n\n getMesh() {\n return this._mesh;\n }\n\n // Destroys the tile and removes it from the layer and memory\n //\n // Ensure that this leaves no trace of the tile – no textures, no meshes,\n // nothing in memory or the GPU\n destroy() {}\n\n _createMesh() {\n var mesh = new THREE.Object3D();\n var geom = new THREE.PlaneGeometry(this._side, this._side, 1);\n\n var material = new THREE.MeshBasicMaterial();\n\n var localMesh = new THREE.Mesh(geom, material);\n localMesh.rotation.x = -90 * Math.PI / 180;\n\n mesh.add(localMesh);\n\n mesh.position.x = this._center[0];\n mesh.position.z = this._center[1];\n\n var box = new THREE.BoxHelper(localMesh);\n mesh.add(box);\n\n // mesh.add(this._createDebugMesh());\n\n return mesh;\n }\n\n _requestTextureAsync() {\n var letter = String.fromCharCode(97 + Math.floor(Math.random() * 26));\n var url = 'http://' + letter + '.basemaps.cartocdn.com/light_nolabels/';\n // var url = 'http://tile.stamen.com/toner-lite/';\n\n loader.load(url + this._tile[2] + '/' + this._tile[0] + '/' + this._tile[1] + '.png', texture => {\n // console.log('Loaded');\n // Silky smooth images when tilted\n texture.magFilter = THREE.LinearFilter;\n texture.minFilter = THREE.LinearMipMapLinearFilter;\n\n // TODO: Set this to renderer.getMaxAnisotropy() / 4\n texture.anisotropy = 4;\n\n texture.needsUpdate = true;\n\n this._mesh.children[0].material.map = texture;\n this._mesh.children[0].material.needsUpdate = true;\n this._ready = true;\n }, null, xhr => {\n console.log(xhr);\n });\n }\n\n // Convert from quadcode to TMS tile coordinates\n _quadcodeToTile(quadcode) {\n var x = 0;\n var y = 0;\n var z = quadcode.length;\n\n for (var i = z; i > 0; i--) {\n var mask = 1 << (i - 1);\n var q = +quadcode[z - i];\n if (q === 1) {\n x |= mask;\n }\n if (q === 2) {\n y |= mask;\n }\n if (q === 3) {\n x |= mask;\n y |= mask;\n }\n }\n\n return [x, y, z];\n }\n\n // Convert WGS84 tile bounds to world coordinates\n _tileBoundsFromWGS84(boundsWGS84) {\n var sw = this._layer._world.latLonToPoint(LatLon(boundsWGS84[1], boundsWGS84[0]));\n var ne = this._layer._world.latLonToPoint(LatLon(boundsWGS84[3], boundsWGS84[2]));\n\n return [sw.x, sw.y, ne.x, ne.y];\n }\n\n // Get tile bounds in WGS84 coordinates\n _tileBoundsWGS84(tile) {\n var e = this._tile2lon(tile[0] + 1, tile[2]);\n var w = this._tile2lon(tile[0], tile[2]);\n var s = this._tile2lat(tile[1] + 1, tile[2]);\n var n = this._tile2lat(tile[1], tile[2]);\n return [w, s, e, n];\n }\n\n _tile2lon(x, z) {\n return x / Math.pow(2, z) * 360 - 180;\n }\n\n _tile2lat(y, z) {\n var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z);\n return r2d * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n)));\n }\n\n _boundsToCenter(bounds) {\n var x = bounds[0] + (bounds[2] - bounds[0]) / 2;\n var y = bounds[1] + (bounds[3] - bounds[1]) / 2;\n\n return [x, y];\n }\n\n _getSide(bounds) {\n return (new THREE.Vector3(bounds[0], 0, bounds[3])).sub(new THREE.Vector3(bounds[0], 0, bounds[1])).length();\n }\n}\n\nexport default Tile;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/layer/tile/Tile.js\n **/","/**\n * lodash 4.0.0 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\nvar debounce = require('lodash.debounce');\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide an options object to indicate whether\n * `func` should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the the throttled function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.leading=true] Specify invoking on the leading\n * edge of the timeout.\n * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n * edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // avoid excessively updating the position while scrolling\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // cancel a trailing throttled invocation\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing });\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\nmodule.exports = throttle;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash.throttle/index.js\n ** module id = 44\n ** module chunks = 0\n **/","/**\n * lodash 4.0.1 (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation \n * Based on Underscore.js 1.8.3 \n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license \n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @type Function\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => logs the number of milliseconds it took for the deferred function to be invoked\n */\nvar now = Date.now;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide an options object to indicate whether `func` should be invoked on\n * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent calls\n * to the debounced function return the result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n * on the trailing edge of the timeout only if the the debounced function is\n * invoked more than once during the `wait` timeout.\n *\n * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options] The options object.\n * @param {boolean} [options.leading=false] Specify invoking on the leading\n * edge of the timeout.\n * @param {number} [options.maxWait] The maximum time `func` is allowed to be\n * delayed before it's invoked.\n * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n * edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var args,\n maxTimeoutId,\n result,\n stamp,\n thisArg,\n timeoutId,\n trailingCall,\n lastCalled = 0,\n leading = false,\n maxWait = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait);\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n if (maxTimeoutId) {\n clearTimeout(maxTimeoutId);\n }\n lastCalled = 0;\n args = maxTimeoutId = thisArg = timeoutId = trailingCall = undefined;\n }\n\n function complete(isCalled, id) {\n if (id) {\n clearTimeout(id);\n }\n maxTimeoutId = timeoutId = trailingCall = undefined;\n if (isCalled) {\n lastCalled = now();\n result = func.apply(thisArg, args);\n if (!timeoutId && !maxTimeoutId) {\n args = thisArg = undefined;\n }\n }\n }\n\n function delayed() {\n var remaining = wait - (now() - stamp);\n if (remaining <= 0 || remaining > wait) {\n complete(trailingCall, maxTimeoutId);\n } else {\n timeoutId = setTimeout(delayed, remaining);\n }\n }\n\n function flush() {\n if ((timeoutId && trailingCall) || (maxTimeoutId && trailing)) {\n result = func.apply(thisArg, args);\n }\n cancel();\n return result;\n }\n\n function maxDelayed() {\n complete(trailing, timeoutId);\n }\n\n function debounced() {\n args = arguments;\n stamp = now();\n thisArg = this;\n trailingCall = trailing && (timeoutId || !leading);\n\n if (maxWait === false) {\n var leadingCall = leading && !timeoutId;\n } else {\n if (!maxTimeoutId && !leading) {\n lastCalled = stamp;\n }\n var remaining = maxWait - (stamp - lastCalled),\n isCalled = remaining <= 0 || remaining > maxWait;\n\n if (isCalled) {\n if (maxTimeoutId) {\n maxTimeoutId = clearTimeout(maxTimeoutId);\n }\n lastCalled = stamp;\n result = func.apply(thisArg, args);\n }\n else if (!maxTimeoutId) {\n maxTimeoutId = setTimeout(maxDelayed, remaining);\n }\n }\n if (isCalled && timeoutId) {\n timeoutId = clearTimeout(timeoutId);\n }\n else if (!timeoutId && wait !== maxWait) {\n timeoutId = setTimeout(delayed, wait);\n }\n if (leadingCall) {\n isCalled = true;\n result = func.apply(thisArg, args);\n }\n if (isCalled && !timeoutId && !maxTimeoutId) {\n args = thisArg = undefined;\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8 which returns 'object' for typed array constructors, and\n // PhantomJS 1.9 which returns 'function' for `NodeList` instances.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3);\n * // => 3\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3');\n * // => 3\n */\nfunction toNumber(value) {\n if (isObject(value)) {\n var other = isFunction(value.valueOf) ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/lodash.throttle/~/lodash.debounce/index.js\n ** module id = 45\n ** module chunks = 0\n **/"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/package.json b/package.json index baf2715..fd4f499 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,8 @@ "dependencies": { "eventemitter3": "^1.1.1", "lodash.assign": "^4.0.2", + "lodash.throttle": "^4.0.0", + "lru-cache": "^4.0.0", "three-orbit-controls": "github:robhawkes/three-orbit-controls" } } diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js index 3a8980f..385b2cb 100644 --- a/src/layer/tile/GridLayer.js +++ b/src/layer/tile/GridLayer.js @@ -1,5 +1,6 @@ import Layer from '../Layer'; -import Surface from './Surface'; +import TileCache from './TileCache'; +import throttle from 'lodash.throttle'; import THREE from 'three'; // TODO: Prevent tiles from being loaded if they are further than a certain @@ -9,8 +10,12 @@ class GridLayer extends Layer { constructor() { super(); + this._tileCache = new TileCache(1000); + + // TODO: Work out why changing the minLOD causes loads of issues this._minLOD = 3; this._maxLOD = 18; + this._frustum = new THREE.Frustum(); } @@ -27,9 +32,13 @@ class GridLayer extends Layer { } _initEvents() { - this._world.on('move', latlon => { + // Run LOD calculations based on render calls + // + // TODO: Perhaps don't perform a calculation if nothing has changed in a + // frame and there are no tiles waiting to be loaded. + this._world.on('preUpdate', throttle(() => { this._calculateLOD(); - }); + }, 100)); } _updateFrustum() { @@ -41,11 +50,18 @@ class GridLayer extends Layer { this._frustum.setFromMatrix(new THREE.Matrix4().multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse)); } - _surfaceInFrustum(surface) { - return this._frustum.intersectsBox(new THREE.Box3(new THREE.Vector3(surface.bounds[0], 0, surface.bounds[3]), new THREE.Vector3(surface.bounds[2], 0, surface.bounds[1]))); + _tileInFrustum(tile) { + var bounds = tile.getBounds(); + return this._frustum.intersectsBox(new THREE.Box3(new THREE.Vector3(bounds[0], 0, bounds[3]), new THREE.Vector3(bounds[2], 0, bounds[1]))); } _calculateLOD() { + if (this._stop) { + return; + } + + // var start = performance.now(); + var camera = this._world.getCamera(); // 1. Update and retrieve camera frustum @@ -54,44 +70,82 @@ class GridLayer extends Layer { // 2. Add the four root items of the quadtree to a check list var checkList = this._checklist; checkList = []; - checkList.push(Surface('0', this._world)); - checkList.push(Surface('1', this._world)); - checkList.push(Surface('2', this._world)); - checkList.push(Surface('3', this._world)); + checkList.push(this._tileCache.requestTile('0', this)); + checkList.push(this._tileCache.requestTile('1', this)); + checkList.push(this._tileCache.requestTile('2', this)); + checkList.push(this._tileCache.requestTile('3', this)); // 3. Call Divide, passing in the check list this._divide(checkList); - // 4. Render the quadtree items remaining in the check list - checkList.forEach((surface, index) => { - if (!this._surfaceInFrustum(surface)) { + // 4. Remove all tiles from layer + this._removeTiles(); + + var tileCount = 0; + + // 5. Render the tiles remaining in the check list + checkList.forEach((tile, index) => { + // Skip tile if it's not in the current view frustum + if (!this._tileInFrustum(tile)) { return; } - // console.log(surface); + // TODO: Can probably speed this up + var center = tile.getCenter(); + var dist = (new THREE.Vector3(center[0], 0, center[1])).sub(camera.position).length(); - // surface.render(); - this._layer.add(surface.mesh); + // Manual distance limit to cut down on tiles so far away + if (dist > 8000) { + return; + } + + // Does the tile have a mesh? + // + // If yes, continue + // If no, generate tile mesh, request texture and skip + if (!tile.getMesh()) { + tile.requestTileAsync(); + return; + } + + // Are the mesh and texture ready? + // + // If yes, continue + // If no, skip + if (!tile.isReady()) { + return; + } + + // Add tile to layer (and to scene) + this._layer.add(tile.getMesh()); + + // Output added tile (for debugging) + // console.log(tile); + + tileCount++; }); + + // console.log(tileCount); + // console.log(performance.now() - start); } _divide(checkList) { var count = 0; var currentItem; - var quadkey; + var quadcode; // 1. Loop until count equals check list length while (count != checkList.length) { currentItem = checkList[count]; - quadkey = currentItem.quadkey; + quadcode = currentItem.getQuadcode(); - // 2. Increase count and continue loop if quadkey equals max LOD / zoom + // 2. Increase count and continue loop if quadcode equals max LOD / zoom if (currentItem.length === this._maxLOD) { count++; continue; } - // 3. Else, calculate screen-space error metric for quadkey + // 3. Else, calculate screen-space error metric for quadcode if (this._screenSpaceError(currentItem)) { // 4. If error is sufficient... @@ -99,10 +153,10 @@ class GridLayer extends Layer { checkList.splice(count, 1); // 4b. Add 4 child items to the check list - checkList.push(Surface(quadkey + '0', this._world)); - checkList.push(Surface(quadkey + '1', this._world)); - checkList.push(Surface(quadkey + '2', this._world)); - checkList.push(Surface(quadkey + '3', this._world)); + checkList.push(this._tileCache.requestTile(quadcode + '0', this)); + checkList.push(this._tileCache.requestTile(quadcode + '1', this)); + checkList.push(this._tileCache.requestTile(quadcode + '2', this)); + checkList.push(this._tileCache.requestTile(quadcode + '3', this)); // 4d. Continue the loop without increasing count continue; @@ -113,44 +167,54 @@ class GridLayer extends Layer { } } - _screenSpaceError(surface) { + _screenSpaceError(tile) { var minDepth = this._minLOD; var maxDepth = this._maxLOD; + var quadcode = tile.getQuadcode(); + var camera = this._world.getCamera(); // Tweak this value to refine specific point that each quad is subdivided // - // It's used to multiple the dimensions of the surface sides before - // comparing against the surface distance from camera + // It's used to multiple the dimensions of the tile sides before + // comparing against the tile distance from camera var quality = 3.0; - // 1. Return false if quadkey length is greater than maxDepth - if (surface.quadkey.length > maxDepth) { + // 1. Return false if quadcode length is greater than maxDepth + if (quadcode.length > maxDepth) { return false; } - // 2. Return true if quadkey length is less than minDepth - if (surface.quadkey.length < minDepth) { + // 2. Return true if quadcode length is less than minDepth + if (quadcode.length < minDepth) { return true; } - // 3. Return false if quadkey bounds are not in view frustum - if (!this._surfaceInFrustum(surface)) { + // 3. Return false if quadcode bounds are not in view frustum + if (!this._tileInFrustum(tile)) { return false; } + var center = tile.getCenter(); + // 4. Calculate screen-space error metric - // TODO: Use closest distance to one of the 4 surface corners - var dist = (new THREE.Vector3(surface.center[0], 0, surface.center[1])).sub(camera.position).length(); + // TODO: Use closest distance to one of the 4 tile corners + var dist = (new THREE.Vector3(center[0], 0, center[1])).sub(camera.position).length(); - // console.log(surface, dist); - - var error = quality * surface.side / dist; + var error = quality * tile.getSide() / dist; // 5. Return true if error is greater than 1.0, else return false return (error > 1.0); } + + _removeTiles() { + // console.log('Pre:', this._layer.children.length); + for (var i = this._layer.children.length - 1; i >= 0; i--) { + this._layer.remove(this._layer.children[i]); + } + // console.log('Post:', this._layer.children.length); + } } // Initialise without requiring new keyword diff --git a/src/layer/tile/Tile.js b/src/layer/tile/Tile.js new file mode 100644 index 0000000..a4d3e82 --- /dev/null +++ b/src/layer/tile/Tile.js @@ -0,0 +1,201 @@ +import LatLon from '../../geo/LatLon'; +import THREE from 'three'; + +// Manages a single tile and its layers + +var r2d = 180 / Math.PI; + +var loader = new THREE.TextureLoader(); +loader.setCrossOrigin(''); + +class Tile { + constructor(quadcode, layer) { + this._layer = layer; + this._quadcode = quadcode; + + this._ready = false; + + this._tile = this._quadcodeToTile(quadcode); + + // Bottom-left and top-right bounds in WGS84 coordinates + this._boundsLatLon = this._tileBoundsWGS84(this._tile); + + // Bottom-left and top-right bounds in world coordinates + this._boundsWorld = this._tileBoundsFromWGS84(this._boundsLatLon); + + // Tile center in world coordinates + this._center = this._boundsToCenter(this._boundsWorld); + + // Length of a tile side in world coorindates + this._side = this._getSide(this._boundsWorld); + } + + // Returns true if the tile mesh and texture are ready to be used + // Otherwise, returns false + isReady() { + return this._ready; + } + + // Request data for the various tile providers + // + // Providers are provided here and not on instantiation of the class so that + // providers can be easily changed in subsequent requests without heavy + // management + // + // If requestData is called more than once then the provider data will be + // re-downloaded and the mesh output will be changed + // + // Being able to update tile data and output like this on-the-fly makes it + // appealing for situations where tile data may be dynamic / realtime + // (eg. realtime traffic tiles) + // + // May need to be intelligent about what exactly is updated each time + // requestData is called as it doesn't make sense to re-request and + // re-generate a mesh each time when only the image provider needs updating, + // and likewise it doesn't make sense to update the imagery when only terrain + // provider changes + requestTileAsync(imageProviders) { + // Making this asynchronous really speeds up the LOD framerate + setTimeout(() => { + if (!this._mesh) { + this._mesh = this._createMesh(); + this._requestTextureAsync(); + } + }, 0); + } + + getQuadcode() { + return this._quadcode; + } + + getBounds() { + return this._boundsWorld; + } + + getCenter() { + return this._center; + } + + getSide() { + return this._side; + } + + getMesh() { + return this._mesh; + } + + // Destroys the tile and removes it from the layer and memory + // + // Ensure that this leaves no trace of the tile – no textures, no meshes, + // nothing in memory or the GPU + destroy() {} + + _createMesh() { + var mesh = new THREE.Object3D(); + var geom = new THREE.PlaneGeometry(this._side, this._side, 1); + + var material = new THREE.MeshBasicMaterial(); + + var localMesh = new THREE.Mesh(geom, material); + localMesh.rotation.x = -90 * Math.PI / 180; + + mesh.add(localMesh); + + mesh.position.x = this._center[0]; + mesh.position.z = this._center[1]; + + var box = new THREE.BoxHelper(localMesh); + mesh.add(box); + + // mesh.add(this._createDebugMesh()); + + return mesh; + } + + _requestTextureAsync() { + var letter = String.fromCharCode(97 + Math.floor(Math.random() * 26)); + var url = 'http://' + letter + '.basemaps.cartocdn.com/light_nolabels/'; + // var url = 'http://tile.stamen.com/toner-lite/'; + + loader.load(url + this._tile[2] + '/' + this._tile[0] + '/' + this._tile[1] + '.png', texture => { + // console.log('Loaded'); + // Silky smooth images when tilted + texture.magFilter = THREE.LinearFilter; + texture.minFilter = THREE.LinearMipMapLinearFilter; + + // TODO: Set this to renderer.getMaxAnisotropy() / 4 + texture.anisotropy = 4; + + texture.needsUpdate = true; + + this._mesh.children[0].material.map = texture; + this._mesh.children[0].material.needsUpdate = true; + this._ready = true; + }, null, xhr => { + console.log(xhr); + }); + } + + // Convert from quadcode to TMS tile coordinates + _quadcodeToTile(quadcode) { + var x = 0; + var y = 0; + var z = quadcode.length; + + for (var i = z; i > 0; i--) { + var mask = 1 << (i - 1); + var q = +quadcode[z - i]; + if (q === 1) { + x |= mask; + } + if (q === 2) { + y |= mask; + } + if (q === 3) { + x |= mask; + y |= mask; + } + } + + return [x, y, z]; + } + + // Convert WGS84 tile bounds to world coordinates + _tileBoundsFromWGS84(boundsWGS84) { + var sw = this._layer._world.latLonToPoint(LatLon(boundsWGS84[1], boundsWGS84[0])); + var ne = this._layer._world.latLonToPoint(LatLon(boundsWGS84[3], boundsWGS84[2])); + + return [sw.x, sw.y, ne.x, ne.y]; + } + + // Get tile bounds in WGS84 coordinates + _tileBoundsWGS84(tile) { + var e = this._tile2lon(tile[0] + 1, tile[2]); + var w = this._tile2lon(tile[0], tile[2]); + var s = this._tile2lat(tile[1] + 1, tile[2]); + var n = this._tile2lat(tile[1], tile[2]); + return [w, s, e, n]; + } + + _tile2lon(x, z) { + return x / Math.pow(2, z) * 360 - 180; + } + + _tile2lat(y, z) { + var n = Math.PI - 2 * Math.PI * y / Math.pow(2, z); + return r2d * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n))); + } + + _boundsToCenter(bounds) { + var x = bounds[0] + (bounds[2] - bounds[0]) / 2; + var y = bounds[1] + (bounds[3] - bounds[1]) / 2; + + return [x, y]; + } + + _getSide(bounds) { + return (new THREE.Vector3(bounds[0], 0, bounds[3])).sub(new THREE.Vector3(bounds[0], 0, bounds[1])).length(); + } +} + +export default Tile; diff --git a/src/layer/tile/TileCache.js b/src/layer/tile/TileCache.js new file mode 100644 index 0000000..cf9c0ba --- /dev/null +++ b/src/layer/tile/TileCache.js @@ -0,0 +1,50 @@ +import LRUCache from 'lru-cache'; +import Tile from './Tile'; + +// This process is based on a similar approach taken by OpenWebGlobe +// See: https://github.com/OpenWebGlobe/WebViewer/blob/master/source/core/globecache.js + +class TileCache { + constructor(cacheLimit) { + this._cache = LRUCache(cacheLimit); + } + + // Returns true if all specified tile providers are ready to be used + // Otherwise, returns false + isReady() { + return false; + } + + // Get a cached tile or request a new one if not in cache + requestTile(quadcode, layer) { + var tile = this._cache.get(quadcode); + + if (!tile) { + // Set up a brand new tile + tile = new Tile(quadcode, layer); + + // Request data for various tile providers + // tile.requestData(imageProviders); + + // Add tile to cache, though it won't be ready yet as the data is being + // requested from various places asynchronously + this._cache.set(quadcode, tile); + } + + return tile; + } + + // Get a cached tile without requesting a new one + getTile(quadcode) { + return this._cache.get(quadcode); + } + + // Destroy the cache and remove it from memory + // + // TODO: Call destroy method on items in cache + destroy() { + this._cache.reset(); + } +} + +export default TileCache;