(function e(t, n, r) { function s(o, u) { if (!n[o]) { if (!t[o]) { var a = "function" == typeof require && require; if (!u && a) return require(o, !0); if (i) return i(o, !0); var f = new Error("Cannot find module '" + o + "'"); throw f.code = "MODULE_NOT_FOUND", f; } var l = n[o] = { exports: {} }; t[o][0].call(l.exports, function(e) { var n = t[o][1][e]; return s(n || e); }, l, l.exports, e, t, n, r); } return n[o].exports; } for (var i = "function" == typeof require && require, o = 0; o < r.length; o++) s(r[o]); return s; })({"3":[function(_dereq_, module, exports) { function UnitBezier(t, i, e, r) { this.cx = 3 * t, this.bx = 3 * (e - t) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * i, this.by = 3 * (r - i) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = t, this.p1y = r, this.p2x = e, this.p2y = r; } module.exports = UnitBezier, UnitBezier.prototype.sampleCurveX = function(t) { return ((this.ax * t + this.bx) * t + this.cx) * t; }, UnitBezier.prototype.sampleCurveY = function(t) { return ((this.ay * t + this.by) * t + this.cy) * t; }, UnitBezier.prototype.sampleCurveDerivativeX = function(t) { return (3 * this.ax * t + 2 * this.bx) * t + this.cx; }, UnitBezier.prototype.solveCurveX = function(t, i) { void 0 === i && (i = 1e-6); var e, r, s, h, n; for (s = t, n = 0; n < 8; n++) { if (h = this.sampleCurveX(s) - t, Math.abs(h) < i) return s; var u = this.sampleCurveDerivativeX(s); if (Math.abs(u) < 1e-6) break; s -= h / u; } if (e = 0, r = 1, (s = t) < e) return e; if (s > r) return r; for (;e < r; ) { if (h = this.sampleCurveX(s), Math.abs(h - t) < i) return s; t > h ? e = s : r = s, s = .5 * (r - e) + e; } return s; }, UnitBezier.prototype.solve = function(t, i) { return this.sampleCurveY(this.solveCurveX(t, i)); }; },{}],"5":[function(_dereq_, module, exports) { "use strict"; function earcut(e, n, r) { r = r || 2; var t = n && n.length, i = t ? n[0] * r : e.length, x = linkedList(e, 0, i, r, !0), a = []; if (!x) return a; var o, l, u, s, v, f, y; if (t && (x = eliminateHoles(e, n, x, r)), e.length > 80 * r) { o = u = e[0], l = s = e[1]; for (var d = r; d < i; d += r) v = e[d], f = e[d + 1], v < o && (o = v), f < l && (l = f), v > u && (u = v), f > s && (s = f); y = Math.max(u - o, s - l); } return earcutLinked(x, a, r, o, l, y), a; } function linkedList(e, n, r, t, i) { var x, a; if (i === signedArea(e, n, r, t) > 0) for (x = n; x < r; x += t) a = insertNode(x, e[x], e[x + 1], a); else for (x = r - t; x >= n; x -= t) a = insertNode(x, e[x], e[x + 1], a); return a && equals(a, a.next) && (removeNode(a), a = a.next), a; } function filterPoints(e, n) { if (!e) return e; n || (n = e); var r, t = e; do { if (r = !1, t.steiner || !equals(t, t.next) && 0 !== area(t.prev, t, t.next)) t = t.next; else { if (removeNode(t), (t = n = t.prev) === t.next) return null; r = !0; } } while (r || t !== n); return n; } function earcutLinked(e, n, r, t, i, x, a) { if (e) { !a && x && indexCurve(e, t, i, x); for (var o, l, u = e; e.prev !== e.next; ) if (o = e.prev, l = e.next, x ? isEarHashed(e, t, i, x) : isEar(e)) n.push(o.i / r), n.push(e.i / r), n.push(l.i / r), removeNode(e), e = l.next, u = l.next; else if ((e = l) === u) { a ? 1 === a ? (e = cureLocalIntersections(e, n, r), earcutLinked(e, n, r, t, i, x, 2)) : 2 === a && splitEarcut(e, n, r, t, i, x) : earcutLinked(filterPoints(e), n, r, t, i, x, 1); break; } } } function isEar(e) { var n = e.prev, r = e, t = e.next; if (area(n, r, t) >= 0) return !1; for (var i = e.next.next; i !== e.prev; ) { if (pointInTriangle(n.x, n.y, r.x, r.y, t.x, t.y, i.x, i.y) && area(i.prev, i, i.next) >= 0) return !1; i = i.next; } return !0; } function isEarHashed(e, n, r, t) { var i = e.prev, x = e, a = e.next; if (area(i, x, a) >= 0) return !1; for (var o = i.x < x.x ? i.x < a.x ? i.x : a.x : x.x < a.x ? x.x : a.x, l = i.y < x.y ? i.y < a.y ? i.y : a.y : x.y < a.y ? x.y : a.y, u = i.x > x.x ? i.x > a.x ? i.x : a.x : x.x > a.x ? x.x : a.x, s = i.y > x.y ? i.y > a.y ? i.y : a.y : x.y > a.y ? x.y : a.y, v = zOrder(o, l, n, r, t), f = zOrder(u, s, n, r, t), y = e.nextZ; y && y.z <= f; ) { if (y !== e.prev && y !== e.next && pointInTriangle(i.x, i.y, x.x, x.y, a.x, a.y, y.x, y.y) && area(y.prev, y, y.next) >= 0) return !1; y = y.nextZ; } for (y = e.prevZ; y && y.z >= v; ) { if (y !== e.prev && y !== e.next && pointInTriangle(i.x, i.y, x.x, x.y, a.x, a.y, y.x, y.y) && area(y.prev, y, y.next) >= 0) return !1; y = y.prevZ; } return !0; } function cureLocalIntersections(e, n, r) { var t = e; do { var i = t.prev, x = t.next.next; !equals(i, x) && intersects(i, t, t.next, x) && locallyInside(i, x) && locallyInside(x, i) && (n.push(i.i / r), n.push(t.i / r), n.push(x.i / r), removeNode(t), removeNode(t.next), t = e = x), t = t.next; } while (t !== e); return t; } function splitEarcut(e, n, r, t, i, x) { var a = e; do { for (var o = a.next.next; o !== a.prev; ) { if (a.i !== o.i && isValidDiagonal(a, o)) { var l = splitPolygon(a, o); return a = filterPoints(a, a.next), l = filterPoints(l, l.next), earcutLinked(a, n, r, t, i, x), void earcutLinked(l, n, r, t, i, x); } o = o.next; } a = a.next; } while (a !== e); } function eliminateHoles(e, n, r, t) { var i, x, a, o, l, u = []; for (i = 0, x = n.length; i < x; i++) a = n[i] * t, o = i < x - 1 ? n[i + 1] * t : e.length, l = linkedList(e, a, o, t, !1), l === l.next && (l.steiner = !0), u.push(getLeftmost(l)); for (u.sort(compareX), i = 0; i < u.length; i++) eliminateHole(u[i], r), r = filterPoints(r, r.next); return r; } function compareX(e, n) { return e.x - n.x; } function eliminateHole(e, n) { if (n = findHoleBridge(e, n)) { var r = splitPolygon(n, e); filterPoints(r, r.next); } } function findHoleBridge(e, n) { var r, t = n, i = e.x, x = e.y, a = -1 / 0; do { if (x <= t.y && x >= t.next.y) { var o = t.x + (x - t.y) * (t.next.x - t.x) / (t.next.y - t.y); if (o <= i && o > a) { if (a = o, o === i) { if (x === t.y) return t; if (x === t.next.y) return t.next; } r = t.x < t.next.x ? t : t.next; } } t = t.next; } while (t !== n); if (!r) return null; if (i === a) return r.prev; var l, u = r, s = r.x, v = r.y, f = 1 / 0; for (t = r.next; t !== u; ) i >= t.x && t.x >= s && pointInTriangle(x < v ? i : a, x, s, v, x < v ? a : i, x, t.x, t.y) && ((l = Math.abs(x - t.y) / (i - t.x)) < f || l === f && t.x > r.x) && locallyInside(t, e) && (r = t, f = l), t = t.next; return r; } function indexCurve(e, n, r, t) { var i = e; do { null === i.z && (i.z = zOrder(i.x, i.y, n, r, t)), i.prevZ = i.prev, i.nextZ = i.next, i = i.next; } while (i !== e); i.prevZ.nextZ = null, i.prevZ = null, sortLinked(i); } function sortLinked(e) { var n, r, t, i, x, a, o, l, u = 1; do { for (r = e, e = null, x = null, a = 0; r; ) { for (a++, t = r, o = 0, n = 0; n < u && (o++, t = t.nextZ); n++) ; for (l = u; o > 0 || l > 0 && t; ) 0 === o ? (i = t, t = t.nextZ, l--) : 0 !== l && t ? r.z <= t.z ? (i = r, r = r.nextZ, o--) : (i = t, t = t.nextZ, l--) : (i = r, r = r.nextZ, o--), x ? x.nextZ = i : e = i, i.prevZ = x, x = i; r = t; } x.nextZ = null, u *= 2; } while (a > 1); return e; } function zOrder(e, n, r, t, i) { return e = 32767 * (e - r) / i, n = 32767 * (n - t) / i, e = 16711935 & (e | e << 8), e = 252645135 & (e | e << 4), e = 858993459 & (e | e << 2), e = 1431655765 & (e | e << 1), n = 16711935 & (n | n << 8), n = 252645135 & (n | n << 4), n = 858993459 & (n | n << 2), n = 1431655765 & (n | n << 1), e | n << 1; } function getLeftmost(e) { var n = e, r = e; do { n.x < r.x && (r = n), n = n.next; } while (n !== e); return r; } function pointInTriangle(e, n, r, t, i, x, a, o) { return (i - a) * (n - o) - (e - a) * (x - o) >= 0 && (e - a) * (t - o) - (r - a) * (n - o) >= 0 && (r - a) * (x - o) - (i - a) * (t - o) >= 0; } function isValidDiagonal(e, n) { return e.next.i !== n.i && e.prev.i !== n.i && !intersectsPolygon(e, n) && locallyInside(e, n) && locallyInside(n, e) && middleInside(e, n); } function area(e, n, r) { return (n.y - e.y) * (r.x - n.x) - (n.x - e.x) * (r.y - n.y); } function equals(e, n) { return e.x === n.x && e.y === n.y; } function intersects(e, n, r, t) { return !!(equals(e, n) && equals(r, t) || equals(e, t) && equals(r, n)) || area(e, n, r) > 0 != area(e, n, t) > 0 && area(r, t, e) > 0 != area(r, t, n) > 0; } function intersectsPolygon(e, n) { var r = e; do { if (r.i !== e.i && r.next.i !== e.i && r.i !== n.i && r.next.i !== n.i && intersects(r, r.next, e, n)) return !0; r = r.next; } while (r !== e); return !1; } function locallyInside(e, n) { return area(e.prev, e, e.next) < 0 ? area(e, n, e.next) >= 0 && area(e, e.prev, n) >= 0 : area(e, n, e.prev) < 0 || area(e, e.next, n) < 0; } function middleInside(e, n) { var r = e, t = !1, i = (e.x + n.x) / 2, x = (e.y + n.y) / 2; do { r.y > x != r.next.y > x && i < (r.next.x - r.x) * (x - r.y) / (r.next.y - r.y) + r.x && (t = !t), r = r.next; } while (r !== e); return t; } function splitPolygon(e, n) { var r = new Node(e.i, e.x, e.y), t = new Node(n.i, n.x, n.y), i = e.next, x = n.prev; return e.next = n, n.prev = e, r.next = i, i.prev = r, t.next = r, r.prev = t, x.next = t, t.prev = x, t; } function insertNode(e, n, r, t) { var i = new Node(e, n, r); return t ? (i.next = t.next, i.prev = t, t.next.prev = i, t.next = i) : (i.prev = i, i.next = i), i; } function removeNode(e) { e.next.prev = e.prev, e.prev.next = e.next, e.prevZ && (e.prevZ.nextZ = e.nextZ), e.nextZ && (e.nextZ.prevZ = e.prevZ); } function Node(e, n, r) { this.i = e, this.x = n, this.y = r, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = !1; } function signedArea(e, n, r, t) { for (var i = 0, x = n, a = r - t; x < r; x += t) i += (e[a] - e[x]) * (e[x + 1] + e[a + 1]), a = x; return i; } module.exports = earcut, earcut.deviation = function(e, n, r, t) { var i = n && n.length, x = i ? n[0] * r : e.length, a = Math.abs(signedArea(e, 0, x, r)); if (i) for (var o = 0, l = n.length; o < l; o++) { var u = n[o] * r, s = o < l - 1 ? n[o + 1] * r : e.length; a -= Math.abs(signedArea(e, u, s, r)); } var v = 0; for (o = 0; o < t.length; o += 3) { var f = t[o] * r, y = t[o + 1] * r, d = t[o + 2] * r; v += Math.abs((e[f] - e[d]) * (e[y + 1] - e[f + 1]) - (e[f] - e[y]) * (e[d + 1] - e[f + 1])); } return 0 === a && 0 === v ? 0 : Math.abs((v - a) / a); }, earcut.flatten = function(e) { for (var n = e[0][0].length, r = { vertices: [], holes: [], dimensions: n }, t = 0, i = 0; i < e.length; i++) { for (var x = 0; x < e[i].length; x++) for (var a = 0; a < n; a++) r.vertices.push(e[i][x][a]); i > 0 && (t += e[i - 1].length, r.holes.push(t)); } return r; }; },{}],"6":[function(_dereq_, module, exports) { function geometry(r) { if ("Polygon" === r.type) return polygonArea(r.coordinates); if ("MultiPolygon" === r.type) { for (var e = 0, n = 0; n < r.coordinates.length; n++) e += polygonArea(r.coordinates[n]); return e; } return null; } function polygonArea(r) { var e = 0; if (r && r.length > 0) { e += Math.abs(ringArea(r[0])); for (var n = 1; n < r.length; n++) e -= Math.abs(ringArea(r[n])); } return e; } function ringArea(r) { var e = 0; if (r.length > 2) { for (var n, t, o = 0; o < r.length - 1; o++) n = r[o], t = r[o + 1], e += rad(t[0] - n[0]) * (2 + Math.sin(rad(n[1])) + Math.sin(rad(t[1]))); e = e * wgs84.RADIUS * wgs84.RADIUS / 2; } return e; } function rad(r) { return r * Math.PI / 180; } var wgs84 = _dereq_("wgs84"); module.exports.geometry = geometry, module.exports.ring = ringArea; },{"wgs84":42}],"7":[function(_dereq_, module, exports) { function rewind(r, e) { switch (r && r.type || null) { case "FeatureCollection": return r.features = r.features.map(curryOuter(rewind, e)), r; case "Feature": return r.geometry = rewind(r.geometry, e), r; case "Polygon": case "MultiPolygon": return correct(r, e); default: return r; } } function curryOuter(r, e) { return function(n) { return r(n, e); }; } function correct(r, e) { return "Polygon" === r.type ? r.coordinates = correctRings(r.coordinates, e) : "MultiPolygon" === r.type && (r.coordinates = r.coordinates.map(curryOuter(correctRings, e))), r; } function correctRings(r, e) { e = !!e, r[0] = wind(r[0], !e); for (var n = 1; n < r.length; n++) r[n] = wind(r[n], e); return r; } function wind(r, e) { return cw(r) === e ? r : r.reverse(); } function cw(r) { return geojsonArea.ring(r) >= 0; } var geojsonArea = _dereq_("geojson-area"); module.exports = rewind; },{"geojson-area":6}],"8":[function(_dereq_, module, exports) { "use strict"; function clip(e, r, t, n, u, i, l, s) { if (t /= r, n /= r, l >= t && s <= n) return e; if (l > n || s < t) return null; for (var h = [], p = 0; p < e.length; p++) { var a, c, o = e[p], f = o.geometry, g = o.type; if (a = o.min[u], c = o.max[u], a >= t && c <= n) h.push(o); else if (!(a > n || c < t)) { var v = 1 === g ? clipPoints(f, t, n, u) : clipGeometry(f, t, n, u, i, 3 === g); v.length && h.push(createFeature(o.tags, g, v, o.id)); } } return h.length ? h : null; } function clipPoints(e, r, t, n) { for (var u = [], i = 0; i < e.length; i++) { var l = e[i], s = l[n]; s >= r && s <= t && u.push(l); } return u; } function clipGeometry(e, r, t, n, u, i) { for (var l = [], s = 0; s < e.length; s++) { var h, p, a, c = 0, o = 0, f = null, g = e[s], v = g.area, m = g.dist, w = g.outer, S = g.length, d = []; for (p = 0; p < S - 1; p++) h = f || g[p], f = g[p + 1], c = o || h[n], o = f[n], c < r ? o > t ? (d.push(u(h, f, r), u(h, f, t)), i || (d = newSlice(l, d, v, m, w))) : o >= r && d.push(u(h, f, r)) : c > t ? o < r ? (d.push(u(h, f, t), u(h, f, r)), i || (d = newSlice(l, d, v, m, w))) : o <= t && d.push(u(h, f, t)) : (d.push(h), o < r ? (d.push(u(h, f, r)), i || (d = newSlice(l, d, v, m, w))) : o > t && (d.push(u(h, f, t)), i || (d = newSlice(l, d, v, m, w)))); h = g[S - 1], c = h[n], c >= r && c <= t && d.push(h), a = d[d.length - 1], i && a && (d[0][0] !== a[0] || d[0][1] !== a[1]) && d.push(d[0]), newSlice(l, d, v, m, w); } return l; } function newSlice(e, r, t, n, u) { return r.length && (r.area = t, r.dist = n, void 0 !== u && (r.outer = u), e.push(r)), []; } module.exports = clip; var createFeature = _dereq_("./feature"); },{"./feature":10}],"9":[function(_dereq_, module, exports) { "use strict"; function convert(e, t) { var r = []; if ("FeatureCollection" === e.type) for (var o = 0; o < e.features.length; o++) convertFeature(r, e.features[o], t); else "Feature" === e.type ? convertFeature(r, e, t) : convertFeature(r, { geometry: e }, t); return r; } function convertFeature(e, t, r) { if (null !== t.geometry) { var o, a, i, n, u = t.geometry, c = u.type, l = u.coordinates, s = t.properties, p = t.id; if ("Point" === c) e.push(createFeature(s, 1, [ projectPoint(l) ], p)); else if ("MultiPoint" === c) e.push(createFeature(s, 1, project(l), p)); else if ("LineString" === c) e.push(createFeature(s, 2, [ project(l, r) ], p)); else if ("MultiLineString" === c || "Polygon" === c) { for (i = [], o = 0; o < l.length; o++) n = project(l[o], r), "Polygon" === c && (n.outer = 0 === o), i.push(n); e.push(createFeature(s, "Polygon" === c ? 3 : 2, i, p)); } else if ("MultiPolygon" === c) { for (i = [], o = 0; o < l.length; o++) for (a = 0; a < l[o].length; a++) n = project(l[o][a], r), n.outer = 0 === a, i.push(n); e.push(createFeature(s, 3, i, p)); } else { if ("GeometryCollection" !== c) throw new Error("Input data is not a valid GeoJSON object."); for (o = 0; o < u.geometries.length; o++) convertFeature(e, { geometry: u.geometries[o], properties: s }, r); } } } function project(e, t) { for (var r = [], o = 0; o < e.length; o++) r.push(projectPoint(e[o])); return t && (simplify(r, t), calcSize(r)), r; } function projectPoint(e) { var t = Math.sin(e[1] * Math.PI / 180), r = e[0] / 360 + .5, o = .5 - .25 * Math.log((1 + t) / (1 - t)) / Math.PI; return o = o < 0 ? 0 : o > 1 ? 1 : o, [ r, o, 0 ]; } function calcSize(e) { for (var t, r, o = 0, a = 0, i = 0; i < e.length - 1; i++) t = r || e[i], r = e[i + 1], o += t[0] * r[1] - r[0] * t[1], a += Math.abs(r[0] - t[0]) + Math.abs(r[1] - t[1]); e.area = Math.abs(o / 2), e.dist = a; } module.exports = convert; var simplify = _dereq_("./simplify"), createFeature = _dereq_("./feature"); },{"./feature":10,"./simplify":12}],"10":[function(_dereq_, module, exports) { "use strict"; function createFeature(e, t, a, n) { var r = { id: n || null, type: t, geometry: a, tags: e || null, min: [ 1 / 0, 1 / 0 ], max: [ -1 / 0, -1 / 0 ] }; return calcBBox(r), r; } function calcBBox(e) { var t = e.geometry, a = e.min, n = e.max; if (1 === e.type) calcRingBBox(a, n, t); else for (var r = 0; r < t.length; r++) calcRingBBox(a, n, t[r]); return e; } function calcRingBBox(e, t, a) { for (var n, r = 0; r < a.length; r++) n = a[r], e[0] = Math.min(n[0], e[0]), t[0] = Math.max(n[0], t[0]), e[1] = Math.min(n[1], e[1]), t[1] = Math.max(n[1], t[1]); } module.exports = createFeature; },{}],"11":[function(_dereq_, module, exports) { "use strict"; function geojsonvt(e, t) { return new GeoJSONVT(e, t); } function GeoJSONVT(e, t) { t = this.options = extend(Object.create(this.options), t); var i = t.debug; i && console.time("preprocess data"); var o = 1 << t.maxZoom, n = convert(e, t.tolerance / (o * t.extent)); this.tiles = {}, this.tileCoords = [], i && (console.timeEnd("preprocess data"), console.log("index: maxZoom: %d, maxPoints: %d", t.indexMaxZoom, t.indexMaxPoints), console.time("generate tiles"), this.stats = {}, this.total = 0), n = wrap(n, t.buffer / t.extent, intersectX), n.length && this.splitTile(n, 0, 0, 0), i && (n.length && console.log("features: %d, points: %d", this.tiles[0].numFeatures, this.tiles[0].numPoints), console.timeEnd("generate tiles"), console.log("tiles generated:", this.total, JSON.stringify(this.stats))); } function toID(e, t, i) { return 32 * ((1 << e) * i + t) + e; } function intersectX(e, t, i) { return [ i, (i - e[0]) * (t[1] - e[1]) / (t[0] - e[0]) + e[1], 1 ]; } function intersectY(e, t, i) { return [ (i - e[1]) * (t[0] - e[0]) / (t[1] - e[1]) + e[0], i, 1 ]; } function extend(e, t) { for (var i in t) e[i] = t[i]; return e; } function isClippedSquare(e, t, i) { var o = e.source; if (1 !== o.length) return !1; var n = o[0]; if (3 !== n.type || n.geometry.length > 1) return !1; var r = n.geometry[0].length; if (5 !== r) return !1; for (var s = 0; s < r; s++) { var l = transform.point(n.geometry[0][s], t, e.z2, e.x, e.y); if (l[0] !== -i && l[0] !== t + i || l[1] !== -i && l[1] !== t + i) return !1; } return !0; } module.exports = geojsonvt; var convert = _dereq_("./convert"), transform = _dereq_("./transform"), clip = _dereq_("./clip"), wrap = _dereq_("./wrap"), createTile = _dereq_("./tile"); GeoJSONVT.prototype.options = { maxZoom: 14, indexMaxZoom: 5, indexMaxPoints: 1e5, solidChildren: !1, tolerance: 3, extent: 4096, buffer: 64, debug: 0 }, GeoJSONVT.prototype.splitTile = function(e, t, i, o, n, r, s) { for (var l = [ e, t, i, o ], a = this.options, u = a.debug, c = null; l.length; ) { o = l.pop(), i = l.pop(), t = l.pop(), e = l.pop(); var p = 1 << t, d = toID(t, i, o), m = this.tiles[d], f = t === a.maxZoom ? 0 : a.tolerance / (p * a.extent); if (!m && (u > 1 && console.time("creation"), m = this.tiles[d] = createTile(e, p, i, o, f, t === a.maxZoom), this.tileCoords.push({ z: t, x: i, y: o }), u)) { u > 1 && (console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)", t, i, o, m.numFeatures, m.numPoints, m.numSimplified), console.timeEnd("creation")); var h = "z" + t; this.stats[h] = (this.stats[h] || 0) + 1, this.total++; } if (m.source = e, n) { if (t === a.maxZoom || t === n) continue; var x = 1 << n - t; if (i !== Math.floor(r / x) || o !== Math.floor(s / x)) continue; } else if (t === a.indexMaxZoom || m.numPoints <= a.indexMaxPoints) continue; if (a.solidChildren || !isClippedSquare(m, a.extent, a.buffer)) { m.source = null, u > 1 && console.time("clipping"); var g, v, M, T, b, y, S = .5 * a.buffer / a.extent, Z = .5 - S, q = .5 + S, w = 1 + S; g = v = M = T = null, b = clip(e, p, i - S, i + q, 0, intersectX, m.min[0], m.max[0]), y = clip(e, p, i + Z, i + w, 0, intersectX, m.min[0], m.max[0]), b && (g = clip(b, p, o - S, o + q, 1, intersectY, m.min[1], m.max[1]), v = clip(b, p, o + Z, o + w, 1, intersectY, m.min[1], m.max[1])), y && (M = clip(y, p, o - S, o + q, 1, intersectY, m.min[1], m.max[1]), T = clip(y, p, o + Z, o + w, 1, intersectY, m.min[1], m.max[1])), u > 1 && console.timeEnd("clipping"), e.length && (l.push(g || [], t + 1, 2 * i, 2 * o), l.push(v || [], t + 1, 2 * i, 2 * o + 1), l.push(M || [], t + 1, 2 * i + 1, 2 * o), l.push(T || [], t + 1, 2 * i + 1, 2 * o + 1)); } else n && (c = t); } return c; }, GeoJSONVT.prototype.getTile = function(e, t, i) { var o = this.options, n = o.extent, r = o.debug, s = 1 << e; t = (t % s + s) % s; var l = toID(e, t, i); if (this.tiles[l]) return transform.tile(this.tiles[l], n); r > 1 && console.log("drilling down to z%d-%d-%d", e, t, i); for (var a, u = e, c = t, p = i; !a && u > 0; ) u--, c = Math.floor(c / 2), p = Math.floor(p / 2), a = this.tiles[toID(u, c, p)]; if (!a || !a.source) return null; if (r > 1 && console.log("found parent tile z%d-%d-%d", u, c, p), isClippedSquare(a, n, o.buffer)) return transform.tile(a, n); r > 1 && console.time("drilling down"); var d = this.splitTile(a.source, u, c, p, e, t, i); if (r > 1 && console.timeEnd("drilling down"), null !== d) { var m = 1 << e - d; l = toID(d, Math.floor(t / m), Math.floor(i / m)); } return this.tiles[l] ? transform.tile(this.tiles[l], n) : null; }; },{"./clip":8,"./convert":9,"./tile":13,"./transform":14,"./wrap":15}],"12":[function(_dereq_, module, exports) { "use strict"; function simplify(t, i) { var e, p, r, s, o = i * i, f = t.length, u = 0, n = f - 1, g = []; for (t[u][2] = 1, t[n][2] = 1; n; ) { for (p = 0, e = u + 1; e < n; e++) (r = getSqSegDist(t[e], t[u], t[n])) > p && (s = e, p = r); p > o ? (t[s][2] = p, g.push(u), g.push(s), u = s) : (n = g.pop(), u = g.pop()); } } function getSqSegDist(t, i, e) { var p = i[0], r = i[1], s = e[0], o = e[1], f = t[0], u = t[1], n = s - p, g = o - r; if (0 !== n || 0 !== g) { var l = ((f - p) * n + (u - r) * g) / (n * n + g * g); l > 1 ? (p = s, r = o) : l > 0 && (p += n * l, r += g * l); } return n = f - p, g = u - r, n * n + g * g; } module.exports = simplify; },{}],"13":[function(_dereq_, module, exports) { "use strict"; function createTile(e, n, r, i, t, u) { for (var a = { features: [], numPoints: 0, numSimplified: 0, numFeatures: 0, source: null, x: r, y: i, z2: n, transformed: !1, min: [ 2, 1 ], max: [ -1, 0 ] }, m = 0; m < e.length; m++) { a.numFeatures++, addFeature(a, e[m], t, u); var s = e[m].min, l = e[m].max; s[0] < a.min[0] && (a.min[0] = s[0]), s[1] < a.min[1] && (a.min[1] = s[1]), l[0] > a.max[0] && (a.max[0] = l[0]), l[1] > a.max[1] && (a.max[1] = l[1]); } return a; } function addFeature(e, n, r, i) { var t, u, a, m, s = n.geometry, l = n.type, o = [], f = r * r; if (1 === l) for (t = 0; t < s.length; t++) o.push(s[t]), e.numPoints++, e.numSimplified++; else for (t = 0; t < s.length; t++) if (a = s[t], i || !(2 === l && a.dist < r || 3 === l && a.area < f)) { var d = []; for (u = 0; u < a.length; u++) m = a[u], (i || m[2] > f) && (d.push(m), e.numSimplified++), e.numPoints++; 3 === l && rewind(d, a.outer), o.push(d); } else e.numPoints += a.length; if (o.length) { var g = { geometry: o, type: l, tags: n.tags || null }; null !== n.id && (g.id = n.id), e.features.push(g); } } function rewind(e, n) { signedArea(e) < 0 === n && e.reverse(); } function signedArea(e) { for (var n, r, i = 0, t = 0, u = e.length, a = u - 1; t < u; a = t++) n = e[t], r = e[a], i += (r[0] - n[0]) * (n[1] + r[1]); return i; } module.exports = createTile; },{}],"14":[function(_dereq_, module, exports) { "use strict"; function transformTile(r, t) { if (r.transformed) return r; var n, e, o, f = r.z2, a = r.x, s = r.y; for (n = 0; n < r.features.length; n++) { var i = r.features[n], u = i.geometry; if (1 === i.type) for (e = 0; e < u.length; e++) u[e] = transformPoint(u[e], t, f, a, s); else for (e = 0; e < u.length; e++) { var l = u[e]; for (o = 0; o < l.length; o++) l[o] = transformPoint(l[o], t, f, a, s); } } return r.transformed = !0, r; } function transformPoint(r, t, n, e, o) { return [ Math.round(t * (r[0] * n - e)), Math.round(t * (r[1] * n - o)) ]; } exports.tile = transformTile, exports.point = transformPoint; },{}],"15":[function(_dereq_, module, exports) { "use strict"; function wrap(r, e, t) { var o = r, a = clip(r, 1, -1 - e, e, 0, t, -1, 2), s = clip(r, 1, 1 - e, 2 + e, 0, t, -1, 2); return (a || s) && (o = clip(r, 1, -e, 1 + e, 0, t, -1, 2) || [], a && (o = shiftFeatureCoords(a, 1).concat(o)), s && (o = o.concat(shiftFeatureCoords(s, -1)))), o; } function shiftFeatureCoords(r, e) { for (var t = [], o = 0; o < r.length; o++) { var a, s = r[o], i = s.type; if (1 === i) a = shiftCoords(s.geometry, e); else { a = []; for (var u = 0; u < s.geometry.length; u++) a.push(shiftCoords(s.geometry[u], e)); } t.push(createFeature(s.tags, i, a, s.id)); } return t; } function shiftCoords(r, e) { var t = []; t.area = r.area, t.dist = r.dist; for (var o = 0; o < r.length; o++) t.push([ r[o][0] + e, r[o][1], r[o][2] ]); return t; } var clip = _dereq_("./clip"), createFeature = _dereq_("./feature"); module.exports = wrap; },{"./clip":8,"./feature":10}],"16":[function(_dereq_, module, exports) { "use strict"; function GridIndex(t, r, e) { var s = this.cells = []; if (t instanceof ArrayBuffer) { this.arrayBuffer = t; var i = new Int32Array(this.arrayBuffer); t = i[0], r = i[1], e = i[2], this.d = r + 2 * e; for (var h = 0; h < this.d * this.d; h++) { var n = i[NUM_PARAMS + h], o = i[NUM_PARAMS + h + 1]; s.push(n === o ? null : i.subarray(n, o)); } var l = i[NUM_PARAMS + s.length], a = i[NUM_PARAMS + s.length + 1]; this.keys = i.subarray(l, a), this.bboxes = i.subarray(a), this.insert = this._insertReadonly; } else { this.d = r + 2 * e; for (var d = 0; d < this.d * this.d; d++) s.push([]); this.keys = [], this.bboxes = []; } this.n = r, this.extent = t, this.padding = e, this.scale = r / t, this.uid = 0; var f = e / r * t; this.min = -f, this.max = t + f; } module.exports = GridIndex; var NUM_PARAMS = 3; GridIndex.prototype.insert = function(t, r, e, s, i) { this._forEachCell(r, e, s, i, this._insertCell, this.uid++), this.keys.push(t), this.bboxes.push(r), this.bboxes.push(e), this.bboxes.push(s), this.bboxes.push(i); }, GridIndex.prototype._insertReadonly = function() { throw "Cannot insert into a GridIndex created from an ArrayBuffer."; }, GridIndex.prototype._insertCell = function(t, r, e, s, i, h) { this.cells[i].push(h); }, GridIndex.prototype.query = function(t, r, e, s) { var i = this.min, h = this.max; if (t <= i && r <= i && h <= e && h <= s) return Array.prototype.slice.call(this.keys); var n = [], o = {}; return this._forEachCell(t, r, e, s, this._queryCell, n, o), n; }, GridIndex.prototype._queryCell = function(t, r, e, s, i, h, n) { var o = this.cells[i]; if (null !== o) for (var l = this.keys, a = this.bboxes, d = 0; d < o.length; d++) { var f = o[d]; if (void 0 === n[f]) { var u = 4 * f; t <= a[u + 2] && r <= a[u + 3] && e >= a[u + 0] && s >= a[u + 1] ? (n[f] = !0, h.push(l[f])) : n[f] = !1; } } }, GridIndex.prototype._forEachCell = function(t, r, e, s, i, h, n) { for (var o = this._convertToCellCoord(t), l = this._convertToCellCoord(r), a = this._convertToCellCoord(e), d = this._convertToCellCoord(s), f = o; f <= a; f++) for (var u = l; u <= d; u++) { var y = this.d * u + f; if (i.call(this, t, r, e, s, y, h, n)) return; } }, GridIndex.prototype._convertToCellCoord = function(t) { return Math.max(0, Math.min(this.d - 1, Math.floor(t * this.scale) + this.padding)); }, GridIndex.prototype.toArrayBuffer = function() { if (this.arrayBuffer) return this.arrayBuffer; for (var t = this.cells, r = NUM_PARAMS + this.cells.length + 1 + 1, e = 0, s = 0; s < this.cells.length; s++) e += this.cells[s].length; var i = new Int32Array(r + e + this.keys.length + this.bboxes.length); i[0] = this.extent, i[1] = this.n, i[2] = this.padding; for (var h = r, n = 0; n < t.length; n++) { var o = t[n]; i[NUM_PARAMS + n] = h, i.set(o, h), h += o.length; } return i[NUM_PARAMS + t.length] = h, i.set(this.keys, h), h += this.keys.length, i[NUM_PARAMS + t.length + 1] = h, i.set(this.bboxes, h), h += this.bboxes.length, i.buffer; }; },{}],"17":[function(_dereq_, module, exports) { exports.read = function(a, o, t, r, h) { var M, p, w = 8 * h - r - 1, f = (1 << w) - 1, e = f >> 1, i = -7, N = t ? h - 1 : 0, n = t ? -1 : 1, s = a[o + N]; for (N += n, M = s & (1 << -i) - 1, s >>= -i, i += w; i > 0; M = 256 * M + a[o + N], N += n, i -= 8) ; for (p = M & (1 << -i) - 1, M >>= -i, i += r; i > 0; p = 256 * p + a[o + N], N += n, i -= 8) ; if (0 === M) M = 1 - e; else { if (M === f) return p ? NaN : 1 / 0 * (s ? -1 : 1); p += Math.pow(2, r), M -= e; } return (s ? -1 : 1) * p * Math.pow(2, M - r); }, exports.write = function(a, o, t, r, h, M) { var p, w, f, e = 8 * M - h - 1, i = (1 << e) - 1, N = i >> 1, n = 23 === h ? Math.pow(2, -24) - Math.pow(2, -77) : 0, s = r ? 0 : M - 1, u = r ? 1 : -1, l = o < 0 || 0 === o && 1 / o < 0 ? 1 : 0; for (o = Math.abs(o), isNaN(o) || o === 1 / 0 ? (w = isNaN(o) ? 1 : 0, p = i) : (p = Math.floor(Math.log(o) / Math.LN2), o * (f = Math.pow(2, -p)) < 1 && (p--, f *= 2), o += p + N >= 1 ? n / f : n * Math.pow(2, 1 - N), o * f >= 2 && (p++, f /= 2), p + N >= i ? (w = 0, p = i) : p + N >= 1 ? (w = (o * f - 1) * Math.pow(2, h), p += N) : (w = o * Math.pow(2, N - 1) * Math.pow(2, h), p = 0)); h >= 8; a[t + s] = 255 & w, s += u, w /= 256, h -= 8) ; for (p = p << h | w, e += h; e > 0; a[t + s] = 255 & p, s += u, p /= 256, e -= 8) ; a[t + s - u] |= 128 * l; }; },{}],"18":[function(_dereq_, module, exports) { "use strict"; function kdbush(t, i, e, s, n) { return new KDBush(t, i, e, s, n); } function KDBush(t, i, e, s, n) { i = i || defaultGetX, e = e || defaultGetY, n = n || Array, this.nodeSize = s || 64, this.points = t, this.ids = new n(t.length), this.coords = new n(2 * t.length); for (var r = 0; r < t.length; r++) this.ids[r] = r, this.coords[2 * r] = i(t[r]), this.coords[2 * r + 1] = e(t[r]); sort(this.ids, this.coords, this.nodeSize, 0, this.ids.length - 1, 0); } function defaultGetX(t) { return t[0]; } function defaultGetY(t) { return t[1]; } var sort = _dereq_("./sort"), range = _dereq_("./range"), within = _dereq_("./within"); module.exports = kdbush, KDBush.prototype = { range: function(t, i, e, s) { return range(this.ids, this.coords, t, i, e, s, this.nodeSize); }, within: function(t, i, e) { return within(this.ids, this.coords, t, i, e, this.nodeSize); } }; },{"./range":19,"./sort":20,"./within":21}],"19":[function(_dereq_, module, exports) { "use strict"; function range(p, r, s, u, h, e, o) { for (var a, t, n = [ 0, p.length - 1, 0 ], f = []; n.length; ) { var l = n.pop(), v = n.pop(), g = n.pop(); if (v - g <= o) for (var i = g; i <= v; i++) a = r[2 * i], t = r[2 * i + 1], a >= s && a <= h && t >= u && t <= e && f.push(p[i]); else { var c = Math.floor((g + v) / 2); a = r[2 * c], t = r[2 * c + 1], a >= s && a <= h && t >= u && t <= e && f.push(p[c]); var d = (l + 1) % 2; (0 === l ? s <= a : u <= t) && (n.push(g), n.push(c - 1), n.push(d)), (0 === l ? h >= a : e >= t) && (n.push(c + 1), n.push(v), n.push(d)); } } return f; } module.exports = range; },{}],"20":[function(_dereq_, module, exports) { "use strict"; function sortKD(t, a, o, s, r, e) { if (!(r - s <= o)) { var f = Math.floor((s + r) / 2); select(t, a, f, s, r, e % 2), sortKD(t, a, o, s, f - 1, e + 1), sortKD(t, a, o, f + 1, r, e + 1); } } function select(t, a, o, s, r, e) { for (;r > s; ) { if (r - s > 600) { var f = r - s + 1, p = o - s + 1, w = Math.log(f), m = .5 * Math.exp(2 * w / 3), n = .5 * Math.sqrt(w * m * (f - m) / f) * (p - f / 2 < 0 ? -1 : 1); select(t, a, o, Math.max(s, Math.floor(o - p * m / f + n)), Math.min(r, Math.floor(o + (f - p) * m / f + n)), e); } var i = a[2 * o + e], l = s, M = r; for (swapItem(t, a, s, o), a[2 * r + e] > i && swapItem(t, a, s, r); l < M; ) { for (swapItem(t, a, l, M), l++, M--; a[2 * l + e] < i; ) l++; for (;a[2 * M + e] > i; ) M--; } a[2 * s + e] === i ? swapItem(t, a, s, M) : (M++, swapItem(t, a, M, r)), M <= o && (s = M + 1), o <= M && (r = M - 1); } } function swapItem(t, a, o, s) { swap(t, o, s), swap(a, 2 * o, 2 * s), swap(a, 2 * o + 1, 2 * s + 1); } function swap(t, a, o) { var s = t[a]; t[a] = t[o], t[o] = s; } module.exports = sortKD; },{}],"21":[function(_dereq_, module, exports) { "use strict"; function within(s, p, r, t, u, h) { for (var i = [ 0, s.length - 1, 0 ], o = [], n = u * u; i.length; ) { var e = i.pop(), a = i.pop(), f = i.pop(); if (a - f <= h) for (var v = f; v <= a; v++) sqDist(p[2 * v], p[2 * v + 1], r, t) <= n && o.push(s[v]); else { var l = Math.floor((f + a) / 2), c = p[2 * l], q = p[2 * l + 1]; sqDist(c, q, r, t) <= n && o.push(s[l]); var D = (e + 1) % 2; (0 === e ? r - u <= c : t - u <= q) && (i.push(f), i.push(l - 1), i.push(D)), (0 === e ? r + u >= c : t + u >= q) && (i.push(l + 1), i.push(a), i.push(D)); } } return o; } function sqDist(s, p, r, t) { var u = s - r, h = p - t; return u * u + h * h; } module.exports = within; },{}],"24":[function(_dereq_, module, exports) { "use strict"; function Buffer(t) { var e; t && t.length && (e = t, t = e.length); var r = new Uint8Array(t || 0); return e && r.set(e), r.readUInt32LE = BufferMethods.readUInt32LE, r.writeUInt32LE = BufferMethods.writeUInt32LE, r.readInt32LE = BufferMethods.readInt32LE, r.writeInt32LE = BufferMethods.writeInt32LE, r.readFloatLE = BufferMethods.readFloatLE, r.writeFloatLE = BufferMethods.writeFloatLE, r.readDoubleLE = BufferMethods.readDoubleLE, r.writeDoubleLE = BufferMethods.writeDoubleLE, r.toString = BufferMethods.toString, r.write = BufferMethods.write, r.slice = BufferMethods.slice, r.copy = BufferMethods.copy, r._isBuffer = !0, r; } function encodeString(t) { for (var e, r, n = t.length, i = [], o = 0; o < n; o++) { if ((e = t.charCodeAt(o)) > 55295 && e < 57344) { if (!r) { e > 56319 || o + 1 === n ? i.push(239, 191, 189) : r = e; continue; } if (e < 56320) { i.push(239, 191, 189), r = e; continue; } e = r - 55296 << 10 | e - 56320 | 65536, r = null; } else r && (i.push(239, 191, 189), r = null); e < 128 ? i.push(e) : e < 2048 ? i.push(e >> 6 | 192, 63 & e | 128) : e < 65536 ? i.push(e >> 12 | 224, e >> 6 & 63 | 128, 63 & e | 128) : i.push(e >> 18 | 240, e >> 12 & 63 | 128, e >> 6 & 63 | 128, 63 & e | 128); } return i; } module.exports = Buffer; var BufferMethods, lastStr, lastStrEncoded, ieee754 = _dereq_("ieee754"); BufferMethods = { readUInt32LE: function(t) { return (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3]; }, writeUInt32LE: function(t, e) { this[e] = t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24; }, readInt32LE: function(t) { return (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + (this[t + 3] << 24); }, readFloatLE: function(t) { return ieee754.read(this, t, !0, 23, 4); }, readDoubleLE: function(t) { return ieee754.read(this, t, !0, 52, 8); }, writeFloatLE: function(t, e) { return ieee754.write(this, t, e, !0, 23, 4); }, writeDoubleLE: function(t, e) { return ieee754.write(this, t, e, !0, 52, 8); }, toString: function(t, e, r) { var n = "", i = ""; e = e || 0, r = Math.min(this.length, r || this.length); for (var o = e; o < r; o++) { var u = this[o]; u <= 127 ? (n += decodeURIComponent(i) + String.fromCharCode(u), i = "") : i += "%" + u.toString(16); } return n += decodeURIComponent(i); }, write: function(t, e) { for (var r = t === lastStr ? lastStrEncoded : encodeString(t), n = 0; n < r.length; n++) this[e + n] = r[n]; }, slice: function(t, e) { return this.subarray(t, e); }, copy: function(t, e) { e = e || 0; for (var r = 0; r < this.length; r++) t[e + r] = this[r]; } }, BufferMethods.writeInt32LE = BufferMethods.writeUInt32LE, Buffer.byteLength = function(t) { return lastStr = t, lastStrEncoded = encodeString(t), lastStrEncoded.length; }, Buffer.isBuffer = function(t) { return !(!t || !t._isBuffer); }; },{"ieee754":17}],"25":[function(_dereq_, module, exports) { (function(global) { "use strict"; function Pbf(t) { this.buf = Buffer.isBuffer(t) ? t : new Buffer(t || 0), this.pos = 0, this.length = this.buf.length; } function readVarintRemainder(t, i) { var e, r = i.buf; if (e = r[i.pos++], t += 268435456 * (127 & e), e < 128) return t; if (e = r[i.pos++], t += 34359738368 * (127 & e), e < 128) return t; if (e = r[i.pos++], t += 4398046511104 * (127 & e), e < 128) return t; if (e = r[i.pos++], t += 562949953421312 * (127 & e), e < 128) return t; if (e = r[i.pos++], t += 72057594037927940 * (127 & e), e < 128) return t; if (e = r[i.pos++], t += 0x8000000000000000 * (127 & e), e < 128) return t; throw new Error("Expected varint not more than 10 bytes"); } function writeBigVarint(t, i) { i.realloc(10); for (var e = i.pos + 10; t >= 1; ) { if (i.pos >= e) throw new Error("Given varint doesn't fit into 10 bytes"); var r = 255 & t; i.buf[i.pos++] = r | (t >= 128 ? 128 : 0), t /= 128; } } function reallocForRawMessage(t, i, e) { var r = i <= 16383 ? 1 : i <= 2097151 ? 2 : i <= 268435455 ? 3 : Math.ceil(Math.log(i) / (7 * Math.LN2)); e.realloc(r); for (var s = e.pos - 1; s >= t; s--) e.buf[s + r] = e.buf[s]; } function writePackedVarint(t, i) { for (var e = 0; e < t.length; e++) i.writeVarint(t[e]); } function writePackedSVarint(t, i) { for (var e = 0; e < t.length; e++) i.writeSVarint(t[e]); } function writePackedFloat(t, i) { for (var e = 0; e < t.length; e++) i.writeFloat(t[e]); } function writePackedDouble(t, i) { for (var e = 0; e < t.length; e++) i.writeDouble(t[e]); } function writePackedBoolean(t, i) { for (var e = 0; e < t.length; e++) i.writeBoolean(t[e]); } function writePackedFixed32(t, i) { for (var e = 0; e < t.length; e++) i.writeFixed32(t[e]); } function writePackedSFixed32(t, i) { for (var e = 0; e < t.length; e++) i.writeSFixed32(t[e]); } function writePackedFixed64(t, i) { for (var e = 0; e < t.length; e++) i.writeFixed64(t[e]); } function writePackedSFixed64(t, i) { for (var e = 0; e < t.length; e++) i.writeSFixed64(t[e]); } module.exports = Pbf; var Buffer = global.Buffer || _dereq_("./buffer"); Pbf.Varint = 0, Pbf.Fixed64 = 1, Pbf.Bytes = 2, Pbf.Fixed32 = 5; var POW_2_63 = Math.pow(2, 63); Pbf.prototype = { destroy: function() { this.buf = null; }, readFields: function(t, i, e) { for (e = e || this.length; this.pos < e; ) { var r = this.readVarint(), s = r >> 3, n = this.pos; t(s, i, this), this.pos === n && this.skip(r); } return i; }, readMessage: function(t, i) { return this.readFields(t, i, this.readVarint() + this.pos); }, readFixed32: function() { var t = this.buf.readUInt32LE(this.pos); return this.pos += 4, t; }, readSFixed32: function() { var t = this.buf.readInt32LE(this.pos); return this.pos += 4, t; }, readFixed64: function() { var t = this.buf.readUInt32LE(this.pos) + 4294967296 * this.buf.readUInt32LE(this.pos + 4); return this.pos += 8, t; }, readSFixed64: function() { var t = this.buf.readUInt32LE(this.pos) + 4294967296 * this.buf.readInt32LE(this.pos + 4); return this.pos += 8, t; }, readFloat: function() { var t = this.buf.readFloatLE(this.pos); return this.pos += 4, t; }, readDouble: function() { var t = this.buf.readDoubleLE(this.pos); return this.pos += 8, t; }, readVarint: function() { var t, i, e = this.buf; return i = e[this.pos++], t = 127 & i, i < 128 ? t : (i = e[this.pos++], t |= (127 & i) << 7, i < 128 ? t : (i = e[this.pos++], t |= (127 & i) << 14, i < 128 ? t : (i = e[this.pos++], t |= (127 & i) << 21, i < 128 ? t : readVarintRemainder(t, this)))); }, readVarint64: function() { var t = this.pos, i = this.readVarint(); if (i < POW_2_63) return i; for (var e = this.pos - 2; 255 === this.buf[e]; ) e--; e < t && (e = t), i = 0; for (var r = 0; r < e - t + 1; r++) { var s = 127 & ~this.buf[t + r]; i += r < 4 ? s << 7 * r : s * Math.pow(2, 7 * r); } return -i - 1; }, readSVarint: function() { var t = this.readVarint(); return t % 2 == 1 ? (t + 1) / -2 : t / 2; }, readBoolean: function() { return Boolean(this.readVarint()); }, readString: function() { var t = this.readVarint() + this.pos, i = this.buf.toString("utf8", this.pos, t); return this.pos = t, i; }, readBytes: function() { var t = this.readVarint() + this.pos, i = this.buf.slice(this.pos, t); return this.pos = t, i; }, readPackedVarint: function() { for (var t = this.readVarint() + this.pos, i = []; this.pos < t; ) i.push(this.readVarint()); return i; }, readPackedSVarint: function() { for (var t = this.readVarint() + this.pos, i = []; this.pos < t; ) i.push(this.readSVarint()); return i; }, readPackedBoolean: function() { for (var t = this.readVarint() + this.pos, i = []; this.pos < t; ) i.push(this.readBoolean()); return i; }, readPackedFloat: function() { for (var t = this.readVarint() + this.pos, i = []; this.pos < t; ) i.push(this.readFloat()); return i; }, readPackedDouble: function() { for (var t = this.readVarint() + this.pos, i = []; this.pos < t; ) i.push(this.readDouble()); return i; }, readPackedFixed32: function() { for (var t = this.readVarint() + this.pos, i = []; this.pos < t; ) i.push(this.readFixed32()); return i; }, readPackedSFixed32: function() { for (var t = this.readVarint() + this.pos, i = []; this.pos < t; ) i.push(this.readSFixed32()); return i; }, readPackedFixed64: function() { for (var t = this.readVarint() + this.pos, i = []; this.pos < t; ) i.push(this.readFixed64()); return i; }, readPackedSFixed64: function() { for (var t = this.readVarint() + this.pos, i = []; this.pos < t; ) i.push(this.readSFixed64()); return i; }, skip: function(t) { var i = 7 & t; if (i === Pbf.Varint) for (;this.buf[this.pos++] > 127; ) ; else if (i === Pbf.Bytes) this.pos = this.readVarint() + this.pos; else if (i === Pbf.Fixed32) this.pos += 4; else { if (i !== Pbf.Fixed64) throw new Error("Unimplemented type: " + i); this.pos += 8; } }, writeTag: function(t, i) { this.writeVarint(t << 3 | i); }, realloc: function(t) { for (var i = this.length || 16; i < this.pos + t; ) i *= 2; if (i !== this.length) { var e = new Buffer(i); this.buf.copy(e), this.buf = e, this.length = i; } }, finish: function() { return this.length = this.pos, this.pos = 0, this.buf.slice(0, this.length); }, writeFixed32: function(t) { this.realloc(4), this.buf.writeUInt32LE(t, this.pos), this.pos += 4; }, writeSFixed32: function(t) { this.realloc(4), this.buf.writeInt32LE(t, this.pos), this.pos += 4; }, writeFixed64: function(t) { this.realloc(8), this.buf.writeInt32LE(-1 & t, this.pos), this.buf.writeUInt32LE(Math.floor(t * (1 / 4294967296)), this.pos + 4), this.pos += 8; }, writeSFixed64: function(t) { this.realloc(8), this.buf.writeInt32LE(-1 & t, this.pos), this.buf.writeInt32LE(Math.floor(t * (1 / 4294967296)), this.pos + 4), this.pos += 8; }, writeVarint: function(t) { return t = +t, t > 268435455 ? void writeBigVarint(t, this) : (this.realloc(4), this.buf[this.pos++] = 127 & t | (t > 127 ? 128 : 0), void (t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = t >>> 7 & 127))))); }, writeSVarint: function(t) { this.writeVarint(t < 0 ? 2 * -t - 1 : 2 * t); }, writeBoolean: function(t) { this.writeVarint(Boolean(t)); }, writeString: function(t) { t = String(t); var i = Buffer.byteLength(t); this.writeVarint(i), this.realloc(i), this.buf.write(t, this.pos), this.pos += i; }, writeFloat: function(t) { this.realloc(4), this.buf.writeFloatLE(t, this.pos), this.pos += 4; }, writeDouble: function(t) { this.realloc(8), this.buf.writeDoubleLE(t, this.pos), this.pos += 8; }, writeBytes: function(t) { var i = t.length; this.writeVarint(i), this.realloc(i); for (var e = 0; e < i; e++) this.buf[this.pos++] = t[e]; }, writeRawMessage: function(t, i) { this.pos++; var e = this.pos; t(i, this); var r = this.pos - e; r >= 128 && reallocForRawMessage(e, r, this), this.pos = e - 1, this.writeVarint(r), this.pos += r; }, writeMessage: function(t, i, e) { this.writeTag(t, Pbf.Bytes), this.writeRawMessage(i, e); }, writePackedVarint: function(t, i) { this.writeMessage(t, writePackedVarint, i); }, writePackedSVarint: function(t, i) { this.writeMessage(t, writePackedSVarint, i); }, writePackedBoolean: function(t, i) { this.writeMessage(t, writePackedBoolean, i); }, writePackedFloat: function(t, i) { this.writeMessage(t, writePackedFloat, i); }, writePackedDouble: function(t, i) { this.writeMessage(t, writePackedDouble, i); }, writePackedFixed32: function(t, i) { this.writeMessage(t, writePackedFixed32, i); }, writePackedSFixed32: function(t, i) { this.writeMessage(t, writePackedSFixed32, i); }, writePackedFixed64: function(t, i) { this.writeMessage(t, writePackedFixed64, i); }, writePackedSFixed64: function(t, i) { this.writeMessage(t, writePackedSFixed64, i); }, writeBytesField: function(t, i) { this.writeTag(t, Pbf.Bytes), this.writeBytes(i); }, writeFixed32Field: function(t, i) { this.writeTag(t, Pbf.Fixed32), this.writeFixed32(i); }, writeSFixed32Field: function(t, i) { this.writeTag(t, Pbf.Fixed32), this.writeSFixed32(i); }, writeFixed64Field: function(t, i) { this.writeTag(t, Pbf.Fixed64), this.writeFixed64(i); }, writeSFixed64Field: function(t, i) { this.writeTag(t, Pbf.Fixed64), this.writeSFixed64(i); }, writeVarintField: function(t, i) { this.writeTag(t, Pbf.Varint), this.writeVarint(i); }, writeSVarintField: function(t, i) { this.writeTag(t, Pbf.Varint), this.writeSVarint(i); }, writeStringField: function(t, i) { this.writeTag(t, Pbf.Bytes), this.writeString(i); }, writeFloatField: function(t, i) { this.writeTag(t, Pbf.Fixed32), this.writeFloat(i); }, writeDoubleField: function(t, i) { this.writeTag(t, Pbf.Fixed64), this.writeDouble(i); }, writeBooleanField: function(t, i) { this.writeVarintField(t, Boolean(i)); } }; }).call(this, void 0 !== global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); },{"./buffer":24}],"26":[function(_dereq_, module, exports) { "use strict"; function Point(t, n) { this.x = t, this.y = n; } module.exports = Point, Point.prototype = { clone: function() { return new Point(this.x, this.y); }, add: function(t) { return this.clone()._add(t); }, sub: function(t) { return this.clone()._sub(t); }, mult: function(t) { return this.clone()._mult(t); }, div: function(t) { return this.clone()._div(t); }, rotate: function(t) { return this.clone()._rotate(t); }, matMult: function(t) { return this.clone()._matMult(t); }, unit: function() { return this.clone()._unit(); }, perp: function() { return this.clone()._perp(); }, round: function() { return this.clone()._round(); }, mag: function() { return Math.sqrt(this.x * this.x + this.y * this.y); }, equals: function(t) { return this.x === t.x && this.y === t.y; }, dist: function(t) { return Math.sqrt(this.distSqr(t)); }, distSqr: function(t) { var n = t.x - this.x, i = t.y - this.y; return n * n + i * i; }, angle: function() { return Math.atan2(this.y, this.x); }, angleTo: function(t) { return Math.atan2(this.y - t.y, this.x - t.x); }, angleWith: function(t) { return this.angleWithSep(t.x, t.y); }, angleWithSep: function(t, n) { return Math.atan2(this.x * n - this.y * t, this.x * t + this.y * n); }, _matMult: function(t) { var n = t[0] * this.x + t[1] * this.y, i = t[2] * this.x + t[3] * this.y; return this.x = n, this.y = i, this; }, _add: function(t) { return this.x += t.x, this.y += t.y, this; }, _sub: function(t) { return this.x -= t.x, this.y -= t.y, this; }, _mult: function(t) { return this.x *= t, this.y *= t, this; }, _div: function(t) { return this.x /= t, this.y /= t, this; }, _unit: function() { return this._div(this.mag()), this; }, _perp: function() { var t = this.y; return this.y = this.x, this.x = -t, this; }, _rotate: function(t) { var n = Math.cos(t), i = Math.sin(t), s = n * this.x - i * this.y, r = i * this.x + n * this.y; return this.x = s, this.y = r, this; }, _round: function() { return this.x = Math.round(this.x), this.y = Math.round(this.y), this; } }, Point.convert = function(t) { return t instanceof Point ? t : Array.isArray(t) ? new Point(t[0], t[1]) : t; }; },{}],"27":[function(_dereq_, module, exports) { function defaultSetTimout() { throw new Error("setTimeout has not been defined"); } function defaultClearTimeout() { throw new Error("clearTimeout has not been defined"); } function runTimeout(e) { if (cachedSetTimeout === setTimeout) return setTimeout(e, 0); if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) return cachedSetTimeout = setTimeout, setTimeout(e, 0); try { return cachedSetTimeout(e, 0); } catch (t) { try { return cachedSetTimeout.call(null, e, 0); } catch (t) { return cachedSetTimeout.call(this, e, 0); } } } function runClearTimeout(e) { if (cachedClearTimeout === clearTimeout) return clearTimeout(e); if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) return cachedClearTimeout = clearTimeout, clearTimeout(e); try { return cachedClearTimeout(e); } catch (t) { try { return cachedClearTimeout.call(null, e); } catch (t) { return cachedClearTimeout.call(this, e); } } } function cleanUpNextTick() { draining && currentQueue && (draining = !1, currentQueue.length ? queue = currentQueue.concat(queue) : queueIndex = -1, queue.length && drainQueue()); } function drainQueue() { if (!draining) { var e = runTimeout(cleanUpNextTick); draining = !0; for (var t = queue.length; t; ) { for (currentQueue = queue, queue = []; ++queueIndex < t; ) currentQueue && currentQueue[queueIndex].run(); queueIndex = -1, t = queue.length; } currentQueue = null, draining = !1, runClearTimeout(e); } } function Item(e, t) { this.fun = e, this.array = t; } function noop() {} var cachedSetTimeout, cachedClearTimeout, process = module.exports = {}; !function() { try { cachedSetTimeout = "function" == typeof setTimeout ? setTimeout : defaultSetTimout; } catch (e) { cachedSetTimeout = defaultSetTimout; } try { cachedClearTimeout = "function" == typeof clearTimeout ? clearTimeout : defaultClearTimeout; } catch (e) { cachedClearTimeout = defaultClearTimeout; } }(); var currentQueue, queue = [], draining = !1, queueIndex = -1; process.nextTick = function(e) { var t = new Array(arguments.length - 1); if (arguments.length > 1) for (var u = 1; u < arguments.length; u++) t[u - 1] = arguments[u]; queue.push(new Item(e, t)), 1 !== queue.length || draining || runTimeout(drainQueue); }, Item.prototype.run = function() { this.fun.apply(null, this.array); }, process.title = "browser", process.browser = !0, process.env = {}, process.argv = [], process.version = "", process.versions = {}, process.on = noop, process.addListener = noop, process.once = noop, process.off = noop, process.removeListener = noop, process.removeAllListeners = noop, process.emit = noop, process.binding = function(e) { throw new Error("process.binding is not supported"); }, process.cwd = function() { return "/"; }, process.chdir = function(e) { throw new Error("process.chdir is not supported"); }, process.umask = function() { return 0; }; },{}],"28":[function(_dereq_, module, exports) { "use strict"; function partialSort(a, t, r, o, p) { for (r = r || 0, o = o || a.length - 1, p = p || defaultCompare; o > r; ) { if (o - r > 600) { var f = o - r + 1, e = t - r + 1, l = Math.log(f), s = .5 * Math.exp(2 * l / 3), i = .5 * Math.sqrt(l * s * (f - s) / f) * (e - f / 2 < 0 ? -1 : 1); partialSort(a, t, Math.max(r, Math.floor(t - e * s / f + i)), Math.min(o, Math.floor(t + (f - e) * s / f + i)), p); } var u = a[t], M = r, w = o; for (swap(a, r, t), p(a[o], u) > 0 && swap(a, r, o); M < w; ) { for (swap(a, M, w), M++, w--; p(a[M], u) < 0; ) M++; for (;p(a[w], u) > 0; ) w--; } 0 === p(a[r], u) ? swap(a, r, w) : (w++, swap(a, w, o)), w <= t && (r = w + 1), t <= w && (o = w - 1); } } function swap(a, t, r) { var o = a[t]; a[t] = a[r], a[r] = o; } function defaultCompare(a, t) { return a < t ? -1 : a > t ? 1 : 0; } module.exports = partialSort; },{}],"29":[function(_dereq_, module, exports) { "use strict"; function supercluster(t) { return new SuperCluster(t); } function SuperCluster(t) { this.options = extend(Object.create(this.options), t), this.trees = new Array(this.options.maxZoom + 1); } function createCluster(t, e, o, n) { return { x: t, y: e, zoom: 1 / 0, id: n, numPoints: o }; } function createPointCluster(t, e) { var o = t.geometry.coordinates; return createCluster(lngX(o[0]), latY(o[1]), 1, e); } function getClusterJSON(t) { return { type: "Feature", properties: getClusterProperties(t), geometry: { type: "Point", coordinates: [ xLng(t.x), yLat(t.y) ] } }; } function getClusterProperties(t) { var e = t.numPoints; return { cluster: !0, point_count: e, point_count_abbreviated: e >= 1e4 ? Math.round(e / 1e3) + "k" : e >= 1e3 ? Math.round(e / 100) / 10 + "k" : e }; } function lngX(t) { return t / 360 + .5; } function latY(t) { var e = Math.sin(t * Math.PI / 180), o = .5 - .25 * Math.log((1 + e) / (1 - e)) / Math.PI; return o < 0 ? 0 : o > 1 ? 1 : o; } function xLng(t) { return 360 * (t - .5); } function yLat(t) { var e = (180 - 360 * t) * Math.PI / 180; return 360 * Math.atan(Math.exp(e)) / Math.PI - 90; } function extend(t, e) { for (var o in e) t[o] = e[o]; return t; } function getX(t) { return t.x; } function getY(t) { return t.y; } var kdbush = _dereq_("kdbush"); module.exports = supercluster, SuperCluster.prototype = { options: { minZoom: 0, maxZoom: 16, radius: 40, extent: 512, nodeSize: 64, log: !1 }, load: function(t) { var e = this.options.log; e && console.time("total time"); var o = "prepare " + t.length + " points"; e && console.time(o), this.points = t; var n = t.map(createPointCluster); e && console.timeEnd(o); for (var r = this.options.maxZoom; r >= this.options.minZoom; r--) { var i = +Date.now(); this.trees[r + 1] = kdbush(n, getX, getY, this.options.nodeSize, Float32Array), n = this._cluster(n, r), e && console.log("z%d: %d clusters in %dms", r, n.length, +Date.now() - i); } return this.trees[this.options.minZoom] = kdbush(n, getX, getY, this.options.nodeSize, Float32Array), e && console.timeEnd("total time"), this; }, getClusters: function(t, e) { for (var o = this.trees[this._limitZoom(e)], n = o.range(lngX(t[0]), latY(t[3]), lngX(t[2]), latY(t[1])), r = [], i = 0; i < n.length; i++) { var s = o.points[n[i]]; r.push(-1 !== s.id ? this.points[s.id] : getClusterJSON(s)); } return r; }, getTile: function(t, e, o) { var n = this.trees[this._limitZoom(t)], r = Math.pow(2, t), i = this.options.extent, s = this.options.radius, u = s / i, a = (o - u) / r, h = (o + 1 + u) / r, l = { features: [] }; return this._addTileFeatures(n.range((e - u) / r, a, (e + 1 + u) / r, h), n.points, e, o, r, l), 0 === e && this._addTileFeatures(n.range(1 - u / r, a, 1, h), n.points, r, o, r, l), e === r - 1 && this._addTileFeatures(n.range(0, a, u / r, h), n.points, -1, o, r, l), l.features.length ? l : null; }, _addTileFeatures: function(t, e, o, n, r, i) { for (var s = 0; s < t.length; s++) { var u = e[t[s]]; i.features.push({ type: 1, geometry: [ [ Math.round(this.options.extent * (u.x * r - o)), Math.round(this.options.extent * (u.y * r - n)) ] ], tags: -1 !== u.id ? this.points[u.id].properties : getClusterProperties(u) }); } }, _limitZoom: function(t) { return Math.max(this.options.minZoom, Math.min(t, this.options.maxZoom + 1)); }, _cluster: function(t, e) { for (var o = [], n = this.options.radius / (this.options.extent * Math.pow(2, e)), r = 0; r < t.length; r++) { var i = t[r]; if (!(i.zoom <= e)) { i.zoom = e; for (var s = this.trees[e + 1], u = s.within(i.x, i.y, n), a = !1, h = i.numPoints, l = i.x * h, p = i.y * h, m = 0; m < u.length; m++) { var c = s.points[u[m]]; e < c.zoom && (a = !0, c.zoom = e, l += c.x * c.numPoints, p += c.y * c.numPoints, h += c.numPoints); } o.push(a ? createCluster(l / h, p / h, h, -1) : i); } } return o; } }; },{"kdbush":18}],"30":[function(_dereq_, module, exports) { "use strict"; function TinyQueue(t, i) { if (!(this instanceof TinyQueue)) return new TinyQueue(t, i); if (this.data = t || [], this.length = this.data.length, this.compare = i || defaultCompare, t) for (var a = Math.floor(this.length / 2); a >= 0; a--) this._down(a); } function defaultCompare(t, i) { return t < i ? -1 : t > i ? 1 : 0; } function swap(t, i, a) { var n = t[i]; t[i] = t[a], t[a] = n; } module.exports = TinyQueue, TinyQueue.prototype = { push: function(t) { this.data.push(t), this.length++, this._up(this.length - 1); }, pop: function() { var t = this.data[0]; return this.data[0] = this.data[this.length - 1], this.length--, this.data.pop(), this._down(0), t; }, peek: function() { return this.data[0]; }, _up: function(t) { for (var i = this.data, a = this.compare; t > 0; ) { var n = Math.floor((t - 1) / 2); if (!(a(i[t], i[n]) < 0)) break; swap(i, n, t), t = n; } }, _down: function(t) { for (var i = this.data, a = this.compare, n = this.length; ;) { var e = 2 * t + 1, h = e + 1, s = t; if (e < n && a(i[e], i[s]) < 0 && (s = e), h < n && a(i[h], i[s]) < 0 && (s = h), s === t) return; swap(i, s, t), t = s; } } }; },{}],"31":[function(_dereq_, module, exports) { "function" == typeof Object.create ? module.exports = function(t, e) { t.super_ = e, t.prototype = Object.create(e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }); } : module.exports = function(t, e) { t.super_ = e; var o = function() {}; o.prototype = e.prototype, t.prototype = new o(), t.prototype.constructor = t; }; },{}],"32":[function(_dereq_, module, exports) { module.exports = function(o) { return o && "object" == typeof o && "function" == typeof o.copy && "function" == typeof o.fill && "function" == typeof o.readUInt8; }; },{}],"33":[function(_dereq_, module, exports) { (function(process, global) { function inspect(e, r) { var t = { seen: [], stylize: stylizeNoColor }; return arguments.length >= 3 && (t.depth = arguments[2]), arguments.length >= 4 && (t.colors = arguments[3]), isBoolean(r) ? t.showHidden = r : r && exports._extend(t, r), isUndefined(t.showHidden) && (t.showHidden = !1), isUndefined(t.depth) && (t.depth = 2), isUndefined(t.colors) && (t.colors = !1), isUndefined(t.customInspect) && (t.customInspect = !0), t.colors && (t.stylize = stylizeWithColor), formatValue(t, e, t.depth); } function stylizeWithColor(e, r) { var t = inspect.styles[r]; return t ? "[" + inspect.colors[t][0] + "m" + e + "[" + inspect.colors[t][1] + "m" : e; } function stylizeNoColor(e, r) { return e; } function arrayToHash(e) { var r = {}; return e.forEach(function(e, t) { r[e] = !0; }), r; } function formatValue(e, r, t) { if (e.customInspect && r && isFunction(r.inspect) && r.inspect !== exports.inspect && (!r.constructor || r.constructor.prototype !== r)) { var n = r.inspect(t, e); return isString(n) || (n = formatValue(e, n, t)), n; } var i = formatPrimitive(e, r); if (i) return i; var o = Object.keys(r), s = arrayToHash(o); if (e.showHidden && (o = Object.getOwnPropertyNames(r)), isError(r) && (o.indexOf("message") >= 0 || o.indexOf("description") >= 0)) return formatError(r); if (0 === o.length) { if (isFunction(r)) { var u = r.name ? ": " + r.name : ""; return e.stylize("[Function" + u + "]", "special"); } if (isRegExp(r)) return e.stylize(RegExp.prototype.toString.call(r), "regexp"); if (isDate(r)) return e.stylize(Date.prototype.toString.call(r), "date"); if (isError(r)) return formatError(r); } var c = "", a = !1, l = [ "{", "}" ]; if (isArray(r) && (a = !0, l = [ "[", "]" ]), isFunction(r)) { c = " [Function" + (r.name ? ": " + r.name : "") + "]"; } if (isRegExp(r) && (c = " " + RegExp.prototype.toString.call(r)), isDate(r) && (c = " " + Date.prototype.toUTCString.call(r)), isError(r) && (c = " " + formatError(r)), 0 === o.length && (!a || 0 == r.length)) return l[0] + c + l[1]; if (t < 0) return isRegExp(r) ? e.stylize(RegExp.prototype.toString.call(r), "regexp") : e.stylize("[Object]", "special"); e.seen.push(r); var f; return f = a ? formatArray(e, r, t, s, o) : o.map(function(n) { return formatProperty(e, r, t, s, n, a); }), e.seen.pop(), reduceToSingleString(f, c, l); } function formatPrimitive(e, r) { if (isUndefined(r)) return e.stylize("undefined", "undefined"); if (isString(r)) { var t = "'" + JSON.stringify(r).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; return e.stylize(t, "string"); } return isNumber(r) ? e.stylize("" + r, "number") : isBoolean(r) ? e.stylize("" + r, "boolean") : isNull(r) ? e.stylize("null", "null") : void 0; } function formatError(e) { return "[" + Error.prototype.toString.call(e) + "]"; } function formatArray(e, r, t, n, i) { for (var o = [], s = 0, u = r.length; s < u; ++s) hasOwnProperty(r, String(s)) ? o.push(formatProperty(e, r, t, n, String(s), !0)) : o.push(""); return i.forEach(function(i) { i.match(/^\d+$/) || o.push(formatProperty(e, r, t, n, i, !0)); }), o; } function formatProperty(e, r, t, n, i, o) { var s, u, c; if (c = Object.getOwnPropertyDescriptor(r, i) || { value: r[i] }, c.get ? u = c.set ? e.stylize("[Getter/Setter]", "special") : e.stylize("[Getter]", "special") : c.set && (u = e.stylize("[Setter]", "special")), hasOwnProperty(n, i) || (s = "[" + i + "]"), u || (e.seen.indexOf(c.value) < 0 ? (u = isNull(t) ? formatValue(e, c.value, null) : formatValue(e, c.value, t - 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(s)) { if (o && i.match(/^\d+$/)) return u; s = JSON.stringify("" + i), s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (s = s.substr(1, s.length - 2), s = e.stylize(s, "name")) : (s = s.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), s = e.stylize(s, "string")); } return s + ": " + u; } function reduceToSingleString(e, r, t) { var n = 0; return e.reduce(function(e, r) { return n++, r.indexOf("\n") >= 0 && n++, e + r.replace(/\u001b\[\d\d?m/g, "").length + 1; }, 0) > 60 ? t[0] + ("" === r ? "" : r + "\n ") + " " + e.join(",\n ") + " " + t[1] : t[0] + r + " " + e.join(", ") + " " + t[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 || void 0 === e; } function objectToString(e) { return Object.prototype.toString.call(e); } function pad(e) { return e < 10 ? "0" + e.toString(10) : e.toString(10); } function timestamp() { var e = new Date(), r = [ pad(e.getHours()), pad(e.getMinutes()), pad(e.getSeconds()) ].join(":"); return [ e.getDate(), months[e.getMonth()], r ].join(" "); } function hasOwnProperty(e, r) { return Object.prototype.hasOwnProperty.call(e, r); } var formatRegExp = /%[sdj%]/g; exports.format = function(e) { if (!isString(e)) { for (var r = [], t = 0; t < arguments.length; t++) r.push(inspect(arguments[t])); return r.join(" "); } for (var t = 1, n = arguments, i = n.length, o = String(e).replace(formatRegExp, function(e) { if ("%%" === e) return "%"; if (t >= i) return e; switch (e) { case "%s": return String(n[t++]); case "%d": return Number(n[t++]); case "%j": try { return JSON.stringify(n[t++]); } catch (e) { return "[Circular]"; } default: return e; } }), s = n[t]; t < i; s = n[++t]) o += isNull(s) || !isObject(s) ? " " + s : " " + inspect(s); return o; }, exports.deprecate = function(e, r) { function t() { if (!n) { if (process.throwDeprecation) throw new Error(r); process.traceDeprecation ? console.trace(r) : console.error(r), n = !0; } return e.apply(this, arguments); } if (isUndefined(global.process)) return function() { return exports.deprecate(e, r).apply(this, arguments); }; if (!0 === process.noDeprecation) return e; var n = !1; return t; }; var debugEnviron, debugs = {}; exports.debuglog = function(e) { if (isUndefined(debugEnviron) && (debugEnviron = process.env.NODE_DEBUG || ""), e = e.toUpperCase(), !debugs[e]) if (new RegExp("\\b" + e + "\\b", "i").test(debugEnviron)) { var r = process.pid; debugs[e] = function() { var t = exports.format.apply(exports, arguments); console.error("%s %d: %s", e, r, t); }; } else debugs[e] = function() {}; return debugs[e]; }, exports.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" }, exports.isArray = isArray, exports.isBoolean = isBoolean, exports.isNull = isNull, exports.isNullOrUndefined = isNullOrUndefined, exports.isNumber = isNumber, exports.isString = isString, exports.isSymbol = isSymbol, exports.isUndefined = isUndefined, exports.isRegExp = isRegExp, exports.isObject = isObject, exports.isDate = isDate, exports.isError = isError, exports.isFunction = isFunction, exports.isPrimitive = isPrimitive, exports.isBuffer = _dereq_("./support/isBuffer"); var months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; exports.log = function() { console.log("%s - %s", timestamp(), exports.format.apply(exports, arguments)); }, exports.inherits = _dereq_("inherits"), exports._extend = function(e, r) { if (!r || !isObject(r)) return e; for (var t = Object.keys(r), n = t.length; n--; ) e[t[n]] = r[t[n]]; return e; }; }).call(this, _dereq_("_process"), void 0 !== global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); },{"./support/isBuffer":32,"_process":27,"inherits":31}],"34":[function(_dereq_, module, exports) { module.exports.VectorTile = _dereq_("./lib/vectortile.js"), module.exports.VectorTileFeature = _dereq_("./lib/vectortilefeature.js"), module.exports.VectorTileLayer = _dereq_("./lib/vectortilelayer.js"); },{"./lib/vectortile.js":35,"./lib/vectortilefeature.js":36,"./lib/vectortilelayer.js":37}],"35":[function(_dereq_, module, exports) { "use strict"; function VectorTile(e, r) { this.layers = e.readFields(readTile, {}, r); } function readTile(e, r, i) { if (3 === e) { var t = new VectorTileLayer(i, i.readVarint() + i.pos); t.length && (r[t.name] = t); } } var VectorTileLayer = _dereq_("./vectortilelayer"); module.exports = VectorTile; },{"./vectortilelayer":37}],"36":[function(_dereq_, module, exports) { "use strict"; function VectorTileFeature(e, t, r, i, a) { this.properties = {}, this.extent = r, this.type = 0, this._pbf = e, this._geometry = -1, this._keys = i, this._values = a, e.readFields(readFeature, this, t); } function readFeature(e, t, r) { 1 == e ? t.id = r.readVarint() : 2 == e ? readTag(r, t) : 3 == e ? t.type = r.readVarint() : 4 == e && (t._geometry = r.pos); } function readTag(e, t) { for (var r = e.readVarint() + e.pos; e.pos < r; ) { var i = t._keys[e.readVarint()], a = t._values[e.readVarint()]; t.properties[i] = a; } } function classifyRings(e) { var t = e.length; if (t <= 1) return [ e ]; for (var r, i, a = [], o = 0; o < t; o++) { var n = signedArea(e[o]); 0 !== n && (void 0 === i && (i = n < 0), i === n < 0 ? (r && a.push(r), r = [ e[o] ]) : r.push(e[o])); } return r && a.push(r), a; } function signedArea(e) { for (var t, r, i = 0, a = 0, o = e.length, n = o - 1; a < o; n = a++) t = e[a], r = e[n], i += (r.x - t.x) * (t.y + r.y); return i; } var Point = _dereq_("point-geometry"); module.exports = VectorTileFeature, VectorTileFeature.types = [ "Unknown", "Point", "LineString", "Polygon" ], VectorTileFeature.prototype.loadGeometry = function() { var e = this._pbf; e.pos = this._geometry; for (var t, r = e.readVarint() + e.pos, i = 1, a = 0, o = 0, n = 0, s = []; e.pos < r; ) { if (!a) { var p = e.readVarint(); i = 7 & p, a = p >> 3; } if (a--, 1 === i || 2 === i) o += e.readSVarint(), n += e.readSVarint(), 1 === i && (t && s.push(t), t = []), t.push(new Point(o, n)); else { if (7 !== i) throw new Error("unknown command " + i); t && t.push(t[0].clone()); } } return t && s.push(t), s; }, VectorTileFeature.prototype.bbox = function() { var e = this._pbf; e.pos = this._geometry; for (var t = e.readVarint() + e.pos, r = 1, i = 0, a = 0, o = 0, n = 1 / 0, s = -1 / 0, p = 1 / 0, h = -1 / 0; e.pos < t; ) { if (!i) { var u = e.readVarint(); r = 7 & u, i = u >> 3; } if (i--, 1 === r || 2 === r) a += e.readSVarint(), o += e.readSVarint(), a < n && (n = a), a > s && (s = a), o < p && (p = o), o > h && (h = o); else if (7 !== r) throw new Error("unknown command " + r); } return [ n, p, s, h ]; }, VectorTileFeature.prototype.toGeoJSON = function(e, t, r) { function i(e) { for (var t = 0; t < e.length; t++) { var r = e[t], i = 180 - 360 * (r.y + p) / n; e[t] = [ 360 * (r.x + s) / n - 180, 360 / Math.PI * Math.atan(Math.exp(i * Math.PI / 180)) - 90 ]; } } var a, o, n = this.extent * Math.pow(2, r), s = this.extent * e, p = this.extent * t, h = this.loadGeometry(), u = VectorTileFeature.types[this.type]; switch (this.type) { case 1: var d = []; for (a = 0; a < h.length; a++) d[a] = h[a][0]; h = d, i(h); break; case 2: for (a = 0; a < h.length; a++) i(h[a]); break; case 3: for (h = classifyRings(h), a = 0; a < h.length; a++) for (o = 0; o < h[a].length; o++) i(h[a][o]); } 1 === h.length ? h = h[0] : u = "Multi" + u; var f = { type: "Feature", geometry: { type: u, coordinates: h }, properties: this.properties }; return "id" in this && (f.id = this.id), f; }; },{"point-geometry":26}],"37":[function(_dereq_, module, exports) { "use strict"; function VectorTileLayer(e, t) { this.version = 1, this.name = null, this.extent = 4096, this.length = 0, this._pbf = e, this._keys = [], this._values = [], this._features = [], e.readFields(readLayer, this, t), this.length = this._features.length; } function readLayer(e, t, r) { 15 === e ? t.version = r.readVarint() : 1 === e ? t.name = r.readString() : 5 === e ? t.extent = r.readVarint() : 2 === e ? t._features.push(r.pos) : 3 === e ? t._keys.push(r.readString()) : 4 === e && t._values.push(readValueMessage(r)); } function readValueMessage(e) { for (var t = null, r = e.readVarint() + e.pos; e.pos < r; ) { var a = e.readVarint() >> 3; t = 1 === a ? e.readString() : 2 === a ? e.readFloat() : 3 === a ? e.readDouble() : 4 === a ? e.readVarint64() : 5 === a ? e.readVarint() : 6 === a ? e.readSVarint() : 7 === a ? e.readBoolean() : null; } return t; } var VectorTileFeature = _dereq_("./vectortilefeature.js"); module.exports = VectorTileLayer, VectorTileLayer.prototype.feature = function(e) { if (e < 0 || e >= this._features.length) throw new Error("feature index out of bounds"); this._pbf.pos = this._features[e]; var t = this._pbf.readVarint() + this._pbf.pos; return new VectorTileFeature(this._pbf, t, this.extent, this._keys, this._values); }; },{"./vectortilefeature.js":36}],"38":[function(_dereq_, module, exports) { function fromVectorTileJs(e) { var r = []; for (var o in e.layers) r.push(prepareLayer(e.layers[o])); var t = new Pbf(); return vtpb.tile.write({ layers: r }, t), t.finish(); } function fromGeojsonVt(e) { var r = {}; for (var o in e) r[o] = new GeoJSONWrapper(e[o].features), r[o].name = o; return fromVectorTileJs({ layers: r }); } function prepareLayer(e) { for (var r = { name: e.name || "", version: e.version || 1, extent: e.extent || 4096, keys: [], values: [], features: [] }, o = {}, t = {}, n = 0; n < e.length; n++) { var a = e.feature(n); a.geometry = encodeGeometry(a.loadGeometry()); var u = []; for (var s in a.properties) { var i = o[s]; void 0 === i && (r.keys.push(s), i = r.keys.length - 1, o[s] = i); var p = wrapValue(a.properties[s]), l = t[p.key]; void 0 === l && (r.values.push(p), l = r.values.length - 1, t[p.key] = l), u.push(i), u.push(l); } a.tags = u, r.features.push(a); } return r; } function command(e, r) { return (r << 3) + (7 & e); } function zigzag(e) { return e << 1 ^ e >> 31; } function encodeGeometry(e) { for (var r = [], o = 0, t = 0, n = e.length, a = 0; a < n; a++) { var u = e[a]; r.push(command(1, 1)); for (var s = 0; s < u.length; s++) { 1 === s && r.push(command(2, u.length - 1)); var i = u[s].x - o, p = u[s].y - t; r.push(zigzag(i), zigzag(p)), o += i, t += p; } } return r; } function wrapValue(e) { var r, o = typeof e; return "string" === o ? r = { string_value: e } : "boolean" === o ? r = { bool_value: e } : "number" === o ? r = e % 1 != 0 ? { double_value: e } : e < 0 ? { sint_value: e } : { uint_value: e } : (e = JSON.stringify(e), r = { string_value: e }), r.key = o + ":" + e, r; } var Pbf = _dereq_("pbf"), vtpb = _dereq_("./vector-tile-pb"), GeoJSONWrapper = _dereq_("./lib/geojson_wrapper"); module.exports = fromVectorTileJs, module.exports.fromVectorTileJs = fromVectorTileJs, module.exports.fromGeojsonVt = fromGeojsonVt, module.exports.GeoJSONWrapper = GeoJSONWrapper; },{"./lib/geojson_wrapper":39,"./vector-tile-pb":40,"pbf":25}],"39":[function(_dereq_, module, exports) { "use strict"; function GeoJSONWrapper(e) { this.features = e, this.length = e.length; } function FeatureWrapper(e) { this.id = "number" == typeof e.id ? e.id : void 0, this.type = e.type, this.rawGeometry = 1 === e.type ? [ e.geometry ] : e.geometry, this.properties = e.tags, this.extent = 4096; } var Point = _dereq_("point-geometry"), VectorTileFeature = _dereq_("vector-tile").VectorTileFeature; module.exports = GeoJSONWrapper, GeoJSONWrapper.prototype.feature = function(e) { return new FeatureWrapper(this.features[e]); }, FeatureWrapper.prototype.loadGeometry = function() { var e = this.rawGeometry; this.geometry = []; for (var t = 0; t < e.length; t++) { for (var r = e[t], o = [], a = 0; a < r.length; a++) o.push(new Point(r[a][0], r[a][1])); this.geometry.push(o); } return this.geometry; }, FeatureWrapper.prototype.bbox = function() { this.geometry || this.loadGeometry(); for (var e = this.geometry, t = 1 / 0, r = -1 / 0, o = 1 / 0, a = -1 / 0, i = 0; i < e.length; i++) for (var p = e[i], n = 0; n < p.length; n++) { var h = p[n]; t = Math.min(t, h.x), r = Math.max(r, h.x), o = Math.min(o, h.y), a = Math.max(a, h.y); } return [ t, o, r, a ]; }, FeatureWrapper.prototype.toGeoJSON = VectorTileFeature.prototype.toGeoJSON; },{"point-geometry":26,"vector-tile":34}],"40":[function(_dereq_, module, exports) { "use strict"; function readTile(e, r) { return e.readFields(readTileField, { layers: [] }, r); } function readTileField(e, r, i) { 3 === e && r.layers.push(readLayer(i, i.readVarint() + i.pos)); } function writeTile(e, r) { var i; if (void 0 !== e.layers) for (i = 0; i < e.layers.length; i++) r.writeMessage(3, writeLayer, e.layers[i]); } function readValue(e, r) { return e.readFields(readValueField, {}, r); } function readValueField(e, r, i) { 1 === e ? r.string_value = i.readString() : 2 === e ? r.float_value = i.readFloat() : 3 === e ? r.double_value = i.readDouble() : 4 === e ? r.int_value = i.readVarint() : 5 === e ? r.uint_value = i.readVarint() : 6 === e ? r.sint_value = i.readSVarint() : 7 === e && (r.bool_value = i.readBoolean()); } function writeValue(e, r) { void 0 !== e.string_value && r.writeStringField(1, e.string_value), void 0 !== e.float_value && r.writeFloatField(2, e.float_value), void 0 !== e.double_value && r.writeDoubleField(3, e.double_value), void 0 !== e.int_value && r.writeVarintField(4, e.int_value), void 0 !== e.uint_value && r.writeVarintField(5, e.uint_value), void 0 !== e.sint_value && r.writeSVarintField(6, e.sint_value), void 0 !== e.bool_value && r.writeBooleanField(7, e.bool_value); } function readFeature(e, r) { var i = e.readFields(readFeatureField, {}, r); return void 0 === i.type && (i.type = "Unknown"), i; } function readFeatureField(e, r, i) { 1 === e ? r.id = i.readVarint() : 2 === e ? r.tags = i.readPackedVarint() : 3 === e ? r.type = i.readVarint() : 4 === e && (r.geometry = i.readPackedVarint()); } function writeFeature(e, r) { void 0 !== e.id && r.writeVarintField(1, e.id), void 0 !== e.tags && r.writePackedVarint(2, e.tags), void 0 !== e.type && r.writeVarintField(3, e.type), void 0 !== e.geometry && r.writePackedVarint(4, e.geometry); } function readLayer(e, r) { return e.readFields(readLayerField, { features: [], keys: [], values: [] }, r); } function readLayerField(e, r, i) { 15 === e ? r.version = i.readVarint() : 1 === e ? r.name = i.readString() : 2 === e ? r.features.push(readFeature(i, i.readVarint() + i.pos)) : 3 === e ? r.keys.push(i.readString()) : 4 === e ? r.values.push(readValue(i, i.readVarint() + i.pos)) : 5 === e && (r.extent = i.readVarint()); } function writeLayer(e, r) { void 0 !== e.version && r.writeVarintField(15, e.version), void 0 !== e.name && r.writeStringField(1, e.name); var i; if (void 0 !== e.features) for (i = 0; i < e.features.length; i++) r.writeMessage(2, writeFeature, e.features[i]); if (void 0 !== e.keys) for (i = 0; i < e.keys.length; i++) r.writeStringField(3, e.keys[i]); if (void 0 !== e.values) for (i = 0; i < e.values.length; i++) r.writeMessage(4, writeValue, e.values[i]); void 0 !== e.extent && r.writeVarintField(5, e.extent); } var tile = exports.tile = { read: readTile, write: writeTile }; tile.GeomType = { Unknown: 0, Point: 1, LineString: 2, Polygon: 3 }, tile.value = { read: readValue, write: writeValue }, tile.feature = { read: readFeature, write: writeFeature }, tile.layer = { read: readLayer, write: writeLayer }; },{}],"42":[function(_dereq_, module, exports) { module.exports.RADIUS = 6378137, module.exports.FLATTENING = 1 / 298.257223563, module.exports.POLAR_RADIUS = 6356752.3142; },{}],"44":[function(_dereq_, module, exports) { "use strict"; function serializePaintVertexArrays(r, e) { var t = {}; for (var a in r) { var i = r[a].paintVertexArray; if (0 !== i.length) { var n = i.serialize(e), s = i.constructor.serialize(); t[a] = { array: n, type: s }; } } return t; } var ProgramConfiguration = _dereq_("./program_configuration"), createVertexArrayType = _dereq_("./vertex_array_type"), Segment = function(r, e) { this.vertexOffset = r, this.primitiveOffset = e, this.vertexLength = 0, this.primitiveLength = 0; }, ArrayGroup = function(r, e, t) { var a = this; this.globalProperties = { zoom: t }; var i = createVertexArrayType(r.layoutAttributes); this.layoutVertexArray = new i(); var n = r.elementArrayType; n && (this.elementArray = new n()); var s = r.elementArrayType2; s && (this.elementArray2 = new s()), this.layerData = {}; for (var y = 0, o = e; y < o.length; y += 1) { var p = o[y], l = ProgramConfiguration.createDynamic(r.paintAttributes || [], p, t); a.layerData[p.id] = { layer: p, programConfiguration: l, paintVertexArray: new l.PaintVertexArray(), paintPropertyStatistics: l.createPaintPropertyStatistics() }; } this.segments = [], this.segments2 = []; }; ArrayGroup.prototype.prepareSegment = function(r) { var e = this.segments[this.segments.length - 1]; return (!e || e.vertexLength + r > ArrayGroup.MAX_VERTEX_ARRAY_LENGTH) && (e = new Segment(this.layoutVertexArray.length, this.elementArray.length), this.segments.push(e)), e; }, ArrayGroup.prototype.prepareSegment2 = function(r) { var e = this.segments2[this.segments2.length - 1]; return (!e || e.vertexLength + r > ArrayGroup.MAX_VERTEX_ARRAY_LENGTH) && (e = new Segment(this.layoutVertexArray.length, this.elementArray2.length), this.segments2.push(e)), e; }, ArrayGroup.prototype.populatePaintArrays = function(r) { var e = this; for (var t in e.layerData) { var a = e.layerData[t]; 0 !== a.paintVertexArray.bytesPerElement && a.programConfiguration.populatePaintArray(a.layer, a.paintVertexArray, a.paintPropertyStatistics, e.layoutVertexArray.length, e.globalProperties, r); } }, ArrayGroup.prototype.isEmpty = function() { return 0 === this.layoutVertexArray.length; }, ArrayGroup.prototype.serialize = function(r) { return { layoutVertexArray: this.layoutVertexArray.serialize(r), elementArray: this.elementArray && this.elementArray.serialize(r), elementArray2: this.elementArray2 && this.elementArray2.serialize(r), paintVertexArrays: serializePaintVertexArrays(this.layerData, r), segments: this.segments, segments2: this.segments2 }; }, ArrayGroup.MAX_VERTEX_ARRAY_LENGTH = Math.pow(2, 16) - 1, module.exports = ArrayGroup; },{"./program_configuration":58,"./vertex_array_type":60}],"45":[function(_dereq_, module, exports) { "use strict"; var ArrayGroup = _dereq_("./array_group"), BufferGroup = _dereq_("./buffer_group"), util = _dereq_("../util/util"), Bucket = function(r, t) { this.zoom = r.zoom, this.overscaling = r.overscaling, this.layers = r.layers, this.index = r.index, r.arrays ? this.buffers = new BufferGroup(t, r.layers, r.zoom, r.arrays) : this.arrays = new ArrayGroup(t, r.layers, r.zoom); }; Bucket.prototype.populate = function(r, t) { for (var e = this, i = 0, a = r; i < a.length; i += 1) { var u = a[i]; e.layers[0].filter(u) && (e.addFeature(u), t.featureIndex.insert(u, e.index)); } }, Bucket.prototype.getPaintPropertyStatistics = function() { return util.mapObject(this.arrays.layerData, function(r) { return r.paintPropertyStatistics; }); }, Bucket.prototype.isEmpty = function() { return this.arrays.isEmpty(); }, Bucket.prototype.serialize = function(r) { return { zoom: this.zoom, layerIds: this.layers.map(function(r) { return r.id; }), arrays: this.arrays.serialize(r) }; }, Bucket.prototype.destroy = function() { this.buffers && (this.buffers.destroy(), this.buffers = null); }, module.exports = Bucket, Bucket.deserialize = function(r, t) { if (t) { for (var e = {}, i = 0, a = r; i < a.length; i += 1) { var u = a[i], o = u.layerIds.map(function(r) { return t.getLayer(r); }).filter(Boolean); if (0 !== o.length) for (var s = o[0].createBucket(util.extend({ layers: o }, u)), n = 0, f = o; n < f.length; n += 1) { var y = f[n]; e[y.id] = s; } } return e; } }; },{"../util/util":215,"./array_group":44,"./buffer_group":52}],"46":[function(_dereq_, module, exports) { "use strict"; function addCircleVertex(e, r, t, c, i) { e.emplaceBack(2 * r + (c + 1) / 2, 2 * t + (i + 1) / 2); } var Bucket = _dereq_("../bucket"), createElementArrayType = _dereq_("../element_array_type"), loadGeometry = _dereq_("../load_geometry"), EXTENT = _dereq_("../extent"), circleInterface = { layoutAttributes: [ { name: "a_pos", components: 2, type: "Int16" } ], elementArrayType: createElementArrayType(), paintAttributes: [ { property: "circle-color", type: "Uint8" }, { property: "circle-radius", type: "Uint16", multiplier: 10 }, { property: "circle-blur", type: "Uint16", multiplier: 10 }, { property: "circle-opacity", type: "Uint8", multiplier: 255 }, { property: "circle-stroke-color", type: "Uint8" }, { property: "circle-stroke-width", type: "Uint16", multiplier: 10 }, { property: "circle-stroke-opacity", type: "Uint8", multiplier: 255 } ] }, CircleBucket = function(e) { function r(r) { e.call(this, r, circleInterface); } return e && (r.__proto__ = e), r.prototype = Object.create(e && e.prototype), r.prototype.constructor = r, r.prototype.addFeature = function(e) { for (var r = this.arrays, t = 0, c = loadGeometry(e); t < c.length; t += 1) for (var i = c[t], a = 0, p = i; a < p.length; a += 1) { var l = p[a], o = l.x, y = l.y; if (!(o < 0 || o >= EXTENT || y < 0 || y >= EXTENT)) { var n = r.prepareSegment(4), u = n.vertexLength; addCircleVertex(r.layoutVertexArray, o, y, -1, -1), addCircleVertex(r.layoutVertexArray, o, y, 1, -1), addCircleVertex(r.layoutVertexArray, o, y, 1, 1), addCircleVertex(r.layoutVertexArray, o, y, -1, 1), r.elementArray.emplaceBack(u, u + 1, u + 2), r.elementArray.emplaceBack(u, u + 3, u + 2), n.vertexLength += 4, n.primitiveLength += 2; } } r.populatePaintArrays(e.properties); }, r; }(Bucket); CircleBucket.programInterface = circleInterface, module.exports = CircleBucket; },{"../bucket":45,"../element_array_type":53,"../extent":54,"../load_geometry":56}],"47":[function(_dereq_, module, exports) { "use strict"; var Bucket = _dereq_("../bucket"), createElementArrayType = _dereq_("../element_array_type"), loadGeometry = _dereq_("../load_geometry"), earcut = _dereq_("earcut"), classifyRings = _dereq_("../../util/classify_rings"), fillInterface = { layoutAttributes: [ { name: "a_pos", components: 2, type: "Int16" } ], elementArrayType: createElementArrayType(3), elementArrayType2: createElementArrayType(2), paintAttributes: [ { property: "fill-color", type: "Uint8" }, { property: "fill-outline-color", type: "Uint8" }, { property: "fill-opacity", type: "Uint8", multiplier: 255 } ] }, FillBucket = function(e) { function t(t) { e.call(this, t, fillInterface); } return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.addFeature = function(e) { for (var t = this.arrays, r = 0, a = classifyRings(loadGeometry(e), 500); r < a.length; r += 1) { for (var l = a[r], n = 0, p = 0, i = l; p < i.length; p += 1) { n += i[p].length; } for (var y = t.prepareSegment(n), c = y.vertexLength, u = [], s = [], g = 0, h = l; g < h.length; g += 1) { var m = h[g]; if (0 !== m.length) { m !== l[0] && s.push(u.length / 2); var f = t.prepareSegment2(m.length), A = f.vertexLength; t.layoutVertexArray.emplaceBack(m[0].x, m[0].y), t.elementArray2.emplaceBack(A + m.length - 1, A), u.push(m[0].x), u.push(m[0].y); for (var v = 1; v < m.length; v++) t.layoutVertexArray.emplaceBack(m[v].x, m[v].y), t.elementArray2.emplaceBack(A + v - 1, A + v), u.push(m[v].x), u.push(m[v].y); f.vertexLength += m.length, f.primitiveLength += m.length; } } for (var _ = earcut(u, s), k = 0; k < _.length; k += 3) t.elementArray.emplaceBack(c + _[k], c + _[k + 1], c + _[k + 2]); y.vertexLength += n, y.primitiveLength += _.length / 3; } t.populatePaintArrays(e.properties); }, t; }(Bucket); FillBucket.programInterface = fillInterface, module.exports = FillBucket; },{"../../util/classify_rings":198,"../bucket":45,"../element_array_type":53,"../load_geometry":56,"earcut":5}],"48":[function(_dereq_, module, exports) { "use strict"; function addVertex(e, t, r, a, n, o, i, y) { e.emplaceBack(t, r, 2 * Math.floor(a * FACTOR) + i, n * FACTOR * 2, o * FACTOR * 2, Math.round(y)); } function isBoundaryEdge(e, t) { return e.x === t.x && (e.x < 0 || e.x > EXTENT) || e.y === t.y && (e.y < 0 || e.y > EXTENT); } var Bucket = _dereq_("../bucket"), createElementArrayType = _dereq_("../element_array_type"), loadGeometry = _dereq_("../load_geometry"), EXTENT = _dereq_("../extent"), earcut = _dereq_("earcut"), classifyRings = _dereq_("../../util/classify_rings"), fillExtrusionInterface = { layoutAttributes: [ { name: "a_pos", components: 2, type: "Int16" }, { name: "a_normal", components: 3, type: "Int16" }, { name: "a_edgedistance", components: 1, type: "Int16" } ], elementArrayType: createElementArrayType(3), paintAttributes: [ { property: "fill-extrusion-base", type: "Uint16" }, { property: "fill-extrusion-height", type: "Uint16" }, { property: "fill-extrusion-color", type: "Uint8" } ] }, FACTOR = Math.pow(2, 13), FillExtrusionBucket = function(e) { function t(t) { e.call(this, t, fillExtrusionInterface); } return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.addFeature = function(e) { for (var t = this.arrays, r = 0, a = classifyRings(loadGeometry(e), 500); r < a.length; r += 1) { for (var n = a[r], o = 0, i = 0, y = n; i < y.length; i += 1) { o += y[i].length; } for (var u = t.prepareSegment(5 * o), p = [], s = [], c = [], x = 0, f = n; x < f.length; x += 1) { var d = f[x]; if (0 !== d.length) { d !== n[0] && s.push(p.length / 2); for (var m = 0, h = 0; h < d.length; h++) { var g = d[h]; if (addVertex(t.layoutVertexArray, g.x, g.y, 0, 0, 1, 1, 0), c.push(u.vertexLength++), h >= 1) { var A = d[h - 1]; if (!isBoundaryEdge(g, A)) { var E = g.sub(A)._perp()._unit(); addVertex(t.layoutVertexArray, g.x, g.y, E.x, E.y, 0, 0, m), addVertex(t.layoutVertexArray, g.x, g.y, E.x, E.y, 0, 1, m), m += A.dist(g), addVertex(t.layoutVertexArray, A.x, A.y, E.x, E.y, 0, 0, m), addVertex(t.layoutVertexArray, A.x, A.y, E.x, E.y, 0, 1, m); var v = u.vertexLength; t.elementArray.emplaceBack(v, v + 1, v + 2), t.elementArray.emplaceBack(v + 1, v + 2, v + 3), u.vertexLength += 4, u.primitiveLength += 2; } } p.push(g.x), p.push(g.y); } } } for (var _ = earcut(p, s), T = 0; T < _.length; T += 3) t.elementArray.emplaceBack(c[_[T]], c[_[T + 1]], c[_[T + 2]]); u.primitiveLength += _.length / 3; } t.populatePaintArrays(e.properties); }, t; }(Bucket); FillExtrusionBucket.programInterface = fillExtrusionInterface, module.exports = FillExtrusionBucket; },{"../../util/classify_rings":198,"../bucket":45,"../element_array_type":53,"../extent":54,"../load_geometry":56,"earcut":5}],"49":[function(_dereq_, module, exports) { "use strict"; function addLineVertex(e, t, r, i, a, n, d) { e.emplaceBack(t.x << 1 | i, t.y << 1 | a, Math.round(EXTRUDE_SCALE * r.x) + 128, Math.round(EXTRUDE_SCALE * r.y) + 128, 1 + (0 === n ? 0 : n < 0 ? -1 : 1) | (d * LINE_DISTANCE_SCALE & 63) << 2, d * LINE_DISTANCE_SCALE >> 6); } var Bucket = _dereq_("../bucket"), createElementArrayType = _dereq_("../element_array_type"), loadGeometry = _dereq_("../load_geometry"), EXTENT = _dereq_("../extent"), VectorTileFeature = _dereq_("vector-tile").VectorTileFeature, EXTRUDE_SCALE = 63, COS_HALF_SHARP_CORNER = Math.cos(Math.PI / 180 * 37.5), LINE_DISTANCE_SCALE = .5, MAX_LINE_DISTANCE = Math.pow(2, 14) / LINE_DISTANCE_SCALE, lineInterface = { layoutAttributes: [ { name: "a_pos", components: 2, type: "Int16" }, { name: "a_data", components: 4, type: "Uint8" } ], paintAttributes: [ { property: "line-color", type: "Uint8" }, { property: "line-blur", multiplier: 10, type: "Uint8" }, { property: "line-opacity", multiplier: 10, type: "Uint8" }, { property: "line-gap-width", multiplier: 10, type: "Uint8", name: "a_gapwidth" }, { property: "line-offset", multiplier: 1, type: "Int8" } ], elementArrayType: createElementArrayType() }, LineBucket = function(e) { function t(t) { e.call(this, t, lineInterface); } return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.addFeature = function(e) { for (var t = this, r = this.layers[0].layout, i = r["line-join"], a = r["line-cap"], n = r["line-miter-limit"], d = r["line-round-limit"], s = 0, u = loadGeometry(e, 15); s < u.length; s += 1) { var l = u[s]; t.addLine(l, e, i, a, n, d); } }, t.prototype.addLine = function(e, t, r, i, a, n) { for (var d = this, s = t.properties, u = "Polygon" === VectorTileFeature.types[t.type], l = e.length; l >= 2 && e[l - 1].equals(e[l - 2]); ) l--; for (var o = 0; o < l - 1 && e[o].equals(e[o + 1]); ) o++; if (!(l < (u ? 3 : 2))) { "bevel" === r && (a = 1.05); var p = EXTENT / (512 * this.overscaling) * 15, c = e[o], _ = this.arrays, h = _.prepareSegment(10 * l); this.distance = 0; var y, m, E, x, C, v, f, A = i, L = u ? "butt" : i, S = !0; this.e1 = this.e2 = this.e3 = -1, u && (y = e[l - 2], C = c.sub(y)._unit()._perp()); for (var V = o; V < l; V++) if (!(E = u && V === l - 1 ? e[o + 1] : e[V + 1]) || !e[V].equals(E)) { C && (x = C), y && (m = y), y = e[V], C = E ? E.sub(y)._unit()._perp() : x, x = x || C; var I = x.add(C); 0 === I.x && 0 === I.y || I._unit(); var T = I.x * C.x + I.y * C.y, N = 0 !== T ? 1 / T : 1 / 0, b = T < COS_HALF_SHARP_CORNER && m && E; if (b && V > o) { var R = y.dist(m); if (R > 2 * p) { var g = y.sub(y.sub(m)._mult(p / R)._round()); d.distance += g.dist(m), d.addCurrentVertex(g, d.distance, x.mult(1), 0, 0, !1, h), m = g; } } var F = m && E, B = F ? r : E ? A : L; if (F && "round" === B && (N < n ? B = "miter" : N <= 2 && (B = "fakeround")), "miter" === B && N > a && (B = "bevel"), "bevel" === B && (N > 2 && (B = "flipbevel"), N < a && (B = "miter")), m && (d.distance += y.dist(m)), "miter" === B) I._mult(N), d.addCurrentVertex(y, d.distance, I, 0, 0, !1, h); else if ("flipbevel" === B) { if (N > 100) I = C.clone().mult(-1); else { var k = x.x * C.y - x.y * C.x > 0 ? -1 : 1, D = N * x.add(C).mag() / x.sub(C).mag(); I._perp()._mult(D * k); } d.addCurrentVertex(y, d.distance, I, 0, 0, !1, h), d.addCurrentVertex(y, d.distance, I.mult(-1), 0, 0, !1, h); } else if ("bevel" === B || "fakeround" === B) { var P = x.x * C.y - x.y * C.x > 0, U = -Math.sqrt(N * N - 1); if (P ? (f = 0, v = U) : (v = 0, f = U), S || d.addCurrentVertex(y, d.distance, x, v, f, !1, h), "fakeround" === B) { for (var q = Math.floor(8 * (.5 - (T - .5))), M = void 0, O = 0; O < q; O++) M = C.mult((O + 1) / (q + 1))._add(x)._unit(), d.addPieSliceVertex(y, d.distance, M, P, h); d.addPieSliceVertex(y, d.distance, I, P, h); for (var X = q - 1; X >= 0; X--) M = x.mult((X + 1) / (q + 1))._add(C)._unit(), d.addPieSliceVertex(y, d.distance, M, P, h); } E && d.addCurrentVertex(y, d.distance, C, -v, -f, !1, h); } else "butt" === B ? (S || d.addCurrentVertex(y, d.distance, x, 0, 0, !1, h), E && d.addCurrentVertex(y, d.distance, C, 0, 0, !1, h)) : "square" === B ? (S || (d.addCurrentVertex(y, d.distance, x, 1, 1, !1, h), d.e1 = d.e2 = -1), E && d.addCurrentVertex(y, d.distance, C, -1, -1, !1, h)) : "round" === B && (S || (d.addCurrentVertex(y, d.distance, x, 0, 0, !1, h), d.addCurrentVertex(y, d.distance, x, 1, 1, !0, h), d.e1 = d.e2 = -1), E && (d.addCurrentVertex(y, d.distance, C, -1, -1, !0, h), d.addCurrentVertex(y, d.distance, C, 0, 0, !1, h))); if (b && V < l - 1) { var H = y.dist(E); if (H > 2 * p) { var w = y.add(E.sub(y)._mult(p / H)._round()); d.distance += w.dist(y), d.addCurrentVertex(w, d.distance, C.mult(1), 0, 0, !1, h), y = w; } } S = !1; } _.populatePaintArrays(s); } }, t.prototype.addCurrentVertex = function(e, t, r, i, a, n, d) { var s, u = n ? 1 : 0, l = this.arrays, o = l.layoutVertexArray, p = l.elementArray; s = r.clone(), i && s._sub(r.perp()._mult(i)), addLineVertex(o, e, s, u, 0, i, t), this.e3 = d.vertexLength++, this.e1 >= 0 && this.e2 >= 0 && (p.emplaceBack(this.e1, this.e2, this.e3), d.primitiveLength++), this.e1 = this.e2, this.e2 = this.e3, s = r.mult(-1), a && s._sub(r.perp()._mult(a)), addLineVertex(o, e, s, u, 1, -a, t), this.e3 = d.vertexLength++, this.e1 >= 0 && this.e2 >= 0 && (p.emplaceBack(this.e1, this.e2, this.e3), d.primitiveLength++), this.e1 = this.e2, this.e2 = this.e3, t > MAX_LINE_DISTANCE / 2 && (this.distance = 0, this.addCurrentVertex(e, this.distance, r, i, a, n, d)); }, t.prototype.addPieSliceVertex = function(e, t, r, i, a) { var n = i ? 1 : 0; r = r.mult(i ? -1 : 1); var d = this.arrays, s = d.layoutVertexArray, u = d.elementArray; addLineVertex(s, e, r, 0, n, 0, t), this.e3 = a.vertexLength++, this.e1 >= 0 && this.e2 >= 0 && (u.emplaceBack(this.e1, this.e2, this.e3), a.primitiveLength++), i ? this.e2 = this.e3 : this.e1 = this.e3; }, t; }(Bucket); LineBucket.programInterface = lineInterface, module.exports = LineBucket; },{"../bucket":45,"../element_array_type":53,"../extent":54,"../load_geometry":56,"vector-tile":34}],"50":[function(_dereq_, module, exports) { "use strict"; function addVertex(e, t, o, a, i, r, n, s, l, c, u, y) { e.emplaceBack(t, o, Math.round(64 * a), Math.round(64 * i), r / 4, n / 4, packUint8ToFloat(10 * (u || 0), y % 256), packUint8ToFloat(10 * (l || 0), 10 * Math.min(c || 25, 25)), s ? s[0] : void 0, s ? s[1] : void 0, s ? s[2] : void 0); } function addCollisionBoxVertex(e, t, o, a, i) { return e.emplaceBack(t.x, t.y, Math.round(o.x), Math.round(o.y), 10 * a, 10 * i); } function getSizeData(e, t, o) { var a = { isFeatureConstant: t.isLayoutValueFeatureConstant(o), isZoomConstant: t.isLayoutValueZoomConstant(o) }; if (a.isFeatureConstant && (a.layoutSize = t.getLayoutValue(o, { zoom: e + 1 })), !a.isZoomConstant) { for (var i = t.getLayoutValueStopZoomLevels(o), r = 0; r < i.length && i[r] <= e; ) r++; r = Math.max(0, r - 1); for (var n = r; n < i.length && i[n] < e + 1; ) n++; n = Math.min(i.length - 1, n), a.coveringZoomRange = [ i[r], i[n] ], t.isLayoutValueFeatureConstant(o) && (a.coveringStopValues = [ t.getLayoutValue(o, { zoom: i[r] }), t.getLayoutValue(o, { zoom: i[n] }) ]), a.functionBase = t.getLayoutProperty(o).base, void 0 === a.functionBase && (a.functionBase = 1), a.functionType = t.getLayoutProperty(o).type || "exponential"; } return a; } function getSizeAttributeDeclarations(e, t) { return e.isLayoutValueZoomConstant(t) && !e.isLayoutValueFeatureConstant(t) ? [ { name: "a_size", components: 1, type: "Uint16" } ] : e.isLayoutValueZoomConstant(t) || e.isLayoutValueFeatureConstant(t) ? [] : [ { name: "a_size", components: 3, type: "Uint16" } ]; } function getSizeVertexData(e, t, o, a, i) { return e.isLayoutValueZoomConstant(a) && !e.isLayoutValueFeatureConstant(a) ? [ 10 * e.getLayoutValue(a, {}, i) ] : e.isLayoutValueZoomConstant(a) || e.isLayoutValueFeatureConstant(a) ? null : [ 10 * e.getLayoutValue(a, { zoom: o[0] }, i), 10 * e.getLayoutValue(a, { zoom: o[1] }, i), 10 * e.getLayoutValue(a, { zoom: 1 + t }, i) ]; } var Point = _dereq_("point-geometry"), ArrayGroup = _dereq_("../array_group"), BufferGroup = _dereq_("../buffer_group"), createElementArrayType = _dereq_("../element_array_type"), EXTENT = _dereq_("../extent"), packUint8ToFloat = _dereq_("../../shaders/encode_attribute").packUint8ToFloat, Anchor = _dereq_("../../symbol/anchor"), getAnchors = _dereq_("../../symbol/get_anchors"), resolveTokens = _dereq_("../../util/token"), Quads = _dereq_("../../symbol/quads"), Shaping = _dereq_("../../symbol/shaping"), transformText = _dereq_("../../symbol/transform_text"), mergeLines = _dereq_("../../symbol/mergelines"), clipLine = _dereq_("../../symbol/clip_line"), util = _dereq_("../../util/util"), scriptDetection = _dereq_("../../util/script_detection"), loadGeometry = _dereq_("../load_geometry"), CollisionFeature = _dereq_("../../symbol/collision_feature"), findPoleOfInaccessibility = _dereq_("../../util/find_pole_of_inaccessibility"), classifyRings = _dereq_("../../util/classify_rings"), VectorTileFeature = _dereq_("vector-tile").VectorTileFeature, shapeText = Shaping.shapeText, shapeIcon = Shaping.shapeIcon, WritingMode = Shaping.WritingMode, getGlyphQuads = Quads.getGlyphQuads, getIconQuads = Quads.getIconQuads, elementArrayType = createElementArrayType(), layoutAttributes = [ { name: "a_pos_offset", components: 4, type: "Int16" }, { name: "a_data", components: 4, type: "Uint16" } ], symbolInterfaces = { glyph: { layoutAttributes: layoutAttributes, elementArrayType: elementArrayType, paintAttributes: [ { name: "a_fill_color", property: "text-color", type: "Uint8" }, { name: "a_halo_color", property: "text-halo-color", type: "Uint8" }, { name: "a_halo_width", property: "text-halo-width", type: "Uint16", multiplier: 10 }, { name: "a_halo_blur", property: "text-halo-blur", type: "Uint16", multiplier: 10 }, { name: "a_opacity", property: "text-opacity", type: "Uint8", multiplier: 255 } ] }, icon: { layoutAttributes: layoutAttributes, elementArrayType: elementArrayType, paintAttributes: [ { name: "a_fill_color", property: "icon-color", type: "Uint8" }, { name: "a_halo_color", property: "icon-halo-color", type: "Uint8" }, { name: "a_halo_width", property: "icon-halo-width", type: "Uint16", multiplier: 10 }, { name: "a_halo_blur", property: "icon-halo-blur", type: "Uint16", multiplier: 10 }, { name: "a_opacity", property: "icon-opacity", type: "Uint8", multiplier: 255 } ] }, collisionBox: { layoutAttributes: [ { name: "a_pos", components: 2, type: "Int16" }, { name: "a_extrude", components: 2, type: "Int16" }, { name: "a_data", components: 2, type: "Uint8" } ], elementArrayType: createElementArrayType(2) } }, SymbolBucket = function(e) { var t = this; this.collisionBoxArray = e.collisionBoxArray, this.zoom = e.zoom, this.overscaling = e.overscaling, this.layers = e.layers, this.index = e.index, this.sdfIcons = e.sdfIcons, this.iconsNeedLinear = e.iconsNeedLinear, this.fontstack = e.fontstack; var o = this.layers[0]; if (this.symbolInterfaces = { glyph: util.extend({}, symbolInterfaces.glyph, { layoutAttributes: [].concat(symbolInterfaces.glyph.layoutAttributes, getSizeAttributeDeclarations(o, "text-size")) }), icon: util.extend({}, symbolInterfaces.icon, { layoutAttributes: [].concat(symbolInterfaces.icon.layoutAttributes, getSizeAttributeDeclarations(o, "icon-size")) }), collisionBox: util.extend({}, symbolInterfaces.collisionBox, { layoutAttributes: [].concat(symbolInterfaces.collisionBox.layoutAttributes) }) }, e.arrays) { this.buffers = {}; for (var a in e.arrays) e.arrays[a] && (t.buffers[a] = new BufferGroup(t.symbolInterfaces[a], e.layers, e.zoom, e.arrays[a])); this.textSizeData = e.textSizeData, this.iconSizeData = e.iconSizeData; } else this.textSizeData = getSizeData(this.zoom, o, "text-size"), this.iconSizeData = getSizeData(this.zoom, o, "icon-size"); }; SymbolBucket.prototype.populate = function(e, t) { var o = this, a = this.layers[0], i = a.layout, r = i["text-font"], n = (!a.isLayoutValueFeatureConstant("text-field") || i["text-field"]) && r, s = !a.isLayoutValueFeatureConstant("icon-image") || i["icon-image"]; if (this.features = [], n || s) { for (var l = t.iconDependencies, c = t.glyphDependencies, u = c[r] = c[r] || {}, y = { zoom: this.zoom }, p = 0; p < e.length; p++) { var m = e[p]; if (a.filter(m)) { var h = void 0; n && (h = a.getLayoutValue("text-field", y, m.properties), a.isLayoutValueFeatureConstant("text-field") && (h = resolveTokens(m.properties, h)), h = transformText(h, a, y, m.properties)); var x = void 0; if (s && (x = a.getLayoutValue("icon-image", y, m.properties), a.isLayoutValueFeatureConstant("icon-image") && (x = resolveTokens(m.properties, x))), (h || x) && (o.features.push({ text: h, icon: x, index: p, sourceLayerIndex: m.sourceLayerIndex, geometry: loadGeometry(m), properties: m.properties, type: VectorTileFeature.types[m.type] }), x && (l[x] = !0), h)) for (var d = 0; d < h.length; d++) u[h.charCodeAt(d)] = !0; } } "line" === i["symbol-placement"] && (this.features = mergeLines(this.features)); } }, SymbolBucket.prototype.isEmpty = function() { return this.arrays.icon.isEmpty() && this.arrays.glyph.isEmpty() && this.arrays.collisionBox.isEmpty(); }, SymbolBucket.prototype.getPaintPropertyStatistics = function() { for (var e = this, t = {}, o = 0, a = e.layers; o < a.length; o += 1) { var i = a[o]; t[i.id] = util.extend({}, e.arrays.icon.layerData[i.id].paintPropertyStatistics, e.arrays.glyph.layerData[i.id].paintPropertyStatistics); } return t; }, SymbolBucket.prototype.serialize = function(e) { return { zoom: this.zoom, layerIds: this.layers.map(function(e) { return e.id; }), sdfIcons: this.sdfIcons, iconsNeedLinear: this.iconsNeedLinear, textSizeData: this.textSizeData, iconSizeData: this.iconSizeData, fontstack: this.fontstack, arrays: util.mapObject(this.arrays, function(t) { return t.isEmpty() ? null : t.serialize(e); }) }; }, SymbolBucket.prototype.destroy = function() { this.buffers && (this.buffers.icon && this.buffers.icon.destroy(), this.buffers.glyph && this.buffers.glyph.destroy(), this.buffers.collisionBox && this.buffers.collisionBox.destroy(), this.buffers = null); }, SymbolBucket.prototype.createArrays = function() { var e = this; this.arrays = util.mapObject(this.symbolInterfaces, function(t) { return new ArrayGroup(t, e.layers, e.zoom); }); }, SymbolBucket.prototype.prepare = function(e, t) { var o = this; this.symbolInstances = []; var a = 512 * this.overscaling; this.tilePixelRatio = EXTENT / a, this.compareText = {}, this.iconsNeedLinear = !1; var i = this.layers[0].layout, r = .5, n = .5; switch (i["text-anchor"]) { case "right": case "top-right": case "bottom-right": r = 1; break; case "left": case "top-left": case "bottom-left": r = 0; } switch (i["text-anchor"]) { case "bottom": case "bottom-right": case "bottom-left": n = 1; break; case "top": case "top-right": case "top-left": n = 0; } for (var s = "right" === i["text-justify"] ? 1 : "left" === i["text-justify"] ? 0 : .5, l = 24, c = i["text-line-height"] * l, u = "line" !== i["symbol-placement"] ? i["text-max-width"] * l : 0, y = i["text-letter-spacing"] * l, p = this.fontstack = i["text-font"].join(","), m = "map" === i["text-rotation-alignment"] && "line" === i["symbol-placement"], h = 0, x = o.features; h < x.length; h += 1) { var d = x[h], g = void 0; if (d.text) { var f = scriptDetection.allowsVerticalWritingMode(d.text), b = o.layers[0].getLayoutValue("text-offset", { zoom: o.zoom }, d.properties).map(function(e) { return e * l; }); g = {}, g[WritingMode.horizontal] = shapeText(d.text, e[p], u, c, r, n, s, y, b, l, WritingMode.horizontal), g[WritingMode.vertical] = f && m && shapeText(d.text, e[p], u, c, r, n, s, y, b, l, WritingMode.vertical); } else g = {}; var v = void 0; if (d.icon) { var S = t[d.icon], I = o.layers[0].getLayoutValue("icon-offset", { zoom: o.zoom }, d.properties); v = shapeIcon(S, I), S && (void 0 === o.sdfIcons ? o.sdfIcons = S.sdf : o.sdfIcons !== S.sdf && util.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"), 1 !== S.pixelRatio ? o.iconsNeedLinear = !0 : 0 === i["icon-rotate"] && o.layers[0].isLayoutValueFeatureConstant("icon-rotate") || (o.iconsNeedLinear = !0)); } (g[WritingMode.horizontal] || v) && o.addFeature(d, g, v); } }, SymbolBucket.prototype.addFeature = function(e, t, o) { var a = this, i = this.layers[0].getLayoutValue("text-size", { zoom: this.zoom + 1 }, e.properties), r = this.layers[0].getLayoutValue("icon-size", { zoom: this.zoom + 1 }, e.properties), n = this.layers[0].getLayoutValue("text-size", { zoom: 18 }, e.properties); void 0 === n && (n = i); var s = this.layers[0].layout, c = i / 24, u = this.tilePixelRatio * c, y = this.tilePixelRatio * n / 24, p = this.tilePixelRatio * r, m = this.tilePixelRatio * s["symbol-spacing"], h = s["symbol-avoid-edges"], x = s["text-padding"] * this.tilePixelRatio, d = s["icon-padding"] * this.tilePixelRatio, g = s["text-max-angle"] / 180 * Math.PI, f = "map" === s["text-rotation-alignment"] && "line" === s["symbol-placement"], b = "map" === s["icon-rotation-alignment"] && "line" === s["symbol-placement"], v = s["text-allow-overlap"] || s["icon-allow-overlap"] || s["text-ignore-placement"] || s["icon-ignore-placement"], S = s["symbol-placement"], I = m / 2, z = function(i, r) { var n = !(r.x < 0 || r.x > EXTENT || r.y < 0 || r.y > EXTENT); if (!h || n) { var s = n || v; a.addSymbolInstance(r, i, t, o, a.layers[0], s, a.collisionBoxArray, e.index, e.sourceLayerIndex, a.index, u, x, f, p, d, b, { zoom: a.zoom }, e.properties); } }; if ("line" === S) for (var B = 0, M = clipLine(e.geometry, 0, 0, EXTENT, EXTENT); B < M.length; B += 1) for (var L = M[B], A = getAnchors(L, m, g, t[WritingMode.vertical] || t[WritingMode.horizontal], o, 24, y, a.overscaling, EXTENT), T = 0, V = A; T < V.length; T += 1) { var _ = V[T], k = t[WritingMode.horizontal]; k && a.anchorIsTooClose(k.text, I, _) || z(L, _); } else if ("Polygon" === e.type) for (var C = 0, E = classifyRings(e.geometry, 0); C < E.length; C += 1) { var P = E[C], F = findPoleOfInaccessibility(P, 16); z(P[0], new Anchor(F.x, F.y, 0)); } else if ("LineString" === e.type) for (var w = 0, D = e.geometry; w < D.length; w += 1) { var N = D[w]; z(N, new Anchor(N[0].x, N[0].y, 0)); } else if ("Point" === e.type) for (var q = 0, U = e.geometry; q < U.length; q += 1) for (var W = U[q], Q = 0, R = W; Q < R.length; Q += 1) { var Z = R[Q]; z([ Z ], new Anchor(Z.x, Z.y, 0)); } }, SymbolBucket.prototype.anchorIsTooClose = function(e, t, o) { var a = this.compareText; if (e in a) { for (var i = a[e], r = i.length - 1; r >= 0; r--) if (o.dist(i[r]) < t) return !0; } else a[e] = []; return a[e].push(o), !1; }, SymbolBucket.prototype.place = function(e, t) { var o = this; this.createArrays(); var a = this.layers[0], i = a.layout, r = e.maxScale, n = "map" === i["text-rotation-alignment"] && "line" === i["symbol-placement"], s = "map" === i["icon-rotation-alignment"] && "line" === i["symbol-placement"]; if (i["text-allow-overlap"] || i["icon-allow-overlap"] || i["text-ignore-placement"] || i["icon-ignore-placement"]) { var c = e.angle, u = Math.sin(c), y = Math.cos(c); this.symbolInstances.sort(function(e, t) { return (u * e.anchor.x + y * e.anchor.y | 0) - (u * t.anchor.x + y * t.anchor.y | 0) || t.featureIndex - e.featureIndex; }); } for (var p = 0, m = o.symbolInstances; p < m.length; p += 1) { var h = m[p], x = { boxStartIndex: h.textBoxStartIndex, boxEndIndex: h.textBoxEndIndex }, d = { boxStartIndex: h.iconBoxStartIndex, boxEndIndex: h.iconBoxEndIndex }, g = !(h.textBoxStartIndex === h.textBoxEndIndex), f = !(h.iconBoxStartIndex === h.iconBoxEndIndex), b = i["text-optional"] || !g, v = i["icon-optional"] || !f, S = g ? e.placeCollisionFeature(x, i["text-allow-overlap"], i["symbol-avoid-edges"]) : e.minScale, I = f ? e.placeCollisionFeature(d, i["icon-allow-overlap"], i["symbol-avoid-edges"]) : e.minScale; if (b || v ? !v && S ? S = Math.max(I, S) : !b && I && (I = Math.max(I, S)) : I = S = Math.max(I, S), g && (e.insertCollisionFeature(x, S, i["text-ignore-placement"]), S <= r)) { var z = getSizeVertexData(a, o.zoom, o.textSizeData.coveringZoomRange, "text-size", h.featureProperties); o.addSymbols(o.arrays.glyph, h.glyphQuads, S, z, i["text-keep-upright"], n, e.angle, h.featureProperties, h.writingModes); } if (f && (e.insertCollisionFeature(d, I, i["icon-ignore-placement"]), I <= r)) { var B = getSizeVertexData(a, o.zoom, o.iconSizeData.coveringZoomRange, "icon-size", h.featureProperties); o.addSymbols(o.arrays.icon, h.iconQuads, I, B, i["icon-keep-upright"], s, e.angle, h.featureProperties); } } t && this.addToDebugBuffers(e); }, SymbolBucket.prototype.addSymbols = function(e, t, o, a, i, r, n, s, l) { for (var c = e.elementArray, u = e.layoutVertexArray, y = this.zoom, p = Math.max(Math.log(o) / Math.LN2 + y, 0), m = 0, h = t; m < h.length; m += 1) { var x = h[m], d = (x.anchorAngle + n + Math.PI) % (2 * Math.PI); if (l & WritingMode.vertical) { if (r && x.writingMode === WritingMode.vertical) { if (i && r && d <= 5 * Math.PI / 4 || d > 7 * Math.PI / 4) continue; } else if (i && r && d <= 3 * Math.PI / 4 || d > 5 * Math.PI / 4) continue; } else if (i && r && (d <= Math.PI / 2 || d > 3 * Math.PI / 2)) continue; var g = x.tl, f = x.tr, b = x.bl, v = x.br, S = x.tex, I = x.anchorPoint, z = Math.max(y + Math.log(x.minScale) / Math.LN2, p), B = Math.min(y + Math.log(x.maxScale) / Math.LN2, 25); if (!(B <= z)) { z === p && (z = 0); var M = Math.round(x.glyphAngle / (2 * Math.PI) * 256), L = e.prepareSegment(4), A = L.vertexLength; addVertex(u, I.x, I.y, g.x, g.y, S.x, S.y, a, z, B, p, M), addVertex(u, I.x, I.y, f.x, f.y, S.x + S.w, S.y, a, z, B, p, M), addVertex(u, I.x, I.y, b.x, b.y, S.x, S.y + S.h, a, z, B, p, M), addVertex(u, I.x, I.y, v.x, v.y, S.x + S.w, S.y + S.h, a, z, B, p, M), c.emplaceBack(A, A + 1, A + 2), c.emplaceBack(A + 1, A + 2, A + 3), L.vertexLength += 4, L.primitiveLength += 2; } } e.populatePaintArrays(s); }, SymbolBucket.prototype.addToDebugBuffers = function(e) { for (var t = this, o = this.arrays.collisionBox, a = o.layoutVertexArray, i = o.elementArray, r = -e.angle, n = e.yStretch, s = 0, l = t.symbolInstances; s < l.length; s += 1) { var c = l[s]; c.textCollisionFeature = { boxStartIndex: c.textBoxStartIndex, boxEndIndex: c.textBoxEndIndex }, c.iconCollisionFeature = { boxStartIndex: c.iconBoxStartIndex, boxEndIndex: c.iconBoxEndIndex }; for (var u = 0; u < 2; u++) { var y = c[0 === u ? "textCollisionFeature" : "iconCollisionFeature"]; if (y) for (var p = y.boxStartIndex; p < y.boxEndIndex; p++) { var m = t.collisionBoxArray.get(p), h = m.anchorPoint, x = new Point(m.x1, m.y1 * n)._rotate(r), d = new Point(m.x2, m.y1 * n)._rotate(r), g = new Point(m.x1, m.y2 * n)._rotate(r), f = new Point(m.x2, m.y2 * n)._rotate(r), b = Math.max(0, Math.min(25, t.zoom + Math.log(m.maxScale) / Math.LN2)), v = Math.max(0, Math.min(25, t.zoom + Math.log(m.placementScale) / Math.LN2)), S = o.prepareSegment(4), I = S.vertexLength; addCollisionBoxVertex(a, h, x, b, v), addCollisionBoxVertex(a, h, d, b, v), addCollisionBoxVertex(a, h, f, b, v), addCollisionBoxVertex(a, h, g, b, v), i.emplaceBack(I, I + 1), i.emplaceBack(I + 1, I + 2), i.emplaceBack(I + 2, I + 3), i.emplaceBack(I + 3, I), S.vertexLength += 4, S.primitiveLength += 4; } } } }, SymbolBucket.prototype.addSymbolInstance = function(e, t, o, a, i, r, n, s, l, c, u, y, p, m, h, x, d, g) { var f, b, v = [], S = []; for (var I in o) { var z = parseInt(I, 10); o[z] && (S = S.concat(r ? getGlyphQuads(e, o[z], u, t, i, p, d, g) : []), f = new CollisionFeature(n, t, e, s, l, c, o[z], u, y, p, !1)); } var B = f ? f.boxStartIndex : this.collisionBoxArray.length, M = f ? f.boxEndIndex : this.collisionBoxArray.length; a && (v = r ? getIconQuads(e, a, m, t, i, x, o[WritingMode.horizontal], d, g) : [], b = new CollisionFeature(n, t, e, s, l, c, a, m, h, x, !0)); var L = b ? b.boxStartIndex : this.collisionBoxArray.length, A = b ? b.boxEndIndex : this.collisionBoxArray.length; M > SymbolBucket.MAX_INSTANCES && util.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"), A > SymbolBucket.MAX_INSTANCES && util.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"); var T = (o[WritingMode.vertical] ? WritingMode.vertical : 0) | (o[WritingMode.horizontal] ? WritingMode.horizontal : 0); this.symbolInstances.push({ textBoxStartIndex: B, textBoxEndIndex: M, iconBoxStartIndex: L, iconBoxEndIndex: A, glyphQuads: S, iconQuads: v, anchor: e, featureIndex: s, featureProperties: g, writingModes: T }); }, SymbolBucket.programInterfaces = symbolInterfaces, SymbolBucket.MAX_INSTANCES = 65535, module.exports = SymbolBucket; },{"../../shaders/encode_attribute":81,"../../symbol/anchor":160,"../../symbol/clip_line":162,"../../symbol/collision_feature":164,"../../symbol/get_anchors":166,"../../symbol/mergelines":169,"../../symbol/quads":170,"../../symbol/shaping":171,"../../symbol/transform_text":173,"../../util/classify_rings":198,"../../util/find_pole_of_inaccessibility":204,"../../util/script_detection":211,"../../util/token":214,"../../util/util":215,"../array_group":44,"../buffer_group":52,"../element_array_type":53,"../extent":54,"../load_geometry":56,"point-geometry":26,"vector-tile":34}],"51":[function(_dereq_, module, exports) { "use strict"; var AttributeType = { Int8: "BYTE", Uint8: "UNSIGNED_BYTE", Int16: "SHORT", Uint16: "UNSIGNED_SHORT" }, Buffer = function(t, e, r) { this.arrayBuffer = t.arrayBuffer, this.length = t.length, this.attributes = e.members, this.itemSize = e.bytesPerElement, this.type = r, this.arrayType = e; }; Buffer.fromStructArray = function(t, e) { return new Buffer(t.serialize(), t.constructor.serialize(), e); }, Buffer.prototype.bind = function(t) { var e = t[this.type]; this.buffer ? t.bindBuffer(e, this.buffer) : (this.gl = t, this.buffer = t.createBuffer(), t.bindBuffer(e, this.buffer), t.bufferData(e, this.arrayBuffer, t.STATIC_DRAW), this.arrayBuffer = null); }, Buffer.prototype.enableAttributes = function(t, e) { for (var r = this, f = 0; f < this.attributes.length; f++) { var i = r.attributes[f], u = e[i.name]; void 0 !== u && t.enableVertexAttribArray(u); } }, Buffer.prototype.setVertexAttribPointers = function(t, e, r) { for (var f = this, i = 0; i < this.attributes.length; i++) { var u = f.attributes[i], s = e[u.name]; void 0 !== s && t.vertexAttribPointer(s, u.components, t[AttributeType[u.type]], !1, f.arrayType.bytesPerElement, u.offset + (f.arrayType.bytesPerElement * r || 0)); } }, Buffer.prototype.destroy = function() { this.buffer && this.gl.deleteBuffer(this.buffer); }, Buffer.BufferType = { VERTEX: "ARRAY_BUFFER", ELEMENT: "ELEMENT_ARRAY_BUFFER" }, module.exports = Buffer; },{}],"52":[function(_dereq_, module, exports) { "use strict"; var util = _dereq_("../util/util"), Buffer = _dereq_("./buffer"), ProgramConfiguration = _dereq_("./program_configuration"), createVertexArrayType = _dereq_("./vertex_array_type"), VertexArrayObject = _dereq_("../render/vertex_array_object"), BufferGroup = function(e, r, t, a) { var f = this, u = createVertexArrayType(e.layoutAttributes); this.layoutVertexBuffer = new Buffer(a.layoutVertexArray, u.serialize(), Buffer.BufferType.VERTEX), a.elementArray && (this.elementBuffer = new Buffer(a.elementArray, e.elementArrayType.serialize(), Buffer.BufferType.ELEMENT)), a.elementArray2 && (this.elementBuffer2 = new Buffer(a.elementArray2, e.elementArrayType2.serialize(), Buffer.BufferType.ELEMENT)), this.layerData = {}; for (var n = 0, i = r; n < i.length; n += 1) { var s = i[n], o = a.paintVertexArrays && a.paintVertexArrays[s.id], y = ProgramConfiguration.createDynamic(e.paintAttributes || [], s, t), l = o ? new Buffer(o.array, o.type, Buffer.BufferType.VERTEX) : null; f.layerData[s.id] = { programConfiguration: y, paintVertexBuffer: l }; } this.segments = a.segments, this.segments2 = a.segments2; for (var m = 0, B = [ f.segments, f.segments2 ]; m < B.length; m += 1) for (var p = B[m], g = 0, v = p || []; g < v.length; g += 1) { var h = v[g]; h.vaos = util.mapObject(f.layerData, function() { return new VertexArrayObject(); }); } }; BufferGroup.prototype.destroy = function() { var e = this; this.layoutVertexBuffer.destroy(), this.elementBuffer && this.elementBuffer.destroy(), this.elementBuffer2 && this.elementBuffer2.destroy(); for (var r in e.layerData) { var t = e.layerData[r].paintVertexBuffer; t && t.destroy(); } for (var a = 0, f = [ e.segments, e.segments2 ]; a < f.length; a += 1) for (var u = f[a], n = 0, i = u || []; n < i.length; n += 1) { var s = i[n]; for (var o in s.vaos) s.vaos[o].destroy(); } }, module.exports = BufferGroup; },{"../render/vertex_array_object":80,"../util/util":215,"./buffer":51,"./program_configuration":58,"./vertex_array_type":60}],"53":[function(_dereq_, module, exports) { "use strict"; function createElementArrayType(e) { return createStructArrayType({ members: [ { type: "Uint16", name: "vertices", components: e || 3 } ] }); } var createStructArrayType = _dereq_("../util/struct_array"); module.exports = createElementArrayType; },{"../util/struct_array":213}],"54":[function(_dereq_, module, exports) { "use strict"; module.exports = 8192; },{}],"55":[function(_dereq_, module, exports) { "use strict"; function translateDistance(e) { return Math.sqrt(e[0] * e[0] + e[1] * e[1]); } function topDownFeatureComparator(e, t) { return t - e; } function getLineWidth(e, t) { return t > 0 ? t + 2 * e : e; } function translate(e, t, r, i, a) { if (!t[0] && !t[1]) return e; t = Point.convert(t), "viewport" === r && t._rotate(-i); for (var n = [], s = 0; s < e.length; s++) { for (var o = e[s], l = [], u = 0; u < o.length; u++) l.push(o[u].sub(t._mult(a))); n.push(l); } return n; } function offsetLine(e, t) { for (var r = [], i = new Point(0, 0), a = 0; a < e.length; a++) { for (var n = e[a], s = [], o = 0; o < n.length; o++) { var l = n[o - 1], u = n[o], c = n[o + 1], y = 0 === o ? i : u.sub(l)._unit()._perp(), f = o === n.length - 1 ? i : c.sub(u)._unit()._perp(), h = y._add(f)._unit(), d = h.x * f.x + h.y * f.y; h._mult(1 / d), s.push(h._mult(t)._add(u)); } r.push(s); } return r; } var Point = _dereq_("point-geometry"), loadGeometry = _dereq_("./load_geometry"), EXTENT = _dereq_("./extent"), featureFilter = _dereq_("../style-spec/feature_filter"), createStructArrayType = _dereq_("../util/struct_array"), Grid = _dereq_("grid-index"), DictionaryCoder = _dereq_("../util/dictionary_coder"), vt = _dereq_("vector-tile"), Protobuf = _dereq_("pbf"), GeoJSONFeature = _dereq_("../util/vectortile_to_geojson"), arraysIntersect = _dereq_("../util/util").arraysIntersect, intersection = _dereq_("../util/intersection_tests"), multiPolygonIntersectsBufferedMultiPoint = intersection.multiPolygonIntersectsBufferedMultiPoint, multiPolygonIntersectsMultiPolygon = intersection.multiPolygonIntersectsMultiPolygon, multiPolygonIntersectsBufferedMultiLine = intersection.multiPolygonIntersectsBufferedMultiLine, FeatureIndexArray = createStructArrayType({ members: [ { type: "Uint32", name: "featureIndex" }, { type: "Uint16", name: "sourceLayerIndex" }, { type: "Uint16", name: "bucketIndex" } ] }), FeatureIndex = function(e, t, r) { if (e.grid) { var i = e, a = t; e = i.coord, t = i.overscaling, this.grid = new Grid(i.grid), this.featureIndexArray = new FeatureIndexArray(i.featureIndexArray), this.rawTileData = a, this.bucketLayerIDs = i.bucketLayerIDs, this.paintPropertyStatistics = i.paintPropertyStatistics; } else this.grid = new Grid(EXTENT, 16, 0), this.featureIndexArray = new FeatureIndexArray(); this.coord = e, this.overscaling = t, this.x = e.x, this.y = e.y, this.z = e.z - Math.log(t) / Math.LN2, this.setCollisionTile(r); }; FeatureIndex.prototype.insert = function(e, t) { var r = this, i = this.featureIndexArray.length; this.featureIndexArray.emplaceBack(e.index, e.sourceLayerIndex, t); for (var a = loadGeometry(e), n = 0; n < a.length; n++) { for (var s = a[n], o = [ 1 / 0, 1 / 0, -1 / 0, -1 / 0 ], l = 0; l < s.length; l++) { var u = s[l]; o[0] = Math.min(o[0], u.x), o[1] = Math.min(o[1], u.y), o[2] = Math.max(o[2], u.x), o[3] = Math.max(o[3], u.y); } r.grid.insert(i, o[0], o[1], o[2], o[3]); } }, FeatureIndex.prototype.setCollisionTile = function(e) { this.collisionTile = e; }, FeatureIndex.prototype.serialize = function(e) { var t = this.grid.toArrayBuffer(); return e && e.push(t), { coord: this.coord, overscaling: this.overscaling, grid: t, featureIndexArray: this.featureIndexArray.serialize(e), bucketLayerIDs: this.bucketLayerIDs, paintPropertyStatistics: this.paintPropertyStatistics }; }, FeatureIndex.prototype.query = function(e, t) { var r = this; this.vtLayers || (this.vtLayers = new vt.VectorTile(new Protobuf(this.rawTileData)).layers, this.sourceLayerCoder = new DictionaryCoder(this.vtLayers ? Object.keys(this.vtLayers).sort() : [ "_geojsonTileLayer" ])); var i = {}, a = e.params || {}, n = EXTENT / e.tileSize / e.scale, s = featureFilter(a.filter), o = 0; for (var l in t) if (r.hasLayer(l)) { var u = t[l], c = 0; if ("line" === u.type) { var y = getLineWidth(r.getPaintValue("line-width", u), r.getPaintValue("line-gap-width", u)), f = r.getPaintValue("line-offset", u), h = r.getPaintValue("line-translate", u); c = y / 2 + Math.abs(f) + translateDistance(h); } else "fill" === u.type ? c = translateDistance(r.getPaintValue("fill-translate", u)) : "fill-extrusion" === u.type ? c = translateDistance(r.getPaintValue("fill-extrusion-translate", u)) : "circle" === u.type && (c = r.getPaintValue("circle-radius", u) + translateDistance(r.getPaintValue("circle-translate", u))); o = Math.max(o, c * n); } for (var d = e.queryGeometry.map(function(e) { return e.map(function(e) { return new Point(e.x, e.y); }); }), g = 1 / 0, p = 1 / 0, v = -1 / 0, x = -1 / 0, P = 0; P < d.length; P++) for (var I = d[P], m = 0; m < I.length; m++) { var L = I[m]; g = Math.min(g, L.x), p = Math.min(p, L.y), v = Math.max(v, L.x), x = Math.max(x, L.y); } var M = this.grid.query(g - o, p - o, v + o, x + o); M.sort(topDownFeatureComparator), this.filterMatching(i, M, this.featureIndexArray, d, s, a.layers, t, e.bearing, n); var b = this.collisionTile.queryRenderedSymbols(d, e.scale); return b.sort(), this.filterMatching(i, b, this.collisionTile.collisionBoxArray, d, s, a.layers, t, e.bearing, n), i; }, FeatureIndex.prototype.filterMatching = function(e, t, r, i, a, n, s, o, l) { for (var u, c = this, y = 0; y < t.length; y++) { var f = t[y]; if (f !== u) { u = f; var h = r.get(f), d = c.bucketLayerIDs[h.bucketIndex]; if (!n || arraysIntersect(n, d)) { var g = c.sourceLayerCoder.decode(h.sourceLayerIndex), p = c.vtLayers[g], v = p.feature(h.featureIndex); if (a(v)) for (var x = null, P = 0; P < d.length; P++) { var I = d[P]; if (!(n && n.indexOf(I) < 0)) { var m = s[I]; if (m) { var L = void 0; if ("symbol" !== m.type) if (x || (x = loadGeometry(v)), "line" === m.type) { L = translate(i, c.getPaintValue("line-translate", m, v), c.getPaintValue("line-translate-anchor", m, v), o, l); var M = l / 2 * getLineWidth(c.getPaintValue("line-width", m, v), c.getPaintValue("line-gap-width", m, v)), b = c.getPaintValue("line-offset", m, v); if (b && (x = offsetLine(x, b * l)), !multiPolygonIntersectsBufferedMultiLine(L, x, M)) continue; } else if ("fill" === m.type || "fill-extrusion" === m.type) { var V = m.type; if (L = translate(i, c.getPaintValue(V + "-translate", m, v), c.getPaintValue(V + "-translate-anchor", m, v), o, l), !multiPolygonIntersectsMultiPolygon(L, x)) continue; } else if ("circle" === m.type) { L = translate(i, c.getPaintValue("circle-translate", m, v), c.getPaintValue("circle-translate-anchor", m, v), o, l); var w = c.getPaintValue("circle-radius", m, v) * l; if (!multiPolygonIntersectsBufferedMultiPoint(L, x, w)) continue; } var F = new GeoJSONFeature(v, c.z, c.x, c.y); F.layer = m.serialize(); var _ = e[I]; void 0 === _ && (_ = e[I] = []), _.push(F); } } } } } } }, FeatureIndex.prototype.hasLayer = function(e) { var t = this; for (var r in t.bucketLayerIDs) for (var i = 0, a = t.bucketLayerIDs[r]; i < a.length; i += 1) { var n = a[i]; if (e === n) return !0; } return !1; }, FeatureIndex.prototype.getPaintValue = function(e, t, r) { if (t.isPaintValueFeatureConstant(e) || r) { var a = r ? r.properties : {}; return t.getPaintValue(e, { zoom: this.z }, a); } return this.paintPropertyStatistics[t.id][e].max; }, module.exports = FeatureIndex; },{"../style-spec/feature_filter":105,"../util/dictionary_coder":200,"../util/intersection_tests":207,"../util/struct_array":213,"../util/util":215,"../util/vectortile_to_geojson":216,"./extent":54,"./load_geometry":56,"grid-index":16,"pbf":25,"point-geometry":26,"vector-tile":34}],"56":[function(_dereq_, module, exports) { "use strict"; function createBounds(e) { return { min: -1 * Math.pow(2, e - 1), max: Math.pow(2, e - 1) - 1 }; } var util = _dereq_("../util/util"), EXTENT = _dereq_("./extent"), boundsLookup = { 15: createBounds(15), 16: createBounds(16) }; module.exports = function(e, t) { for (var r = boundsLookup[t || 16], o = EXTENT / e.extent, u = e.loadGeometry(), n = 0; n < u.length; n++) for (var a = u[n], i = 0; i < a.length; i++) { var d = a[i]; d.x = Math.round(d.x * o), d.y = Math.round(d.y * o), (d.x < r.min || d.x > r.max || d.y < r.min || d.y > r.max) && util.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size"); } return u; }; },{"../util/util":215,"./extent":54}],"58":[function(_dereq_, module, exports) { "use strict"; function getPaintAttributeValue(t, r, e, i) { if (!t.zoomStops) return r.getPaintValue(t.property, e, i); var a = t.zoomStops.map(function(a) { return r.getPaintValue(t.property, util.extend({}, e, { zoom: a }), i); }); return 1 === a.length ? a[0] : a; } function normalizePaintAttribute(t, r) { var e = t.name; e || (e = t.property.replace(r.type + "-", "").replace(/-/g, "_")); var i = "color" === r._paintSpecifications[t.property].type; return util.extend({ name: "a_" + e, components: i ? 4 : 1, multiplier: i ? 255 : 1, dimensions: i ? 4 : 1 }, t); } var createVertexArrayType = _dereq_("./vertex_array_type"), util = _dereq_("../util/util"), ProgramConfiguration = function() { this.attributes = [], this.uniforms = [], this.interpolationUniforms = [], this.pragmas = { vertex: {}, fragment: {} }, this.cacheKey = ""; }; ProgramConfiguration.createDynamic = function(t, r, e) { for (var i = new ProgramConfiguration(), a = 0, n = t; a < n.length; a += 1) { var o = n[a], p = normalizePaintAttribute(o, r), u = p.name.slice(2); r.isPaintValueFeatureConstant(p.property) ? i.addZoomAttribute(u, p) : r.isPaintValueZoomConstant(p.property) ? i.addPropertyAttribute(u, p) : i.addZoomAndPropertyAttribute(u, p, r, e); } return i.PaintVertexArray = createVertexArrayType(i.attributes), i; }, ProgramConfiguration.createStatic = function(t) { for (var r = new ProgramConfiguration(), e = 0, i = t; e < i.length; e += 1) { var a = i[e]; r.addUniform(a, "u_" + a); } return r; }, ProgramConfiguration.prototype.addUniform = function(t, r) { var e = this.getPragmas(t); e.define.push("uniform {precision} {type} " + r + ";"), e.initialize.push("{precision} {type} " + t + " = " + r + ";"), this.cacheKey += "/u_" + t; }, ProgramConfiguration.prototype.addZoomAttribute = function(t, r) { this.uniforms.push(r), this.addUniform(t, r.name); }, ProgramConfiguration.prototype.addPropertyAttribute = function(t, r) { var e = this.getPragmas(t); this.attributes.push(r), e.define.push("varying {precision} {type} " + t + ";"), e.vertex.define.push("attribute {precision} {type} " + r.name + ";"), e.vertex.initialize.push(t + " = " + r.name + " / " + r.multiplier + ".0;"), this.cacheKey += "/a_" + t; }, ProgramConfiguration.prototype.addZoomAndPropertyAttribute = function(t, r, e, i) { var a = this, n = this.getPragmas(t); n.define.push("varying {precision} {type} " + t + ";"); var o = e.getPaintValueStopZoomLevels(r.property), p = 0; if (o.length > 4) for (;p < o.length - 2 && o[p] < i; ) p++; var u = "u_" + t + "_t"; n.vertex.define.push("uniform lowp float " + u + ";"), this.interpolationUniforms.push({ name: u, property: r.property, stopOffset: p }); for (var s = [], m = 0; m < 4; m++) s.push(o[Math.min(p + m, o.length - 1)]); var f = []; if (1 === r.components) this.attributes.push(util.extend({}, r, { components: 4, zoomStops: s })), n.vertex.define.push("attribute {precision} vec4 " + r.name + ";"), f.push(r.name); else for (var g = 0; g < 4; g++) { var h = r.name + g; f.push(h), a.attributes.push(util.extend({}, r, { name: h, zoomStops: [ s[g] ] })), n.vertex.define.push("attribute {precision} {type} " + h + ";"); } n.vertex.initialize.push(t + " = evaluate_zoom_function_" + r.components + "( " + f.join(", ") + ", " + u + ") / " + r.multiplier + ".0;"), this.cacheKey += "/z_" + t; }, ProgramConfiguration.prototype.getPragmas = function(t) { return this.pragmas[t] || (this.pragmas[t] = { define: [], initialize: [] }, this.pragmas[t].fragment = { define: [], initialize: [] }, this.pragmas[t].vertex = { define: [], initialize: [] }), this.pragmas[t]; }, ProgramConfiguration.prototype.applyPragmas = function(t, r) { var e = this; return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g, function(t, i, a, n, o) { return e.pragmas[o][i].concat(e.pragmas[o][r][i]).join("\n").replace(/{type}/g, n).replace(/{precision}/g, a); }); }, ProgramConfiguration.prototype.createPaintPropertyStatistics = function() { for (var t = this, r = {}, e = 0, i = t.attributes; e < i.length; e += 1) { var a = i[e]; 1 === a.dimensions && (r[a.property] = { max: -1 / 0 }); } return r; }, ProgramConfiguration.prototype.populatePaintArray = function(t, r, e, i, a, n) { var o = this, p = r.length; r.resize(i); for (var u = 0, s = o.attributes; u < s.length; u += 1) for (var m = s[u], f = getPaintAttributeValue(m, t, a, n), g = p; g < i; g++) { var h = r.get(g); if (4 === m.components) for (var l = 0; l < 4; l++) h[m.name + l] = f[l] * m.multiplier; else h[m.name] = f * m.multiplier; if (1 === m.dimensions) { var c = e[m.property]; c.max = Math.max(c.max, 1 === m.components ? f : Math.max.apply(Math, f)); } } }, ProgramConfiguration.prototype.setUniforms = function(t, r, e, i) { for (var a = this, n = 0, o = a.uniforms; n < o.length; n += 1) { var p = o[n], u = e.getPaintValue(p.property, i); 4 === p.components ? t.uniform4fv(r[p.name], u) : t.uniform1f(r[p.name], u); } for (var s = 0, m = a.interpolationUniforms; s < m.length; s += 1) { var f = m[s], g = e.getPaintInterpolationT(f.property, i); t.uniform1f(r[f.name], Math.max(0, Math.min(3, g - f.stopOffset))); } }, module.exports = ProgramConfiguration; },{"../util/util":215,"./vertex_array_type":60}],"60":[function(_dereq_, module, exports) { "use strict"; function createVertexArrayType(r) { return createStructArrayType({ members: r, alignment: 4 }); } var createStructArrayType = _dereq_("../util/struct_array"); module.exports = createVertexArrayType; },{"../util/struct_array":213}],"61":[function(_dereq_, module, exports) { "use strict"; var Coordinate = function(o, t, n) { this.column = o, this.row = t, this.zoom = n; }; Coordinate.prototype.clone = function() { return new Coordinate(this.column, this.row, this.zoom); }, Coordinate.prototype.zoomTo = function(o) { return this.clone()._zoomTo(o); }, Coordinate.prototype.sub = function(o) { return this.clone()._sub(o); }, Coordinate.prototype._zoomTo = function(o) { var t = Math.pow(2, o - this.zoom); return this.column *= t, this.row *= t, this.zoom = o, this; }, Coordinate.prototype._sub = function(o) { return o = o.zoomTo(this.zoom), this.column -= o.column, this.row -= o.row, this; }, module.exports = Coordinate; },{}],"80":[function(_dereq_, module, exports) { "use strict"; var VertexArrayObject = function() { this.boundProgram = null, this.boundVertexBuffer = null, this.boundVertexBuffer2 = null, this.boundElementBuffer = null, this.boundVertexOffset = null, this.vao = null; }; VertexArrayObject.prototype.bind = function(e, t, r, i, n, s) { void 0 === e.extVertexArrayObject && (e.extVertexArrayObject = e.getExtension("OES_vertex_array_object")); var o = !this.vao || this.boundProgram !== t || this.boundVertexBuffer !== r || this.boundVertexBuffer2 !== n || this.boundElementBuffer !== i || this.boundVertexOffset !== s; !e.extVertexArrayObject || o ? (this.freshBind(e, t, r, i, n, s), this.gl = e) : e.extVertexArrayObject.bindVertexArrayOES(this.vao); }, VertexArrayObject.prototype.freshBind = function(e, t, r, i, n, s) { var o, u = t.numAttributes; if (e.extVertexArrayObject) this.vao && this.destroy(), this.vao = e.extVertexArrayObject.createVertexArrayOES(), e.extVertexArrayObject.bindVertexArrayOES(this.vao), o = 0, this.boundProgram = t, this.boundVertexBuffer = r, this.boundVertexBuffer2 = n, this.boundElementBuffer = i, this.boundVertexOffset = s; else { o = e.currentNumAttributes || 0; for (var b = u; b < o; b++) e.disableVertexAttribArray(b); } r.enableAttributes(e, t), n && n.enableAttributes(e, t), r.bind(e), r.setVertexAttribPointers(e, t, s), n && (n.bind(e), n.setVertexAttribPointers(e, t, s)), i && i.bind(e), e.currentNumAttributes = u; }, VertexArrayObject.prototype.destroy = function() { this.vao && (this.gl.extVertexArrayObject.deleteVertexArrayOES(this.vao), this.vao = null); }, module.exports = VertexArrayObject; },{}],"81":[function(_dereq_, module, exports) { "use strict"; var util = _dereq_("../util/util"); exports.packUint8ToFloat = function(t, l) { return t = util.clamp(Math.floor(t), 0, 255), l = util.clamp(Math.floor(l), 0, 255), 256 * t + l; }; },{"../util/util":215}],"84":[function(_dereq_, module, exports) { "use strict"; var ajax = _dereq_("../util/ajax"), rewind = _dereq_("geojson-rewind"), GeoJSONWrapper = _dereq_("./geojson_wrapper"), vtpbf = _dereq_("vt-pbf"), supercluster = _dereq_("supercluster"), geojsonvt = _dereq_("geojson-vt"), VectorTileWorkerSource = _dereq_("./vector_tile_worker_source"), GeoJSONWorkerSource = function(e) { function r(r, t, o) { e.call(this, r, t), o && (this.loadGeoJSON = o), this._geoJSONIndexes = {}; } return e && (r.__proto__ = e), r.prototype = Object.create(e && e.prototype), r.prototype.constructor = r, r.prototype.loadVectorData = function(e, r) { var t = e.source, o = e.coord; if (!this._geoJSONIndexes[t]) return r(null, null); var n = this._geoJSONIndexes[t].getTile(Math.min(o.z, e.maxZoom), o.x, o.y); if (!n) return r(null, null); var u = new GeoJSONWrapper(n.features); u.name = "_geojsonTileLayer"; var a = vtpbf({ layers: { _geojsonTileLayer: u } }); 0 === a.byteOffset && a.byteLength === a.buffer.byteLength || (a = new Uint8Array(a)), u.rawData = a.buffer, r(null, u); }, r.prototype.loadData = function(e, r) { var t = function(t, o) { var n = this; return t ? r(t) : "object" != typeof o ? r(new Error("Input data is not a valid GeoJSON object.")) : (rewind(o, !0), void this._indexData(o, e, function(t, o) { return t ? r(t) : (n._geoJSONIndexes[e.source] = o, void r(null)); })); }.bind(this); this.loadGeoJSON(e, t); }, r.prototype.loadGeoJSON = function(e, r) { if (e.url) ajax.getJSON(e.url, r); else { if ("string" != typeof e.data) return r(new Error("Input data is not a valid GeoJSON object.")); try { return r(null, JSON.parse(e.data)); } catch (e) { return r(new Error("Input data is not a valid GeoJSON object.")); } } }, r.prototype.removeSource = function(e) { this._geoJSONIndexes[e.source] && delete this._geoJSONIndexes[e.source]; }, r.prototype._indexData = function(e, r, t) { try { r.cluster ? t(null, supercluster(r.superclusterOptions).load(e.features)) : t(null, geojsonvt(e, r.geojsonVtOptions)); } catch (e) { return t(e); } }, r; }(VectorTileWorkerSource); module.exports = GeoJSONWorkerSource; },{"../util/ajax":194,"./geojson_wrapper":85,"./vector_tile_worker_source":98,"geojson-rewind":7,"geojson-vt":11,"supercluster":29,"vt-pbf":38}],"85":[function(_dereq_, module, exports) { "use strict"; var Point = _dereq_("point-geometry"), VectorTileFeature = _dereq_("vector-tile").VectorTileFeature, EXTENT = _dereq_("../data/extent"), FeatureWrapper = function(e) { var t = this; if (this.type = e.type, 1 === e.type) { this.rawGeometry = []; for (var r = 0; r < e.geometry.length; r++) t.rawGeometry.push([ e.geometry[r] ]); } else this.rawGeometry = e.geometry; this.properties = e.tags, "id" in e && !isNaN(e.id) && (this.id = parseInt(e.id, 10)), this.extent = EXTENT; }; FeatureWrapper.prototype.loadGeometry = function() { var e = this, t = this.rawGeometry; this.geometry = []; for (var r = 0; r < t.length; r++) { for (var o = t[r], a = [], i = 0; i < o.length; i++) a.push(new Point(o[i][0], o[i][1])); e.geometry.push(a); } return this.geometry; }, FeatureWrapper.prototype.bbox = function() { this.geometry || this.loadGeometry(); for (var e = this.geometry, t = 1 / 0, r = -1 / 0, o = 1 / 0, a = -1 / 0, i = 0; i < e.length; i++) for (var p = e[i], n = 0; n < p.length; n++) { var h = p[n]; t = Math.min(t, h.x), r = Math.max(r, h.x), o = Math.min(o, h.y), a = Math.max(a, h.y); } return [ t, o, r, a ]; }, FeatureWrapper.prototype.toGeoJSON = function() { VectorTileFeature.prototype.toGeoJSON.call(this); }; var GeoJSONWrapper = function(e) { this.features = e, this.length = e.length, this.extent = EXTENT; }; GeoJSONWrapper.prototype.feature = function(e) { return new FeatureWrapper(this.features[e]); }, module.exports = GeoJSONWrapper; },{"../data/extent":54,"point-geometry":26,"vector-tile":34}],"91":[function(_dereq_, module, exports) { "use strict"; var ajax = _dereq_("../util/ajax"), Evented = _dereq_("../util/evented"), window = _dereq_("../util/window"), pluginRequested = !1, pluginBlobURL = null; module.exports.evented = new Evented(), module.exports.registerForPluginAvailability = function(e) { return pluginBlobURL ? e(pluginBlobURL, module.exports.errorCallback) : module.exports.evented.once("pluginAvailable", e), e; }, module.exports.setRTLTextPlugin = function(e, l) { if (pluginRequested) throw new Error("setRTLTextPlugin cannot be called multiple times."); pluginRequested = !0, module.exports.errorCallback = l, ajax.getArrayBuffer(e, function(e, t) { e ? l(e) : (pluginBlobURL = window.URL.createObjectURL(new window.Blob([ t.data ]), { type: "text/javascript" }), module.exports.evented.fire("pluginAvailable", { pluginBlobURL: pluginBlobURL, errorCallback: l })); }); }; },{"../util/ajax":194,"../util/evented":203,"../util/window":197}],"98":[function(_dereq_, module, exports) { "use strict"; var ajax = _dereq_("../util/ajax"), vt = _dereq_("vector-tile"), Protobuf = _dereq_("pbf"), WorkerTile = _dereq_("./worker_tile"), util = _dereq_("../util/util"), VectorTileWorkerSource = function(e, r, t) { this.actor = e, this.layerIndex = r, t && (this.loadVectorData = t), this.loading = {}, this.loaded = {}; }; VectorTileWorkerSource.prototype.loadTile = function(e, r) { function t(e, t) { return delete this.loading[o][i], e ? r(e) : t ? (a.vectorTile = t, a.parse(t, this.layerIndex, this.actor, function(e, o, i) { if (e) return r(e); var a = {}; t.expires && (a.expires = t.expires), t.cacheControl && (a.cacheControl = t.cacheControl), r(null, util.extend({ rawTileData: t.rawData }, o, a), i); }), this.loaded[o] = this.loaded[o] || {}, void (this.loaded[o][i] = a)) : r(null, null); } var o = e.source, i = e.uid; this.loading[o] || (this.loading[o] = {}); var a = this.loading[o][i] = new WorkerTile(e); a.abort = this.loadVectorData(e, t.bind(this)); }, VectorTileWorkerSource.prototype.reloadTile = function(e, r) { function t(e, t) { if (this.reloadCallback) { var o = this.reloadCallback; delete this.reloadCallback, this.parse(this.vectorTile, a.layerIndex, a.actor, o); } r(e, t); } var o = this.loaded[e.source], i = e.uid, a = this; if (o && o[i]) { var l = o[i]; "parsing" === l.status ? l.reloadCallback = r : "done" === l.status && l.parse(l.vectorTile, this.layerIndex, this.actor, t.bind(l)); } }, VectorTileWorkerSource.prototype.abortTile = function(e) { var r = this.loading[e.source], t = e.uid; r && r[t] && r[t].abort && (r[t].abort(), delete r[t]); }, VectorTileWorkerSource.prototype.removeTile = function(e) { var r = this.loaded[e.source], t = e.uid; r && r[t] && delete r[t]; }, VectorTileWorkerSource.prototype.loadVectorData = function(e, r) { function t(e, t) { if (e) return r(e); var o = new vt.VectorTile(new Protobuf(t.data)); o.rawData = t.data, o.cacheControl = t.cacheControl, o.expires = t.expires, r(e, o); } var o = ajax.getArrayBuffer(e.url, t.bind(this)); return function() { o.abort(); }; }, VectorTileWorkerSource.prototype.redoPlacement = function(e, r) { var t = this.loaded[e.source], o = this.loading[e.source], i = e.uid; if (t && t[i]) { var a = t[i], l = a.redoPlacement(e.angle, e.pitch, e.showCollisionBoxes); l.result && r(null, l.result, l.transferables); } else o && o[i] && (o[i].angle = e.angle); }, module.exports = VectorTileWorkerSource; },{"../util/ajax":194,"../util/util":215,"./worker_tile":101,"pbf":25,"vector-tile":34}],"100":[function(_dereq_, module, exports) { "use strict"; var Actor = _dereq_("../util/actor"), StyleLayerIndex = _dereq_("../style/style_layer_index"), VectorTileWorkerSource = _dereq_("./vector_tile_worker_source"), GeoJSONWorkerSource = _dereq_("./geojson_worker_source"), globalRTLTextPlugin = _dereq_("./rtl_text_plugin"), Worker = function(e) { var r = this; this.self = e, this.actor = new Actor(e, this), this.layerIndexes = {}, this.workerSourceTypes = { vector: VectorTileWorkerSource, geojson: GeoJSONWorkerSource }, this.workerSources = {}, this.self.registerWorkerSource = function(e, o) { if (r.workerSourceTypes[e]) throw new Error('Worker source with name "' + e + '" already registered.'); r.workerSourceTypes[e] = o; }, this.self.registerRTLTextPlugin = function(e) { if (globalRTLTextPlugin.applyArabicShaping || globalRTLTextPlugin.processBidirectionalText) throw new Error("RTL text plugin already registered."); globalRTLTextPlugin.applyArabicShaping = e.applyArabicShaping, globalRTLTextPlugin.processBidirectionalText = e.processBidirectionalText; }; }; Worker.prototype.setLayers = function(e, r) { this.getLayerIndex(e).replace(r); }, Worker.prototype.updateLayers = function(e, r) { this.getLayerIndex(e).update(r.layers, r.removedIds, r.symbolOrder); }, Worker.prototype.loadTile = function(e, r, o) { this.getWorkerSource(e, r.type).loadTile(r, o); }, Worker.prototype.reloadTile = function(e, r, o) { this.getWorkerSource(e, r.type).reloadTile(r, o); }, Worker.prototype.abortTile = function(e, r) { this.getWorkerSource(e, r.type).abortTile(r); }, Worker.prototype.removeTile = function(e, r) { this.getWorkerSource(e, r.type).removeTile(r); }, Worker.prototype.removeSource = function(e, r) { var o = this.getWorkerSource(e, r.type); void 0 !== o.removeSource && o.removeSource(r); }, Worker.prototype.redoPlacement = function(e, r, o) { this.getWorkerSource(e, r.type).redoPlacement(r, o); }, Worker.prototype.loadWorkerSource = function(e, r, o) { try { this.self.importScripts(r.url), o(); } catch (e) { o(e); } }, Worker.prototype.loadRTLTextPlugin = function(e, r, o) { try { globalRTLTextPlugin.applyArabicShaping || globalRTLTextPlugin.processBidirectionalText || this.self.importScripts(r); } catch (e) { o(e); } }, Worker.prototype.getLayerIndex = function(e) { var r = this.layerIndexes[e]; return r || (r = this.layerIndexes[e] = new StyleLayerIndex()), r; }, Worker.prototype.getWorkerSource = function(e, r) { var o = this; if (this.workerSources[e] || (this.workerSources[e] = {}), !this.workerSources[e][r]) { var t = { send: function(r, t, i, n) { o.actor.send(r, t, i, n, e); } }; this.workerSources[e][r] = new this.workerSourceTypes[r](t, this.getLayerIndex(e)); } return this.workerSources[e][r]; }, module.exports = function(e) { return new Worker(e); }; },{"../style/style_layer_index":157,"../util/actor":193,"./geojson_worker_source":84,"./rtl_text_plugin":91,"./vector_tile_worker_source":98}],"101":[function(_dereq_, module, exports) { "use strict"; function recalculateLayers(e, i) { for (var r = 0, o = e.layers; r < o.length; r += 1) { o[r].recalculate(i); } } function serializeBuckets(e, i) { return e.filter(function(e) { return !e.isEmpty(); }).map(function(e) { return e.serialize(i); }); } var FeatureIndex = _dereq_("../data/feature_index"), CollisionTile = _dereq_("../symbol/collision_tile"), CollisionBoxArray = _dereq_("../symbol/collision_box"), DictionaryCoder = _dereq_("../util/dictionary_coder"), util = _dereq_("../util/util"), WorkerTile = function(e) { this.coord = e.coord, this.uid = e.uid, this.zoom = e.zoom, this.tileSize = e.tileSize, this.source = e.source, this.overscaling = e.overscaling, this.angle = e.angle, this.pitch = e.pitch, this.showCollisionBoxes = e.showCollisionBoxes; }; WorkerTile.prototype.parse = function(e, i, r, o) { var t = this; e.layers || (e = { layers: { _geojsonTileLayer: e } }), this.status = "parsing", this.data = e, this.collisionBoxArray = new CollisionBoxArray(); var s = new DictionaryCoder(Object.keys(e.layers).sort()), l = new FeatureIndex(this.coord, this.overscaling); l.bucketLayerIDs = {}; var n = {}, a = 0, c = { featureIndex: l, iconDependencies: {}, glyphDependencies: {} }, u = i.familiesBySource[this.source]; for (var h in u) { var y = e.layers[h]; if (y) { 1 === y.version && util.warnOnce('Vector tile source "' + t.source + '" layer "' + h + '" does not use vector tile spec v2 and therefore may have some rendering errors.'); for (var d = s.encode(h), p = [], m = 0; m < y.length; m++) { var v = y.feature(m); v.index = m, v.sourceLayerIndex = d, p.push(v); } for (var f = 0, g = u[h]; f < g.length; f += 1) { var x = g[f], B = x[0]; if (!(B.minzoom && t.zoom < B.minzoom || B.maxzoom && t.zoom >= B.maxzoom || B.layout && "none" === B.layout.visibility)) { for (var b = 0, k = x; b < k.length; b += 1) { k[b].recalculate(t.zoom); } (n[B.id] = B.createBucket({ index: a, layers: x, zoom: t.zoom, overscaling: t.overscaling, collisionBoxArray: t.collisionBoxArray })).populate(p, c), l.bucketLayerIDs[a] = x.map(function(e) { return e.id; }), a++; } } } } var T = function(e) { t.status = "done", l.paintPropertyStatistics = {}; for (var i in n) util.extend(l.paintPropertyStatistics, n[i].getPaintPropertyStatistics()); var r = []; o(null, { buckets: serializeBuckets(util.values(n), r), featureIndex: l.serialize(r), collisionTile: e.serialize(r), collisionBoxArray: t.collisionBoxArray.serialize() }, r); }; this.symbolBuckets = []; for (var w = i.symbolOrder.length - 1; w >= 0; w--) { var A = n[i.symbolOrder[w]]; A && t.symbolBuckets.push(A); } if (0 === this.symbolBuckets.length) return T(new CollisionTile(this.angle, this.pitch, this.collisionBoxArray)); var D = 0, I = Object.keys(c.iconDependencies), O = util.mapObject(c.glyphDependencies, function(e) { return Object.keys(e).map(Number); }), L = function(e) { if (e) return o(e); if (2 === ++D) { for (var i = new CollisionTile(t.angle, t.pitch, t.collisionBoxArray), r = 0, s = t.symbolBuckets; r < s.length; r += 1) { var l = s[r]; recalculateLayers(l, t.zoom), l.prepare(O, I), l.place(i, t.showCollisionBoxes); } T(i); } }; Object.keys(O).length ? r.send("getGlyphs", { uid: this.uid, stacks: O }, function(e, i) { O = i, L(e); }) : L(), I.length ? r.send("getIcons", { icons: I }, function(e, i) { I = i, L(e); }) : L(); }, WorkerTile.prototype.redoPlacement = function(e, i, r) { var o = this; if (this.angle = e, this.pitch = i, "done" !== this.status) return {}; for (var t = new CollisionTile(this.angle, this.pitch, this.collisionBoxArray), s = 0, l = o.symbolBuckets; s < l.length; s += 1) { var n = l[s]; recalculateLayers(n, o.zoom), n.place(t, r); } var a = []; return { result: { buckets: serializeBuckets(this.symbolBuckets, a), collisionTile: t.serialize(a) }, transferables: a }; }, module.exports = WorkerTile; },{"../data/feature_index":55,"../symbol/collision_box":163,"../symbol/collision_tile":165,"../util/dictionary_coder":200,"../util/util":215}],"104":[function(_dereq_, module, exports) { "use strict"; function ValidationError(r, i) { this.message = (r ? r + ": " : "") + format.apply(format, Array.prototype.slice.call(arguments, 2)), null !== i && void 0 !== i && i.__line__ && (this.line = i.__line__); } var format = _dereq_("util").format; module.exports = ValidationError; },{"util":33}],"105":[function(_dereq_, module, exports) { "use strict"; function createFilter(e) { return new Function("f", "var p = (f && f.properties || {}); return " + compile(e)); } function compile(e) { if (!e) return "true"; var i = e[0]; return e.length <= 1 ? "any" === i ? "false" : "true" : "(" + ("==" === i ? compileComparisonOp(e[1], e[2], "===", !1) : "!=" === i ? compileComparisonOp(e[1], e[2], "!==", !1) : "<" === i || ">" === i || "<=" === i || ">=" === i ? compileComparisonOp(e[1], e[2], i, !0) : "any" === i ? compileLogicalOp(e.slice(1), "||") : "all" === i ? compileLogicalOp(e.slice(1), "&&") : "none" === i ? compileNegation(compileLogicalOp(e.slice(1), "||")) : "in" === i ? compileInOp(e[1], e.slice(2)) : "!in" === i ? compileNegation(compileInOp(e[1], e.slice(2))) : "has" === i ? compileHasOp(e[1]) : "!has" === i ? compileNegation(compileHasOp(e[1])) : "true") + ")"; } function compilePropertyReference(e) { return "$type" === e ? "f.type" : "$id" === e ? "f.id" : "p[" + JSON.stringify(e) + "]"; } function compileComparisonOp(e, i, n, r) { var o = compilePropertyReference(e), t = "$type" === e ? types.indexOf(i) : JSON.stringify(i); return (r ? "typeof " + o + "=== typeof " + t + "&&" : "") + o + n + t; } function compileLogicalOp(e, i) { return e.map(compile).join(i); } function compileInOp(e, i) { "$type" === e && (i = i.map(function(e) { return types.indexOf(e); })); var n = JSON.stringify(i.sort(compare)), r = compilePropertyReference(e); return i.length <= 200 ? n + ".indexOf(" + r + ") !== -1" : "function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }(" + r + ", " + n + ",0," + (i.length - 1) + ")"; } function compileHasOp(e) { return "$id" === e ? '"id" in f' : JSON.stringify(e) + " in p"; } function compileNegation(e) { return "!(" + e + ")"; } function compare(e, i) { return e < i ? -1 : e > i ? 1 : 0; } module.exports = createFilter; var types = [ "Unknown", "Point", "LineString", "Polygon" ]; },{}],"106":[function(_dereq_, module, exports) { "use strict"; function xyz2lab(r) { return r > t3 ? Math.pow(r, 1 / 3) : r / t2 + t0; } function lab2xyz(r) { return r > t1 ? r * r * r : t2 * (r - t0); } function xyz2rgb(r) { return 255 * (r <= .0031308 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055); } function rgb2xyz(r) { return r /= 255, r <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4); } function rgbToLab(r) { var t = rgb2xyz(r[0]), a = rgb2xyz(r[1]), n = rgb2xyz(r[2]), b = xyz2lab((.4124564 * t + .3575761 * a + .1804375 * n) / Xn), o = xyz2lab((.2126729 * t + .7151522 * a + .072175 * n) / Yn); return [ 116 * o - 16, 500 * (b - o), 200 * (o - xyz2lab((.0193339 * t + .119192 * a + .9503041 * n) / Zn)), r[3] ]; } function labToRgb(r) { var t = (r[0] + 16) / 116, a = isNaN(r[1]) ? t : t + r[1] / 500, n = isNaN(r[2]) ? t : t - r[2] / 200; return t = Yn * lab2xyz(t), a = Xn * lab2xyz(a), n = Zn * lab2xyz(n), [ xyz2rgb(3.2404542 * a - 1.5371385 * t - .4985314 * n), xyz2rgb(-.969266 * a + 1.8760108 * t + .041556 * n), xyz2rgb(.0556434 * a - .2040259 * t + 1.0572252 * n), r[3] ]; } function rgbToHcl(r) { var t = rgbToLab(r), a = t[0], n = t[1], b = t[2], o = Math.atan2(b, n) * rad2deg; return [ o < 0 ? o + 360 : o, Math.sqrt(n * n + b * b), a, r[3] ]; } function hclToRgb(r) { var t = r[0] * deg2rad, a = r[1]; return labToRgb([ r[2], Math.cos(t) * a, Math.sin(t) * a, r[3] ]); } var Xn = .95047, Yn = 1, Zn = 1.08883, t0 = 4 / 29, t1 = 6 / 29, t2 = 3 * t1 * t1, t3 = t1 * t1 * t1, deg2rad = Math.PI / 180, rad2deg = 180 / Math.PI; module.exports = { lab: { forward: rgbToLab, reverse: labToRgb }, hcl: { forward: rgbToHcl, reverse: hclToRgb } }; },{}],"107":[function(_dereq_, module, exports) { "use strict"; function identityFunction(t) { return t; } function createFunction(t, e) { var o, n = "color" === e.type; if (isFunctionDefinition(t)) { var r = t.stops && "object" == typeof t.stops[0][0], a = r || void 0 !== t.property, i = r || !a, s = t.type || ("interpolated" === e.function ? "exponential" : "interval"); n && (t = extend({}, t), t.stops && (t.stops = t.stops.map(function(t) { return [ t[0], parseColor(t[1]) ]; })), t.default ? t.default = parseColor(t.default) : t.default = parseColor(e.default)); var u, p, l; if ("exponential" === s) u = evaluateExponentialFunction; else if ("interval" === s) u = evaluateIntervalFunction; else if ("categorical" === s) { u = evaluateCategoricalFunction, p = Object.create(null); for (var c = 0, f = t.stops; c < f.length; c += 1) { var d = f[c]; p[d[0]] = d[1]; } l = typeof t.stops[0][0]; } else { if ("identity" !== s) throw new Error('Unknown function type "' + s + '"'); u = evaluateIdentityFunction; } var v; if (t.colorSpace && "rgb" !== t.colorSpace) { if (!colorSpaces[t.colorSpace]) throw new Error("Unknown color space: " + t.colorSpace); var y = colorSpaces[t.colorSpace]; t = JSON.parse(JSON.stringify(t)); for (var F = 0; F < t.stops.length; F++) t.stops[F] = [ t.stops[F][0], y.forward(t.stops[F][1]) ]; v = y.reverse; } else v = identityFunction; if (r) { for (var h = {}, g = [], C = 0; C < t.stops.length; C++) { var m = t.stops[C], S = m[0].zoom; void 0 === h[S] && (h[S] = { zoom: S, type: t.type, property: t.property, default: t.default, stops: [] }, g.push(S)), h[S].stops.push([ m[0].value, m[1] ]); } for (var T = [], x = 0, b = g; x < b.length; x += 1) { var q = b[x]; T.push([ h[q].zoom, createFunction(h[q], e) ]); } o = function(o, n) { return v(evaluateExponentialFunction({ stops: T, base: t.base }, e, o)(o, n)); }, o.isFeatureConstant = !1, o.isZoomConstant = !1; } else i ? (o = function(o) { return v(u(t, e, o, p, l)); }, o.isFeatureConstant = !0, o.isZoomConstant = !1) : (o = function(o, n) { var r = n[t.property]; return void 0 === r ? coalesce(t.default, e.default) : v(u(t, e, r, p, l)); }, o.isFeatureConstant = !1, o.isZoomConstant = !0); } else n && t && (t = parseColor(t)), o = function() { return t; }, o.isFeatureConstant = !0, o.isZoomConstant = !0; return o; } function coalesce(t, e, o) { return void 0 !== t ? t : void 0 !== e ? e : void 0 !== o ? o : void 0; } function evaluateCategoricalFunction(t, e, o, n, r) { return coalesce(typeof o === r ? n[o] : void 0, t.default, e.default); } function evaluateIntervalFunction(t, e, o) { if ("number" !== getType(o)) return coalesce(t.default, e.default); var n = t.stops.length; if (1 === n) return t.stops[0][1]; if (o <= t.stops[0][0]) return t.stops[0][1]; if (o >= t.stops[n - 1][0]) return t.stops[n - 1][1]; var r = findStopLessThanOrEqualTo(t.stops, o); return t.stops[r][1]; } function evaluateExponentialFunction(t, e, o) { var n = void 0 !== t.base ? t.base : 1; if ("number" !== getType(o)) return coalesce(t.default, e.default); var r = t.stops.length; if (1 === r) return t.stops[0][1]; if (o <= t.stops[0][0]) return t.stops[0][1]; if (o >= t.stops[r - 1][0]) return t.stops[r - 1][1]; var a = findStopLessThanOrEqualTo(t.stops, o), i = interpolationFactor(o, n, t.stops[a][0], t.stops[a + 1][0]), s = t.stops[a][1], u = t.stops[a + 1][1], p = interpolate[e.type] || identityFunction; return "function" == typeof s ? function() { var t = s.apply(void 0, arguments), e = u.apply(void 0, arguments); if (void 0 !== t && void 0 !== e) return p(t, e, i); } : p(s, u, i); } function evaluateIdentityFunction(t, e, o) { return "color" === e.type ? o = parseColor(o) : getType(o) !== e.type && (o = void 0), coalesce(o, t.default, e.default); } function findStopLessThanOrEqualTo(t, e) { for (var o, n, r = t.length, a = 0, i = r - 1, s = 0; a <= i; ) { if (s = Math.floor((a + i) / 2), o = t[s][0], n = t[s + 1][0], e === o || e > o && e < n) return s; o < e ? a = s + 1 : o > e && (i = s - 1); } return Math.max(s - 1, 0); } function isFunctionDefinition(t) { return "object" == typeof t && (t.stops || "identity" === t.type); } function interpolationFactor(t, e, o, n) { var r = n - o, a = t - o; return 1 === e ? a / r : (Math.pow(e, a) - 1) / (Math.pow(e, r) - 1); } var colorSpaces = _dereq_("./color_spaces"), parseColor = _dereq_("../util/parse_color"), extend = _dereq_("../util/extend"), getType = _dereq_("../util/get_type"), interpolate = _dereq_("../util/interpolate"); module.exports = createFunction, module.exports.isFunctionDefinition = isFunctionDefinition, module.exports.interpolationFactor = interpolationFactor, module.exports.findStopLessThanOrEqualTo = findStopLessThanOrEqualTo; },{"../util/extend":121,"../util/get_type":122,"../util/interpolate":123,"../util/parse_color":124,"./color_spaces":106}],"108":[function(_dereq_, module, exports) { "use strict"; function key(r) { return stringify(refProperties.map(function(e) { return r[e]; })); } function groupByLayout(r) { for (var e = {}, t = 0; t < r.length; t++) { var i = key(r[t]), u = e[i]; u || (u = e[i] = []), u.push(r[t]); } var n = []; for (var o in e) n.push(e[o]); return n; } var refProperties = _dereq_("./util/ref_properties"), stringify = _dereq_("fast-stable-stringify"); module.exports = groupByLayout; },{"./util/ref_properties":125,"fast-stable-stringify":110}],"109":[function(_dereq_, module, exports) { function clamp_css_byte(e) { return e = Math.round(e), e < 0 ? 0 : e > 255 ? 255 : e; } function clamp_css_float(e) { return e < 0 ? 0 : e > 1 ? 1 : e; } function parse_css_int(e) { return clamp_css_byte("%" === e[e.length - 1] ? parseFloat(e) / 100 * 255 : parseInt(e)); } function parse_css_float(e) { return clamp_css_float("%" === e[e.length - 1] ? parseFloat(e) / 100 : parseFloat(e)); } function css_hue_to_rgb(e, r, l) { return l < 0 ? l += 1 : l > 1 && (l -= 1), 6 * l < 1 ? e + (r - e) * l * 6 : 2 * l < 1 ? r : 3 * l < 2 ? e + (r - e) * (2 / 3 - l) * 6 : e; } function parseCSSColor(e) { var r = e.replace(/ /g, "").toLowerCase(); if (r in kCSSColorTable) return kCSSColorTable[r].slice(); if ("#" === r[0]) { if (4 === r.length) { var l = parseInt(r.substr(1), 16); return l >= 0 && l <= 4095 ? [ (3840 & l) >> 4 | (3840 & l) >> 8, 240 & l | (240 & l) >> 4, 15 & l | (15 & l) << 4, 1 ] : null; } if (7 === r.length) { var l = parseInt(r.substr(1), 16); return l >= 0 && l <= 16777215 ? [ (16711680 & l) >> 16, (65280 & l) >> 8, 255 & l, 1 ] : null; } return null; } var a = r.indexOf("("), t = r.indexOf(")"); if (-1 !== a && t + 1 === r.length) { var n = r.substr(0, a), s = r.substr(a + 1, t - (a + 1)).split(","), o = 1; switch (n) { case "rgba": if (4 !== s.length) return null; o = parse_css_float(s.pop()); case "rgb": return 3 !== s.length ? null : [ parse_css_int(s[0]), parse_css_int(s[1]), parse_css_int(s[2]), o ]; case "hsla": if (4 !== s.length) return null; o = parse_css_float(s.pop()); case "hsl": if (3 !== s.length) return null; var i = (parseFloat(s[0]) % 360 + 360) % 360 / 360, u = parse_css_float(s[1]), g = parse_css_float(s[2]), d = g <= .5 ? g * (u + 1) : g + u - g * u, c = 2 * g - d; return [ clamp_css_byte(255 * css_hue_to_rgb(c, d, i + 1 / 3)), clamp_css_byte(255 * css_hue_to_rgb(c, d, i)), clamp_css_byte(255 * css_hue_to_rgb(c, d, i - 1 / 3)), o ]; default: return null; } } return null; } var kCSSColorTable = { transparent: [ 0, 0, 0, 0 ], aliceblue: [ 240, 248, 255, 1 ], antiquewhite: [ 250, 235, 215, 1 ], aqua: [ 0, 255, 255, 1 ], aquamarine: [ 127, 255, 212, 1 ], azure: [ 240, 255, 255, 1 ], beige: [ 245, 245, 220, 1 ], bisque: [ 255, 228, 196, 1 ], black: [ 0, 0, 0, 1 ], blanchedalmond: [ 255, 235, 205, 1 ], blue: [ 0, 0, 255, 1 ], blueviolet: [ 138, 43, 226, 1 ], brown: [ 165, 42, 42, 1 ], burlywood: [ 222, 184, 135, 1 ], cadetblue: [ 95, 158, 160, 1 ], chartreuse: [ 127, 255, 0, 1 ], chocolate: [ 210, 105, 30, 1 ], coral: [ 255, 127, 80, 1 ], cornflowerblue: [ 100, 149, 237, 1 ], cornsilk: [ 255, 248, 220, 1 ], crimson: [ 220, 20, 60, 1 ], cyan: [ 0, 255, 255, 1 ], darkblue: [ 0, 0, 139, 1 ], darkcyan: [ 0, 139, 139, 1 ], darkgoldenrod: [ 184, 134, 11, 1 ], darkgray: [ 169, 169, 169, 1 ], darkgreen: [ 0, 100, 0, 1 ], darkgrey: [ 169, 169, 169, 1 ], darkkhaki: [ 189, 183, 107, 1 ], darkmagenta: [ 139, 0, 139, 1 ], darkolivegreen: [ 85, 107, 47, 1 ], darkorange: [ 255, 140, 0, 1 ], darkorchid: [ 153, 50, 204, 1 ], darkred: [ 139, 0, 0, 1 ], darksalmon: [ 233, 150, 122, 1 ], darkseagreen: [ 143, 188, 143, 1 ], darkslateblue: [ 72, 61, 139, 1 ], darkslategray: [ 47, 79, 79, 1 ], darkslategrey: [ 47, 79, 79, 1 ], darkturquoise: [ 0, 206, 209, 1 ], darkviolet: [ 148, 0, 211, 1 ], deeppink: [ 255, 20, 147, 1 ], deepskyblue: [ 0, 191, 255, 1 ], dimgray: [ 105, 105, 105, 1 ], dimgrey: [ 105, 105, 105, 1 ], dodgerblue: [ 30, 144, 255, 1 ], firebrick: [ 178, 34, 34, 1 ], floralwhite: [ 255, 250, 240, 1 ], forestgreen: [ 34, 139, 34, 1 ], fuchsia: [ 255, 0, 255, 1 ], gainsboro: [ 220, 220, 220, 1 ], ghostwhite: [ 248, 248, 255, 1 ], gold: [ 255, 215, 0, 1 ], goldenrod: [ 218, 165, 32, 1 ], gray: [ 128, 128, 128, 1 ], green: [ 0, 128, 0, 1 ], greenyellow: [ 173, 255, 47, 1 ], grey: [ 128, 128, 128, 1 ], honeydew: [ 240, 255, 240, 1 ], hotpink: [ 255, 105, 180, 1 ], indianred: [ 205, 92, 92, 1 ], indigo: [ 75, 0, 130, 1 ], ivory: [ 255, 255, 240, 1 ], khaki: [ 240, 230, 140, 1 ], lavender: [ 230, 230, 250, 1 ], lavenderblush: [ 255, 240, 245, 1 ], lawngreen: [ 124, 252, 0, 1 ], lemonchiffon: [ 255, 250, 205, 1 ], lightblue: [ 173, 216, 230, 1 ], lightcoral: [ 240, 128, 128, 1 ], lightcyan: [ 224, 255, 255, 1 ], lightgoldenrodyellow: [ 250, 250, 210, 1 ], lightgray: [ 211, 211, 211, 1 ], lightgreen: [ 144, 238, 144, 1 ], lightgrey: [ 211, 211, 211, 1 ], lightpink: [ 255, 182, 193, 1 ], lightsalmon: [ 255, 160, 122, 1 ], lightseagreen: [ 32, 178, 170, 1 ], lightskyblue: [ 135, 206, 250, 1 ], lightslategray: [ 119, 136, 153, 1 ], lightslategrey: [ 119, 136, 153, 1 ], lightsteelblue: [ 176, 196, 222, 1 ], lightyellow: [ 255, 255, 224, 1 ], lime: [ 0, 255, 0, 1 ], limegreen: [ 50, 205, 50, 1 ], linen: [ 250, 240, 230, 1 ], magenta: [ 255, 0, 255, 1 ], maroon: [ 128, 0, 0, 1 ], mediumaquamarine: [ 102, 205, 170, 1 ], mediumblue: [ 0, 0, 205, 1 ], mediumorchid: [ 186, 85, 211, 1 ], mediumpurple: [ 147, 112, 219, 1 ], mediumseagreen: [ 60, 179, 113, 1 ], mediumslateblue: [ 123, 104, 238, 1 ], mediumspringgreen: [ 0, 250, 154, 1 ], mediumturquoise: [ 72, 209, 204, 1 ], mediumvioletred: [ 199, 21, 133, 1 ], midnightblue: [ 25, 25, 112, 1 ], mintcream: [ 245, 255, 250, 1 ], mistyrose: [ 255, 228, 225, 1 ], moccasin: [ 255, 228, 181, 1 ], navajowhite: [ 255, 222, 173, 1 ], navy: [ 0, 0, 128, 1 ], oldlace: [ 253, 245, 230, 1 ], olive: [ 128, 128, 0, 1 ], olivedrab: [ 107, 142, 35, 1 ], orange: [ 255, 165, 0, 1 ], orangered: [ 255, 69, 0, 1 ], orchid: [ 218, 112, 214, 1 ], palegoldenrod: [ 238, 232, 170, 1 ], palegreen: [ 152, 251, 152, 1 ], paleturquoise: [ 175, 238, 238, 1 ], palevioletred: [ 219, 112, 147, 1 ], papayawhip: [ 255, 239, 213, 1 ], peachpuff: [ 255, 218, 185, 1 ], peru: [ 205, 133, 63, 1 ], pink: [ 255, 192, 203, 1 ], plum: [ 221, 160, 221, 1 ], powderblue: [ 176, 224, 230, 1 ], purple: [ 128, 0, 128, 1 ], rebeccapurple: [ 102, 51, 153, 1 ], red: [ 255, 0, 0, 1 ], rosybrown: [ 188, 143, 143, 1 ], royalblue: [ 65, 105, 225, 1 ], saddlebrown: [ 139, 69, 19, 1 ], salmon: [ 250, 128, 114, 1 ], sandybrown: [ 244, 164, 96, 1 ], seagreen: [ 46, 139, 87, 1 ], seashell: [ 255, 245, 238, 1 ], sienna: [ 160, 82, 45, 1 ], silver: [ 192, 192, 192, 1 ], skyblue: [ 135, 206, 235, 1 ], slateblue: [ 106, 90, 205, 1 ], slategray: [ 112, 128, 144, 1 ], slategrey: [ 112, 128, 144, 1 ], snow: [ 255, 250, 250, 1 ], springgreen: [ 0, 255, 127, 1 ], steelblue: [ 70, 130, 180, 1 ], tan: [ 210, 180, 140, 1 ], teal: [ 0, 128, 128, 1 ], thistle: [ 216, 191, 216, 1 ], tomato: [ 255, 99, 71, 1 ], turquoise: [ 64, 224, 208, 1 ], violet: [ 238, 130, 238, 1 ], wheat: [ 245, 222, 179, 1 ], white: [ 255, 255, 255, 1 ], whitesmoke: [ 245, 245, 245, 1 ], yellow: [ 255, 255, 0, 1 ], yellowgreen: [ 154, 205, 50, 1 ] }; try { exports.parseCSSColor = parseCSSColor; } catch (e) {} },{}],"110":[function(_dereq_, module, exports) { function sss(r) { var e, t, s, n, u, a; switch (typeof r) { case "object": if (null === r) return null; if (isArray(r)) { for (s = "[", t = r.length - 1, e = 0; e < t; e++) s += sss(r[e]) + ","; return t > -1 && (s += sss(r[e])), s + "]"; } for (n = objKeys(r).sort(), t = n.length, s = "{", u = n[e = 0], a = t > 0 && void 0 !== r[u]; e < t; ) a ? (s += '"' + u.replace(strReg, strReplace) + '":' + sss(r[u]), u = n[++e], (a = e < t && void 0 !== r[u]) && (s += ",")) : (u = n[++e], a = e < t && void 0 !== r[u]); return s + "}"; case "undefined": return null; case "string": return '"' + r.replace(strReg, strReplace) + '"'; default: return r; } } var toString = {}.toString, isArray = Array.isArray || function(r) { return "[object Array]" === toString.call(r); }, objKeys = Object.keys || function(r) { var e = []; for (var t in r) r.hasOwnProperty(t) && e.push(t); return e; }, strReg = /[\u0000-\u001f"\\]/g, strReplace = function(r) { var e = r.charCodeAt(0); switch (e) { case 34: return '\\"'; case 92: return "\\\\"; case 12: return "\\f"; case 10: return "\\n"; case 13: return "\\r"; case 9: return "\\t"; case 8: return "\\b"; default: return e > 15 ? "\\u00" + e.toString(16) : "\\u000" + e.toString(16); } }; module.exports = function(r) { if (void 0 !== r) return "" + sss(r); }, module.exports.stringSearch = strReg, module.exports.stringReplace = strReplace; },{}],"119":[function(_dereq_, module, exports) { "use strict"; module.exports = _dereq_("./v8.json"); },{"./v8.json":120}],"120":[function(_dereq_, module, exports) { module.exports = { $version: 8, $root: { version: { required: !0, type: "enum", values: [ 8 ] }, name: { type: "string" }, metadata: { type: "*" }, center: { type: "array", value: "number" }, zoom: { type: "number" }, bearing: { type: "number", default: 0, period: 360, units: "degrees" }, pitch: { type: "number", default: 0, units: "degrees" }, light: { type: "light" }, sources: { required: !0, type: "sources" }, sprite: { type: "string" }, glyphs: { type: "string" }, transition: { type: "transition" }, layers: { required: !0, type: "array", value: "layer" } }, sources: { "*": { type: "source" } }, source: [ "source_tile", "source_geojson", "source_video", "source_image", "source_canvas" ], source_tile: { type: { required: !0, type: "enum", values: { vector: {}, raster: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, "*": { type: "*" } }, source_geojson: { type: { required: !0, type: "enum", values: { geojson: {} } }, data: { type: "*" }, maxzoom: { type: "number", default: 18 }, buffer: { type: "number", default: 128, maximum: 512, minimum: 0 }, tolerance: { type: "number", default: .375 }, cluster: { type: "boolean", default: !1 }, clusterRadius: { type: "number", default: 50, minimum: 0 }, clusterMaxZoom: { type: "number" } }, source_video: { type: { required: !0, type: "enum", values: { video: {} } }, urls: { required: !0, type: "array", value: "string" }, coordinates: { required: !0, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, source_image: { type: { required: !0, type: "enum", values: { image: {} } }, url: { required: !0, type: "string" }, coordinates: { required: !0, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, source_canvas: { type: { required: !0, type: "enum", values: { canvas: {} } }, coordinates: { required: !0, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } }, animate: { type: "boolean", default: "true" }, canvas: { type: "string", required: !0 } }, layer: { id: { type: "string", required: !0 }, type: { type: "enum", values: { fill: {}, line: {}, symbol: {}, circle: {}, "fill-extrusion": {}, raster: {}, background: {} } }, metadata: { type: "*" }, ref: { type: "string" }, source: { type: "string" }, "source-layer": { type: "string" }, minzoom: { type: "number", minimum: 0, maximum: 24 }, maxzoom: { type: "number", minimum: 0, maximum: 24 }, filter: { type: "filter" }, layout: { type: "layout" }, paint: { type: "paint" }, "paint.*": { type: "paint" } }, layout: [ "layout_fill", "layout_line", "layout_circle", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_background" ], layout_background: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible" } }, layout_fill: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible" } }, layout_circle: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible" } }, "layout_fill-extrusion": { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible" } }, layout_line: { "line-cap": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { butt: {}, round: {}, square: {} }, default: "butt" }, "line-join": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { bevel: {}, round: {}, miter: {} }, default: "miter" }, "line-miter-limit": { type: "number", default: 2, function: "interpolated", "zoom-function": !0, requires: [ { "line-join": "miter" } ] }, "line-round-limit": { type: "number", default: 1.05, function: "interpolated", "zoom-function": !0, requires: [ { "line-join": "round" } ] }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible" } }, layout_symbol: { "symbol-placement": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { point: {}, line: {} }, default: "point" }, "symbol-spacing": { type: "number", default: 250, minimum: 1, function: "interpolated", "zoom-function": !0, units: "pixels", requires: [ { "symbol-placement": "line" } ] }, "symbol-avoid-edges": { type: "boolean", function: "piecewise-constant", "zoom-function": !0, default: !1 }, "icon-allow-overlap": { type: "boolean", function: "piecewise-constant", "zoom-function": !0, default: !1, requires: [ "icon-image" ] }, "icon-ignore-placement": { type: "boolean", function: "piecewise-constant", "zoom-function": !0, default: !1, requires: [ "icon-image" ] }, "icon-optional": { type: "boolean", function: "piecewise-constant", "zoom-function": !0, default: !1, requires: [ "icon-image", "text-field" ] }, "icon-rotation-alignment": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: [ "icon-image" ] }, "icon-size": { type: "number", default: 1, minimum: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, requires: [ "icon-image" ] }, "icon-text-fit": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { none: {}, width: {}, height: {}, both: {} }, default: "none", requires: [ "icon-image", "text-field" ] }, "icon-text-fit-padding": { type: "array", value: "number", length: 4, default: [ 0, 0, 0, 0 ], units: "pixels", function: "interpolated", "zoom-function": !0, requires: [ "icon-image", "text-field", { "icon-text-fit": [ "both", "width", "height" ] } ] }, "icon-image": { type: "string", function: "piecewise-constant", "zoom-function": !0, "property-function": !0, tokens: !0 }, "icon-rotate": { type: "number", default: 0, period: 360, function: "interpolated", "zoom-function": !0, "property-function": !0, units: "degrees", requires: [ "icon-image" ] }, "icon-padding": { type: "number", default: 2, minimum: 0, function: "interpolated", "zoom-function": !0, units: "pixels", requires: [ "icon-image" ] }, "icon-keep-upright": { type: "boolean", function: "piecewise-constant", "zoom-function": !0, default: !1, requires: [ "icon-image", { "icon-rotation-alignment": "map" }, { "symbol-placement": "line" } ] }, "icon-offset": { type: "array", value: "number", length: 2, default: [ 0, 0 ], function: "interpolated", "zoom-function": !0, "property-function": !0, requires: [ "icon-image" ] }, "text-pitch-alignment": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: [ "text-field" ] }, "text-rotation-alignment": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: [ "text-field" ] }, "text-field": { type: "string", function: "piecewise-constant", "zoom-function": !0, "property-function": !0, default: "", tokens: !0 }, "text-font": { type: "array", value: "string", function: "piecewise-constant", "zoom-function": !0, default: [ "Open Sans Regular", "Arial Unicode MS Regular" ], requires: [ "text-field" ] }, "text-size": { type: "number", default: 16, minimum: 0, units: "pixels", function: "interpolated", "zoom-function": !0, "property-function": !0, requires: [ "text-field" ] }, "text-max-width": { type: "number", default: 10, minimum: 0, units: "ems", function: "interpolated", "zoom-function": !0, requires: [ "text-field" ] }, "text-line-height": { type: "number", default: 1.2, units: "ems", function: "interpolated", "zoom-function": !0, requires: [ "text-field" ] }, "text-letter-spacing": { type: "number", default: 0, units: "ems", function: "interpolated", "zoom-function": !0, requires: [ "text-field" ] }, "text-justify": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { left: {}, center: {}, right: {} }, default: "center", requires: [ "text-field" ] }, "text-anchor": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: [ "text-field" ] }, "text-max-angle": { type: "number", default: 45, units: "degrees", function: "interpolated", "zoom-function": !0, requires: [ "text-field", { "symbol-placement": "line" } ] }, "text-rotate": { type: "number", default: 0, period: 360, units: "degrees", function: "interpolated", "zoom-function": !0, "property-function": !0, requires: [ "text-field" ] }, "text-padding": { type: "number", default: 2, minimum: 0, units: "pixels", function: "interpolated", "zoom-function": !0, requires: [ "text-field" ] }, "text-keep-upright": { type: "boolean", function: "piecewise-constant", "zoom-function": !0, default: !0, requires: [ "text-field", { "text-rotation-alignment": "map" }, { "symbol-placement": "line" } ] }, "text-transform": { type: "enum", function: "piecewise-constant", "zoom-function": !0, "property-function": !0, values: { none: {}, uppercase: {}, lowercase: {} }, default: "none", requires: [ "text-field" ] }, "text-offset": { type: "array", value: "number", units: "ems", function: "interpolated", "zoom-function": !0, "property-function": !0, length: 2, default: [ 0, 0 ], requires: [ "text-field" ] }, "text-allow-overlap": { type: "boolean", function: "piecewise-constant", "zoom-function": !0, default: !1, requires: [ "text-field" ] }, "text-ignore-placement": { type: "boolean", function: "piecewise-constant", "zoom-function": !0, default: !1, requires: [ "text-field" ] }, "text-optional": { type: "boolean", function: "piecewise-constant", "zoom-function": !0, default: !1, requires: [ "text-field", "icon-image" ] }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible" } }, layout_raster: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible" } }, filter: { type: "array", value: "*" }, filter_operator: { type: "enum", values: { "==": {}, "!=": {}, ">": {}, ">=": {}, "<": {}, "<=": {}, in: {}, "!in": {}, all: {}, any: {}, none: {}, has: {}, "!has": {} } }, geometry_type: { type: "enum", values: { Point: {}, LineString: {}, Polygon: {} } }, function: { stops: { type: "array", value: "function_stop" }, base: { type: "number", default: 1, minimum: 0 }, property: { type: "string", default: "$zoom" }, type: { type: "enum", values: { identity: {}, exponential: {}, interval: {}, categorical: {} }, default: "exponential" }, colorSpace: { type: "enum", values: { rgb: {}, lab: {}, hcl: {} }, default: "rgb" }, default: { type: "*", required: !1 } }, function_stop: { type: "array", minimum: 0, maximum: 22, value: [ "number", "color" ], length: 2 }, light: { anchor: { type: "enum", default: "viewport", values: { map: {}, viewport: {} }, transition: !1 }, position: { type: "array", default: [ 1.15, 210, 30 ], length: 3, value: "number", transition: !0, function: "interpolated", "zoom-function": !0, "property-function": !1 }, color: { type: "color", default: "#ffffff", function: "interpolated", "zoom-function": !0, "property-function": !1, transition: !0 }, intensity: { type: "number", default: .5, minimum: 0, maximum: 1, function: "interpolated", "zoom-function": !0, "property-function": !1, transition: !0 } }, paint: [ "paint_fill", "paint_line", "paint_circle", "paint_fill-extrusion", "paint_symbol", "paint_raster", "paint_background" ], paint_fill: { "fill-antialias": { type: "boolean", function: "piecewise-constant", "zoom-function": !0, default: !0 }, "fill-opacity": { type: "number", function: "interpolated", "zoom-function": !0, "property-function": !0, default: 1, minimum: 0, maximum: 1, transition: !0 }, "fill-color": { type: "color", default: "#000000", function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, requires: [ { "!": "fill-pattern" } ] }, "fill-outline-color": { type: "color", function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, requires: [ { "!": "fill-pattern" }, { "fill-antialias": !0 } ] }, "fill-translate": { type: "array", value: "number", length: 2, default: [ 0, 0 ], function: "interpolated", "zoom-function": !0, transition: !0, units: "pixels" }, "fill-translate-anchor": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { map: {}, viewport: {} }, default: "map", requires: [ "fill-translate" ] }, "fill-pattern": { type: "string", function: "piecewise-constant", "zoom-function": !0, transition: !0 } }, "paint_fill-extrusion": { "fill-extrusion-opacity": { type: "number", function: "interpolated", "zoom-function": !0, "property-function": !1, default: 1, minimum: 0, maximum: 1, transition: !0 }, "fill-extrusion-color": { type: "color", default: "#000000", function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, requires: [ { "!": "fill-extrusion-pattern" } ] }, "fill-extrusion-translate": { type: "array", value: "number", length: 2, default: [ 0, 0 ], function: "interpolated", "zoom-function": !0, transition: !0, units: "pixels" }, "fill-extrusion-translate-anchor": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { map: {}, viewport: {} }, default: "map", requires: [ "fill-extrusion-translate" ] }, "fill-extrusion-pattern": { type: "string", function: "piecewise-constant", "zoom-function": !0, transition: !0 }, "fill-extrusion-height": { type: "number", function: "interpolated", "zoom-function": !0, "property-function": !0, default: 0, minimum: 0, maximum: 65535, units: "meters", transition: !0 }, "fill-extrusion-base": { type: "number", function: "interpolated", "zoom-function": !0, "property-function": !0, default: 0, minimum: 0, maximum: 65535, units: "meters", transition: !0, requires: [ "fill-extrusion-height" ] } }, paint_line: { "line-opacity": { type: "number", function: "interpolated", "zoom-function": !0, "property-function": !0, default: 1, minimum: 0, maximum: 1, transition: !0 }, "line-color": { type: "color", default: "#000000", function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, requires: [ { "!": "line-pattern" } ] }, "line-translate": { type: "array", value: "number", length: 2, default: [ 0, 0 ], function: "interpolated", "zoom-function": !0, transition: !0, units: "pixels" }, "line-translate-anchor": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { map: {}, viewport: {} }, default: "map", requires: [ "line-translate" ] }, "line-width": { type: "number", default: 1, minimum: 0, function: "interpolated", "zoom-function": !0, transition: !0, units: "pixels" }, "line-gap-width": { type: "number", default: 0, minimum: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, units: "pixels" }, "line-offset": { type: "number", default: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, units: "pixels" }, "line-blur": { type: "number", default: 0, minimum: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, units: "pixels" }, "line-dasharray": { type: "array", value: "number", function: "piecewise-constant", "zoom-function": !0, minimum: 0, transition: !0, units: "line widths", requires: [ { "!": "line-pattern" } ] }, "line-pattern": { type: "string", function: "piecewise-constant", "zoom-function": !0, transition: !0 } }, paint_circle: { "circle-radius": { type: "number", default: 5, minimum: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, units: "pixels" }, "circle-color": { type: "color", default: "#000000", function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0 }, "circle-blur": { type: "number", default: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0 }, "circle-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0 }, "circle-translate": { type: "array", value: "number", length: 2, default: [ 0, 0 ], function: "interpolated", "zoom-function": !0, transition: !0, units: "pixels" }, "circle-translate-anchor": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { map: {}, viewport: {} }, default: "map", requires: [ "circle-translate" ] }, "circle-pitch-scale": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { map: {}, viewport: {} }, default: "map" }, "circle-stroke-width": { type: "number", default: 0, minimum: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, units: "pixels" }, "circle-stroke-color": { type: "color", default: "#000000", function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0 }, "circle-stroke-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0 } }, paint_symbol: { "icon-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, requires: [ "icon-image" ] }, "icon-color": { type: "color", default: "#000000", function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, requires: [ "icon-image" ] }, "icon-halo-color": { type: "color", default: "rgba(0, 0, 0, 0)", function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, requires: [ "icon-image" ] }, "icon-halo-width": { type: "number", default: 0, minimum: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, units: "pixels", requires: [ "icon-image" ] }, "icon-halo-blur": { type: "number", default: 0, minimum: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, units: "pixels", requires: [ "icon-image" ] }, "icon-translate": { type: "array", value: "number", length: 2, default: [ 0, 0 ], function: "interpolated", "zoom-function": !0, transition: !0, units: "pixels", requires: [ "icon-image" ] }, "icon-translate-anchor": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { map: {}, viewport: {} }, default: "map", requires: [ "icon-image", "icon-translate" ] }, "text-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, requires: [ "text-field" ] }, "text-color": { type: "color", default: "#000000", function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, requires: [ "text-field" ] }, "text-halo-color": { type: "color", default: "rgba(0, 0, 0, 0)", function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, requires: [ "text-field" ] }, "text-halo-width": { type: "number", default: 0, minimum: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, units: "pixels", requires: [ "text-field" ] }, "text-halo-blur": { type: "number", default: 0, minimum: 0, function: "interpolated", "zoom-function": !0, "property-function": !0, transition: !0, units: "pixels", requires: [ "text-field" ] }, "text-translate": { type: "array", value: "number", length: 2, default: [ 0, 0 ], function: "interpolated", "zoom-function": !0, transition: !0, units: "pixels", requires: [ "text-field" ] }, "text-translate-anchor": { type: "enum", function: "piecewise-constant", "zoom-function": !0, values: { map: {}, viewport: {} }, default: "map", requires: [ "text-field", "text-translate" ] } }, paint_raster: { "raster-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, function: "interpolated", "zoom-function": !0, transition: !0 }, "raster-hue-rotate": { type: "number", default: 0, period: 360, function: "interpolated", "zoom-function": !0, transition: !0, units: "degrees" }, "raster-brightness-min": { type: "number", function: "interpolated", "zoom-function": !0, default: 0, minimum: 0, maximum: 1, transition: !0 }, "raster-brightness-max": { type: "number", function: "interpolated", "zoom-function": !0, default: 1, minimum: 0, maximum: 1, transition: !0 }, "raster-saturation": { type: "number", default: 0, minimum: -1, maximum: 1, function: "interpolated", "zoom-function": !0, transition: !0 }, "raster-contrast": { type: "number", default: 0, minimum: -1, maximum: 1, function: "interpolated", "zoom-function": !0, transition: !0 }, "raster-fade-duration": { type: "number", default: 300, minimum: 0, function: "interpolated", "zoom-function": !0, transition: !0, units: "milliseconds" } }, paint_background: { "background-color": { type: "color", default: "#000000", function: "interpolated", "zoom-function": !0, transition: !0, requires: [ { "!": "background-pattern" } ] }, "background-pattern": { type: "string", function: "piecewise-constant", "zoom-function": !0, transition: !0 }, "background-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, function: "interpolated", "zoom-function": !0, transition: !0 } }, transition: { duration: { type: "number", default: 300, minimum: 0, units: "milliseconds" }, delay: { type: "number", default: 0, minimum: 0, units: "milliseconds" } } }; },{}],"121":[function(_dereq_, module, exports) { "use strict"; module.exports = function(r) { for (var t = arguments, e = 1; e < arguments.length; e++) { var n = t[e]; for (var o in n) r[o] = n[o]; } return r; }; },{}],"122":[function(_dereq_, module, exports) { "use strict"; module.exports = function(n) { return n instanceof Number ? "number" : n instanceof String ? "string" : n instanceof Boolean ? "boolean" : Array.isArray(n) ? "array" : null === n ? "null" : typeof n; }; },{}],"123":[function(_dereq_, module, exports) { "use strict"; function interpolate(t, e, n) { return t * (1 - n) + e * n; } module.exports = interpolate, interpolate.number = interpolate, interpolate.vec2 = function(t, e, n) { return [ interpolate(t[0], e[0], n), interpolate(t[1], e[1], n) ]; }, interpolate.color = function(t, e, n) { return [ interpolate(t[0], e[0], n), interpolate(t[1], e[1], n), interpolate(t[2], e[2], n), interpolate(t[3], e[3], n) ]; }, interpolate.array = function(t, e, n) { return t.map(function(t, r) { return interpolate(t, e[r], n); }); }; },{}],"124":[function(_dereq_, module, exports) { "use strict"; var parseColorString = _dereq_("csscolorparser").parseCSSColor; module.exports = function(r) { if ("string" == typeof r) { var e = parseColorString(r); if (!e) return; return [ e[0] / 255 * e[3], e[1] / 255 * e[3], e[2] / 255 * e[3], e[3] ]; } return Array.isArray(r) ? r : void 0; }; },{"csscolorparser":109}],"125":[function(_dereq_, module, exports) { "use strict"; module.exports = [ "type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout" ]; },{}],"126":[function(_dereq_, module, exports) { "use strict"; module.exports = function(n) { return n instanceof Number || n instanceof String || n instanceof Boolean ? n.valueOf() : n; }; },{}],"127":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), getType = _dereq_("../util/get_type"), extend = _dereq_("../util/extend"); module.exports = function(e) { var r = _dereq_("./validate_function"), t = _dereq_("./validate_object"), i = { "*": function() { return []; }, array: _dereq_("./validate_array"), boolean: _dereq_("./validate_boolean"), number: _dereq_("./validate_number"), color: _dereq_("./validate_color"), constants: _dereq_("./validate_constants"), enum: _dereq_("./validate_enum"), filter: _dereq_("./validate_filter"), function: _dereq_("./validate_function"), layer: _dereq_("./validate_layer"), object: _dereq_("./validate_object"), source: _dereq_("./validate_source"), light: _dereq_("./validate_light"), string: _dereq_("./validate_string") }, a = e.value, n = e.valueSpec, u = e.key, o = e.styleSpec, l = e.style; if ("string" === getType(a) && "@" === a[0]) { if (o.$version > 7) return [ new ValidationError(u, a, "constants have been deprecated as of v8") ]; if (!(a in l.constants)) return [ new ValidationError(u, a, 'constant "%s" not found', a) ]; e = extend({}, e, { value: l.constants[a] }); } return n.function && "object" === getType(a) ? r(e) : n.type && i[n.type] ? i[n.type](e) : t(extend({}, e, { valueSpec: n.type ? o[n.type] : n })); }; },{"../error/validation_error":104,"../util/extend":121,"../util/get_type":122,"./validate_array":128,"./validate_boolean":129,"./validate_color":130,"./validate_constants":131,"./validate_enum":132,"./validate_filter":133,"./validate_function":134,"./validate_layer":136,"./validate_light":138,"./validate_number":139,"./validate_object":140,"./validate_source":143,"./validate_string":144}],"128":[function(_dereq_, module, exports) { "use strict"; var getType = _dereq_("../util/get_type"), validate = _dereq_("./validate"), ValidationError = _dereq_("../error/validation_error"); module.exports = function(e) { var r = e.value, t = e.valueSpec, a = e.style, n = e.styleSpec, l = e.key, i = e.arrayElementValidator || validate; if ("array" !== getType(r)) return [ new ValidationError(l, r, "array expected, %s found", getType(r)) ]; if (t.length && r.length !== t.length) return [ new ValidationError(l, r, "array length %d expected, length %d found", t.length, r.length) ]; if (t["min-length"] && r.length < t["min-length"]) return [ new ValidationError(l, r, "array length at least %d expected, length %d found", t["min-length"], r.length) ]; var o = { type: t.value }; n.$version < 7 && (o.function = t.function), "object" === getType(t.value) && (o = t.value); for (var u = [], d = 0; d < r.length; d++) u = u.concat(i({ array: r, arrayIndex: d, value: r[d], valueSpec: o, style: a, styleSpec: n, key: l + "[" + d + "]" })); return u; }; },{"../error/validation_error":104,"../util/get_type":122,"./validate":127}],"129":[function(_dereq_, module, exports) { "use strict"; var getType = _dereq_("../util/get_type"), ValidationError = _dereq_("../error/validation_error"); module.exports = function(e) { var r = e.value, o = e.key, t = getType(r); return "boolean" !== t ? [ new ValidationError(o, r, "boolean expected, %s found", t) ] : []; }; },{"../error/validation_error":104,"../util/get_type":122}],"130":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), getType = _dereq_("../util/get_type"), parseCSSColor = _dereq_("csscolorparser").parseCSSColor; module.exports = function(r) { var e = r.key, o = r.value, t = getType(o); return "string" !== t ? [ new ValidationError(e, o, "color expected, %s found", t) ] : null === parseCSSColor(o) ? [ new ValidationError(e, o, 'color expected, "%s" found', o) ] : []; }; },{"../error/validation_error":104,"../util/get_type":122,"csscolorparser":109}],"131":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), getType = _dereq_("../util/get_type"); module.exports = function(r) { var e = r.key, t = r.value; if (r.styleSpec.$version > 7) return t ? [ new ValidationError(e, t, "constants have been deprecated as of v8") ] : []; var o = getType(t); if ("object" !== o) return [ new ValidationError(e, t, "object expected, %s found", o) ]; var n = []; for (var i in t) "@" !== i[0] && n.push(new ValidationError(e + "." + i, t[i], 'constants must start with "@"')); return n; }; },{"../error/validation_error":104,"../util/get_type":122}],"132":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), unbundle = _dereq_("../util/unbundle_jsonlint"); module.exports = function(e) { var r = e.key, n = e.value, u = e.valueSpec, o = []; return Array.isArray(u.values) ? -1 === u.values.indexOf(unbundle(n)) && o.push(new ValidationError(r, n, "expected one of [%s], %s found", u.values.join(", "), n)) : -1 === Object.keys(u.values).indexOf(unbundle(n)) && o.push(new ValidationError(r, n, "expected one of [%s], %s found", Object.keys(u.values).join(", "), n)), o; }; },{"../error/validation_error":104,"../util/unbundle_jsonlint":126}],"133":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), validateEnum = _dereq_("./validate_enum"), getType = _dereq_("../util/get_type"), unbundle = _dereq_("../util/unbundle_jsonlint"); module.exports = function e(r) { var t, a = r.value, n = r.key, l = r.styleSpec, s = []; if ("array" !== getType(a)) return [ new ValidationError(n, a, "array expected, %s found", getType(a)) ]; if (a.length < 1) return [ new ValidationError(n, a, "filter array must have at least 1 element") ]; switch (s = s.concat(validateEnum({ key: n + "[0]", value: a[0], valueSpec: l.filter_operator, style: r.style, styleSpec: r.styleSpec })), unbundle(a[0])) { case "<": case "<=": case ">": case ">=": a.length >= 2 && "$type" === unbundle(a[1]) && s.push(new ValidationError(n, a, '"$type" cannot be use with operator "%s"', a[0])); case "==": case "!=": 3 !== a.length && s.push(new ValidationError(n, a, 'filter array for operator "%s" must have 3 elements', a[0])); case "in": case "!in": a.length >= 2 && "string" !== (t = getType(a[1])) && s.push(new ValidationError(n + "[1]", a[1], "string expected, %s found", t)); for (var o = 2; o < a.length; o++) t = getType(a[o]), "$type" === unbundle(a[1]) ? s = s.concat(validateEnum({ key: n + "[" + o + "]", value: a[o], valueSpec: l.geometry_type, style: r.style, styleSpec: r.styleSpec })) : "string" !== t && "number" !== t && "boolean" !== t && s.push(new ValidationError(n + "[" + o + "]", a[o], "string, number, or boolean expected, %s found", t)); break; case "any": case "all": case "none": for (var i = 1; i < a.length; i++) s = s.concat(e({ key: n + "[" + i + "]", value: a[i], style: r.style, styleSpec: r.styleSpec })); break; case "has": case "!has": t = getType(a[1]), 2 !== a.length ? s.push(new ValidationError(n, a, 'filter array for "%s" operator must have 2 elements', a[0])) : "string" !== t && s.push(new ValidationError(n + "[1]", a[1], "string expected, %s found", t)); } return s; }; },{"../error/validation_error":104,"../util/get_type":122,"../util/unbundle_jsonlint":126,"./validate_enum":132}],"134":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), getType = _dereq_("../util/get_type"), validate = _dereq_("./validate"), validateObject = _dereq_("./validate_object"), validateArray = _dereq_("./validate_array"), validateNumber = _dereq_("./validate_number"), unbundle = _dereq_("../util/unbundle_jsonlint"); module.exports = function(e) { function t(e) { if ("identity" === p) return [ new ValidationError(e.key, e.value, 'identity function may not have a "stops" property') ]; var t = [], a = e.value; return t = t.concat(validateArray({ key: e.key, value: a, valueSpec: e.valueSpec, style: e.style, styleSpec: e.styleSpec, arrayElementValidator: r })), "array" === getType(a) && 0 === a.length && t.push(new ValidationError(e.key, a, "array must have at least one stop")), t; } function r(e) { var t = [], r = e.value, o = e.key; if ("array" !== getType(r)) return [ new ValidationError(o, r, "array expected, %s found", getType(r)) ]; if (2 !== r.length) return [ new ValidationError(o, r, "array length %d expected, length %d found", 2, r.length) ]; if (c) { if ("object" !== getType(r[0])) return [ new ValidationError(o, r, "object expected, %s found", getType(r[0])) ]; if (void 0 === r[0].zoom) return [ new ValidationError(o, r, "object stop key must have zoom") ]; if (void 0 === r[0].value) return [ new ValidationError(o, r, "object stop key must have value") ]; if (l && l > unbundle(r[0].zoom)) return [ new ValidationError(o, r[0].zoom, "stop zoom values must appear in ascending order") ]; unbundle(r[0].zoom) !== l && (l = unbundle(r[0].zoom), i = void 0, s = {}), t = t.concat(validateObject({ key: o + "[0]", value: r[0], valueSpec: { zoom: {} }, style: e.style, styleSpec: e.styleSpec, objectElementValidators: { zoom: validateNumber, value: a } })); } else t = t.concat(a({ key: o + "[0]", value: r[0], valueSpec: {}, style: e.style, styleSpec: e.styleSpec })); return t.concat(validate({ key: o + "[1]", value: r[1], valueSpec: u, style: e.style, styleSpec: e.styleSpec })); } function a(e) { var t = getType(e.value), r = unbundle(e.value); if (n) { if (t !== n) return [ new ValidationError(e.key, e.value, "%s stop domain type must match previous stop domain type %s", t, n) ]; } else n = t; if ("number" !== t && "string" !== t && "boolean" !== t) return [ new ValidationError(e.key, e.value, "stop domain value must be a number, string, or boolean") ]; if ("number" !== t && "categorical" !== p) { var a = "number expected, %s found"; return u["property-function"] && void 0 === p && (a += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [ new ValidationError(e.key, e.value, a, t) ]; } return "categorical" !== p || "number" !== t || isFinite(r) && Math.floor(r) === r ? "number" === t && void 0 !== i && r < i ? [ new ValidationError(e.key, e.value, "stop domain values must appear in ascending order") ] : (i = r, "categorical" === p && r in s ? [ new ValidationError(e.key, e.value, "stop domain values must be unique") ] : (s[r] = !0, [])) : [ new ValidationError(e.key, e.value, "integer expected, found %s", r) ]; } function o(e) { return validate({ key: e.key, value: e.value, valueSpec: u, style: e.style, styleSpec: e.styleSpec }); } var n, i, l, u = e.valueSpec, p = unbundle(e.value.type), s = {}, y = "categorical" !== p && void 0 === e.value.property, d = !y, c = "array" === getType(e.value.stops) && "array" === getType(e.value.stops[0]) && "object" === getType(e.value.stops[0][0]), v = validateObject({ key: e.key, value: e.value, valueSpec: e.styleSpec.function, style: e.style, styleSpec: e.styleSpec, objectElementValidators: { stops: t, default: o } }); return "identity" === p && y && v.push(new ValidationError(e.key, e.value, 'missing required property "property"')), "identity" === p || e.value.stops || v.push(new ValidationError(e.key, e.value, 'missing required property "stops"')), "exponential" === p && "piecewise-constant" === e.valueSpec.function && v.push(new ValidationError(e.key, e.value, "exponential functions not supported")), e.styleSpec.$version >= 8 && (d && !e.valueSpec["property-function"] ? v.push(new ValidationError(e.key, e.value, "property functions not supported")) : y && !e.valueSpec["zoom-function"] && v.push(new ValidationError(e.key, e.value, "zoom functions not supported"))), "categorical" !== p && !c || void 0 !== e.value.property || v.push(new ValidationError(e.key, e.value, '"property" property is required')), v; }; },{"../error/validation_error":104,"../util/get_type":122,"../util/unbundle_jsonlint":126,"./validate":127,"./validate_array":128,"./validate_number":139,"./validate_object":140}],"135":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), validateString = _dereq_("./validate_string"); module.exports = function(r) { var e = r.value, t = r.key, a = validateString(r); return a.length ? a : (-1 === e.indexOf("{fontstack}") && a.push(new ValidationError(t, e, '"glyphs" url must include a "{fontstack}" token')), -1 === e.indexOf("{range}") && a.push(new ValidationError(t, e, '"glyphs" url must include a "{range}" token')), a); }; },{"../error/validation_error":104,"./validate_string":144}],"136":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), unbundle = _dereq_("../util/unbundle_jsonlint"), validateObject = _dereq_("./validate_object"), validateFilter = _dereq_("./validate_filter"), validatePaintProperty = _dereq_("./validate_paint_property"), validateLayoutProperty = _dereq_("./validate_layout_property"), extend = _dereq_("../util/extend"); module.exports = function(e) { var r = [], t = e.value, a = e.key, i = e.style, l = e.styleSpec; t.type || t.ref || r.push(new ValidationError(a, t, 'either "type" or "ref" is required')); var u = unbundle(t.type), n = unbundle(t.ref); if (t.id) for (var o = unbundle(t.id), s = 0; s < e.arrayIndex; s++) { var d = i.layers[s]; unbundle(d.id) === o && r.push(new ValidationError(a, t.id, 'duplicate layer id "%s", previously used at line %d', t.id, d.id.__line__)); } if ("ref" in t) { [ "type", "source", "source-layer", "filter", "layout" ].forEach(function(e) { e in t && r.push(new ValidationError(a, t[e], '"%s" is prohibited for ref layers', e)); }); var y; i.layers.forEach(function(e) { unbundle(e.id) === n && (y = e); }), y ? y.ref ? r.push(new ValidationError(a, t.ref, "ref cannot reference another ref layer")) : u = unbundle(y.type) : r.push(new ValidationError(a, t.ref, 'ref layer "%s" not found', n)); } else if ("background" !== u) if (t.source) { var c = i.sources && i.sources[t.source], p = c && unbundle(c.type); c ? "vector" === p && "raster" === u ? r.push(new ValidationError(a, t.source, 'layer "%s" requires a raster source', t.id)) : "raster" === p && "raster" !== u ? r.push(new ValidationError(a, t.source, 'layer "%s" requires a vector source', t.id)) : "vector" !== p || t["source-layer"] || r.push(new ValidationError(a, t, 'layer "%s" must specify a "source-layer"', t.id)) : r.push(new ValidationError(a, t.source, 'source "%s" not found', t.source)); } else r.push(new ValidationError(a, t, 'missing required property "source"')); return r = r.concat(validateObject({ key: a, value: t, valueSpec: l.layer, style: e.style, styleSpec: e.styleSpec, objectElementValidators: { "*": function() { return []; }, filter: validateFilter, layout: function(e) { return validateObject({ layer: t, key: e.key, value: e.value, style: e.style, styleSpec: e.styleSpec, objectElementValidators: { "*": function(e) { return validateLayoutProperty(extend({ layerType: u }, e)); } } }); }, paint: function(e) { return validateObject({ layer: t, key: e.key, value: e.value, style: e.style, styleSpec: e.styleSpec, objectElementValidators: { "*": function(e) { return validatePaintProperty(extend({ layerType: u }, e)); } } }); } } })); }; },{"../error/validation_error":104,"../util/extend":121,"../util/unbundle_jsonlint":126,"./validate_filter":133,"./validate_layout_property":137,"./validate_object":140,"./validate_paint_property":141}],"137":[function(_dereq_, module, exports) { "use strict"; var validateProperty = _dereq_("./validate_property"); module.exports = function(r) { return validateProperty(r, "layout"); }; },{"./validate_property":142}],"138":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), getType = _dereq_("../util/get_type"), validate = _dereq_("./validate"); module.exports = function(e) { var t = e.value, r = e.styleSpec, a = r.light, i = e.style, n = [], o = getType(t); if (void 0 === t) return n; if ("object" !== o) return n = n.concat([ new ValidationError("light", t, "object expected, %s found", o) ]); for (var l in t) { var c = l.match(/^(.*)-transition$/); n = c && a[c[1]] && a[c[1]].transition ? n.concat(validate({ key: l, value: t[l], valueSpec: r.transition, style: i, styleSpec: r })) : a[l] ? n.concat(validate({ key: l, value: t[l], valueSpec: a[l], style: i, styleSpec: r })) : n.concat([ new ValidationError(l, t[l], 'unknown property "%s"', l) ]); } return n; }; },{"../error/validation_error":104,"../util/get_type":122,"./validate":127}],"139":[function(_dereq_, module, exports) { "use strict"; var getType = _dereq_("../util/get_type"), ValidationError = _dereq_("../error/validation_error"); module.exports = function(e) { var r = e.key, i = e.value, m = e.valueSpec, a = getType(i); return "number" !== a ? [ new ValidationError(r, i, "number expected, %s found", a) ] : "minimum" in m && i < m.minimum ? [ new ValidationError(r, i, "%s is less than the minimum value %s", i, m.minimum) ] : "maximum" in m && i > m.maximum ? [ new ValidationError(r, i, "%s is greater than the maximum value %s", i, m.maximum) ] : []; }; },{"../error/validation_error":104,"../util/get_type":122}],"140":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), getType = _dereq_("../util/get_type"), validateSpec = _dereq_("./validate"); module.exports = function(e) { var r = e.key, t = e.value, i = e.valueSpec || {}, a = e.objectElementValidators || {}, o = e.style, l = e.styleSpec, n = [], u = getType(t); if ("object" !== u) return [ new ValidationError(r, t, "object expected, %s found", u) ]; for (var d in t) { var p = d.split(".")[0], s = i[p] || i["*"], c = void 0; if (a[p]) c = a[p]; else if (i[p]) c = validateSpec; else if (a["*"]) c = a["*"]; else { if (!i["*"]) { n.push(new ValidationError(r, t[d], 'unknown property "%s"', d)); continue; } c = validateSpec; } n = n.concat(c({ key: (r ? r + "." : r) + d, value: t[d], valueSpec: s, style: o, styleSpec: l, object: t, objectKey: d })); } for (var v in i) i[v].required && void 0 === i[v].default && void 0 === t[v] && n.push(new ValidationError(r, t, 'missing required property "%s"', v)); return n; }; },{"../error/validation_error":104,"../util/get_type":122,"./validate":127}],"141":[function(_dereq_, module, exports) { "use strict"; var validateProperty = _dereq_("./validate_property"); module.exports = function(r) { return validateProperty(r, "paint"); }; },{"./validate_property":142}],"142":[function(_dereq_, module, exports) { "use strict"; var validate = _dereq_("./validate"), ValidationError = _dereq_("../error/validation_error"), getType = _dereq_("../util/get_type"); module.exports = function(e, t) { var r = e.key, i = e.style, a = e.styleSpec, n = e.value, o = e.objectKey, l = a[t + "_" + e.layerType]; if (!l) return []; var y = o.match(/^(.*)-transition$/); if ("paint" === t && y && l[y[1]] && l[y[1]].transition) return validate({ key: r, value: n, valueSpec: a.transition, style: i, styleSpec: a }); var p = e.valueSpec || l[o]; if (!p) return [ new ValidationError(r, n, 'unknown property "%s"', o) ]; var s; if ("string" === getType(n) && p["property-function"] && !p.tokens && (s = /^{([^}]+)}$/.exec(n))) return [ new ValidationError(r, n, '"%s" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": %s` }`.', o, JSON.stringify(s[1])) ]; var u = []; return "symbol" === e.layerType && "text-field" === o && i && !i.glyphs && u.push(new ValidationError(r, n, 'use of "text-field" requires a style "glyphs" property')), u.concat(validate({ key: e.key, value: n, valueSpec: p, style: i, styleSpec: a })); }; },{"../error/validation_error":104,"../util/get_type":122,"./validate":127}],"143":[function(_dereq_, module, exports) { "use strict"; var ValidationError = _dereq_("../error/validation_error"), unbundle = _dereq_("../util/unbundle_jsonlint"), validateObject = _dereq_("./validate_object"), validateEnum = _dereq_("./validate_enum"); module.exports = function(e) { var a = e.value, t = e.key, r = e.styleSpec, l = e.style; if (!a.type) return [ new ValidationError(t, a, '"type" is required') ]; var u = unbundle(a.type), i = []; switch (u) { case "vector": case "raster": if (i = i.concat(validateObject({ key: t, value: a, valueSpec: r.source_tile, style: e.style, styleSpec: r })), "url" in a) for (var s in a) [ "type", "url", "tileSize" ].indexOf(s) < 0 && i.push(new ValidationError(t + "." + s, a[s], 'a source with a "url" property may not include a "%s" property', s)); return i; case "geojson": return validateObject({ key: t, value: a, valueSpec: r.source_geojson, style: l, styleSpec: r }); case "video": return validateObject({ key: t, value: a, valueSpec: r.source_video, style: l, styleSpec: r }); case "image": return validateObject({ key: t, value: a, valueSpec: r.source_image, style: l, styleSpec: r }); case "canvas": return validateObject({ key: t, value: a, valueSpec: r.source_canvas, style: l, styleSpec: r }); default: return validateEnum({ key: t + ".type", value: a.type, valueSpec: { values: [ "vector", "raster", "geojson", "video", "image", "canvas" ] }, style: l, styleSpec: r }); } }; },{"../error/validation_error":104,"../util/unbundle_jsonlint":126,"./validate_enum":132,"./validate_object":140}],"144":[function(_dereq_, module, exports) { "use strict"; var getType = _dereq_("../util/get_type"), ValidationError = _dereq_("../error/validation_error"); module.exports = function(r) { var e = r.value, t = r.key, i = getType(e); return "string" !== i ? [ new ValidationError(t, e, "string expected, %s found", i) ] : []; }; },{"../error/validation_error":104,"../util/get_type":122}],"145":[function(_dereq_, module, exports) { "use strict"; function validateStyleMin(e, a) { a = a || latestStyleSpec; var t = []; return t = t.concat(validate({ key: "", value: e, valueSpec: a.$root, styleSpec: a, style: e, objectElementValidators: { glyphs: validateGlyphsURL, "*": function() { return []; } } })), a.$version > 7 && e.constants && (t = t.concat(validateConstants({ key: "constants", value: e.constants, style: e, styleSpec: a }))), sortErrors(t); } function sortErrors(e) { return [].concat(e).sort(function(e, a) { return e.line - a.line; }); } function wrapCleanErrors(e) { return function() { return sortErrors(e.apply(this, arguments)); }; } var validateConstants = _dereq_("./validate/validate_constants"), validate = _dereq_("./validate/validate"), latestStyleSpec = _dereq_("./reference/latest"), validateGlyphsURL = _dereq_("./validate/validate_glyphs_url"); validateStyleMin.source = wrapCleanErrors(_dereq_("./validate/validate_source")), validateStyleMin.light = wrapCleanErrors(_dereq_("./validate/validate_light")), validateStyleMin.layer = wrapCleanErrors(_dereq_("./validate/validate_layer")), validateStyleMin.filter = wrapCleanErrors(_dereq_("./validate/validate_filter")), validateStyleMin.paintProperty = wrapCleanErrors(_dereq_("./validate/validate_paint_property")), validateStyleMin.layoutProperty = wrapCleanErrors(_dereq_("./validate/validate_layout_property")), module.exports = validateStyleMin; },{"./reference/latest":119,"./validate/validate":127,"./validate/validate_constants":131,"./validate/validate_filter":133,"./validate/validate_glyphs_url":135,"./validate/validate_layer":136,"./validate/validate_layout_property":137,"./validate/validate_light":138,"./validate/validate_paint_property":141,"./validate/validate_source":143}],"150":[function(_dereq_, module, exports) { "use strict"; var createFunction = _dereq_("../style-spec/function"), util = _dereq_("../util/util"), StyleDeclaration = function(t, i) { var o = this; if (this.value = util.clone(i), this.isFunction = createFunction.isFunctionDefinition(i), this.json = JSON.stringify(this.value), this.minimum = t.minimum, this.function = createFunction(this.value, t), this.isFeatureConstant = this.function.isFeatureConstant, this.isZoomConstant = this.function.isZoomConstant, this.isFeatureConstant || this.isZoomConstant) { if (!this.isZoomConstant) { this.stopZoomLevels = []; for (var n = 0, s = o.value.stops; n < s.length; n += 1) { var e = s[n]; o.stopZoomLevels.indexOf(e[0]) < 0 && o.stopZoomLevels.push(e[0]); } } } else { this.stopZoomLevels = []; for (var a = [], u = 0, l = o.value.stops; u < l.length; u += 1) { var r = l[u], c = r[0].zoom; o.stopZoomLevels.indexOf(c) < 0 && (o.stopZoomLevels.push(c), a.push([ c, a.length ])); } this._functionInterpolationT = createFunction({ type: "exponential", stops: a, base: i.base }, { type: "number" }); } }; StyleDeclaration.prototype.calculate = function(t, i) { var o = this.function(t && t.zoom, i || {}); return void 0 !== this.minimum && o < this.minimum ? this.minimum : o; }, StyleDeclaration.prototype.calculateInterpolationT = function(t) { return this.isFeatureConstant || this.isZoomConstant ? 0 : this._functionInterpolationT(t && t.zoom, {}); }, module.exports = StyleDeclaration; },{"../style-spec/function":107,"../util/util":215}],"151":[function(_dereq_, module, exports) { "use strict"; function getDeclarationValue(t) { return t.value; } var util = _dereq_("../util/util"), StyleTransition = _dereq_("./style_transition"), StyleDeclaration = _dereq_("./style_declaration"), styleSpec = _dereq_("../style-spec/reference/latest"), validateStyle = _dereq_("./validate_style"), parseColor = _dereq_("./../style-spec/util/parse_color"), Evented = _dereq_("../util/evented"), StyleLayer = function(t) { function i(i) { var a = this; t.call(this), this.id = i.id, this.metadata = i.metadata, this.type = i.type, this.source = i.source, this.sourceLayer = i["source-layer"], this.minzoom = i.minzoom, this.maxzoom = i.maxzoom, this.filter = i.filter, this.paint = {}, this.layout = {}, this._paintSpecifications = styleSpec["paint_" + this.type], this._layoutSpecifications = styleSpec["layout_" + this.type], this._paintTransitions = {}, this._paintTransitionOptions = {}, this._paintDeclarations = {}, this._layoutDeclarations = {}, this._layoutFunctions = {}; var e, o, n = { validate: !1 }; for (var r in i) { var s = r.match(/^paint(?:\.(.*))?$/); if (s) { var l = s[1] || ""; for (e in i[r]) a.setPaintProperty(e, i[r][e], l, n); } } for (o in i.layout) a.setLayoutProperty(o, i.layout[o], n); for (e in a._paintSpecifications) a.paint[e] = a.getPaintValue(e); for (o in a._layoutSpecifications) a._updateLayoutValue(o); } return t && (i.__proto__ = t), i.prototype = Object.create(t && t.prototype), i.prototype.constructor = i, i.prototype.setLayoutProperty = function(t, i, a) { if (null == i) delete this._layoutDeclarations[t]; else { var e = "layers." + this.id + ".layout." + t; if (this._validate(validateStyle.layoutProperty, e, t, i, a)) return; this._layoutDeclarations[t] = new StyleDeclaration(this._layoutSpecifications[t], i); } this._updateLayoutValue(t); }, i.prototype.getLayoutProperty = function(t) { return this._layoutDeclarations[t] && this._layoutDeclarations[t].value; }, i.prototype.getLayoutValue = function(t, i, a) { var e = this._layoutSpecifications[t], o = this._layoutDeclarations[t]; return o ? o.calculate(i, a) : e.default; }, i.prototype.setPaintProperty = function(t, i, a, e) { var o = "layers." + this.id + (a ? '["paint.' + a + '"].' : ".paint.") + t; if (util.endsWith(t, "-transition")) if (this._paintTransitionOptions[a || ""] || (this._paintTransitionOptions[a || ""] = {}), null === i || void 0 === i) delete this._paintTransitionOptions[a || ""][t]; else { if (this._validate(validateStyle.paintProperty, o, t, i, e)) return; this._paintTransitionOptions[a || ""][t] = i; } else if (this._paintDeclarations[a || ""] || (this._paintDeclarations[a || ""] = {}), null === i || void 0 === i) delete this._paintDeclarations[a || ""][t]; else { if (this._validate(validateStyle.paintProperty, o, t, i, e)) return; this._paintDeclarations[a || ""][t] = new StyleDeclaration(this._paintSpecifications[t], i); } }, i.prototype.getPaintProperty = function(t, i) { return i = i || "", util.endsWith(t, "-transition") ? this._paintTransitionOptions[i] && this._paintTransitionOptions[i][t] : this._paintDeclarations[i] && this._paintDeclarations[i][t] && this._paintDeclarations[i][t].value; }, i.prototype.getPaintValue = function(t, i, a) { var e = this._paintSpecifications[t], o = this._paintTransitions[t]; return o ? o.calculate(i, a) : "color" === e.type && e.default ? parseColor(e.default) : e.default; }, i.prototype.getPaintValueStopZoomLevels = function(t) { var i = this._paintTransitions[t]; return i ? i.declaration.stopZoomLevels : []; }, i.prototype.getLayoutValueStopZoomLevels = function(t) { var i = this._layoutDeclarations[t]; return i ? i.stopZoomLevels : []; }, i.prototype.getPaintInterpolationT = function(t, i) { return this._paintTransitions[t].declaration.calculateInterpolationT(i); }, i.prototype.getLayoutInterpolationT = function(t, i) { return this._layoutDeclarations[t].calculateInterpolationT(i); }, i.prototype.isPaintValueFeatureConstant = function(t) { var i = this._paintTransitions[t]; return !i || i.declaration.isFeatureConstant; }, i.prototype.isLayoutValueFeatureConstant = function(t) { var i = this._layoutDeclarations[t]; return !i || i.isFeatureConstant; }, i.prototype.isPaintValueZoomConstant = function(t) { var i = this._paintTransitions[t]; return !i || i.declaration.isZoomConstant; }, i.prototype.isLayoutValueZoomConstant = function(t) { var i = this._layoutDeclarations[t]; return !i || i.isZoomConstant; }, i.prototype.isHidden = function(t) { return !!(this.minzoom && t < this.minzoom) || !!(this.maxzoom && t >= this.maxzoom) || "none" === this.layout.visibility; }, i.prototype.updatePaintTransitions = function(t, i, a, e, o) { for (var n = this, r = util.extend({}, this._paintDeclarations[""]), s = 0; s < t.length; s++) util.extend(r, n._paintDeclarations[t[s]]); var l; for (l in r) n._applyPaintDeclaration(l, r[l], i, a, e, o); for (l in n._paintTransitions) l in r || n._applyPaintDeclaration(l, null, i, a, e, o); }, i.prototype.updatePaintTransition = function(t, i, a, e, o, n) { for (var r = this, s = this._paintDeclarations[""][t], l = 0; l < i.length; l++) { var u = r._paintDeclarations[i[l]]; u && u[t] && (s = u[t]); } this._applyPaintDeclaration(t, s, a, e, o, n); }, i.prototype.recalculate = function(t) { var i = this; for (var a in i._paintTransitions) i.paint[a] = i.getPaintValue(a, { zoom: t }); for (var e in i._layoutFunctions) i.layout[e] = i.getLayoutValue(e, { zoom: t }); }, i.prototype.serialize = function() { var t = this, i = { id: this.id, type: this.type, source: this.source, "source-layer": this.sourceLayer, metadata: this.metadata, minzoom: this.minzoom, maxzoom: this.maxzoom, filter: this.filter, layout: util.mapObject(this._layoutDeclarations, getDeclarationValue) }; for (var a in t._paintDeclarations) { i["" === a ? "paint" : "paint." + a] = util.mapObject(t._paintDeclarations[a], getDeclarationValue); } return util.filterObject(i, function(t, i) { return void 0 !== t && !("layout" === i && !Object.keys(t).length); }); }, i.prototype._applyPaintDeclaration = function(t, i, a, e, o, n) { var r = a.transition ? this._paintTransitions[t] : void 0, s = this._paintSpecifications[t]; if (null !== i && void 0 !== i || (i = new StyleDeclaration(s, s.default)), !r || r.declaration.json !== i.json) { var l = util.extend({ duration: 300, delay: 0 }, e, this.getPaintProperty(t + "-transition")), u = this._paintTransitions[t] = new StyleTransition(s, i, r, l, n); u.instant() || (u.loopID = o.set(u.endTime - Date.now())), r && o.cancel(r.loopID); } }, i.prototype._updateLayoutValue = function(t) { var i = this._layoutDeclarations[t]; i && i.isFunction ? this._layoutFunctions[t] = !0 : (delete this._layoutFunctions[t], this.layout[t] = this.getLayoutValue(t)); }, i.prototype._validate = function(t, i, a, e, o) { return (!o || !1 !== o.validate) && validateStyle.emitErrors(this, t.call(validateStyle, { key: i, layerType: this.type, objectKey: a, value: e, styleSpec: styleSpec, style: { glyphs: !0, sprite: !0 } })); }, i; }(Evented); module.exports = StyleLayer; var subclasses = { circle: _dereq_("./style_layer/circle_style_layer"), fill: _dereq_("./style_layer/fill_style_layer"), "fill-extrusion": _dereq_("./style_layer/fill_extrusion_style_layer"), line: _dereq_("./style_layer/line_style_layer"), symbol: _dereq_("./style_layer/symbol_style_layer") }; StyleLayer.create = function(t) { return new (subclasses[t.type] || StyleLayer)(t); }; },{"../style-spec/reference/latest":119,"../util/evented":203,"../util/util":215,"./../style-spec/util/parse_color":124,"./style_declaration":150,"./style_layer/circle_style_layer":152,"./style_layer/fill_extrusion_style_layer":153,"./style_layer/fill_style_layer":154,"./style_layer/line_style_layer":155,"./style_layer/symbol_style_layer":156,"./style_transition":158,"./validate_style":159}],"152":[function(_dereq_, module, exports) { "use strict"; var StyleLayer = _dereq_("../style_layer"), CircleBucket = _dereq_("../../data/bucket/circle_bucket"), CircleStyleLayer = function(e) { function t() { e.apply(this, arguments); } return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.createBucket = function(e) { return new CircleBucket(e); }, t; }(StyleLayer); module.exports = CircleStyleLayer; },{"../../data/bucket/circle_bucket":46,"../style_layer":151}],"153":[function(_dereq_, module, exports) { "use strict"; var StyleLayer = _dereq_("../style_layer"), FillExtrusionBucket = _dereq_("../../data/bucket/fill_extrusion_bucket"), FillExtrusionStyleLayer = function(t) { function e() { t.apply(this, arguments); } return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getPaintValue = function(e, r, o) { var l = t.prototype.getPaintValue.call(this, e, r, o); return "fill-extrusion-color" === e && l && (l[3] = 1), l; }, e.prototype.createBucket = function(t) { return new FillExtrusionBucket(t); }, e; }(StyleLayer); module.exports = FillExtrusionStyleLayer; },{"../../data/bucket/fill_extrusion_bucket":48,"../style_layer":151}],"154":[function(_dereq_, module, exports) { "use strict"; var StyleLayer = _dereq_("../style_layer"), FillBucket = _dereq_("../../data/bucket/fill_bucket"), FillStyleLayer = function(t) { function o() { t.apply(this, arguments); } return t && (o.__proto__ = t), o.prototype = Object.create(t && t.prototype), o.prototype.constructor = o, o.prototype.getPaintValue = function(o, l, e) { var i = this; if ("fill-outline-color" === o) { if (void 0 === this.getPaintProperty("fill-outline-color")) return t.prototype.getPaintValue.call(this, "fill-color", l, e); for (var r = this._paintTransitions["fill-outline-color"]; r; ) { if (!(r && r.declaration && r.declaration.value)) return t.prototype.getPaintValue.call(i, "fill-color", l, e); r = r.oldTransition; } } return t.prototype.getPaintValue.call(this, o, l, e); }, o.prototype.getPaintValueStopZoomLevels = function(o) { return "fill-outline-color" === o && void 0 === this.getPaintProperty("fill-outline-color") ? t.prototype.getPaintValueStopZoomLevels.call(this, "fill-color") : t.prototype.getPaintValueStopZoomLevels.call(this, o); }, o.prototype.getPaintInterpolationT = function(o, l) { return "fill-outline-color" === o && void 0 === this.getPaintProperty("fill-outline-color") ? t.prototype.getPaintInterpolationT.call(this, "fill-color", l) : t.prototype.getPaintInterpolationT.call(this, o, l); }, o.prototype.isPaintValueFeatureConstant = function(o) { return "fill-outline-color" === o && void 0 === this.getPaintProperty("fill-outline-color") ? t.prototype.isPaintValueFeatureConstant.call(this, "fill-color") : t.prototype.isPaintValueFeatureConstant.call(this, o); }, o.prototype.isPaintValueZoomConstant = function(o) { return "fill-outline-color" === o && void 0 === this.getPaintProperty("fill-outline-color") ? t.prototype.isPaintValueZoomConstant.call(this, "fill-color") : t.prototype.isPaintValueZoomConstant.call(this, o); }, o.prototype.createBucket = function(t) { return new FillBucket(t); }, o; }(StyleLayer); module.exports = FillStyleLayer; },{"../../data/bucket/fill_bucket":47,"../style_layer":151}],"155":[function(_dereq_, module, exports) { "use strict"; var StyleLayer = _dereq_("../style_layer"), LineBucket = _dereq_("../../data/bucket/line_bucket"), util = _dereq_("../../util/util"), LineStyleLayer = function(e) { function t() { e.apply(this, arguments); } return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.getPaintValue = function(t, r, o) { var i = e.prototype.getPaintValue.call(this, t, r, o); if (i && "line-dasharray" === t) { var a = this.getPaintValue("line-width", util.extend({}, r, { zoom: Math.floor(r.zoom) }), o); i.fromScale *= a, i.toScale *= a; } return i; }, t.prototype.createBucket = function(e) { return new LineBucket(e); }, t; }(StyleLayer); module.exports = LineStyleLayer; },{"../../data/bucket/line_bucket":49,"../../util/util":215,"../style_layer":151}],"156":[function(_dereq_, module, exports) { "use strict"; var StyleLayer = _dereq_("../style_layer"), SymbolBucket = _dereq_("../../data/bucket/symbol_bucket"), SymbolStyleLayer = function(t) { function e() { t.apply(this, arguments); } return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.getLayoutValue = function(e, o, r) { var a = t.prototype.getLayoutValue.call(this, e, o, r); if ("auto" !== a) return a; switch (e) { case "text-rotation-alignment": case "icon-rotation-alignment": return "line" === this.getLayoutValue("symbol-placement", o, r) ? "map" : "viewport"; case "text-pitch-alignment": return this.getLayoutValue("text-rotation-alignment", o, r); default: return a; } }, e.prototype.createBucket = function(t) { return new SymbolBucket(t); }, e; }(StyleLayer); module.exports = SymbolStyleLayer; },{"../../data/bucket/symbol_bucket":50,"../style_layer":151}],"157":[function(_dereq_, module, exports) { "use strict"; var StyleLayer = _dereq_("./style_layer"), util = _dereq_("../util/util"), featureFilter = _dereq_("../style-spec/feature_filter"), groupByLayout = _dereq_("../style-spec/group_by_layout"), StyleLayerIndex = function(e) { e && this.replace(e); }; StyleLayerIndex.prototype.replace = function(e) { var r = this; this.symbolOrder = []; for (var t = 0, i = e; t < i.length; t += 1) { var a = i[t]; "symbol" === a.type && r.symbolOrder.push(a.id); } this._layerConfigs = {}, this._layers = {}, this.update(e, []); }, StyleLayerIndex.prototype.update = function(e, r, t) { for (var i = this, a = 0, l = e; a < l.length; a += 1) { var y = l[a]; i._layerConfigs[y.id] = y; var s = i._layers[y.id] = StyleLayer.create(y); s.updatePaintTransitions({}, { transition: !1 }), s.filter = featureFilter(s.filter); } for (var o = 0, u = r; o < u.length; o += 1) { var n = u[o]; delete i._layerConfigs[n], delete i._layers[n]; } t && (this.symbolOrder = t), this.familiesBySource = {}; for (var f = groupByLayout(util.values(this._layerConfigs)), p = 0, d = f; p < d.length; p += 1) { var h = d[p], c = h.map(function(e) { return i._layers[e.id]; }), v = c[0]; if (!v.layout || "none" !== v.layout.visibility) { var _ = v.source || "", g = i.familiesBySource[_]; g || (g = i.familiesBySource[_] = {}); var L = v.sourceLayer || "_geojsonTileLayer", m = g[L]; m || (m = g[L] = []), m.push(c); } } }, module.exports = StyleLayerIndex; },{"../style-spec/feature_filter":105,"../style-spec/group_by_layout":108,"../util/util":215,"./style_layer":151}],"158":[function(_dereq_, module, exports) { "use strict"; function interpZoomTransitioned(t, i, e) { if (void 0 !== t && void 0 !== i) return { from: t.to, fromScale: t.toScale, to: i.to, toScale: i.toScale, t: e }; } var util = _dereq_("../util/util"), interpolate = _dereq_("../style-spec/util/interpolate"), fakeZoomHistory = { lastIntegerZoom: 0, lastIntegerZoomTime: 0, lastZoom: 0 }, StyleTransition = function(t, i, e, o, a) { this.declaration = i, this.startTime = this.endTime = new Date().getTime(), this.oldTransition = e, this.duration = o.duration || 0, this.delay = o.delay || 0, this.zoomTransitioned = "piecewise-constant" === t.function && t.transition, this.interp = this.zoomTransitioned ? interpZoomTransitioned : interpolate[t.type], this.zoomHistory = a || fakeZoomHistory, this.instant() || (this.endTime = this.startTime + this.duration + this.delay), e && e.endTime <= this.startTime && delete e.oldTransition; }; StyleTransition.prototype.instant = function() { return !this.oldTransition || !this.interp || 0 === this.duration && 0 === this.delay; }, StyleTransition.prototype.calculate = function(t, i, e) { var o = this._calculateTargetValue(t, i); if (this.instant()) return o; if ((e = e || Date.now()) >= this.endTime) return o; var a = this.oldTransition.calculate(t, i, this.startTime), n = util.easeCubicInOut((e - this.startTime - this.delay) / this.duration); return this.interp(a, o, n); }, StyleTransition.prototype._calculateTargetValue = function(t, i) { if (!this.zoomTransitioned) return this.declaration.calculate(t, i); var e = t.zoom, o = this.zoomHistory.lastIntegerZoom, a = e > o ? 2 : .5, n = this.declaration.calculate({ zoom: e > o ? e - 1 : e + 1 }, i), r = this.declaration.calculate({ zoom: e }, i), s = Math.min((Date.now() - this.zoomHistory.lastIntegerZoomTime) / this.duration, 1), l = Math.abs(e - o), u = interpolate(s, 1, l); return void 0 !== n && void 0 !== r ? { from: n, fromScale: a, to: r, toScale: 1, t: u } : void 0; }, module.exports = StyleTransition; },{"../style-spec/util/interpolate":123,"../util/util":215}],"159":[function(_dereq_, module, exports) { "use strict"; module.exports = _dereq_("../style-spec/validate_style.min"), module.exports.emitErrors = function(r, e) { if (e && e.length) { for (var t = 0; t < e.length; t++) r.fire("error", { error: new Error(e[t].message) }); return !0; } return !1; }; },{"../style-spec/validate_style.min":145}],"160":[function(_dereq_, module, exports) { "use strict"; var Point = _dereq_("point-geometry"), Anchor = function(t) { function o(o, e, n, r) { t.call(this, o, e), this.angle = n, void 0 !== r && (this.segment = r); } return t && (o.__proto__ = t), o.prototype = Object.create(t && t.prototype), o.prototype.constructor = o, o.prototype.clone = function() { return new o(this.x, this.y, this.angle, this.segment); }, o; }(Point); module.exports = Anchor; },{"point-geometry":26}],"161":[function(_dereq_, module, exports) { "use strict"; function checkMaxAngle(e, t, a, r, n) { if (void 0 === t.segment) return !0; for (var i = t, s = t.segment + 1, f = 0; f > -a / 2; ) { if (--s < 0) return !1; f -= e[s].dist(i), i = e[s]; } f += e[s].dist(e[s + 1]), s++; for (var l = [], o = 0; f < a / 2; ) { var u = e[s - 1], c = e[s], g = e[s + 1]; if (!g) return !1; var h = u.angleTo(c) - c.angleTo(g); for (h = Math.abs((h + 3 * Math.PI) % (2 * Math.PI) - Math.PI), l.push({ distance: f, angleDelta: h }), o += h; f - l[0].distance > r; ) o -= l.shift().angleDelta; if (o > n) return !1; s++, f += c.dist(g); } return !0; } module.exports = checkMaxAngle; },{}],"162":[function(_dereq_, module, exports) { "use strict"; function clipLine(n, x, y, o, e) { for (var r = [], t = 0; t < n.length; t++) for (var i = n[t], u = void 0, d = 0; d < i.length - 1; d++) { var P = i[d], w = i[d + 1]; P.x < x && w.x < x || (P.x < x ? P = new Point(x, P.y + (w.y - P.y) * ((x - P.x) / (w.x - P.x)))._round() : w.x < x && (w = new Point(x, P.y + (w.y - P.y) * ((x - P.x) / (w.x - P.x)))._round()), P.y < y && w.y < y || (P.y < y ? P = new Point(P.x + (w.x - P.x) * ((y - P.y) / (w.y - P.y)), y)._round() : w.y < y && (w = new Point(P.x + (w.x - P.x) * ((y - P.y) / (w.y - P.y)), y)._round()), P.x >= o && w.x >= o || (P.x >= o ? P = new Point(o, P.y + (w.y - P.y) * ((o - P.x) / (w.x - P.x)))._round() : w.x >= o && (w = new Point(o, P.y + (w.y - P.y) * ((o - P.x) / (w.x - P.x)))._round()), P.y >= e && w.y >= e || (P.y >= e ? P = new Point(P.x + (w.x - P.x) * ((e - P.y) / (w.y - P.y)), e)._round() : w.y >= e && (w = new Point(P.x + (w.x - P.x) * ((e - P.y) / (w.y - P.y)), e)._round()), u && P.equals(u[u.length - 1]) || (u = [ P ], r.push(u)), u.push(w))))); } return r; } var Point = _dereq_("point-geometry"); module.exports = clipLine; },{"point-geometry":26}],"163":[function(_dereq_, module, exports) { "use strict"; var createStructArrayType = _dereq_("../util/struct_array"), Point = _dereq_("point-geometry"), CollisionBoxArray = createStructArrayType({ members: [ { type: "Int16", name: "anchorPointX" }, { type: "Int16", name: "anchorPointY" }, { type: "Int16", name: "x1" }, { type: "Int16", name: "y1" }, { type: "Int16", name: "x2" }, { type: "Int16", name: "y2" }, { type: "Float32", name: "maxScale" }, { type: "Uint32", name: "featureIndex" }, { type: "Uint16", name: "sourceLayerIndex" }, { type: "Uint16", name: "bucketIndex" }, { type: "Int16", name: "bbox0" }, { type: "Int16", name: "bbox1" }, { type: "Int16", name: "bbox2" }, { type: "Int16", name: "bbox3" }, { type: "Float32", name: "placementScale" } ] }); Object.defineProperty(CollisionBoxArray.prototype.StructType.prototype, "anchorPoint", { get: function() { return new Point(this.anchorPointX, this.anchorPointY); } }), module.exports = CollisionBoxArray; },{"../util/struct_array":213,"point-geometry":26}],"164":[function(_dereq_, module, exports) { "use strict"; var CollisionFeature = function(t, e, i, o, s, a, n, r, l, d, u) { var h = n.top * r - l, x = n.bottom * r + l, f = n.left * r - l, m = n.right * r + l; if (this.boxStartIndex = t.length, d) { var _ = x - h, b = m - f; if (_ > 0) if (_ = Math.max(10 * r, _), u) { var v = e[i.segment + 1].sub(e[i.segment])._unit()._mult(b), c = [ i.sub(v), i.add(v) ]; this._addLineCollisionBoxes(t, c, i, 0, b, _, o, s, a); } else this._addLineCollisionBoxes(t, e, i, i.segment, b, _, o, s, a); } else t.emplaceBack(i.x, i.y, f, h, m, x, 1 / 0, o, s, a, 0, 0, 0, 0, 0); this.boxEndIndex = t.length; }; CollisionFeature.prototype._addLineCollisionBoxes = function(t, e, i, o, s, a, n, r, l) { var d = a / 2, u = Math.floor(s / d), h = -a / 2, x = this.boxes, f = i, m = o + 1, _ = h; do { if (--m < 0) return x; _ -= e[m].dist(f), f = e[m]; } while (_ > -s / 2); for (var b = e[m].dist(e[m + 1]), v = 0; v < u; v++) { for (var c = -s / 2 + v * d; _ + b < c; ) { if (_ += b, ++m + 1 >= e.length) return x; b = e[m].dist(e[m + 1]); } var g = c - _, p = e[m], C = e[m + 1], B = C.sub(p)._unit()._mult(g)._add(p)._round(), M = Math.max(Math.abs(c - h) - d / 2, 0), y = s / 2 / M; t.emplaceBack(B.x, B.y, -a / 2, -a / 2, a / 2, a / 2, y, n, r, l, 0, 0, 0, 0, 0); } return x; }, module.exports = CollisionFeature; },{}],"165":[function(_dereq_, module, exports) { "use strict"; var Point = _dereq_("point-geometry"), EXTENT = _dereq_("../data/extent"), Grid = _dereq_("grid-index"), intersectionTests = _dereq_("../util/intersection_tests"), CollisionTile = function(t, e, i) { if ("object" == typeof t) { var r = t; i = e, t = r.angle, e = r.pitch, this.grid = new Grid(r.grid), this.ignoredGrid = new Grid(r.ignoredGrid); } else this.grid = new Grid(EXTENT, 12, 6), this.ignoredGrid = new Grid(EXTENT, 12, 0); this.minScale = .5, this.maxScale = 2, this.angle = t, this.pitch = e; var a = Math.sin(t), o = Math.cos(t); if (this.rotationMatrix = [ o, -a, a, o ], this.reverseRotationMatrix = [ o, a, -a, o ], this.yStretch = 1 / Math.cos(e / 180 * Math.PI), this.yStretch = Math.pow(this.yStretch, 1.3), this.collisionBoxArray = i, 0 === i.length) { i.emplaceBack(); var n = 32767; i.emplaceBack(0, 0, 0, -n, 0, n, n, 0, 0, 0, 0, 0, 0, 0, 0, 0), i.emplaceBack(EXTENT, 0, 0, -n, 0, n, n, 0, 0, 0, 0, 0, 0, 0, 0, 0), i.emplaceBack(0, 0, -n, 0, n, 0, n, 0, 0, 0, 0, 0, 0, 0, 0, 0), i.emplaceBack(0, EXTENT, -n, 0, n, 0, n, 0, 0, 0, 0, 0, 0, 0, 0, 0); } this.tempCollisionBox = i.get(0), this.edges = [ i.get(1), i.get(2), i.get(3), i.get(4) ]; }; CollisionTile.prototype.serialize = function(t) { var e = this.grid.toArrayBuffer(), i = this.ignoredGrid.toArrayBuffer(); return t && (t.push(e), t.push(i)), { angle: this.angle, pitch: this.pitch, grid: e, ignoredGrid: i }; }, CollisionTile.prototype.placeCollisionFeature = function(t, e, i) { for (var r = this, a = this.collisionBoxArray, o = this.minScale, n = this.rotationMatrix, l = this.yStretch, h = t.boxStartIndex; h < t.boxEndIndex; h++) { var s = a.get(h), x = s.anchorPoint._matMult(n), c = x.x, g = x.y, y = c + s.x1, d = g + s.y1 * l, m = c + s.x2, u = g + s.y2 * l; if (s.bbox0 = y, s.bbox1 = d, s.bbox2 = m, s.bbox3 = u, !e) for (var p = r.grid.query(y, d, m, u), M = 0; M < p.length; M++) { var f = a.get(p[M]), v = f.anchorPoint._matMult(n); if ((o = r.getPlacementScale(o, x, s, v, f)) >= r.maxScale) return o; } if (i) { var S = void 0; if (r.angle) { var P = r.reverseRotationMatrix, b = new Point(s.x1, s.y1).matMult(P), T = new Point(s.x2, s.y1).matMult(P), w = new Point(s.x1, s.y2).matMult(P), N = new Point(s.x2, s.y2).matMult(P); S = r.tempCollisionBox, S.anchorPointX = s.anchorPoint.x, S.anchorPointY = s.anchorPoint.y, S.x1 = Math.min(b.x, T.x, w.x, N.x), S.y1 = Math.min(b.y, T.x, w.x, N.x), S.x2 = Math.max(b.x, T.x, w.x, N.x), S.y2 = Math.max(b.y, T.x, w.x, N.x), S.maxScale = s.maxScale; } else S = s; for (var B = 0; B < this.edges.length; B++) { var G = r.edges[B]; if ((o = r.getPlacementScale(o, s.anchorPoint, S, G.anchorPoint, G)) >= r.maxScale) return o; } } } return o; }, CollisionTile.prototype.queryRenderedSymbols = function(t, e) { var i = {}, r = []; if (0 === t.length || 0 === this.grid.length && 0 === this.ignoredGrid.length) return r; for (var a = this.collisionBoxArray, o = this.rotationMatrix, n = this.yStretch, l = [], h = 1 / 0, s = 1 / 0, x = -1 / 0, c = -1 / 0, g = 0; g < t.length; g++) for (var y = t[g], d = 0; d < y.length; d++) { var m = y[d].matMult(o); h = Math.min(h, m.x), s = Math.min(s, m.y), x = Math.max(x, m.x), c = Math.max(c, m.y), l.push(m); } for (var u = this.grid.query(h, s, x, c), p = this.ignoredGrid.query(h, s, x, c), M = 0; M < p.length; M++) u.push(p[M]); for (var f = Math.pow(2, Math.ceil(Math.log(e) / Math.LN2 * 10) / 10), v = 0; v < u.length; v++) { var S = a.get(u[v]), P = S.sourceLayerIndex, b = S.featureIndex; if (void 0 === i[P] && (i[P] = {}), !i[P][b] && !(f < S.placementScale || f > S.maxScale)) { var T = S.anchorPoint.matMult(o), w = T.x + S.x1 / e, N = T.y + S.y1 / e * n, B = T.x + S.x2 / e, G = T.y + S.y2 / e * n, E = [ new Point(w, N), new Point(B, N), new Point(B, G), new Point(w, G) ]; intersectionTests.polygonIntersectsPolygon(l, E) && (i[P][b] = !0, r.push(u[v])); } } return r; }, CollisionTile.prototype.getPlacementScale = function(t, e, i, r, a) { var o = e.x - r.x, n = e.y - r.y, l = (a.x1 - i.x2) / o, h = (a.x2 - i.x1) / o, s = (a.y1 - i.y2) * this.yStretch / n, x = (a.y2 - i.y1) * this.yStretch / n; (isNaN(l) || isNaN(h)) && (l = h = 1), (isNaN(s) || isNaN(x)) && (s = x = 1); var c = Math.min(Math.max(l, h), Math.max(s, x)), g = a.maxScale, y = i.maxScale; return c > g && (c = g), c > y && (c = y), c > t && c >= a.placementScale && (t = c), t; }, CollisionTile.prototype.insertCollisionFeature = function(t, e, i) { for (var r = this, a = i ? this.ignoredGrid : this.grid, o = this.collisionBoxArray, n = t.boxStartIndex; n < t.boxEndIndex; n++) { var l = o.get(n); l.placementScale = e, e < r.maxScale && a.insert(n, l.bbox0, l.bbox1, l.bbox2, l.bbox3); } }, module.exports = CollisionTile; },{"../data/extent":54,"../util/intersection_tests":207,"grid-index":16,"point-geometry":26}],"166":[function(_dereq_, module, exports) { "use strict"; function getAnchors(e, r, t, n, a, l, o, i, c) { var h = n ? .6 * l * o : 0, s = Math.max(n ? n.right - n.left : 0, a ? a.right - a.left : 0), u = 0 === e[0].x || e[0].x === c || 0 === e[0].y || e[0].y === c; r - s * o < r / 4 && (r = s * o + r / 4); var g = 2 * l; return resample(e, u ? r / 2 * i % r : (s / 2 + g) * o * i % r, r, h, t, s * o, u, !1, c); } function resample(e, r, t, n, a, l, o, i, c) { for (var h = l / 2, s = 0, u = 0; u < e.length - 1; u++) s += e[u].dist(e[u + 1]); for (var g = 0, p = r - t, x = [], f = 0; f < e.length - 1; f++) { for (var v = e[f], m = e[f + 1], y = v.dist(m), A = m.angleTo(v); p + t < g + y; ) { p += t; var d = (p - g) / y, k = interpolate(v.x, m.x, d), q = interpolate(v.y, m.y, d); if (k >= 0 && k < c && q >= 0 && q < c && p - h >= 0 && p + h <= s) { var M = new Anchor(k, q, A, f)._round(); n && !checkMaxAngle(e, M, l, n, a) || x.push(M); } } g += y; } return i || x.length || o || (x = resample(e, g / 2, t, n, a, l, o, !0, c)), x; } var interpolate = _dereq_("../style-spec/util/interpolate"), Anchor = _dereq_("../symbol/anchor"), checkMaxAngle = _dereq_("./check_max_angle"); module.exports = getAnchors; },{"../style-spec/util/interpolate":123,"../symbol/anchor":160,"./check_max_angle":161}],"169":[function(_dereq_, module, exports) { "use strict"; module.exports = function(e) { function t(t) { g.push(e[t]), l++; } function r(e, t, r) { var n = u[e]; return delete u[e], u[t] = n, g[n].geometry[0].pop(), g[n].geometry[0] = g[n].geometry[0].concat(r[0]), n; } function n(e, t, r) { var n = i[t]; return delete i[t], i[e] = n, g[n].geometry[0].shift(), g[n].geometry[0] = r[0].concat(g[n].geometry[0]), n; } function o(e, t, r) { var n = r ? t[0][t[0].length - 1] : t[0][0]; return e + ":" + n.x + ":" + n.y; } for (var i = {}, u = {}, g = [], l = 0, m = 0; m < e.length; m++) { var y = e[m], c = y.geometry, f = y.text; if (f) { var a = o(f, c), s = o(f, c, !0); if (a in u && s in i && u[a] !== i[s]) { var v = n(a, s, c), d = r(a, s, g[v].geometry); delete i[a], delete u[s], u[o(f, g[d].geometry, !0)] = d, g[v].geometry = null; } else a in u ? r(a, s, c) : s in i ? n(a, s, c) : (t(m), i[a] = l - 1, u[s] = l - 1); } else t(m); } return g.filter(function(e) { return e.geometry; }); }; },{}],"170":[function(_dereq_, module, exports) { "use strict"; function SymbolQuad(t, e, n, a, i, o, l, r, h, c, g) { this.anchorPoint = t, this.tl = e, this.tr = n, this.bl = a, this.br = i, this.tex = o, this.anchorAngle = l, this.glyphAngle = r, this.minScale = h, this.maxScale = c, this.writingMode = g; } function getIconQuads(t, e, n, a, i, o, l, r, h) { var c, g, u, m, s = e.image.rect, d = i.layout, S = e.left - 1, f = S + s.w / e.image.pixelRatio, M = e.top - 1, y = M + s.h / e.image.pixelRatio; if ("none" !== d["icon-text-fit"] && l) { var P = f - S, p = y - M, w = d["text-size"] / 24, v = l.left * w, b = l.right * w, I = l.top * w, _ = l.bottom * w, Q = b - v, G = _ - I, V = d["icon-text-fit-padding"][0], L = d["icon-text-fit-padding"][1], A = d["icon-text-fit-padding"][2], D = d["icon-text-fit-padding"][3], E = "width" === d["icon-text-fit"] ? .5 * (G - p) : 0, F = "height" === d["icon-text-fit"] ? .5 * (Q - P) : 0, q = "width" === d["icon-text-fit"] || "both" === d["icon-text-fit"] ? Q : P, N = "height" === d["icon-text-fit"] || "both" === d["icon-text-fit"] ? G : p; c = new Point(v + F - D, I + E - V), g = new Point(v + F + L + q, I + E - V), u = new Point(v + F + L + q, I + E + A + N), m = new Point(v + F - D, I + E + A + N); } else c = new Point(S, M), g = new Point(f, M), u = new Point(f, y), m = new Point(S, y); var R = i.getLayoutValue("icon-rotate", r, h) * Math.PI / 180; if (o) { var k = a[t.segment]; if (t.y === k.y && t.x === k.x && t.segment + 1 < a.length) { var z = a[t.segment + 1]; R += Math.atan2(t.y - z.y, t.x - z.x) + Math.PI; } else R += Math.atan2(t.y - k.y, t.x - k.x); } if (R) { var j = Math.sin(R), B = Math.cos(R), C = [ B, -j, j, B ]; c = c.matMult(C), g = g.matMult(C), m = m.matMult(C), u = u.matMult(C); } return [ new SymbolQuad(new Point(t.x, t.y), c, g, m, u, e.image.rect, 0, 0, minScale, 1 / 0) ]; } function getGlyphQuads(t, e, n, a, i, o, l, r) { for (var h = i.getLayoutValue("text-rotate", l, r) * Math.PI / 180, c = i.layout["text-keep-upright"], g = e.positionedGlyphs, u = [], m = 0; m < g.length; m++) { var s = g[m], d = s.glyph; if (d) { var x = d.rect; if (x) { var S = (s.x + d.advance / 2) * n, f = void 0, M = minScale; o ? (f = [], M = getLineGlyphs(f, t, S, a, t.segment, !1), c && (M = Math.min(M, getLineGlyphs(f, t, S, a, t.segment, !0)))) : f = [ { anchorPoint: new Point(t.x, t.y), upsideDown: !1, angle: 0, maxScale: 1 / 0, minScale: minScale } ]; var y = s.x + d.left, P = s.y - d.top, p = y + x.w, w = P + x.h, v = new Point(s.x, d.advance / 2), b = new Point(y, P), I = new Point(p, P), _ = new Point(y, w), Q = new Point(p, w); 0 !== s.angle && (b._sub(v)._rotate(s.angle)._add(v), I._sub(v)._rotate(s.angle)._add(v), _._sub(v)._rotate(s.angle)._add(v), Q._sub(v)._rotate(s.angle)._add(v)); for (var G = 0; G < f.length; G++) { var V = f[G], L = b, A = I, D = _, E = Q; if (h) { var F = Math.sin(h), q = Math.cos(h), N = [ q, -F, F, q ]; L = L.matMult(N), A = A.matMult(N), D = D.matMult(N), E = E.matMult(N); } var R = Math.max(V.minScale, M), k = (t.angle + (V.upsideDown ? Math.PI : 0) + 2 * Math.PI) % (2 * Math.PI), z = (V.angle + (V.upsideDown ? Math.PI : 0) + 2 * Math.PI) % (2 * Math.PI); u.push(new SymbolQuad(V.anchorPoint, L, A, D, E, x, k, z, R, V.maxScale, e.writingMode)); } } } } return u; } function getLineGlyphs(t, e, n, a, i, o) { for (var l = n >= 0 ^ o, r = Math.abs(n), h = new Point(e.x, e.y), c = getSegmentEnd(l, a, i), g = { anchor: h, end: c, index: i, minScale: getMinScaleForSegment(r, h, c), maxScale: 1 / 0 }; ;) { if (insertSegmentGlyph(t, g, l, o), g.minScale <= e.scale) return e.scale; var u = getNextVirtualSegment(g, a, r, l); if (!u) return g.minScale; g = u; } } function insertSegmentGlyph(t, e, n, a) { var i = Math.atan2(e.end.y - e.anchor.y, e.end.x - e.anchor.x), o = n ? i : i + Math.PI; t.push({ anchorPoint: e.anchor, upsideDown: a, minScale: e.minScale, maxScale: e.maxScale, angle: (o + 2 * Math.PI) % (2 * Math.PI) }); } function getVirtualSegmentAnchor(t, e, n) { var a = e.sub(t)._unit(); return t.sub(a._mult(n)); } function getMinScaleForSegment(t, e, n) { return t / e.dist(n); } function getSegmentEnd(t, e, n) { return t ? e[n + 1] : e[n]; } function getNextVirtualSegment(t, e, n, a) { for (var i = t.end, o = i, l = t.index; o.equals(i); ) { if (a && l + 2 < e.length) l += 1; else { if (a || 0 === l) return null; l -= 1; } o = getSegmentEnd(a, e, l); } var r = getVirtualSegmentAnchor(i, o, t.anchor.dist(t.end)); return { anchor: r, end: o, index: l, minScale: getMinScaleForSegment(n, r, o), maxScale: t.minScale }; } var Point = _dereq_("point-geometry"); module.exports = { getIconQuads: getIconQuads, getGlyphQuads: getGlyphQuads, SymbolQuad: SymbolQuad }; var minScale = .5; },{"point-geometry":26}],"171":[function(_dereq_, module, exports) { "use strict"; function PositionedGlyph(e, t, i, n, r) { this.codePoint = e, this.x = t, this.y = i, this.glyph = n || null, this.angle = r; } function Shaping(e, t, i, n, r, a, o) { this.positionedGlyphs = e, this.text = t, this.top = i, this.bottom = n, this.left = r, this.right = a, this.writingMode = o; } function breakLines(e, t) { for (var i = [], n = 0, r = 0, a = t; r < a.length; r += 1) { var o = a[r]; i.push(e.substring(n, o)), n = o; } return n < e.length && i.push(e.substring(n, e.length)), i; } function shapeText(e, t, i, n, r, a, o, s, h, l, c) { var u = e.trim(); c === WritingMode.vertical && (u = verticalizePunctuation(u)); var d, g = [], p = new Shaping(g, u, h[1], h[1], h[0], h[0], c); return d = rtlTextPlugin.processBidirectionalText ? rtlTextPlugin.processBidirectionalText(u, determineLineBreaks(u, s, i, t)) : breakLines(u, determineLineBreaks(u, s, i, t)), shapeLines(p, t, d, n, r, a, o, h, c, s, l), !!g.length && p; } function determineAverageLineWidth(e, t, i, n) { var r = 0; for (var a in e) { var o = n[e.charCodeAt(a)]; o && (r += o.advance + t); } return r / Math.max(1, Math.ceil(r / i)); } function calculateBadness(e, t, i, n) { var r = Math.pow(e - t, 2); return n ? e < t ? r / 2 : 2 * r : r + Math.abs(i) * i; } function calculatePenalty(e, t) { var i = 0; return 10 === e && (i -= 1e4), 40 !== e && 65288 !== e || (i += 50), 41 !== t && 65289 !== t || (i += 50), i; } function evaluateBreak(e, t, i, n, r, a) { for (var o = null, s = calculateBadness(t, i, r, a), h = 0, l = n; h < l.length; h += 1) { var c = l[h], u = t - c.x, d = calculateBadness(u, i, r, a) + c.badness; d <= s && (o = c, s = d); } return { index: e, x: t, priorBreak: o, badness: s }; } function leastBadBreaks(e) { return e ? leastBadBreaks(e.priorBreak).concat(e.index) : []; } function determineLineBreaks(e, t, i, n) { if (!i) return []; if (!e) return []; for (var r = [], a = determineAverageLineWidth(e, t, i, n), o = 0, s = 0; s < e.length; s++) { var h = e.charCodeAt(s), l = n[h]; l && !whitespace[h] && (o += l.advance + t), s < e.length - 1 && (breakable[h] || scriptDetection.charAllowsIdeographicBreaking(h)) && r.push(evaluateBreak(s + 1, o, a, r, calculatePenalty(h, e.charCodeAt(s + 1)), !1)); } return leastBadBreaks(evaluateBreak(e.length, o, a, r, 0, !0)); } function shapeLines(e, t, i, n, r, a, o, s, h, l, c) { var d = 0, g = -17, p = 0, v = e.positionedGlyphs; for (var f in i) { var x = i[f].trim(); if (x.length) { for (var B = v.length, k = 0; k < x.length; k++) { var P = x.charCodeAt(k), b = t[P]; b && (scriptDetection.charHasUprightVerticalOrientation(P) && h !== WritingMode.horizontal ? (v.push(new PositionedGlyph(P, d, 0, b, -Math.PI / 2)), d += c + l) : (v.push(new PositionedGlyph(P, d, g, b, 0)), d += b.advance + l)); } if (v.length !== B) { var m = d - l; p = Math.max(m, p), justifyLine(v, t, B, v.length - 1, o); } d = 0, g += n; } else g += n; } align(v, o, r, a, p, n, i.length, s); var y = i.length * n; e.top += -a * y, e.bottom = e.top + y, e.left += -r * p, e.right = e.left + p; } function justifyLine(e, t, i, n, r) { if (r) for (var a = t[e[n].codePoint].advance, o = (e[n].x + a) * r, s = i; s <= n; s++) e[s].x -= o; } function align(e, t, i, n, r, a, o, s) { for (var h = (t - i) * r + s[0], l = (-n * o + .5) * a + s[1], c = 0; c < e.length; c++) e[c].x += h, e[c].y += l; } function shapeIcon(e, t) { if (!e || !e.rect) return null; var i = t[0], n = t[1], r = i - e.width / 2, a = r + e.width, o = n - e.height / 2; return new PositionedIcon(e, o, o + e.height, r, a); } function PositionedIcon(e, t, i, n, r) { this.image = e, this.top = t, this.bottom = i, this.left = n, this.right = r; } var scriptDetection = _dereq_("../util/script_detection"), verticalizePunctuation = _dereq_("../util/verticalize_punctuation"), rtlTextPlugin = _dereq_("../source/rtl_text_plugin"), WritingMode = { horizontal: 1, vertical: 2 }; module.exports = { shapeText: shapeText, shapeIcon: shapeIcon, WritingMode: WritingMode }; var whitespace = { 9: !0, 10: !0, 11: !0, 12: !0, 13: !0, 32: !0 }, breakable = { 10: !0, 32: !0, 38: !0, 40: !0, 41: !0, 43: !0, 45: !0, 47: !0, 173: !0, 183: !0, 8203: !0, 8208: !0, 8211: !0, 8231: !0 }; },{"../source/rtl_text_plugin":91,"../util/script_detection":211,"../util/verticalize_punctuation":217}],"173":[function(_dereq_, module, exports) { "use strict"; var rtlTextPlugin = _dereq_("../source/rtl_text_plugin"); module.exports = function(e, r, t, a) { var l = r.getLayoutValue("text-transform", t, a); return "uppercase" === l ? e = e.toLocaleUpperCase() : "lowercase" === l && (e = e.toLocaleLowerCase()), rtlTextPlugin.applyArabicShaping && (e = rtlTextPlugin.applyArabicShaping(e)), e; }; },{"../source/rtl_text_plugin":91}],"193":[function(_dereq_, module, exports) { "use strict"; var Actor = function(t, e, a) { this.target = t, this.parent = e, this.mapId = a, this.callbacks = {}, this.callbackID = 0, this.receive = this.receive.bind(this), this.target.addEventListener("message", this.receive, !1); }; Actor.prototype.send = function(t, e, a, r, s) { var i = a ? this.mapId + ":" + this.callbackID++ : null; a && (this.callbacks[i] = a), this.target.postMessage({ targetMapId: s, sourceMapId: this.mapId, type: t, id: String(i), data: e }, r); }, Actor.prototype.receive = function(t) { var e, a = this, r = t.data, s = r.id; if (!r.targetMapId || this.mapId === r.targetMapId) { var i = function(t, e, r) { a.target.postMessage({ sourceMapId: a.mapId, type: "", id: String(s), error: t ? String(t) : null, data: e }, r); }; if ("" === r.type) e = this.callbacks[r.id], delete this.callbacks[r.id], e && e(r.error || null, r.data); else if (void 0 !== r.id && this.parent[r.type]) this.parent[r.type](r.sourceMapId, r.data, i); else if (void 0 !== r.id && this.parent.getWorkerSource) { var p = r.type.split("."), d = this.parent.getWorkerSource(r.sourceMapId, p[0]); d[p[1]](r.data, i); } else this.parent[r.type](r.data); } }, Actor.prototype.remove = function() { this.target.removeEventListener("message", this.receive, !1); }, module.exports = Actor; },{}],"194":[function(_dereq_, module, exports) { "use strict"; function sameOrigin(e) { var t = window.document.createElement("a"); return t.href = e, t.protocol === window.document.location.protocol && t.host === window.document.location.host; } var window = _dereq_("./window"), AJAXError = function(e) { function t(t, r) { e.call(this, t), this.status = r; } return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t; }(Error); exports.getJSON = function(e, t) { var r = new window.XMLHttpRequest(); return r.open("GET", e, !0), r.setRequestHeader("Accept", "application/json"), r.onerror = function(e) { t(e); }, r.onload = function() { if (r.status >= 200 && r.status < 300 && r.response) { var e; try { e = JSON.parse(r.response); } catch (e) { return t(e); } t(null, e); } else t(new AJAXError(r.statusText, r.status)); }, r.send(), r; }, exports.getArrayBuffer = function(e, t) { var r = new window.XMLHttpRequest(); return r.open("GET", e, !0), r.responseType = "arraybuffer", r.onerror = function(e) { t(e); }, r.onload = function() { return 0 === r.response.byteLength && 200 === r.status ? t(new Error("http status 200 returned without content.")) : void (r.status >= 200 && r.status < 300 && r.response ? t(null, { data: r.response, cacheControl: r.getResponseHeader("Cache-Control"), expires: r.getResponseHeader("Expires") }) : t(new AJAXError(r.statusText, r.status))); }, r.send(), r; }; exports.getImage = function(e, t) { return exports.getArrayBuffer(e, function(e, r) { if (e) return t(e); var n = new window.Image(), o = window.URL || window.webkitURL; n.onload = function() { t(null, n), o.revokeObjectURL(n.src); }; var s = new window.Blob([ new Uint8Array(r.data) ], { type: "image/png" }); n.cacheControl = r.cacheControl, n.expires = r.expires, n.src = r.data.byteLength ? o.createObjectURL(s) : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="; }); }, exports.getVideo = function(e, t) { var r = window.document.createElement("video"); r.onloadstart = function() { t(null, r); }; for (var n = 0; n < e.length; n++) { var o = window.document.createElement("source"); sameOrigin(e[n]) || (r.crossOrigin = "Anonymous"), o.src = e[n], r.appendChild(o); } return r; }; },{"./window":197}],"197":[function(_dereq_, module, exports) { "use strict"; module.exports = self; },{}],"198":[function(_dereq_, module, exports) { "use strict"; function compareAreas(e, r) { return r.area - e.area; } var quickselect = _dereq_("quickselect"), calculateSignedArea = _dereq_("./util").calculateSignedArea; module.exports = function(e, r) { var a = e.length; if (a <= 1) return [ e ]; for (var t, u, c = [], i = 0; i < a; i++) { var l = calculateSignedArea(e[i]); 0 !== l && (e[i].area = Math.abs(l), void 0 === u && (u = l < 0), u === l < 0 ? (t && c.push(t), t = [ e[i] ]) : t.push(e[i])); } if (t && c.push(t), r > 1) for (var n = 0; n < c.length; n++) c[n].length <= r || (quickselect(c[n], r, 1, c[n].length - 1, compareAreas), c[n] = c[n].slice(0, r)); return c; }; },{"./util":215,"quickselect":28}],"200":[function(_dereq_, module, exports) { "use strict"; var DictionaryCoder = function(r) { var t = this; this._stringToNumber = {}, this._numberToString = []; for (var o = 0; o < r.length; o++) { var i = r[o]; t._stringToNumber[i] = o, t._numberToString[o] = i; } }; DictionaryCoder.prototype.encode = function(r) { return this._stringToNumber[r]; }, DictionaryCoder.prototype.decode = function(r) { return this._numberToString[r]; }, module.exports = DictionaryCoder; },{}],"203":[function(_dereq_, module, exports) { "use strict"; function _addEventListener(e, t, n) { n[e] = n[e] || [], n[e].push(t); } function _removeEventListener(e, t, n) { if (n && n[e]) { var i = n[e].indexOf(t); -1 !== i && n[e].splice(i, 1); } } var util = _dereq_("./util"), Evented = function() {}; Evented.prototype.on = function(e, t) { return this._listeners = this._listeners || {}, _addEventListener(e, t, this._listeners), this; }, Evented.prototype.off = function(e, t) { return _removeEventListener(e, t, this._listeners), _removeEventListener(e, t, this._oneTimeListeners), this; }, Evented.prototype.once = function(e, t) { return this._oneTimeListeners = this._oneTimeListeners || {}, _addEventListener(e, t, this._oneTimeListeners), this; }, Evented.prototype.fire = function(e, t) { var n = this; if (this.listens(e)) { t = util.extend({}, t, { type: e, target: this }); for (var i = this._listeners && this._listeners[e] ? this._listeners[e].slice() : [], s = 0; s < i.length; s++) i[s].call(n, t); for (var r = this._oneTimeListeners && this._oneTimeListeners[e] ? this._oneTimeListeners[e].slice() : [], o = 0; o < r.length; o++) r[o].call(n, t), _removeEventListener(e, r[o], n._oneTimeListeners); this._eventedParent && this._eventedParent.fire(e, util.extend({}, t, "function" == typeof this._eventedParentData ? this._eventedParentData() : this._eventedParentData)); } else util.endsWith(e, "error") && console.error(t && t.error || t || "Empty error event"); return this; }, Evented.prototype.listens = function(e) { return this._listeners && this._listeners[e] && this._listeners[e].length > 0 || this._oneTimeListeners && this._oneTimeListeners[e] && this._oneTimeListeners[e].length > 0 || this._eventedParent && this._eventedParent.listens(e); }, Evented.prototype.setEventedParent = function(e, t) { return this._eventedParent = e, this._eventedParentData = t, this; }, module.exports = Evented; },{"./util":215}],"204":[function(_dereq_, module, exports) { "use strict"; function compareMax(e, t) { return t.max - e.max; } function Cell(e, t, n, r) { this.p = new Point(e, t), this.h = n, this.d = pointToPolygonDist(this.p, r), this.max = this.d + this.h * Math.SQRT2; } function pointToPolygonDist(e, t) { for (var n = !1, r = 1 / 0, o = 0; o < t.length; o++) for (var i = t[o], l = 0, u = i.length, s = u - 1; l < u; s = l++) { var a = i[l], h = i[s]; a.y > e.y != h.y > e.y && e.x < (h.x - a.x) * (e.y - a.y) / (h.y - a.y) + a.x && (n = !n), r = Math.min(r, distToSegmentSquared(e, a, h)); } return (n ? 1 : -1) * Math.sqrt(r); } function getCentroidCell(e) { for (var t = 0, n = 0, r = 0, o = e[0], i = 0, l = o.length, u = l - 1; i < l; u = i++) { var s = o[i], a = o[u], h = s.x * a.y - a.x * s.y; n += (s.x + a.x) * h, r += (s.y + a.y) * h, t += 3 * h; } return new Cell(n / t, r / t, 0, e); } var Queue = _dereq_("tinyqueue"), Point = _dereq_("point-geometry"), distToSegmentSquared = _dereq_("./intersection_tests").distToSegmentSquared; module.exports = function(e, t, n) { t = t || 1; for (var r, o, i, l, u = e[0], s = 0; s < u.length; s++) { var a = u[s]; (!s || a.x < r) && (r = a.x), (!s || a.y < o) && (o = a.y), (!s || a.x > i) && (i = a.x), (!s || a.y > l) && (l = a.y); } var h = i - r, p = l - o, y = Math.min(h, p), x = y / 2, d = new Queue(null, compareMax); if (0 === y) return [ r, o ]; for (var g = r; g < i; g += y) for (var f = o; f < l; f += y) d.push(new Cell(g + x, f + x, x, e)); for (var m = getCentroidCell(e), c = d.length; d.length; ) { var v = d.pop(); (v.d > m.d || !m.d) && (m = v, n && console.log("found best %d after %d probes", Math.round(1e4 * v.d) / 1e4, c)), v.max - m.d <= t || (x = v.h / 2, d.push(new Cell(v.p.x - x, v.p.y - x, x, e)), d.push(new Cell(v.p.x + x, v.p.y - x, x, e)), d.push(new Cell(v.p.x - x, v.p.y + x, x, e)), d.push(new Cell(v.p.x + x, v.p.y + x, x, e)), c += 4); } return n && (console.log("num probes: " + c), console.log("best distance: " + m.d)), m.p; }; },{"./intersection_tests":207,"point-geometry":26,"tinyqueue":30}],"207":[function(_dereq_, module, exports) { "use strict"; function polygonIntersectsPolygon(n, t) { for (var e = 0; e < n.length; e++) if (polygonContainsPoint(t, n[e])) return !0; for (var r = 0; r < t.length; r++) if (polygonContainsPoint(n, t[r])) return !0; return !!lineIntersectsLine(n, t); } function multiPolygonIntersectsBufferedMultiPoint(n, t, e) { for (var r = 0; r < n.length; r++) for (var o = n[r], i = 0; i < t.length; i++) for (var l = t[i], u = 0; u < l.length; u++) { var s = l[u]; if (polygonContainsPoint(o, s)) return !0; if (pointIntersectsBufferedLine(s, o, e)) return !0; } return !1; } function multiPolygonIntersectsMultiPolygon(n, t) { if (1 === n.length && 1 === n[0].length) return multiPolygonContainsPoint(t, n[0][0]); for (var e = 0; e < t.length; e++) for (var r = t[e], o = 0; o < r.length; o++) if (multiPolygonContainsPoint(n, r[o])) return !0; for (var i = 0; i < n.length; i++) { for (var l = n[i], u = 0; u < l.length; u++) if (multiPolygonContainsPoint(t, l[u])) return !0; for (var s = 0; s < t.length; s++) if (lineIntersectsLine(l, t[s])) return !0; } return !1; } function multiPolygonIntersectsBufferedMultiLine(n, t, e) { for (var r = 0; r < t.length; r++) for (var o = t[r], i = 0; i < n.length; i++) { var l = n[i]; if (l.length >= 3) for (var u = 0; u < o.length; u++) if (polygonContainsPoint(l, o[u])) return !0; if (lineIntersectsBufferedLine(l, o, e)) return !0; } return !1; } function lineIntersectsBufferedLine(n, t, e) { if (n.length > 1) { if (lineIntersectsLine(n, t)) return !0; for (var r = 0; r < t.length; r++) if (pointIntersectsBufferedLine(t[r], n, e)) return !0; } for (var o = 0; o < n.length; o++) if (pointIntersectsBufferedLine(n[o], t, e)) return !0; return !1; } function lineIntersectsLine(n, t) { if (0 === n.length || 0 === t.length) return !1; for (var e = 0; e < n.length - 1; e++) for (var r = n[e], o = n[e + 1], i = 0; i < t.length - 1; i++) { var l = t[i], u = t[i + 1]; if (lineSegmentIntersectsLineSegment(r, o, l, u)) return !0; } return !1; } function lineSegmentIntersectsLineSegment(n, t, e, r) { return isCounterClockwise(n, e, r) !== isCounterClockwise(t, e, r) && isCounterClockwise(n, t, e) !== isCounterClockwise(n, t, r); } function pointIntersectsBufferedLine(n, t, e) { var r = e * e; if (1 === t.length) return n.distSqr(t[0]) < r; for (var o = 1; o < t.length; o++) { if (distToSegmentSquared(n, t[o - 1], t[o]) < r) return !0; } return !1; } function distToSegmentSquared(n, t, e) { var r = t.distSqr(e); if (0 === r) return n.distSqr(t); var o = ((n.x - t.x) * (e.x - t.x) + (n.y - t.y) * (e.y - t.y)) / r; return o < 0 ? n.distSqr(t) : o > 1 ? n.distSqr(e) : n.distSqr(e.sub(t)._mult(o)._add(t)); } function multiPolygonContainsPoint(n, t) { for (var e, r, o, i = !1, l = 0; l < n.length; l++) { e = n[l]; for (var u = 0, s = e.length - 1; u < e.length; s = u++) r = e[u], o = e[s], r.y > t.y != o.y > t.y && t.x < (o.x - r.x) * (t.y - r.y) / (o.y - r.y) + r.x && (i = !i); } return i; } function polygonContainsPoint(n, t) { for (var e = !1, r = 0, o = n.length - 1; r < n.length; o = r++) { var i = n[r], l = n[o]; i.y > t.y != l.y > t.y && t.x < (l.x - i.x) * (t.y - i.y) / (l.y - i.y) + i.x && (e = !e); } return e; } var isCounterClockwise = _dereq_("./util").isCounterClockwise; module.exports = { multiPolygonIntersectsBufferedMultiPoint: multiPolygonIntersectsBufferedMultiPoint, multiPolygonIntersectsMultiPolygon: multiPolygonIntersectsMultiPolygon, multiPolygonIntersectsBufferedMultiLine: multiPolygonIntersectsBufferedMultiLine, polygonIntersectsPolygon: polygonIntersectsPolygon, distToSegmentSquared: distToSegmentSquared }; },{"./util":215}],"208":[function(_dereq_, module, exports) { "use strict"; var unicodeBlockLookup = { "Latin-1 Supplement": function(n) { return n >= 128 && n <= 255; }, "Hangul Jamo": function(n) { return n >= 4352 && n <= 4607; }, "Unified Canadian Aboriginal Syllabics": function(n) { return n >= 5120 && n <= 5759; }, "Unified Canadian Aboriginal Syllabics Extended": function(n) { return n >= 6320 && n <= 6399; }, "General Punctuation": function(n) { return n >= 8192 && n <= 8303; }, "Letterlike Symbols": function(n) { return n >= 8448 && n <= 8527; }, "Number Forms": function(n) { return n >= 8528 && n <= 8591; }, "Miscellaneous Technical": function(n) { return n >= 8960 && n <= 9215; }, "Control Pictures": function(n) { return n >= 9216 && n <= 9279; }, "Optical Character Recognition": function(n) { return n >= 9280 && n <= 9311; }, "Enclosed Alphanumerics": function(n) { return n >= 9312 && n <= 9471; }, "Geometric Shapes": function(n) { return n >= 9632 && n <= 9727; }, "Miscellaneous Symbols": function(n) { return n >= 9728 && n <= 9983; }, "Miscellaneous Symbols and Arrows": function(n) { return n >= 11008 && n <= 11263; }, "CJK Radicals Supplement": function(n) { return n >= 11904 && n <= 12031; }, "Kangxi Radicals": function(n) { return n >= 12032 && n <= 12255; }, "Ideographic Description Characters": function(n) { return n >= 12272 && n <= 12287; }, "CJK Symbols and Punctuation": function(n) { return n >= 12288 && n <= 12351; }, Hiragana: function(n) { return n >= 12352 && n <= 12447; }, Katakana: function(n) { return n >= 12448 && n <= 12543; }, Bopomofo: function(n) { return n >= 12544 && n <= 12591; }, "Hangul Compatibility Jamo": function(n) { return n >= 12592 && n <= 12687; }, Kanbun: function(n) { return n >= 12688 && n <= 12703; }, "Bopomofo Extended": function(n) { return n >= 12704 && n <= 12735; }, "CJK Strokes": function(n) { return n >= 12736 && n <= 12783; }, "Katakana Phonetic Extensions": function(n) { return n >= 12784 && n <= 12799; }, "Enclosed CJK Letters and Months": function(n) { return n >= 12800 && n <= 13055; }, "CJK Compatibility": function(n) { return n >= 13056 && n <= 13311; }, "CJK Unified Ideographs Extension A": function(n) { return n >= 13312 && n <= 19903; }, "Yijing Hexagram Symbols": function(n) { return n >= 19904 && n <= 19967; }, "CJK Unified Ideographs": function(n) { return n >= 19968 && n <= 40959; }, "Yi Syllables": function(n) { return n >= 40960 && n <= 42127; }, "Yi Radicals": function(n) { return n >= 42128 && n <= 42191; }, "Hangul Jamo Extended-A": function(n) { return n >= 43360 && n <= 43391; }, "Hangul Syllables": function(n) { return n >= 44032 && n <= 55215; }, "Hangul Jamo Extended-B": function(n) { return n >= 55216 && n <= 55295; }, "Private Use Area": function(n) { return n >= 57344 && n <= 63743; }, "CJK Compatibility Ideographs": function(n) { return n >= 63744 && n <= 64255; }, "Vertical Forms": function(n) { return n >= 65040 && n <= 65055; }, "CJK Compatibility Forms": function(n) { return n >= 65072 && n <= 65103; }, "Small Form Variants": function(n) { return n >= 65104 && n <= 65135; }, "Halfwidth and Fullwidth Forms": function(n) { return n >= 65280 && n <= 65519; } }; module.exports = unicodeBlockLookup; },{}],"211":[function(_dereq_, module, exports) { "use strict"; var isChar = _dereq_("./is_char_in_unicode_block"); module.exports.allowsIdeographicBreaking = function(a) { for (var i = 0, r = a; i < r.length; i += 1) { var s = r[i]; if (!exports.charAllowsIdeographicBreaking(s.charCodeAt(0))) return !1; } return !0; }, module.exports.allowsVerticalWritingMode = function(a) { for (var i = 0, r = a; i < r.length; i += 1) { var s = r[i]; if (exports.charHasUprightVerticalOrientation(s.charCodeAt(0))) return !0; } return !1; }, module.exports.charAllowsIdeographicBreaking = function(a) { return !!(!(a < 11904) && (isChar["Bopomofo Extended"](a) || isChar.Bopomofo(a) || isChar["CJK Compatibility Forms"](a) || isChar["CJK Compatibility Ideographs"](a) || isChar["CJK Compatibility"](a) || isChar["CJK Radicals Supplement"](a) || isChar["CJK Strokes"](a) || isChar["CJK Symbols and Punctuation"](a) || isChar["CJK Unified Ideographs Extension A"](a) || isChar["CJK Unified Ideographs"](a) || isChar["Enclosed CJK Letters and Months"](a) || isChar["Halfwidth and Fullwidth Forms"](a) || isChar.Hiragana(a) || isChar["Ideographic Description Characters"](a) || isChar["Kangxi Radicals"](a) || isChar["Katakana Phonetic Extensions"](a) || isChar.Katakana(a) || isChar["Vertical Forms"](a) || isChar["Yi Radicals"](a) || isChar["Yi Syllables"](a))); }, exports.charHasUprightVerticalOrientation = function(a) { return !!(746 === a || 747 === a || !(a < 4352) && (isChar["Bopomofo Extended"](a) || isChar.Bopomofo(a) || isChar["CJK Compatibility Forms"](a) && !(a >= 65097 && a <= 65103) || isChar["CJK Compatibility Ideographs"](a) || isChar["CJK Compatibility"](a) || isChar["CJK Radicals Supplement"](a) || isChar["CJK Strokes"](a) || !(!isChar["CJK Symbols and Punctuation"](a) || a >= 12296 && a <= 12305 || a >= 12308 && a <= 12319 || 12336 === a) || isChar["CJK Unified Ideographs Extension A"](a) || isChar["CJK Unified Ideographs"](a) || isChar["Enclosed CJK Letters and Months"](a) || isChar["Hangul Compatibility Jamo"](a) || isChar["Hangul Jamo Extended-A"](a) || isChar["Hangul Jamo Extended-B"](a) || isChar["Hangul Jamo"](a) || isChar["Hangul Syllables"](a) || isChar.Hiragana(a) || isChar["Ideographic Description Characters"](a) || isChar.Kanbun(a) || isChar["Kangxi Radicals"](a) || isChar["Katakana Phonetic Extensions"](a) || isChar.Katakana(a) && 12540 !== a || !(!isChar["Halfwidth and Fullwidth Forms"](a) || 65288 === a || 65289 === a || 65293 === a || a >= 65306 && a <= 65310 || 65339 === a || 65341 === a || 65343 === a || a >= 65371 && a <= 65503 || 65507 === a || a >= 65512 && a <= 65519) || !(!isChar["Small Form Variants"](a) || a >= 65112 && a <= 65118 || a >= 65123 && a <= 65126) || isChar["Unified Canadian Aboriginal Syllabics"](a) || isChar["Unified Canadian Aboriginal Syllabics Extended"](a) || isChar["Vertical Forms"](a) || isChar["Yijing Hexagram Symbols"](a) || isChar["Yi Syllables"](a) || isChar["Yi Radicals"](a))); }, exports.charHasNeutralVerticalOrientation = function(a) { return !!(isChar["Latin-1 Supplement"](a) && (167 === a || 169 === a || 174 === a || 177 === a || 188 === a || 189 === a || 190 === a || 215 === a || 247 === a) || isChar["General Punctuation"](a) && (8214 === a || 8224 === a || 8225 === a || 8240 === a || 8241 === a || 8251 === a || 8252 === a || 8258 === a || 8263 === a || 8264 === a || 8265 === a || 8273 === a) || isChar["Letterlike Symbols"](a) || isChar["Number Forms"](a) || isChar["Miscellaneous Technical"](a) && (a >= 8960 && a <= 8967 || a >= 8972 && a <= 8991 || a >= 8996 && a <= 9e3 || 9003 === a || a >= 9085 && a <= 9114 || a >= 9150 && a <= 9165 || 9167 === a || a >= 9169 && a <= 9179 || a >= 9186 && a <= 9215) || isChar["Control Pictures"](a) && 9251 !== a || isChar["Optical Character Recognition"](a) || isChar["Enclosed Alphanumerics"](a) || isChar["Geometric Shapes"](a) || isChar["Miscellaneous Symbols"](a) && !(a >= 9754 && a <= 9759) || isChar["Miscellaneous Symbols and Arrows"](a) && (a >= 11026 && a <= 11055 || a >= 11088 && a <= 11097 || a >= 11192 && a <= 11243) || isChar["CJK Symbols and Punctuation"](a) || isChar.Katakana(a) || isChar["Private Use Area"](a) || isChar["CJK Compatibility Forms"](a) || isChar["Small Form Variants"](a) || isChar["Halfwidth and Fullwidth Forms"](a) || 8734 === a || 8756 === a || 8757 === a || a >= 9984 && a <= 10087 || a >= 10102 && a <= 10131 || 65532 === a || 65533 === a); }, exports.charHasRotatedVerticalOrientation = function(a) { return !(exports.charHasUprightVerticalOrientation(a) || exports.charHasNeutralVerticalOrientation(a)); }; },{"./is_char_in_unicode_block":208}],"213":[function(_dereq_, module, exports) { "use strict"; function createStructArrayType(t) { var e = JSON.stringify(t); if (structArrayTypeCache[e]) return structArrayTypeCache[e]; var r = void 0 === t.alignment ? 1 : t.alignment, i = 0, n = 0, a = [ "Uint8" ], o = t.members.map(function(t) { a.indexOf(t.type) < 0 && a.push(t.type); var e = sizeOf(t.type), o = i = align(i, Math.max(r, e)), s = t.components || 1; return n = Math.max(n, e), i += e * s, { name: t.name, type: t.type, components: s, offset: o }; }), s = align(i, Math.max(n, r)), p = function(t) { function e() { t.apply(this, arguments); } return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e; }(Struct); p.prototype.alignment = r, p.prototype.size = s; for (var y = 0, c = o; y < c.length; y += 1) for (var h = c[y], u = 0; u < h.components; u++) { var f = h.name + (1 === h.components ? "" : u); Object.defineProperty(p.prototype, f, { get: createGetter(h, u), set: createSetter(h, u) }); } var m = function(t) { function e() { t.apply(this, arguments); } return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e; }(StructArray); return m.prototype.members = o, m.prototype.StructType = p, m.prototype.bytesPerElement = s, m.prototype.emplaceBack = createEmplaceBack(o, s), m.prototype._usedTypes = a, structArrayTypeCache[e] = m, m; } function align(t, e) { return Math.ceil(t / e) * e; } function sizeOf(t) { return viewTypes[t].BYTES_PER_ELEMENT; } function getArrayViewName(t) { return t.toLowerCase(); } function createEmplaceBack(t, e) { for (var r = [], i = [], n = "var i = this.length;\nthis.resize(this.length + 1);\n", a = 0, o = t; a < o.length; a += 1) { var s = o[a], p = sizeOf(s.type); r.indexOf(p) < 0 && (r.push(p), n += "var o" + p.toFixed(0) + " = i * " + (e / p).toFixed(0) + ";\n"); for (var y = 0; y < s.components; y++) { var c = "v" + i.length, h = "o" + p.toFixed(0) + " + " + (s.offset / p + y).toFixed(0); n += "this." + getArrayViewName(s.type) + "[" + h + "] = " + c + ";\n", i.push(c); } } return n += "return i;", new Function(i.toString(), n); } function createMemberComponentString(t, e) { var r = "this._pos" + sizeOf(t.type).toFixed(0), i = (t.offset / sizeOf(t.type) + e).toFixed(0), n = r + " + " + i; return "this._structArray." + getArrayViewName(t.type) + "[" + n + "]"; } function createGetter(t, e) { return new Function("return " + createMemberComponentString(t, e) + ";"); } function createSetter(t, e) { return new Function("x", createMemberComponentString(t, e) + " = x;"); } module.exports = createStructArrayType; var viewTypes = { Int8: Int8Array, Uint8: Uint8Array, Uint8Clamped: Uint8ClampedArray, Int16: Int16Array, Uint16: Uint16Array, Int32: Int32Array, Uint32: Uint32Array, Float32: Float32Array, Float64: Float64Array }, Struct = function(t, e) { this._structArray = t, this._pos1 = e * this.size, this._pos2 = this._pos1 / 2, this._pos4 = this._pos1 / 4, this._pos8 = this._pos1 / 8; }, StructArray = function(t) { this.isTransferred = !1, void 0 !== t ? (this.arrayBuffer = t.arrayBuffer, this.length = t.length, this.capacity = this.arrayBuffer.byteLength / this.bytesPerElement, this._refreshViews()) : (this.capacity = -1, this.resize(0)); }; StructArray.serialize = function() { return { members: this.prototype.members, alignment: this.prototype.StructType.prototype.alignment, bytesPerElement: this.prototype.bytesPerElement }; }, StructArray.prototype.serialize = function(t) { return this._trim(), t && (this.isTransferred = !0, t.push(this.arrayBuffer)), { length: this.length, arrayBuffer: this.arrayBuffer }; }, StructArray.prototype.get = function(t) { return new this.StructType(this, t); }, StructArray.prototype._trim = function() { this.length !== this.capacity && (this.capacity = this.length, this.arrayBuffer = this.arrayBuffer.slice(0, this.length * this.bytesPerElement), this._refreshViews()); }, StructArray.prototype.resize = function(t) { if (this.length = t, t > this.capacity) { this.capacity = Math.max(t, Math.floor(5 * this.capacity), 128), this.arrayBuffer = new ArrayBuffer(this.capacity * this.bytesPerElement); var e = this.uint8; this._refreshViews(), e && this.uint8.set(e); } }, StructArray.prototype._refreshViews = function() { for (var t = this, e = 0, r = t._usedTypes; e < r.length; e += 1) { var i = r[e]; t[getArrayViewName(i)] = new viewTypes[i](t.arrayBuffer); } }, StructArray.prototype.toArray = function(t, e) { for (var r = this, i = [], n = t; n < e; n++) { var a = r.get(n); i.push(a); } return i; }; var structArrayTypeCache = {}; },{}],"214":[function(_dereq_, module, exports) { "use strict"; function resolveTokens(e, n) { return n.replace(/{([^{}]+)}/g, function(n, r) { return r in e ? e[r] : ""; }); } module.exports = resolveTokens; },{}],"215":[function(_dereq_, module, exports) { "use strict"; var UnitBezier = _dereq_("@mapbox/unitbezier"), Coordinate = _dereq_("../geo/coordinate"); _dereq_("point-geometry"); exports.easeCubicInOut = function(r) { if (r <= 0) return 0; if (r >= 1) return 1; var e = r * r, t = e * r; return 4 * (r < .5 ? t : 3 * (r - e) + t - .75); }, exports.bezier = function(r, e, t, n) { var o = new UnitBezier(r, e, t, n); return function(r) { return o.solve(r); }; }, exports.ease = exports.bezier(.25, .1, .25, 1), exports.clamp = function(r, e, t) { return Math.min(t, Math.max(e, r)); }, exports.wrap = function(r, e, t) { var n = t - e, o = ((r - e) % n + n) % n + e; return o === e ? t : o; }, exports.asyncAll = function(r, e, t) { if (!r.length) return t(null, []); var n = r.length, o = new Array(r.length), a = null; r.forEach(function(r, i) { e(r, function(r, e) { r && (a = r), o[i] = e, 0 == --n && t(a, o); }); }); }, exports.values = function(r) { var e = []; for (var t in r) e.push(r[t]); return e; }, exports.keysDifference = function(r, e) { var t = []; for (var n in r) n in e || t.push(n); return t; }, exports.extend = function(r, e, t, n) { for (var o = arguments, a = 1; a < arguments.length; a++) { var i = o[a]; for (var u in i) r[u] = i[u]; } return r; }, exports.pick = function(r, e) { for (var t = {}, n = 0; n < e.length; n++) { var o = e[n]; o in r && (t[o] = r[o]); } return t; }; var id = 1; exports.uniqueId = function() { return id++; }, exports.bindAll = function(r, e) { r.forEach(function(r) { e[r] && (e[r] = e[r].bind(e)); }); }, exports.getCoordinatesCenter = function(r) { for (var e = 1 / 0, t = 1 / 0, n = -1 / 0, o = -1 / 0, a = 0; a < r.length; a++) e = Math.min(e, r[a].column), t = Math.min(t, r[a].row), n = Math.max(n, r[a].column), o = Math.max(o, r[a].row); var i = n - e, u = o - t, s = Math.max(i, u), c = Math.max(0, Math.floor(-Math.log(s) / Math.LN2)); return new Coordinate((e + n) / 2, (t + o) / 2, 0).zoomTo(c); }, exports.endsWith = function(r, e) { return -1 !== r.indexOf(e, r.length - e.length); }, exports.mapObject = function(r, e, t) { var n = this, o = {}; for (var a in r) o[a] = e.call(t || n, r[a], a, r); return o; }, exports.filterObject = function(r, e, t) { var n = this, o = {}; for (var a in r) e.call(t || n, r[a], a, r) && (o[a] = r[a]); return o; }, exports.deepEqual = function(r, e) { if (Array.isArray(r)) { if (!Array.isArray(e) || r.length !== e.length) return !1; for (var t = 0; t < r.length; t++) if (!exports.deepEqual(r[t], e[t])) return !1; return !0; } if ("object" == typeof r && null !== r && null !== e) { if ("object" != typeof e) return !1; if (Object.keys(r).length !== Object.keys(e).length) return !1; for (var o in r) if (!exports.deepEqual(r[o], e[o])) return !1; return !0; } return r === e; }, exports.clone = function(r) { return Array.isArray(r) ? r.map(exports.clone) : "object" == typeof r && r ? exports.mapObject(r, exports.clone) : r; }, exports.arraysIntersect = function(r, e) { for (var t = 0; t < r.length; t++) if (e.indexOf(r[t]) >= 0) return !0; return !1; }; var warnOnceHistory = {}; exports.warnOnce = function(r) { warnOnceHistory[r] || ("undefined" != typeof console && console.warn(r), warnOnceHistory[r] = !0); }, exports.isCounterClockwise = function(r, e, t) { return (t.y - r.y) * (e.x - r.x) > (e.y - r.y) * (t.x - r.x); }, exports.calculateSignedArea = function(r) { for (var e = 0, t = 0, n = r.length, o = n - 1, a = void 0, i = void 0; t < n; o = t++) a = r[t], i = r[o], e += (i.x - a.x) * (a.y + i.y); return e; }, exports.isClosedPolygon = function(r) { if (r.length < 4) return !1; var e = r[0], t = r[r.length - 1]; return !(Math.abs(e.x - t.x) > 0 || Math.abs(e.y - t.y) > 0) && Math.abs(exports.calculateSignedArea(r)) > .01; }, exports.sphericalToCartesian = function(r) { var e = r[0], t = r[1], n = r[2]; return t += 90, t *= Math.PI / 180, n *= Math.PI / 180, [ e * Math.cos(t) * Math.sin(n), e * Math.sin(t) * Math.sin(n), e * Math.cos(n) ]; }, exports.parseCacheControl = function(r) { var e = /(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g, t = {}; if (r.replace(e, function(r, e, n, o) { var a = n || o; return t[e] = !a || a.toLowerCase(), ""; }), t["max-age"]) { var n = parseInt(t["max-age"], 10); isNaN(n) ? delete t["max-age"] : t["max-age"] = n; } return t; }; },{"../geo/coordinate":61,"@mapbox/unitbezier":3,"point-geometry":26}],"216":[function(_dereq_, module, exports) { "use strict"; var Feature = function(e, t, r, o) { this.type = "Feature", this._vectorTileFeature = e, e._z = t, e._x = r, e._y = o, this.properties = e.properties, null != e.id && (this.id = e.id); }, prototypeAccessors = { geometry: {} }; prototypeAccessors.geometry.get = function() { return void 0 === this._geometry && (this._geometry = this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x, this._vectorTileFeature._y, this._vectorTileFeature._z).geometry), this._geometry; }, prototypeAccessors.geometry.set = function(e) { this._geometry = e; }, Feature.prototype.toJSON = function() { var e = this, t = { geometry: this.geometry }; for (var r in e) "_geometry" !== r && "_vectorTileFeature" !== r && (t[r] = e[r]); return t; }, Object.defineProperties(Feature.prototype, prototypeAccessors), module.exports = Feature; },{}],"217":[function(_dereq_, module, exports) { "use strict"; var scriptDetection = _dereq_("./script_detection"); module.exports = function(t) { for (var o = "", e = 0; e < t.length; e++) { var r = t.charCodeAt(e + 1) || null, l = t.charCodeAt(e - 1) || null; o += (!r || !scriptDetection.charHasRotatedVerticalOrientation(r) || module.exports.lookup[t[e + 1]]) && (!l || !scriptDetection.charHasRotatedVerticalOrientation(l) || module.exports.lookup[t[e - 1]]) && module.exports.lookup[t[e]] ? module.exports.lookup[t[e]] : t[e]; } return o; }, module.exports.lookup = { "!": "︕", "#": "#", $: "$", "%": "%", "&": "&", "(": "︵", ")": "︶", "*": "*", "+": "+", ",": "︐", "-": "︲", ".": "・", "/": "/", ":": "︓", ";": "︔", "<": "︿", "=": "=", ">": "﹀", "?": "︖", "@": "@", "[": "﹇", "\\": "\", "]": "﹈", "^": "^", _: "︳", "`": "`", "{": "︷", "|": "―", "}": "︸", "~": "~", "¢": "¢", "£": "£", "¥": "¥", "¦": "¦", "¬": "¬", "¯": " ̄", "–": "︲", "—": "︱", "‘": "﹃", "’": "﹄", "“": "﹁", "”": "﹂", "…": "︙", "‧": "・", "₩": "₩", "、": "︑", "。": "︒", "〈": "︿", "〉": "﹀", "《": "︽", "》": "︾", "「": "﹁", "」": "﹂", "『": "﹃", "』": "﹄", "【": "︻", "】": "︼", "〔": "︹", "〕": "︺", "〖": "︗", "〗": "︘", "!": "︕", "(": "︵", ")": "︶", ",": "︐", "-": "︲", ".": "・", ":": "︓", ";": "︔", "<": "︿", ">": "﹀", "?": "︖", "[": "﹇", "]": "﹈", "_": "︳", "{": "︷", "|": "―", "}": "︸", "⦅": "︵", "⦆": "︶", "。": "︒", "「": "﹁", "」": "﹂" }; },{"./script_detection":211}],"f0522429":[function anonymous(require) { var f = require("100");(f.default ? f.default : f)(self); },{"100":"100"}]},{},["f0522429"])