mapbox-gl
Version:
A WebGL interactive maps library
56 lines • 304 kB
JavaScript
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.mapboxgl = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(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?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";function Buffer(t){t?(this.array=t.array,this.pos=t.pos):(this.array=new ArrayBuffer(this.defaultLength),this.length=this.defaultLength,this.setupViews())}module.exports=Buffer,Buffer.prototype={pos:0,itemSize:4,defaultLength:8192,arrayType:"ARRAY_BUFFER",get index(){return this.pos/this.itemSize},setupViews:function(){this.ubytes=new Uint8Array(this.array),this.bytes=new Int8Array(this.array),this.ushorts=new Uint16Array(this.array),this.shorts=new Int16Array(this.array)},bind:function(t){var e=t[this.arrayType];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.array.slice(0,this.pos),t.STATIC_DRAW),this.array=null)},destroy:function(t){this.buffer&&t.deleteBuffer(this.buffer)},resize:function(){if(this.length<this.pos+this.itemSize){for(;this.length<this.pos+this.itemSize;)this.length=2*Math.round(1.5*this.length/2);this.array=new ArrayBuffer(this.length);var t=new Uint8Array(this.array);t.set(this.ubytes),this.setupViews()}}};
},{}],2:[function(require,module,exports){
"use strict";var LineVertexBuffer=require("./line_vertex_buffer"),LineElementBuffer=require("./line_element_buffer"),FillVertexBuffer=require("./fill_vertex_buffer"),FillElementBuffer=require("./triangle_element_buffer"),OutlineElementBuffer=require("./outline_elements_buffer"),GlyphVertexBuffer=require("./glyph_vertex_buffer"),GlyphElementBuffer=require("./triangle_element_buffer"),IconVertexBuffer=require("./icon_vertex_buffer"),IconElementBuffer=require("./triangle_element_buffer"),CollisionBoxVertexBuffer=require("./collision_box_vertex_buffer");module.exports=function(e){return e=e||{},{glyphVertex:new GlyphVertexBuffer(e.glyphVertex),glyphElement:new GlyphElementBuffer(e.glyphElement),iconVertex:new IconVertexBuffer(e.iconVertex),iconElement:new IconElementBuffer(e.iconElement),fillVertex:new FillVertexBuffer(e.fillVertex),fillElement:new FillElementBuffer(e.fillElement),outlineElement:new OutlineElementBuffer(e.outlineElement),lineVertex:new LineVertexBuffer(e.lineVertex),lineElement:new LineElementBuffer(e.lineElement),collisionBoxVertex:new CollisionBoxVertexBuffer(e.collisionBoxVertex)}};
},{"./collision_box_vertex_buffer":3,"./fill_vertex_buffer":4,"./glyph_vertex_buffer":5,"./icon_vertex_buffer":6,"./line_element_buffer":7,"./line_vertex_buffer":8,"./outline_elements_buffer":9,"./triangle_element_buffer":10}],3:[function(require,module,exports){
"use strict";function CollisionBoxVertexBuffer(t){Buffer.call(this,t)}var util=require("../../util/util"),Buffer=require("./buffer");module.exports=CollisionBoxVertexBuffer,CollisionBoxVertexBuffer.prototype=util.inherit(Buffer,{itemSize:12,defaultLength:32768,add:function(t,i,e,r){var s=this.pos,o=s/2,u=this.index;return this.resize(),this.shorts[o+0]=t.x,this.shorts[o+1]=t.y,this.shorts[o+2]=Math.round(i.x),this.shorts[o+3]=Math.round(i.y),this.ubytes[s+8]=Math.floor(10*e),this.ubytes[s+9]=Math.floor(10*r),this.pos+=this.itemSize,u}});
},{"../../util/util":96,"./buffer":1}],4:[function(require,module,exports){
"use strict";function FillVertexBuffer(e){Buffer.call(this,e)}var util=require("../../util/util"),Buffer=require("./buffer");module.exports=FillVertexBuffer,FillVertexBuffer.prototype=util.inherit(Buffer,{itemSize:4,add:function(e,i){var t=this.pos/2;this.resize(),this.shorts[t+0]=e,this.shorts[t+1]=i,this.pos+=this.itemSize}});
},{"../../util/util":96,"./buffer":1}],5:[function(require,module,exports){
"use strict";function GlyphVertexBuffer(t){Buffer.call(this,t)}var util=require("../../util/util"),Buffer=require("./buffer");module.exports=GlyphVertexBuffer,GlyphVertexBuffer.prototype=util.inherit(Buffer,{defaultLength:32768,itemSize:16,add:function(t,e,r,i,s,h,o,f,u){var a=this.pos,l=a/2;this.resize(),this.shorts[l+0]=t,this.shorts[l+1]=e,this.shorts[l+2]=Math.round(64*r),this.shorts[l+3]=Math.round(64*i),this.ubytes[a+8]=Math.floor(s/4),this.ubytes[a+9]=Math.floor(h/4),this.ubytes[a+10]=Math.floor(10*u),this.ubytes[a+12]=Math.floor(10*o),this.ubytes[a+13]=Math.floor(10*Math.min(f,25)),this.pos+=this.itemSize},bind:function(t,e,r){Buffer.prototype.bind.call(this,t);var i=this.itemSize;t.vertexAttribPointer(e.a_pos,2,t.SHORT,!1,i,r+0),t.vertexAttribPointer(e.a_offset,2,t.SHORT,!1,i,r+4),t.vertexAttribPointer(e.a_data1,4,t.UNSIGNED_BYTE,!1,i,r+8),t.vertexAttribPointer(e.a_data2,2,t.UNSIGNED_BYTE,!1,i,r+12)}});
},{"../../util/util":96,"./buffer":1}],6:[function(require,module,exports){
"use strict";function GlyphVertexBuffer(t){Buffer.call(this,t)}var util=require("../../util/util"),Buffer=require("./buffer");module.exports=GlyphVertexBuffer,GlyphVertexBuffer.prototype=util.inherit(Buffer,{defaultLength:32768,itemSize:16,add:function(t,e,i,r,s,h,o,u,f){var a=this.pos,n=a/2;this.resize(),this.shorts[n+0]=t,this.shorts[n+1]=e,this.shorts[n+2]=Math.round(64*i),this.shorts[n+3]=Math.round(64*r),this.ubytes[a+8]=s/4,this.ubytes[a+9]=h/4,this.ubytes[a+10]=Math.floor(10*(f||0)),this.ubytes[a+12]=Math.floor(10*(o||0)),this.ubytes[a+13]=Math.floor(10*Math.min(u||25,25)),this.pos+=this.itemSize},bind:function(t,e,i){Buffer.prototype.bind.call(this,t);var r=this.itemSize;t.vertexAttribPointer(e.a_pos,2,t.SHORT,!1,r,i+0),t.vertexAttribPointer(e.a_offset,2,t.SHORT,!1,r,i+4),t.vertexAttribPointer(e.a_data1,4,t.UNSIGNED_BYTE,!1,r,i+8),t.vertexAttribPointer(e.a_data2,2,t.UNSIGNED_BYTE,!1,r,i+12)}});
},{"../../util/util":96,"./buffer":1}],7:[function(require,module,exports){
"use strict";function LineElementBuffer(e){Buffer.call(this,e)}var util=require("../../util/util"),Buffer=require("./buffer");module.exports=LineElementBuffer,LineElementBuffer.prototype=util.inherit(Buffer,{itemSize:6,arrayType:"ELEMENT_ARRAY_BUFFER",add:function(e,t,i){var r=this.pos/2;this.resize(),this.ushorts[r+0]=e,this.ushorts[r+1]=t,this.ushorts[r+2]=i,this.pos+=this.itemSize}});
},{"../../util/util":96,"./buffer":1}],8:[function(require,module,exports){
"use strict";function LineVertexBuffer(e){Buffer.call(this,e)}var util=require("../../util/util"),Buffer=require("./buffer");module.exports=LineVertexBuffer,LineVertexBuffer.extrudeScale=63,LineVertexBuffer.prototype=util.inherit(Buffer,{itemSize:8,defaultLength:32768,add:function(e,t,r,i,s){var u=this.pos,f=u/2,h=this.index,o=LineVertexBuffer.extrudeScale;return this.resize(),this.shorts[f+0]=2*Math.floor(e.x)|r,this.shorts[f+1]=2*Math.floor(e.y)|i,this.bytes[u+4]=Math.round(o*t.x),this.bytes[u+5]=Math.round(o*t.y),this.bytes[u+6]=(s||0)/128,this.bytes[u+7]=(s||0)%128,this.pos+=this.itemSize,h}});
},{"../../util/util":96,"./buffer":1}],9:[function(require,module,exports){
"use strict";function OutlineElementsBuffer(e){Buffer.call(this,e)}var util=require("../../util/util"),Buffer=require("./buffer");module.exports=OutlineElementsBuffer,OutlineElementsBuffer.prototype=util.inherit(Buffer,{itemSize:4,arrayType:"ELEMENT_ARRAY_BUFFER",add:function(e,t){var i=this.pos/2;this.resize(),this.ushorts[i+0]=e,this.ushorts[i+1]=t,this.pos+=this.itemSize}});
},{"../../util/util":96,"./buffer":1}],10:[function(require,module,exports){
"use strict";function TriangleElementsBuffer(e){Buffer.call(this,e)}var util=require("../../util/util"),Buffer=require("./buffer");module.exports=TriangleElementsBuffer,TriangleElementsBuffer.prototype=util.inherit(Buffer,{itemSize:6,arrayType:"ELEMENT_ARRAY_BUFFER",add:function(e,t,i){var r=this.pos/2;this.resize(),this.ushorts[r+0]=e,this.ushorts[r+1]=t,this.ushorts[r+2]=i,this.pos+=this.itemSize}});
},{"../../util/util":96,"./buffer":1}],11:[function(require,module,exports){
"use strict";function createBucket(e,t,r,l,i){var o=new StyleDeclarationSet("layout",e.type,e.layout,{}).values(),u={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0},a={};for(var c in o)a[c]=o[c].calculate(r,u);var y="line"===e.type?LineBucket:"fill"===e.type?FillBucket:"symbol"===e.type?SymbolBucket:null,n=new y(t,new LayoutProperties[e.type](a),l,r,i);return n.id=e.id,n.type=e.type,n["source-layer"]=e["source-layer"],n.interactive=e.interactive,n.minZoom=e.minzoom,n.maxZoom=e.maxzoom,n.filter=featureFilter(e.filter),n.features=[],n}module.exports=createBucket;var LineBucket=require("./line_bucket"),FillBucket=require("./fill_bucket"),SymbolBucket=require("./symbol_bucket"),LayoutProperties=require("../style/layout_properties"),featureFilter=require("feature-filter"),StyleDeclarationSet=require("../style/style_declaration_set");
},{"../style/layout_properties":49,"../style/style_declaration_set":55,"./fill_bucket":14,"./line_bucket":15,"./symbol_bucket":16,"feature-filter":102}],12:[function(require,module,exports){
"use strict";function ElementGroups(e,t,n){this.vertexBuffer=e,this.elementBuffer=t,this.secondElementBuffer=n,this.groups=[]}function ElementGroup(e,t,n){this.vertexStartIndex=e,this.elementStartIndex=t,this.secondElementStartIndex=n,this.elementLength=0,this.vertexLength=0,this.secondElementLength=0}module.exports=ElementGroups,ElementGroups.prototype.makeRoomFor=function(e){(!this.current||this.current.vertexLength+e>65535)&&(this.current=new ElementGroup(this.vertexBuffer.index,this.elementBuffer&&this.elementBuffer.index,this.secondElementBuffer&&this.secondElementBuffer.index),this.groups.push(this.current))};
},{}],13:[function(require,module,exports){
"use strict";function FeatureTree(t,e){this.x=t.x,this.y=t.y,this.z=t.z-Math.log(e)/Math.LN2,this.rtree=rbush(9),this.toBeInserted=[]}function geometryContainsPoint(t,e,r,n){return"Point"===e?pointContainsPoint(t,r,n):"LineString"===e?lineContainsPoint(t,r,n):"Polygon"===e?polyContainsPoint(t,r)||lineContainsPoint(t,r,n):!1}function distToSegmentSquared(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return 0>i?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function lineContainsPoint(t,e,r){for(var n=r*r,i=0;i<t.length;i++)for(var o=t[i],s=1;s<o.length;s++){var a=o[s-1],u=o[s];if(distToSegmentSquared(e,a,u)<n)return!0}return!1}function polyContainsPoint(t,e){for(var r,n,i,o=!1,s=0;s<t.length;s++){r=t[s];for(var a=0,u=r.length-1;a<r.length;u=a++)n=r[a],i=r[u],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o)}return o}function pointContainsPoint(t,e,r){for(var n=r*r,i=0;i<t.length;i++)for(var o=t[i],s=0;s<o.length;s++)if(o[s].distSqr(e)<=n)return!0;return!1}var rbush=require("rbush"),Point=require("point-geometry"),vt=require("vector-tile"),util=require("../util/util");module.exports=FeatureTree,FeatureTree.prototype.insert=function(t,e,r){t.layers=e,t.feature=r,this.toBeInserted.push(t)},FeatureTree.prototype._load=function(){this.rtree.load(this.toBeInserted),this.toBeInserted=[]},FeatureTree.prototype.query=function(t,e){this.toBeInserted.length&&this._load();for(var r=t.params||{},n=4096*(r.radius||0)/t.scale,i=t.x,o=t.y,s=[],a=this.rtree.search([i-n,o-n,i+n,o+n]),u=0;u<a.length;u++){var l=a[u].feature,y=a[u].layers,h=vt.VectorTileFeature.types[l.type];if((!r.$type||h===r.$type)&&geometryContainsPoint(l.loadGeometry(),h,new Point(i,o),n))for(var d=l.toGeoJSON(this.x,this.y,this.z),f=0;f<y.length;f++){var p=y[f];r.layer&&p!==r.layer.id||s.push(util.extend({layer:p},d))}}e(null,s)};
},{"../util/util":96,"point-geometry":127,"rbush":128,"vector-tile":131}],14:[function(require,module,exports){
"use strict";function FillBucket(e){this.buffers=e,this.elementGroups=new ElementGroups(e.fillVertex,e.fillElement,e.outlineElement)}var ElementGroups=require("./element_groups");module.exports=FillBucket,FillBucket.prototype.addFeatures=function(){for(var e=this.features,t=0;t<e.length;t++){var l=e[t];this.addFeature(l.loadGeometry())}},FillBucket.prototype.addFeature=function(e){for(var t=0;t<e.length;t++)this.addFill(e[t])},FillBucket.prototype.addFill=function(e){if(!(e.length<3)){var t=e.length;this.elementGroups.makeRoomFor(t+1);for(var l,r,n,i=this.elementGroups.current,o=this.buffers.fillVertex,u=this.buffers.fillElement,s=this.buffers.outlineElement,d=o.index-i.vertexStartIndex,a=0;a<e.length;a++)r=o.index-i.vertexStartIndex,n=e[a],o.add(n.x,n.y),i.vertexLength++,a>=2&&(n.x!==e[0].x||n.y!==e[0].y)&&(u.add(d,l,r),i.elementLength++),a>=1&&(s.add(l,r),i.secondElementLength++),l=r}};
},{"./element_groups":12}],15:[function(require,module,exports){
"use strict";function LineBucket(e,t){this.buffers=e,this.elementGroups=new ElementGroups(e.lineVertex,e.lineElement),this.layoutProperties=t}var ElementGroups=require("./element_groups");module.exports=LineBucket,LineBucket.prototype.addFeatures=function(){for(var e=this.features,t=0;t<e.length;t++){var r=e[t];this.addFeature(r.loadGeometry())}},LineBucket.prototype.addFeature=function(e){for(var t=this.layoutProperties,r=0;r<e.length;r++)this.addLine(e[r],t["line-join"],t["line-cap"],t["line-miter-limit"],t["line-round-limit"])},LineBucket.prototype.addLine=function(e,t,r,i,s){for(var n=e.length;n>2&&e[n-1].equals(e[n-2]);)n--;if(!(e.length<2)){"bevel"===t&&(i=1.05);var u=e[0],h=e[n-1],d=u.equals(h);if(this.elementGroups.makeRoomFor(4*n),2!==n||!d){var a,l,o,p,m,f,x,v=r,b=d?"butt":r,c=1,V=0,y=!0;this.e1=this.e2=this.e3=-1,d&&(a=e[n-2],m=u.sub(a)._unit()._perp());for(var C=0;n>C;C++)if(o=d&&C===n-1?e[1]:e[C+1],!o||!e[C].equals(o)){m&&(p=m),a&&(l=a),a=e[C],l&&(V+=a.dist(l)),m=o?o.sub(a)._unit()._perp():p,p=p||m;var _=p.add(m)._unit(),L=_.x*m.x+_.y*m.y,g=1/L,k=l&&o,G=k?t:o?v:b;if(k&&"round"===G&&s>g&&(G="miter"),"miter"===G&&g>i&&(G="bevel"),"bevel"===G&&(g>2&&(G="flipbevel"),i>g&&(G="miter")),"miter"===G)_._mult(g),this.addCurrentVertex(a,c,V,_,0,0,!1);else if("flipbevel"===G){if(g>100)_=m.clone();else{var q=p.x*m.y-p.y*m.x>0?-1:1,B=g*p.add(m).mag()/p.sub(m).mag();_._perp()._mult(B*q)}this.addCurrentVertex(a,c,V,_,0,0,!1),c=-c}else if("bevel"===G){var E=p.x*m.y-p.y*m.x,F=-Math.sqrt(g*g-1);c*E>0?(x=0,f=F):(f=0,x=F),y||this.addCurrentVertex(a,c,V,p,f,x,!1),o&&this.addCurrentVertex(a,c,V,m,-f,-x,!1)}else"butt"===G?(y||this.addCurrentVertex(a,c,V,p,0,0,!1),o&&this.addCurrentVertex(a,c,V,m,0,0,!1)):"square"===G?(y||(this.addCurrentVertex(a,c,V,p,1,1,!1),this.e1=this.e2=-1,c=1),o&&this.addCurrentVertex(a,c,V,m,-1,-1,!1)):"round"===G&&(y?"round"===v&&this.addCurrentVertex(a,c,V,m,-1,-1,!0):(this.addCurrentVertex(a,c,V,p,0,0,!1),this.addCurrentVertex(a,c,V,p,1,1,!0),this.e1=this.e2=-1,c=1),o&&this.addCurrentVertex(a,c,V,m,0,0,!1));y=!1}}}},LineBucket.prototype.addCurrentVertex=function(e,t,r,i,s,n,u){var h,d=u?1:0,a=this.buffers.lineVertex,l=this.buffers.lineElement,o=this.elementGroups.current,p=this.elementGroups.current.vertexStartIndex;h=i.mult(t),s&&h._sub(i.perp()._mult(s)),this.e3=a.add(e,h,d,0,r)-p,this.e1>=0&&this.e2>=0&&(l.add(this.e1,this.e2,this.e3),o.elementLength++),this.e1=this.e2,this.e2=this.e3,h=i.mult(-t),n&&h._sub(i.perp()._mult(n)),this.e3=a.add(e,h,d,1,r)-p,this.e1>=0&&this.e2>=0&&(l.add(this.e1,this.e2,this.e3),o.elementLength++),this.e1=this.e2,this.e2=this.e3,o.vertexLength+=2};
},{"./element_groups":12}],16:[function(require,module,exports){
"use strict";function SymbolBucket(e,t,o,i,n){this.buffers=e,this.layoutProperties=t,this.overscaling=o,this.zoom=i,this.collisionDebug=n;var s=512*o,a=4096;this.tilePixelRatio=a/s,this.symbolInstances=[]}function SymbolInstance(e,t,o,i,n,s,a,l,r,c,h,u){this.x=e.x,this.y=e.y,this.hasText=!!o,this.hasIcon=!!i,this.hasText&&(this.glyphQuads=s?getGlyphQuads(e,o,a,t,n,r):[],this.textCollisionFeature=new CollisionFeature(t,e,o,a,l,r)),this.hasIcon&&(this.iconQuads=s?getIconQuads(e,i,c,t,n,u):[],this.iconCollisionFeature=new CollisionFeature(t,e,i,c,h,u))}var ElementGroups=require("./element_groups"),Anchor=require("../symbol/anchor"),getAnchors=require("../symbol/get_anchors"),resolveTokens=require("../util/token"),Quads=require("../symbol/quads"),Shaping=require("../symbol/shaping"),resolveText=require("../symbol/resolve_text"),resolveIcons=require("../symbol/resolve_icons"),mergeLines=require("../symbol/mergelines"),shapeText=Shaping.shapeText,shapeIcon=Shaping.shapeIcon,getGlyphQuads=Quads.getGlyphQuads,getIconQuads=Quads.getIconQuads,clipLine=require("../symbol/clip_line"),Point=require("point-geometry"),CollisionFeature=require("../symbol/collision_feature");module.exports=SymbolBucket,SymbolBucket.prototype.needsPlacement=!0,SymbolBucket.prototype.addFeatures=function(e){var t=this.layoutProperties,o=this.features,i=this.textFeatures,n=.5,s=.5;switch(t["text-anchor"]){case"right":case"top-right":case"bottom-right":n=1;break;case"left":case"top-left":case"bottom-left":n=0}switch(t["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":s=1;break;case"top":case"top-right":case"top-left":s=0}for(var a="right"===t["text-justify"]?1:"left"===t["text-justify"]?0:.5,l=24,r=t["text-line-height"]*l,c="line"!==t["symbol-placement"]?t["text-max-width"]*l:0,h=t["text-letter-spacing"]*l,u=[t["text-offset"][0]*l,t["text-offset"][1]*l],m=t["text-font"],p=[],x=0;x<o.length;x++)p.push(o[x].loadGeometry());if("line"===t["symbol-placement"]){var y=mergeLines(o,i,p);p=y.geometries,o=y.features,i=y.textFeatures}for(var d,g,f=0;f<o.length;f++)if(p[f]){if(d=i[f]?shapeText(i[f],this.stacks[m],c,r,n,s,a,h,u):null,t["icon-image"]){var b=resolveTokens(o[f].properties,t["icon-image"]),v=this.icons[b];g=shapeIcon(v,t),v&&(void 0===this.sdfIcons?this.sdfIcons=v.sdf:this.sdfIcons!==v.sdf&&console.warn("Style sheet warning: Cannot mix SDF and non-SDF icons in one bucket"))}else g=null;(d||g)&&this.addFeature(p[f],d,g)}this.placeFeatures(e,this.buffers,this.collisionDebug)},SymbolBucket.prototype.addFeature=function(e,t,o){var i=this.layoutProperties,n=24,s=i["text-max-size"]/n,a=this.tilePixelRatio*s,l=this.tilePixelRatio*i["icon-max-size"],r=this.tilePixelRatio*i["symbol-min-distance"],c=i["symbol-avoid-edges"],h=i["text-padding"]*this.tilePixelRatio,u=i["icon-padding"]*this.tilePixelRatio,m=i["text-max-angle"]/180*Math.PI,p="map"===i["text-rotation-alignment"]&&"line"===i["symbol-placement"],x="map"===i["icon-rotation-alignment"]&&"line"===i["symbol-placement"],y=i["text-allow-overlap"]||i["icon-allow-overlap"]||i["text-ignore-placement"]||i["icon-ignore-placement"];"line"===i["symbol-placement"]&&(e=clipLine(e,0,0,4096,4096));for(var d=0;d<e.length;d++)for(var g=e[d],f="line"===i["symbol-placement"]?getAnchors(g,r,m,t,n,a,this.overscaling):[new Anchor(g[0].x,g[0].y,0)],b=0,v=f.length;v>b;b++){var I=f[b],S=!(I.x<0||I.x>4096||I.y<0||I.y>4096);if(!c||S){var F=S||y;this.symbolInstances.push(new SymbolInstance(I,g,t,o,i,F,a,h,p,l,u,x))}}},SymbolBucket.prototype.placeFeatures=function(e,t,o){this.buffers=t;var i=this.elementGroups={text:new ElementGroups(t.glyphVertex,t.glyphElement),icon:new ElementGroups(t.iconVertex,t.iconElement),sdfIcons:this.sdfIcons},n=this.layoutProperties,s=e.maxScale,a="map"===n["text-rotation-alignment"]&&"line"===n["symbol-placement"],l="map"===n["icon-rotation-alignment"]&&"line"===n["symbol-placement"],r=n["text-allow-overlap"]||n["icon-allow-overlap"]||n["text-ignore-placement"]||n["icon-ignore-placement"];if(r){var c=e.angle,h=Math.sin(c),u=Math.cos(c);this.symbolInstances.sort(function(e,t){var o=h*e.x+u*e.y,i=h*t.x+u*t.y;return i-o})}for(var m=0;m<this.symbolInstances.length;m++){var p=this.symbolInstances[m],x=p.hasText,y=p.hasIcon,d=n["text-optional"]||!x,g=n["icon-optional"]||!y,f=x&&!n["text-allow-overlap"]?e.placeCollisionFeature(p.textCollisionFeature):e.minScale,b=y&&!n["icon-allow-overlap"]?e.placeCollisionFeature(p.iconCollisionFeature):e.minScale;d||g?!g&&f?f=Math.max(b,f):!d&&b&&(b=Math.max(b,f)):b=f=Math.max(b,f),x&&(n["text-ignore-placement"]||e.insertCollisionFeature(p.textCollisionFeature,f),s>=f&&this.addSymbols(t.glyphVertex,t.glyphElement,i.text,p.glyphQuads,f,n["text-keep-upright"],a,e.angle)),y&&(n["icon-ignore-placement"]||e.insertCollisionFeature(p.iconCollisionFeature,b),s>=b&&this.addSymbols(t.iconVertex,t.iconElement,i.icon,p.iconQuads,b,n["icon-keep-upright"],l,e.angle))}o&&this.addToDebugBuffers(e)},SymbolBucket.prototype.addSymbols=function(e,t,o,i,n,s,a,l){o.makeRoomFor(4*i.length);for(var r=o.current,c=this.zoom,h=Math.max(Math.log(n)/Math.LN2+c,0),u=0;u<i.length;u++){var m=i[u],p=m.angle,x=(p+l+Math.PI)%(2*Math.PI);if(!(s&&a&&(x<=Math.PI/2||x>3*Math.PI/2))){var y=m.tl,d=m.tr,g=m.bl,f=m.br,b=m.tex,v=m.anchorPoint,I=Math.max(c+Math.log(m.minScale)/Math.LN2,h),S=Math.min(c+Math.log(m.maxScale)/Math.LN2,25);if(!(I>=S)){I===h&&(I=0);var F=e.index-r.vertexStartIndex;e.add(v.x,v.y,y.x,y.y,b.x,b.y,I,S,h),e.add(v.x,v.y,d.x,d.y,b.x+b.w,b.y,I,S,h),e.add(v.x,v.y,g.x,g.y,b.x,b.y+b.h,I,S,h),e.add(v.x,v.y,f.x,f.y,b.x+b.w,b.y+b.h,I,S,h),r.vertexLength+=4,t.add(F,F+1,F+2),t.add(F+1,F+2,F+3),r.elementLength+=2}}}},SymbolBucket.prototype.getDependencies=function(e,t,o){function i(e){return e||n?o(e):void(n=!0)}var n=!1;this.getTextDependencies(e,t,i),this.getIconDependencies(e,t,i)},SymbolBucket.prototype.getIconDependencies=function(e,t,o){function i(e,t){return e?o(e):(this.icons=t,void o())}if(this.layoutProperties["icon-image"]){var n=this.features,s=resolveIcons(n,this.layoutProperties);s.length?t.send("get icons",{icons:s},i.bind(this)):o()}else o()},SymbolBucket.prototype.getTextDependencies=function(e,t,o){var i=this.features,n=this.layoutProperties["text-font"],s=this.stacks=e.stacks;void 0===s[n]&&(s[n]={});var a=s[n],l=resolveText(i,this.layoutProperties,a);this.textFeatures=l.textFeatures,t.send("get glyphs",{uid:e.uid,fontstack:n,codepoints:l.codepoints},function(e,t){if(e)return o(e);for(var i in t)a[i]=t[i];o()})},SymbolBucket.prototype.addToDebugBuffers=function(e){this.elementGroups.collisionBox=new ElementGroups(this.buffers.collisionBoxVertex),this.elementGroups.collisionBox.makeRoomFor(0);for(var t=this.buffers.collisionBoxVertex,o=-e.angle,i=e.yStretch,n=0;n<this.symbolInstances.length;n++)for(var s=0;2>s;s++){var a=this.symbolInstances[n][0===s?"textCollisionFeature":"iconCollisionFeature"];if(a)for(var l=a.boxes,r=0;r<l.length;r++){var c=l[r],h=c.anchorPoint,u=new Point(c.x1,c.y1*i)._rotate(o),m=new Point(c.x2,c.y1*i)._rotate(o),p=new Point(c.x1,c.y2*i)._rotate(o),x=new Point(c.x2,c.y2*i)._rotate(o),y=Math.max(0,Math.min(25,this.zoom+Math.log(c.maxScale)/Math.LN2)),d=Math.max(0,Math.min(25,this.zoom+Math.log(c.placementScale)/Math.LN2));t.add(h,u,y,d),t.add(h,m,y,d),t.add(h,m,y,d),t.add(h,x,y,d),t.add(h,x,y,d),t.add(h,p,y,d),t.add(h,p,y,d),t.add(h,u,y,d),this.elementGroups.collisionBox.current.vertexLength+=8}}};
},{"../symbol/anchor":58,"../symbol/clip_line":61,"../symbol/collision_feature":63,"../symbol/get_anchors":65,"../symbol/mergelines":68,"../symbol/quads":69,"../symbol/resolve_icons":70,"../symbol/resolve_text":71,"../symbol/shaping":72,"../util/token":95,"./element_groups":12,"point-geometry":127}],17:[function(require,module,exports){
"use strict";function Coordinate(o,t,n){this.column=o,this.row=t,this.zoom=n}module.exports=Coordinate,Coordinate.prototype={clone:function(){return new Coordinate(this.column,this.row,this.zoom)},zoomTo:function(o){return this.clone()._zoomTo(o)},sub:function(o){return this.clone()._sub(o)},_zoomTo:function(o){var t=Math.pow(2,o-this.zoom);return this.column*=t,this.row*=t,this.zoom=o,this},_sub:function(o){return o=o.zoomTo(this.zoom),this.column-=o.column,this.row-=o.row,this}};
},{}],18:[function(require,module,exports){
"use strict";function LatLng(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid LatLng object: ("+t+", "+n+")");this.lat=+t,this.lng=+n}module.exports=LatLng;var wrap=require("../util/util").wrap;LatLng.prototype.wrap=function(){return new LatLng(this.lat,wrap(this.lng,-180,180))},LatLng.convert=function(t){return t instanceof LatLng?t:Array.isArray(t)?new LatLng(t[0],t[1]):t};
},{"../util/util":96}],19:[function(require,module,exports){
"use strict";function LatLngBounds(t,n){if(t)for(var e=n?[t,n]:t,s=0,i=e.length;i>s;s++)this.extend(e[s])}module.exports=LatLngBounds;var LatLng=require("./lat_lng");LatLngBounds.prototype={extend:function(t){var n,e,s=this._sw,i=this._ne;if(t instanceof LatLng)n=t,e=t;else{if(!(t instanceof LatLngBounds))return t?this.extend(LatLng.convert(t)||LatLngBounds.convert(t)):this;if(n=t._sw,e=t._ne,!n||!e)return this}return s||i?(s.lat=Math.min(n.lat,s.lat),s.lng=Math.min(n.lng,s.lng),i.lat=Math.max(e.lat,i.lat),i.lng=Math.max(e.lng,i.lng)):(this._sw=new LatLng(n.lat,n.lng),this._ne=new LatLng(e.lat,e.lng)),this},getCenter:function(){return new LatLng((this._sw.lat+this._ne.lat)/2,(this._sw.lng+this._ne.lng)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat}},LatLngBounds.convert=function(t){return!t||t instanceof LatLngBounds?t:new LatLngBounds(t)};
},{"./lat_lng":18}],20:[function(require,module,exports){
"use strict";function Transform(t,i){this.tileSize=512,this._minZoom=t||0,this._maxZoom=i||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this.zoom=0,this.center=new LatLng(0,0),this.angle=0,this._altitude=1.5,this._pitch=0}var LatLng=require("./lat_lng"),Point=require("point-geometry"),Coordinate=require("./coordinate"),wrap=require("../util/util").wrap,interp=require("../util/interpolate"),vec4=require("gl-matrix").vec4,mat4=require("gl-matrix").mat4;module.exports=Transform,Transform.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom=t,this.zoom=Math.max(this.zoom,t)},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom=t,this.zoom=Math.min(this.zoom,t)},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new Point(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){this.angle=-wrap(t,-180,180)*Math.PI/180},get pitch(){return this._pitch/Math.PI*180},set pitch(t){this._pitch=Math.min(60,t)/180*Math.PI},get altitude(){return this._altitude},set altitude(t){this._altitude=Math.max(.75,t)},get zoom(){return this._zoom},set zoom(t){t=Math.min(Math.max(t,this.minZoom),this.maxZoom),this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain()},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,i){return new Point(this.lngX(t.lng,i),this.latY(t.lat,i))},unproject:function(t,i){return new LatLng(this.yLat(t.y,i),this.xLng(t.x,i))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new Point(this.x,this.y)},lngX:function(t,i){return(180+t)*(i||this.worldSize)/360},latY:function(t,i){var n=180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360));return(180-n)*(i||this.worldSize)/360},xLng:function(t,i){return 360*t/(i||this.worldSize)-180},yLat:function(t,i){var n=180-360*t/(i||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90},panBy:function(t){var i=this.centerPoint._add(t);this.center=this.pointLocation(i),this._constrain()},setLocationAtPoint:function(t,i){var n=this.locationCoordinate(t),o=this.pointCoordinate(i),e=this.pointCoordinate(this.centerPoint),a=o._sub(n);this.center=this.coordinateLocation(e._sub(a)),this._constrain()},setZoomAround:function(t,i){var n;i&&(n=this.locationPoint(i)),this.zoom=t,i&&this.setLocationAtPoint(i,n)},setBearingAround:function(t,i){var n;i&&(n=this.locationPoint(i)),this.bearing=t,i&&this.setLocationAtPoint(i,n)},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var i=this.zoomScale(this.tileZoom)/this.worldSize;return new Coordinate(this.lngX(t.lng)*i,this.latY(t.lat)*i,this.tileZoom)},coordinateLocation:function(t){var i=this.zoomScale(t.zoom);return new LatLng(this.yLat(t.row,i),this.xLng(t.column,i))},pointCoordinate:function(t,i){void 0===i&&(i=0);var n=this.coordinatePointMatrix(this.tileZoom),o=mat4.invert(new Float64Array(16),n);if(!o)throw"failed to invert matrix";var e=vec4.transformMat4([],[t.x,t.y,0,1],o),a=vec4.transformMat4([],[t.x,t.y,1,1],o),r=e[3],h=a[3],s=e[0]/r,c=a[0]/h,u=e[1]/r,l=a[1]/h,m=e[2]/r,g=a[2]/h,f=m===g?0:(i-m)/(g-m);return new Coordinate(interp(s,c,f),interp(u,l,f),this.tileZoom)},coordinatePoint:function(t){var i=this.coordinatePointMatrix(t.zoom),n=vec4.transformMat4([],[t.column,t.row,0,1],i);return new Point(n[0]/n[3],n[1]/n[3])},coordinatePointMatrix:function(t){var i=this.getProjMatrix(),n=this.worldSize/this.zoomScale(t);return mat4.scale(i,i,[n,n,1]),mat4.multiply(i,this.getPixelMatrix(),i),i},getPixelMatrix:function(){var t=mat4.create();return mat4.scale(t,t,[this.width/2,-this.height/2,1]),mat4.translate(t,t,[1,-1,0]),t},_constrain:function(){if(this.center){var t,i,n,o,e,a,r,h,s=this.size;this.latRange&&(t=this.latY(this.latRange[1]),i=this.latY(this.latRange[0]),e=i-t<s.y?s.y/(i-t):0),this.lngRange&&(n=this.lngX(this.lngRange[0]),o=this.lngX(this.lngRange[1]),a=o-n<s.x?s.x/(o-n):0);var c=Math.max(a||0,e||0);if(c)return this.center=this.unproject(new Point(a?(o+n)/2:this.x,e?(i+t)/2:this.y)),void(this.zoom+=this.scaleZoom(c));if(this.latRange){var u=this.y,l=s.y/2;t>u-l&&(h=t+l),u+l>i&&(h=i-l)}if(this.lngRange){var m=this.x,g=s.x/2;n>m-g&&(r=n+g),m+g>o&&(r=o-g)}(void 0!==r||void 0!==h)&&(this.center=this.unproject(new Point(void 0!==r?r:this.x,void 0!==h?h:this.y)))}},getProjMatrix:function(){var t=new Float64Array(16),i=Math.atan(.5/this.altitude),n=Math.sin(i)*this.altitude/Math.sin(Math.PI/2-this._pitch-i),o=Math.cos(Math.PI/2-this._pitch)*n+this.altitude;return mat4.perspective(t,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,o),mat4.translate(t,t,[0,0,-this.altitude]),mat4.scale(t,t,[1,-1,1/this.height]),mat4.rotateX(t,t,this._pitch),mat4.rotateZ(t,t,this.angle),mat4.translate(t,t,[-this.x,-this.y,0]),t}};
},{"../util/interpolate":92,"../util/util":96,"./coordinate":17,"./lat_lng":18,"gl-matrix":109,"point-geometry":127}],21:[function(require,module,exports){
"use strict";var simplexFont={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};module.exports=function(l,n,t,e){e=e||1;var r,o,u,s,i,x,f,p,h=[];for(r=0,o=l.length;o>r;r++)if(i=simplexFont[l[r]]){for(p=null,u=0,s=i[1].length;s>u;u+=2)-1===i[1][u]&&-1===i[1][u+1]?p=null:(x=n+i[1][u]*e,f=t-i[1][u+1]*e,p&&h.push(p.x,p.y,x,f),p={x:x,y:f});n+=i[0]*e}return h};
},{}],22:[function(require,module,exports){
"use strict";var mapboxgl=module.exports={};mapboxgl.Map=require("./ui/map"),mapboxgl.Navigation=require("./ui/control/navigation"),mapboxgl.Attribution=require("./ui/control/attribution"),mapboxgl.Popup=require("./ui/popup"),mapboxgl.GeoJSONSource=require("./source/geojson_source"),mapboxgl.VideoSource=require("./source/video_source"),mapboxgl.Style=require("./style/style"),mapboxgl.LatLng=require("./geo/lat_lng"),mapboxgl.LatLngBounds=require("./geo/lat_lng_bounds"),mapboxgl.Point=require("point-geometry"),mapboxgl.Evented=require("./util/evented"),mapboxgl.util=require("./util/util"),mapboxgl.supported=require("./util/browser").supported;var ajax=require("./util/ajax");mapboxgl.util.getJSON=ajax.getJSON,mapboxgl.util.getArrayBuffer=ajax.getArrayBuffer;var config=require("./util/config");mapboxgl.config=config,Object.defineProperty(mapboxgl,"accessToken",{get:function(){return config.ACCESS_TOKEN},set:function(e){config.ACCESS_TOKEN=e}});
},{"./geo/lat_lng":18,"./geo/lat_lng_bounds":19,"./source/geojson_source":36,"./source/video_source":44,"./style/style":52,"./ui/control/attribution":75,"./ui/control/navigation":77,"./ui/map":81,"./ui/popup":82,"./util/ajax":84,"./util/browser":85,"./util/config":89,"./util/evented":90,"./util/util":96,"point-geometry":127}],23:[function(require,module,exports){
"use strict";function drawBackground(t,a,r){var e,i=t.gl,o=a.paint["background-color"],n=a.paint["background-image"],l=a.paint["background-opacity"],u=n?t.spriteAtlas.getPosition(n.from,!0):null,c=n?t.spriteAtlas.getPosition(n.to,!0):null;if(u&&c){e=t.patternShader,i.switchShader(e,r),i.uniform1i(e.u_image,0),i.uniform2fv(e.u_pattern_tl_a,u.tl),i.uniform2fv(e.u_pattern_br_a,u.br),i.uniform2fv(e.u_pattern_tl_b,c.tl),i.uniform2fv(e.u_pattern_br_b,c.br),i.uniform1f(e.u_opacity,l);var m=t.transform,f=u.size,s=c.size,_=m.locationCoordinate(m.center),d=1/Math.pow(2,m.zoomFraction);i.uniform1f(e.u_mix,n.t);var S=mat3.create();mat3.scale(S,S,[1/(f[0]*n.fromScale),1/(f[1]*n.fromScale)]),mat3.translate(S,S,[_.column*m.tileSize%(f[0]*n.fromScale),_.row*m.tileSize%(f[1]*n.fromScale)]),mat3.rotate(S,S,-m.angle),mat3.scale(S,S,[d*m.width/2,-d*m.height/2]);var b=mat3.create();mat3.scale(b,b,[1/(s[0]*n.toScale),1/(s[1]*n.toScale)]),mat3.translate(b,b,[_.column*m.tileSize%(s[0]*n.toScale),_.row*m.tileSize%(s[1]*n.toScale)]),mat3.rotate(b,b,-m.angle),mat3.scale(b,b,[d*m.width/2,-d*m.height/2]),i.uniformMatrix3fv(e.u_patternmatrix_a,!1,S),i.uniformMatrix3fv(e.u_patternmatrix_b,!1,b),t.spriteAtlas.bind(i,!0)}else e=t.fillShader,i.switchShader(e,r),i.disableVertexAttribArray(e.a_color),i.vertexAttrib4fv(e.a_color,o);i.disable(i.STENCIL_TEST),i.bindBuffer(i.ARRAY_BUFFER,t.backgroundBuffer),i.vertexAttribPointer(e.a_pos,t.backgroundBuffer.itemSize,i.SHORT,!1,0,0),i.drawArrays(i.TRIANGLE_STRIP,0,t.backgroundBuffer.itemCount),i.enable(i.STENCIL_TEST),i.stencilMask(0),i.stencilFunc(i.EQUAL,128,128)}var mat3=require("gl-matrix").mat3;module.exports=drawBackground;
},{"gl-matrix":109}],24:[function(require,module,exports){
"use strict";function drawPlacementDebug(r,e,o,t){var a=t.elementGroups[e.ref||e.id].collisionBox;if(a){var i=r.gl,n=t.buffers.collisionBoxVertex,s=r.collisionBoxShader;i.enable(i.STENCIL_TEST),i.switchShader(s,o),n.bind(i,s),i.lineWidth(1);var u=12;i.vertexAttribPointer(s.a_pos,2,i.SHORT,!1,u,0),i.vertexAttribPointer(s.a_extrude,2,i.SHORT,!1,u,4),i.vertexAttribPointer(s.a_data,2,i.UNSIGNED_BYTE,!1,u,8),i.uniform1f(s.u_scale,Math.pow(2,r.transform.zoom-t.coord.z)),i.uniform1f(s.u_zoom,10*r.transform.zoom),i.uniform1f(s.u_maxzoom,10*(t.coord.z+1));var d=a.groups[0].vertexStartIndex,l=a.groups[0].vertexLength;i.drawArrays(i.LINES,d,l),i.disable(i.STENCIL_TEST)}}module.exports=drawPlacementDebug;
},{}],25:[function(require,module,exports){
"use strict";function drawDebug(e,r){var t=e.gl;t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.switchShader(e.debugShader,r.posMatrix),t.bindBuffer(t.ARRAY_BUFFER,e.debugBuffer),t.vertexAttribPointer(e.debugShader.a_pos,e.debugBuffer.itemSize,t.SHORT,!1,0,0),t.uniform4f(e.debugShader.u_color,1,0,0,1),t.lineWidth(4),t.drawArrays(t.LINE_STRIP,0,e.debugBuffer.itemCount);var i=textVertices(r.coord.toString(),50,200,5);t.bindBuffer(t.ARRAY_BUFFER,e.debugTextBuffer),t.bufferData(t.ARRAY_BUFFER,new Int16Array(i),t.STREAM_DRAW),t.vertexAttribPointer(e.debugShader.a_pos,e.debugTextBuffer.itemSize,t.SHORT,!1,0,0),t.lineWidth(8*browser.devicePixelRatio),t.uniform4f(e.debugShader.u_color,1,1,1,1),t.drawArrays(t.LINES,0,i.length/e.debugTextBuffer.itemSize),t.lineWidth(2*browser.devicePixelRatio),t.uniform4f(e.debugShader.u_color,0,0,0,1),t.drawArrays(t.LINES,0,i.length/e.debugTextBuffer.itemSize),t.blendFunc(t.ONE_MINUS_DST_ALPHA,t.ONE)}var textVertices=require("../lib/debugtext"),browser=require("../util/browser");module.exports=drawDebug;
},{"../lib/debugtext":21,"../util/browser":85}],26:[function(require,module,exports){
"use strict";function drawFill(e,t,r,i){if(i.buffers){var a=i.elementGroups[t.ref||t.id];if(a){var l,n,o,f,s=e.gl,u=e.translateMatrix(r,i,t.paint["fill-translate"],t.paint["fill-translate-anchor"]),c=t.paint["fill-color"];s.stencilMask(63),s.clear(s.STENCIL_BUFFER_BIT),s.stencilFunc(s.NOTEQUAL,128,128),s.stencilOpSeparate(s.FRONT,s.INCR_WRAP,s.KEEP,s.KEEP),s.stencilOpSeparate(s.BACK,s.DECR_WRAP,s.KEEP,s.KEEP),s.colorMask(!1,!1,!1,!1),s.switchShader(e.fillShader,u),l=i.buffers.fillVertex,l.bind(s),n=i.buffers.fillElement,n.bind(s);var m,d;s.disableVertexAttribArray(e.fillShader.a_color);for(var S=0;S<a.groups.length;S++)o=a.groups[S],m=o.vertexStartIndex*l.itemSize,s.vertexAttribPointer(e.fillShader.a_pos,2,s.SHORT,!1,4,m+0),f=3*o.elementLength,d=o.elementStartIndex*n.itemSize,s.drawElements(s.TRIANGLES,f,s.UNSIGNED_SHORT,d);s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.stencilMask(0);var E=t.paint["fill-outline-color"];if(t.paint["fill-antialias"]===!0&&(!t.paint["fill-image"]||E)){s.switchShader(e.outlineShader,u),s.lineWidth(2*browser.devicePixelRatio),E?s.stencilFunc(s.EQUAL,128,128):s.stencilFunc(s.EQUAL,128,191),s.uniform2f(e.outlineShader.u_world,s.drawingBufferWidth,s.drawingBufferHeight),l=i.buffers.fillVertex,n=i.buffers.outlineElement,n.bind(s),s.disableVertexAttribArray(e.outlineShader.a_color),s.vertexAttrib4fv(e.outlineShader.a_color,E?E:c);for(var _=0;_<a.groups.length;_++)o=a.groups[_],m=o.vertexStartIndex*l.itemSize,s.vertexAttribPointer(e.outlineShader.a_pos,2,s.SHORT,!1,4,m+0),f=2*o.secondElementLength,d=o.secondElementStartIndex*n.itemSize,s.drawElements(s.LINES,f,s.UNSIGNED_SHORT,d)}var p,b=t.paint["fill-image"],x=t.paint["fill-opacity"]||1;if(b){var h=e.spriteAtlas.getPosition(b.from,!0),v=e.spriteAtlas.getPosition(b.to,!0);if(!h||!v)return;p=e.patternShader,s.switchShader(p,r),s.uniform1i(p.u_image,0),s.uniform2fv(p.u_pattern_tl_a,h.tl),s.uniform2fv(p.u_pattern_br_a,h.br),s.uniform2fv(p.u_pattern_tl_b,v.tl),s.uniform2fv(p.u_pattern_br_b,v.br),s.uniform1f(p.u_opacity,x),s.uniform1f(p.u_mix,b.t);var A=i.tileExtent/i.tileSize/Math.pow(2,e.transform.tileZoom-i.coord.z),g=mat3.create();mat3.scale(g,g,[1/(h.size[0]*A*b.fromScale),1/(h.size[1]*A*b.fromScale)]);var R=mat3.create();mat3.scale(R,R,[1/(v.size[0]*A*b.toScale),1/(v.size[1]*A*b.toScale)]),s.uniformMatrix3fv(p.u_patternmatrix_a,!1,g),s.uniformMatrix3fv(p.u_patternmatrix_b,!1,R),e.spriteAtlas.bind(s,!0)}else p=e.fillShader,s.switchShader(p,r),s.disableVertexAttribArray(p.a_color),s.vertexAttrib4fv(p.a_color,c);s.stencilFunc(s.NOTEQUAL,0,63),s.bindBuffer(s.ARRAY_BUFFER,e.tileExtentBuffer),s.vertexAttribPointer(p.a_pos,e.tileExtentBuffer.itemSize,s.SHORT,!1,0,0),s.drawArrays(s.TRIANGLE_STRIP,0,e.tileExtentBuffer.itemCount),s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}}}var browser=require("../util/browser"),mat3=require("gl-matrix").mat3;module.exports=drawFill;
},{"../util/browser":85,"gl-matrix":109}],27:[function(require,module,exports){
"use strict";var browser=require("../util/browser"),mat2=require("gl-matrix").mat2;module.exports=function(t,e,i,r){if(r.buffers){var a=r.elementGroups[e.ref||e.id];if(a){var n=t.gl;if(!(e.paint["line-width"]<=0)){var l=1/browser.devicePixelRatio,o=e.paint["line-blur"]+l,f=e.paint["line-width"]/2,s=-1,u=0,m=0;e.paint["line-gap-width"]>0&&(s=e.paint["line-gap-width"]/2+.5*l,f=e.paint["line-width"],u=s-l/2);var _=u+f+l/2+m,h=e.paint["line-color"],d=t.transform.scale/(1<<r.coord.z)/(r.tileExtent/r.tileSize),p=t.translateMatrix(i,r,e.paint["line-translate"],e.paint["line-translate-anchor"]),b=t.transform,c=mat2.create();mat2.scale(c,c,[1,Math.cos(b._pitch)]),mat2.rotate(c,c,t.transform.angle);var v,x=Math.sqrt(b.height*b.height/4*(1+b.altitude*b.altitude)),w=b.height/2*Math.tan(b._pitch),S=(x+w)/x-1,g=r.tileSize/t.transform.tileSize,A=e.paint["line-dasharray"],z=e.paint["line-image"];if(A){v=t.linesdfpatternShader,n.switchShader(v,p,r.exMatrix),n.uniform1f(v.u_ratio,d);var y=t.lineAtlas.getDash(A.from,"round"===e.layout["line-cap"]),M=t.lineAtlas.getDash(A.to,"round"===e.layout["line-cap"]);t.lineAtlas.bind(n);var E=Math.pow(2,Math.floor(Math.log(t.transform.scale)/Math.LN2)-r.coord.z)/8*g,P=[E/y.width/A.fromScale,-y.height/2],R=t.lineAtlas.width/(A.fromScale*y.width*256*browser.devicePixelRatio)/2,V=[E/M.width/A.toScale,-M.height/2],I=t.lineAtlas.width/(A.toScale*M.width*256*browser.devicePixelRatio)/2;n.uniform2fv(v.u_patternscale_a,P),n.uniform1f(v.u_tex_y_a,y.y),n.uniform2fv(v.u_patternscale_b,V),n.uniform1f(v.u_tex_y_b,M.y),n.uniform1i(v.u_image,0),n.uniform1f(v.u_sdfgamma,Math.max(R,I)),n.uniform1f(v.u_mix,A.t)}else if(z){var N=t.spriteAtlas.getPosition(z.from,!0),T=t.spriteAtlas.getPosition(z.to,!0);if(!N||!T)return;var q=r.tileExtent/r.tileSize/Math.pow(2,t.transform.tileZoom-r.coord.z)*g;t.spriteAtlas.bind(n,!0),v=t.linepatternShader,n.switchShader(v,p,r.exMatrix),n.uniform1f(v.u_ratio,d),n.uniform2fv(v.u_pattern_size_a,[N.size[0]*q*z.fromScale,T.size[1]]),n.uniform2fv(v.u_pattern_size_b,[T.size[0]*q*z.toScale,T.size[1]]),n.uniform2fv(v.u_pattern_tl_a,N.tl),n.uniform2fv(v.u_pattern_br_a,N.br),n.uniform2fv(v.u_pattern_tl_b,T.tl),n.uniform2fv(v.u_pattern_br_b,T.br),n.uniform1f(v.u_fade,z.t),n.disableVertexAttribArray(v.a_opacity),n.vertexAttrib1f(v.a_opacity,e.paint["line-opacity"])}else v=t.lineShader,n.switchShader(v,p,r.exMatrix),n.uniform1f(v.u_ratio,d),n.uniform1f(v.u_extra,S),n.uniformMatrix2fv(v.u_antialiasingmatrix,!1,c);void 0!==v.a_color&&(n.disableVertexAttribArray(v.a_color),n.vertexAttrib4fv(v.a_color,h)),n.disableVertexAttribArray(v.a_linewidth),n.vertexAttrib2f(v.a_linewidth,_,s),n.disableVertexAttribArray(v.a_blur),n.vertexAttrib1f(v.a_blur,o);var D=r.buffers.lineVertex;D.bind(n);var G=r.buffers.lineElement;G.bind(n);for(var L=0;L<a.groups.length;L++){var H=a.groups[L],O=H.vertexStartIndex*D.itemSize;n.vertexAttribPointer(v.a_pos,2,n.SHORT,!1,8,O+0),n.vertexAttribPointer(v.a_data,4,n.BYTE,!1,8,O+4);var B=3*H.elementLength,U=H.elementStartIndex*G.itemSize;n.drawElements(n.TRIANGLES,B,n.UNSIGNED_SHORT,U)}}}}};
},{"../util/browser":85,"gl-matrix":109}],28:[function(require,module,exports){
"use strict";function drawRaster(t,r,e,a){var i=t.gl;i.disable(i.STENCIL_TEST);var o=t.rasterShader;i.switchShader(o,e),i.uniform1f(o.u_brightness_low,r.paint["raster-brightness-min"]),i.uniform1f(o.u_brightness_high,r.paint["raster-brightness-max"]),i.uniform1f(o.u_saturation_factor,saturationFactor(r.paint["raster-saturation"])),i.uniform1f(o.u_contrast_factor,contrastFactor(r.paint["raster-contrast"])),i.uniform3fv(o.u_spin_weights,spinWeights(r.paint["raster-hue-rotate"]));var n,u,s=a.source&&a.source._pyramid.findLoadedParent(a.coord,0,{}),c=getOpaci