diff --git a/assets/images/icons-000000@2x.png b/assets/images/icons-000000@2x.png deleted file mode 100644 index 67d8d22..0000000 Binary files a/assets/images/icons-000000@2x.png and /dev/null differ diff --git a/assets/images/icons-ffffff@2x.png b/assets/images/icons-ffffff@2x.png deleted file mode 100644 index e0267bf..0000000 Binary files a/assets/images/icons-ffffff@2x.png and /dev/null differ diff --git a/assets/images/icons.svg b/assets/images/icons.svg deleted file mode 100644 index c72632e..0000000 --- a/assets/images/icons.svg +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/layers-2x.png b/assets/images/layers-2x.png deleted file mode 100644 index a2cf7f9..0000000 Binary files a/assets/images/layers-2x.png and /dev/null differ diff --git a/assets/images/layers.png b/assets/images/layers.png deleted file mode 100644 index bca0a0e..0000000 Binary files a/assets/images/layers.png and /dev/null differ diff --git a/assets/images/marker-icon-2x.png b/assets/images/marker-icon-2x.png deleted file mode 100644 index 0015b64..0000000 Binary files a/assets/images/marker-icon-2x.png and /dev/null differ diff --git a/assets/images/marker-icon.png b/assets/images/marker-icon.png deleted file mode 100644 index e2e9f75..0000000 Binary files a/assets/images/marker-icon.png and /dev/null differ diff --git a/assets/images/marker-shadow.png b/assets/images/marker-shadow.png deleted file mode 100644 index d1e773c..0000000 Binary files a/assets/images/marker-shadow.png and /dev/null differ diff --git a/assets/images/render.sh b/assets/images/render.sh deleted file mode 100644 index 3e9b7fa..0000000 --- a/assets/images/render.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e -u - -# Color variations to be generated -COLORS="000000 ffffff" - -# Check for required commands -COMMANDS="inkscape pngquant convert" -for COMMAND in $COMMANDS; do - if [ -z $(which $COMMAND) ]; then - echo "Command '$COMMAND' not found." - exit 1 - fi -done - -BASE="$(dirname $0)" -TMP="$(mktemp /tmp/tmp.XXXXXXXX)" - -# Render icons.svg variations. -inkscape \ - --export-dpi=90 \ - --export-png=$TMP.png \ - $BASE/icons.svg > /dev/null - -inkscape \ - --export-dpi=180 \ - --export-png=$TMP@2x.png \ - $BASE/icons.svg > /dev/null - -echo "" - -for COLOR in $COLORS; do - convert $TMP@2x.png -fill "#$COLOR" -colorize 100,100,100,0 - | pngquant 32 > $BASE/icons-$COLOR@2x.png - echo -e "\033[01;33m✔ saved $BASE/icons-$COLOR@2x.png" -done - -rm -f $TMP $TMP.png $TMP@2x.png - -echo -e "\n\033[00;33mCOMPLETE! Don't forget to update the \`background-size\` property if the sprite size changed\033[0m" diff --git a/assets/js/mapbox.js b/assets/js/mapbox.js index d2d1a01..dfc15a4 100644 --- a/assets/js/mapbox.js +++ b/assets/js/mapbox.js @@ -1,10 +1,7 @@ -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.mapboxgl=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge||e>=a||0>f||f>=a)){var g=this.buffers.circleVertex.index-this.elementGroups.current.vertexStartIndex;this.buffers.circleVertex.add(e,f,-1,-1),this.buffers.circleVertex.add(e,f,1,-1),this.buffers.circleVertex.add(e,f,1,1),this.buffers.circleVertex.add(e,f,-1,1),this.elementGroups.elementBuffer.add(g,g+1,g+2),this.elementGroups.elementBuffer.add(g,g+3,g+2),this.elementGroups.current.vertexLength+=4,this.elementGroups.current.elementLength+=2}}}},{"./element_groups":14}],13:[function(a,b,c){"use strict";function d(a,b,c,d,l){var m=new k("layout",a.type,a.layout,{}).values(),n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0},o={};for(var p in m)o[p]=m[p].calculate(c,n);"symbol"===a.type&&(m["text-size"]&&(o["text-max-size"]=m["text-size"].calculate(18,n),o["text-size"]=m["text-size"].calculate(c+1,n)),m["icon-size"]&&(o["icon-max-size"]=m["icon-size"].calculate(18,n),o["icon-size"]=m["icon-size"].calculate(c+1,n)));var q="line"===a.type?e:"fill"===a.type?f:"symbol"===a.type?g:"circle"===a.type?h:null,r=new q(b,new i[a.type](o),d,c,l);return r.id=a.id,r.type=a.type,r["source-layer"]=a["source-layer"],r.interactive=a.interactive,r.minZoom=a.minzoom,r.maxZoom=a.maxzoom,r.filter=j(a.filter),r.features=[],r}b.exports=d;var e=a("./line_bucket"),f=a("./fill_bucket"),g=a("./symbol_bucket"),h=a("./circle_bucket"),i=a("../style/layout_properties"),j=a("feature-filter"),k=a("../style/style_declaration_set")},{"../style/layout_properties":53,"../style/style_declaration_set":59,"./circle_bucket":12,"./fill_bucket":16,"./line_bucket":17,"./symbol_bucket":18,"feature-filter":112}],14:[function(a,b,c){"use strict";function d(a,b,c){this.vertexBuffer=a,this.elementBuffer=b,this.secondElementBuffer=c,this.groups=[]}function e(a,b,c){this.vertexStartIndex=a,this.elementStartIndex=b,this.secondElementStartIndex=c,this.elementLength=0,this.vertexLength=0,this.secondElementLength=0}b.exports=d,d.prototype.makeRoomFor=function(a){(!this.current||this.current.vertexLength+a>65535)&&(this.current=new e(this.vertexBuffer.index,this.elementBuffer&&this.elementBuffer.index,this.secondElementBuffer&&this.secondElementBuffer.index),this.groups.push(this.current))}},{}],15:[function(a,b,c){"use strict";function d(a,b){this.x=a.x,this.y=a.y,this.z=a.z-Math.log(b)/Math.LN2,this.rtree=o(9),this.toBeInserted=[]}function e(a,b,c){return"Point"===b?i(a,c):"LineString"===b?g(a,c):"Polygon"===b&&(f(a,c)||g(a,c))}function f(a,b){return!!(m(a,new p(b[0],b[1]))||m(a,new p(b[0],b[3]))||m(a,new p(b[2],b[1]))||m(a,new p(b[2],b[3])))||g(a,b)}function g(a,b){for(var c=0;c=c;var f=(e-a.y)/(b.y-a.y),g=a.x+f*(b.x-a.x);return g>=c&&d>=g&&1>=f&&f>=0}function i(a,b){for(var c=0;c=b[0]&&d[e].y>=b[1]&&d[e].x<=b[2]&&d[e].y<=b[3])return!0;return!1}function j(a,b,c,d){return"Point"===b?n(a,c,d):"LineString"===b?l(a,c,d):"Polygon"===b&&(m(a,c)||l(a,c,d))}function k(a,b,c){var d=b.distSqr(c);if(0===d)return a.distSqr(b);var e=((a.x-b.x)*(c.x-b.x)+(a.y-b.y)*(c.y-b.y))/d;return 0>e?a.distSqr(b):e>1?a.distSqr(c):a.distSqr(c.sub(b)._mult(e)._add(b))}function l(a,b,c){for(var d=c*c,e=0;eb.y!=e.y>b.y&&b.x<(e.x-d.x)*(b.y-d.y)/(e.y-d.y)+d.x&&(f=!f)}return f}function n(a,b,c){for(var d=c*c,e=0;e=2&&(e.x!==a[0].x||e.y!==a[0].y)&&(h.add(j,c,d),f.elementLength++),k>=1&&(i.add(c,d),f.secondElementLength++),c=d}}},{"./element_groups":14}],17:[function(a,b,c){"use strict";function d(a,b){this.buffers=a,this.elementGroups=new e(a.lineVertex,a.lineElement),this.layoutProperties=b}var e=a("./element_groups");b.exports=d,d.prototype.addFeatures=function(){for(var a=this.features,b=0;b2&&a[f-1].equals(a[f-2]);)f--;if(!(a.length<2)){"bevel"===b&&(d=1.05);var g=a[0],h=a[f-1],i=g.equals(h);if(this.elementGroups.makeRoomFor(10*f),2!==f||!i){var j,k,l,m,n,o,p,q=c,r=i?"butt":c,s=1,t=0,u=!0;this.e1=this.e2=this.e3=-1,i&&(j=a[f-2],n=g.sub(j)._unit()._perp());for(var v=0;f>v;v++)if(l=i&&v===f-1?a[1]:a[v+1],!l||!a[v].equals(l)){n&&(m=n),j&&(k=j),j=a[v],k&&(t+=j.dist(k)),n=l?l.sub(j)._unit()._perp():m,m=m||n;var w=m.add(n)._unit(),x=w.x*n.x+w.y*n.y,y=1/x,z=k&&l,A=z?b:l?q:r;if(z&&"round"===A&&(e>y?A="miter":2>=y&&(A="fakeround")),"miter"===A&&y>d&&(A="bevel"),"bevel"===A&&(y>2&&(A="flipbevel"),d>y&&(A="miter")),"miter"===A)w._mult(y),this.addCurrentVertex(j,s,t,w,0,0,!1);else if("flipbevel"===A){if(y>100)w=n.clone();else{var B=m.x*n.y-m.y*n.x>0?-1:1,C=y*m.add(n).mag()/m.sub(n).mag();w._perp()._mult(C*B)}this.addCurrentVertex(j,s,t,w,0,0,!1),s=-s}else if("bevel"===A||"fakeround"===A){var D=s*(m.x*n.y-m.y*n.x)>0,E=-Math.sqrt(y*y-1);if(D?(p=0,o=E):(o=0,p=E),u||this.addCurrentVertex(j,s,t,m,o,p,!1),"fakeround"===A){for(var F,G=Math.floor(8*(.5-(x-.5))),H=0;G>H;H++)F=n.mult((H+1)/(G+1))._add(m)._unit(),this.addPieSliceVertex(j,s,t,F,D);this.addPieSliceVertex(j,s,t,w,D);for(var I=G-1;I>=0;I--)F=m.mult((I+1)/(G+1))._add(n)._unit(),this.addPieSliceVertex(j,s,t,F,D)}l&&this.addCurrentVertex(j,s,t,n,-o,-p,!1)}else"butt"===A?(u||this.addCurrentVertex(j,s,t,m,0,0,!1),l&&this.addCurrentVertex(j,s,t,n,0,0,!1)):"square"===A?(u||(this.addCurrentVertex(j,s,t,m,1,1,!1),this.e1=this.e2=-1,s=1),l&&this.addCurrentVertex(j,s,t,n,-1,-1,!1)):"round"===A&&(u||(this.addCurrentVertex(j,s,t,m,0,0,!1),this.addCurrentVertex(j,s,t,m,1,1,!0),this.e1=this.e2=-1,s=1),l&&(this.addCurrentVertex(j,s,t,n,-1,-1,!0),this.addCurrentVertex(j,s,t,n,0,0,!1)));u=!1}}}},d.prototype.addCurrentVertex=function(a,b,c,d,e,f,g){var h,i=g?1:0,j=this.buffers.lineVertex,k=this.buffers.lineElement,l=this.elementGroups.current,m=this.elementGroups.current.vertexStartIndex;h=d.mult(b),e&&h._sub(d.perp()._mult(e)),this.e3=j.add(a,h,i,0,c)-m,this.e1>=0&&this.e2>=0&&(k.add(this.e1,this.e2,this.e3),l.elementLength++),this.e1=this.e2,this.e2=this.e3,h=d.mult(-b),f&&h._sub(d.perp()._mult(f)),this.e3=j.add(a,h,i,1,c)-m,this.e1>=0&&this.e2>=0&&(k.add(this.e1,this.e2,this.e3),l.elementLength++),this.e1=this.e2,this.e2=this.e3,l.vertexLength+=2},d.prototype.addPieSliceVertex=function(a,b,c,d,e){var f=this.buffers.lineVertex,g=this.buffers.lineElement,h=this.elementGroups.current,i=this.elementGroups.current.vertexStartIndex,j=e;d=d.mult(b*(e?-1:1)),this.e3=f.add(a,d,0,j,c)-i,h.vertexLength+=1,this.e1>=0&&this.e2>=0&&(g.add(this.e1,this.e2,this.e3),h.elementLength++),e?this.e2=this.e3:this.e1=this.e3}},{"./element_groups":14}],18:[function(a,b,c){"use strict";function d(a,b,c,d,e){this.buffers=a,this.layoutProperties=b,this.overscaling=c,this.zoom=d,this.collisionDebug=e;var f=512*c,g=4096;this.tilePixelRatio=g/f,this.compareText={},this.symbolInstances=[]}function e(a,b,c,d,e,f,g,h,i,j,k,l){this.x=a.x,this.y=a.y,this.hasText=!!c,this.hasIcon=!!d,this.hasText&&(this.glyphQuads=f?q(a,c,g,b,e,i):[],this.textCollisionFeature=new u(b,a,c,g,h,i)),this.hasIcon&&(this.iconQuads=f?r(a,d,j,b,e,l):[],this.iconCollisionFeature=new u(b,a,d,j,k,l))}var f=a("./element_groups"),g=a("../symbol/anchor"),h=a("../symbol/get_anchors"),i=a("../util/token"),j=a("../symbol/quads"),k=a("../symbol/shaping"),l=a("../symbol/resolve_text"),m=a("../symbol/resolve_icons"),n=a("../symbol/mergelines"),o=k.shapeText,p=k.shapeIcon,q=j.getGlyphQuads,r=j.getIconQuads,s=a("../symbol/clip_line"),t=a("point-geometry"),u=a("../symbol/collision_feature");b.exports=d,d.prototype.needsPlacement=!0,d.prototype.addFeatures=function(a){var b=this.layoutProperties,c=this.features,d=this.textFeatures,e=.5,f=.5;switch(b["text-anchor"]){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(b["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":f=1;break;case"top":case"top-right":case"top-left":f=0}for(var g="right"===b["text-justify"]?1:"left"===b["text-justify"]?0:.5,h=24,j=b["text-line-height"]*h,k="line"!==b["symbol-placement"]?b["text-max-width"]*h:0,l=b["text-letter-spacing"]*h,m=[b["text-offset"][0]*h,b["text-offset"][1]*h],q=b["text-font"].join(","),r=[],s=0;sA;A++){var C=z[A];if(!(b&&v&&this.anchorIsTooClose(b.text,w,C))){var D=!(C.x<0||C.x>4096||C.y<0||C.y>4096);if(!n||D){var E=D||u;this.symbolInstances.push(new e(C,y,b,c,d,E,j,o,r,l,p,t))}}}},d.prototype.anchorIsTooClose=function(a,b,c){var d=this.compareText;if(a in d){for(var e=d[a],f=e.length-1;f>=0;f--)if(c.dist(e[f])=t&&this.addSymbols(b.glyphVertex,b.glyphElement,d.text,o.glyphQuads,t,e["text-keep-upright"],h,a.angle)),q&&(e["icon-ignore-placement"]||a.insertCollisionFeature(o.iconCollisionFeature,u),g>=u&&this.addSymbols(b.iconVertex,b.iconElement,d.icon,o.iconQuads,u,e["icon-keep-upright"],i,a.angle))}c&&this.addToDebugBuffers(a)},d.prototype.addSymbols=function(a,b,c,d,e,f,g,h){c.makeRoomFor(4*d.length);for(var i=c.current,j=this.zoom,k=Math.max(Math.log(e)/Math.LN2+j,0),l=0;l3*Math.PI/2))){var p=m.tl,q=m.tr,r=m.bl,s=m.br,t=m.tex,u=m.anchorPoint,v=Math.max(j+Math.log(m.minScale)/Math.LN2,k),w=Math.min(j+Math.log(m.maxScale)/Math.LN2,25);if(!(v>=w)){v===k&&(v=0);var x=a.index-i.vertexStartIndex;a.add(u.x,u.y,p.x,p.y,t.x,t.y,v,w,k),a.add(u.x,u.y,q.x,q.y,t.x+t.w,t.y,v,w,k),a.add(u.x,u.y,r.x,r.y,t.x,t.y+t.h,v,w,k),a.add(u.x,u.y,s.x,s.y,t.x+t.w,t.y+t.h,v,w,k),i.vertexLength+=4,b.add(x,x+1,x+2),b.add(x+1,x+2,x+3),i.elementLength+=2}}}},d.prototype.getDependencies=function(a,b,c){function d(a){return a||e?c(a):void(e=!0)}var e=!1;this.getTextDependencies(a,b,d),this.getIconDependencies(a,b,d)},d.prototype.getIconDependencies=function(a,b,c){function d(a,b){return a?c(a):(this.icons=b,void c())}if(this.layoutProperties["icon-image"]){var e=this.features,f=m(e,this.layoutProperties);f.length?b.send("get icons",{icons:f},d.bind(this)):c()}else c()},d.prototype.getTextDependencies=function(a,b,c){var d=this.features,e=this.layoutProperties["text-font"],f=this.stacks=a.stacks;void 0===f[e]&&(f[e]={});var g=f[e],h=l(d,this.layoutProperties,g);this.textFeatures=h.textFeatures,b.send("get glyphs",{uid:a.uid,fontstack:e,codepoints:h.codepoints},function(a,b){if(a)return c(a);for(var d in b)g[d]=b[d];c()})},d.prototype.addToDebugBuffers=function(a){this.elementGroups.collisionBox=new f(this.buffers.collisionBoxVertex),this.elementGroups.collisionBox.makeRoomFor(0);for(var b=this.buffers.collisionBoxVertex,c=-a.angle,d=a.yStretch,e=0;eg;g++){var h=this.symbolInstances[e][0===g?"textCollisionFeature":"iconCollisionFeature"];if(h)for(var i=h.boxes,j=0;j90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}b.exports=d;var e=a("../util/util").wrap;d.prototype.wrap=function(){return new d(e(this.lng,-180,180),this.lat)},d.convert=function(a){return a instanceof d?a:Array.isArray(a)?new d(a[0],a[1]):a}},{"../util/util":106}],21:[function(a,b,c){"use strict";function d(a,b){if(a)for(var c=b?[a,b]:a,d=0,e=c.length;e>d;d++)this.extend(c[d])}b.exports=d;var e=a("./lng_lat");d.prototype={extend:function(a){var b,c,f=this._sw,g=this._ne;if(a instanceof e)b=a,c=a;else{if(!(a instanceof d))return a?this.extend(e.convert(a)||d.convert(a)):this;if(b=a._sw,c=a._ne,!b||!c)return this}return f||g?(f.lng=Math.min(b.lng,f.lng),f.lat=Math.min(b.lat,f.lat),g.lng=Math.max(c.lng,g.lng),g.lat=Math.max(c.lat,g.lat)):(this._sw=new e(b.lng,b.lat),this._ne=new e(c.lng,c.lat)),this},getCenter:function(){return new e((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new e(this.getWest(),this.getNorth())},getSouthEast:function(){return new e(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat}},d.convert=function(a){return!a||a instanceof d?a:new d(a)}},{"./lng_lat":20}],22:[function(a,b,c){"use strict";function d(a,b){this.tileSize=512,this._minZoom=a||0,this._maxZoom=b||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this.zoom=0,this.center=new e(0,0),this.angle=0,this._altitude=1.5,this._pitch=0}var e=a("./lng_lat"),f=a("point-geometry"),g=a("./coordinate"),h=a("../util/util").wrap,i=a("../util/interpolate"),j=a("gl-matrix").vec4,k=a("gl-matrix").mat4;b.exports=d,d.prototype={get minZoom(){return this._minZoom},set minZoom(a){this._minZoom=a,this.zoom=Math.max(this.zoom,a)},get maxZoom(){return this._maxZoom},set maxZoom(a){this._maxZoom=a,this.zoom=Math.min(this.zoom,a)},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new f(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(a){this.angle=-h(a,-180,180)*Math.PI/180},get pitch(){return this._pitch/Math.PI*180},set pitch(a){this._pitch=Math.min(60,a)/180*Math.PI},get altitude(){return this._altitude},set altitude(a){this._altitude=Math.max(.75,a)},get zoom(){return this._zoom},set zoom(a){a=Math.min(Math.max(a,this.minZoom),this.maxZoom),this._zoom=a,this.scale=this.zoomScale(a),this.tileZoom=Math.floor(a),this.zoomFraction=a-this.tileZoom,this._constrain()},zoomScale:function(a){return Math.pow(2,a)},scaleZoom:function(a){return Math.log(a)/Math.LN2},project:function(a,b){return new f(this.lngX(a.lng,b),this.latY(a.lat,b))},unproject:function(a,b){return new e(this.xLng(a.x,b),this.yLat(a.y,b))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new f(this.x,this.y)},lngX:function(a,b){return(180+a)*(b||this.worldSize)/360},latY:function(a,b){var c=180/Math.PI*Math.log(Math.tan(Math.PI/4+a*Math.PI/360));return(180-c)*(b||this.worldSize)/360},xLng:function(a,b){return 360*a/(b||this.worldSize)-180},yLat:function(a,b){var c=180-360*a/(b||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(c*Math.PI/180))-90},panBy:function(a){var b=this.centerPoint._add(a);this.center=this.pointLocation(b),this._constrain()},setLocationAtPoint:function(a,b){var c=this.locationCoordinate(a),d=this.pointCoordinate(b),e=this.pointCoordinate(this.centerPoint),f=d._sub(c);this.center=this.coordinateLocation(e._sub(f)),this._constrain()},setZoomAround:function(a,b){var c;b&&(c=this.locationPoint(b)),this.zoom=a,b&&this.setLocationAtPoint(b,c)},setBearingAround:function(a,b){var c;b&&(c=this.locationPoint(b)),this.bearing=a,b&&this.setLocationAtPoint(b,c)},locationPoint:function(a){return this.coordinatePoint(this.locationCoordinate(a))},pointLocation:function(a){return this.coordinateLocation(this.pointCoordinate(a))},locationCoordinate:function(a){var b=this.zoomScale(this.tileZoom)/this.worldSize,c=e.convert(a);return new g(this.lngX(c.lng)*b,this.latY(c.lat)*b,this.tileZoom)},coordinateLocation:function(a){var b=this.zoomScale(a.zoom);return new e(this.xLng(a.column,b),this.yLat(a.row,b))},pointCoordinate:function(a,b){void 0===b&&(b=0);var c=this.coordinatePointMatrix(this.tileZoom),d=k.invert(new Float64Array(16),c);if(!d)throw"failed to invert matrix";var e=j.transformMat4([],[a.x,a.y,0,1],d),f=j.transformMat4([],[a.x,a.y,1,1],d),h=e[3],l=f[3],m=e[0]/h,n=f[0]/l,o=e[1]/h,p=f[1]/l,q=e[2]/h,r=f[2]/l,s=q===r?0:(b-q)/(r-q);return new g(i(m,n,s),i(o,p,s),this.tileZoom)},coordinatePoint:function(a){var b=this.coordinatePointMatrix(a.zoom),c=j.transformMat4([],[a.column,a.row,0,1],b);return new f(c[0]/c[3],c[1]/c[3])},coordinatePointMatrix:function(a){var b=this.getProjMatrix(),c=this.worldSize/this.zoomScale(a);return k.scale(b,b,[c,c,1]),k.multiply(b,this.getPixelMatrix(),b),b},getPixelMatrix:function(){var a=k.create();return k.scale(a,a,[this.width/2,-this.height/2,1]),k.translate(a,a,[1,-1,0]),a},_constrain:function(){if(this.center){var a,b,c,d,e,g,h,i,j=this.size;this.latRange&&(a=this.latY(this.latRange[1]),b=this.latY(this.latRange[0]),e=b-al-m&&(i=a+m),l+m>b&&(i=b-m)}if(this.lngRange){var n=this.x,o=j.x/2;c>n-o&&(h=c+o),n+o>d&&(h=d-o)}(void 0!==h||void 0!==i)&&(this.center=this.unproject(new f(void 0!==h?h:this.x,void 0!==i?i:this.y)))}},getProjMatrix:function(){var a=new Float64Array(16),b=Math.atan(.5/this.altitude),c=Math.sin(b)*this.altitude/Math.sin(Math.PI/2-this._pitch-b),d=Math.cos(Math.PI/2-this._pitch)*c+this.altitude;return k.perspective(a,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,d),k.translate(a,a,[0,0,-this.altitude]),k.scale(a,a,[1,-1,1/this.height]),k.rotateX(a,a,this._pitch),k.rotateZ(a,a,this.angle),k.translate(a,a,[-this.x,-this.y,0]),a}}},{"../util/interpolate":102,"../util/util":106,"./coordinate":19,"./lng_lat":20,"gl-matrix":119,"point-geometry":137}],23:[function(a,b,c){"use strict";var d={" ":[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]]};b.exports=function(a,b,c,e){e=e||1;var f,g,h,i,j,k,l,m,n=[];for(f=0,g=a.length;g>f;f++)if(j=d[a[f]]){for(m=null,h=0,i=j[1].length;i>h;h+=2)-1===j[1][h]&&-1===j[1][h+1]?m=null:(k=b+j[1][h]*e,l=c-j[1][h+1]*e,m&&n.push(m.x,m.y,k,l),m={x:k,y:l});b+=j[0]*e}return n}},{}],24:[function(a,b,c){"use strict";var d=b.exports={};d.Map=a("./ui/map"),d.Control=a("./ui/control/control"),d.Navigation=a("./ui/control/navigation"),d.Attribution=a("./ui/control/attribution"),d.Popup=a("./ui/popup"),d.GeoJSONSource=a("./source/geojson_source"),d.VideoSource=a("./source/video_source"),d.ImageSource=a("./source/image_source"),d.Style=a("./style/style"),d.LngLat=a("./geo/lng_lat"),d.LngLatBounds=a("./geo/lng_lat_bounds"),d.Point=a("point-geometry"),d.Evented=a("./util/evented"),d.util=a("./util/util"),d.supported=a("./util/browser").supported;var e=a("./util/ajax");d.util.getJSON=e.getJSON,d.util.getArrayBuffer=e.getArrayBuffer;var f=a("./util/config");d.config=f,Object.defineProperty(d,"accessToken",{get:function(){return f.ACCESS_TOKEN},set:function(a){f.ACCESS_TOKEN=a}})},{"./geo/lng_lat":20,"./geo/lng_lat_bounds":21,"./source/geojson_source":39,"./source/image_source":41,"./source/video_source":48,"./style/style":56,"./ui/control/attribution":79,"./ui/control/control":80,"./ui/control/navigation":81,"./ui/map":91,"./ui/popup":92,"./util/ajax":94,"./util/browser":95,"./util/config":99,"./util/evented":100,"./util/util":106,"point-geometry":137}],25:[function(a,b,c){"use strict";function d(a,b,c){var d,f=a.gl,g=b.paint["background-color"],h=b.paint["background-pattern"],i=b.paint["background-opacity"],j=h?a.spriteAtlas.getPosition(h.from,!0):null,k=h?a.spriteAtlas.getPosition(h.to,!0):null;if(j&&k){d=a.patternShader,f.switchShader(d,c),f.uniform1i(d.u_image,0),f.uniform2fv(d.u_pattern_tl_a,j.tl),f.uniform2fv(d.u_pattern_br_a,j.br),f.uniform2fv(d.u_pattern_tl_b,k.tl),f.uniform2fv(d.u_pattern_br_b,k.br),f.uniform1f(d.u_opacity,i);var l=a.transform,m=j.size,n=k.size,o=l.locationCoordinate(l.center),p=1/Math.pow(2,l.zoomFraction);f.uniform1f(d.u_mix,h.t);var q=e.create();e.scale(q,q,[1/(m[0]*h.fromScale),1/(m[1]*h.fromScale)]),e.translate(q,q,[o.column*l.tileSize%(m[0]*h.fromScale),o.row*l.tileSize%(m[1]*h.fromScale)]),e.rotate(q,q,-l.angle),e.scale(q,q,[p*l.width/2,-p*l.height/2]);var r=e.create();e.scale(r,r,[1/(n[0]*h.toScale),1/(n[1]*h.toScale)]),e.translate(r,r,[o.column*l.tileSize%(n[0]*h.toScale),o.row*l.tileSize%(n[1]*h.toScale)]),e.rotate(r,r,-l.angle),e.scale(r,r,[p*l.width/2,-p*l.height/2]),f.uniformMatrix3fv(d.u_patternmatrix_a,!1,q),f.uniformMatrix3fv(d.u_patternmatrix_b,!1,r),a.spriteAtlas.bind(f,!0)}else d=a.fillShader,f.switchShader(d,c),f.uniform4fv(d.u_color,g);f.disable(f.STENCIL_TEST),f.bindBuffer(f.ARRAY_BUFFER,a.backgroundBuffer),f.vertexAttribPointer(d.a_pos,a.backgroundBuffer.itemSize,f.SHORT,!1,0,0),f.drawArrays(f.TRIANGLE_STRIP,0,a.backgroundBuffer.itemCount),f.enable(f.STENCIL_TEST),f.stencilMask(0),f.stencilFunc(f.EQUAL,128,128)}var e=a("gl-matrix").mat3;b.exports=d},{"gl-matrix":119}],26:[function(a,b,c){"use strict";function d(a,b,c,d){if(d.buffers){c=a.translateMatrix(c,d,b.paint["circle-translate"],b.paint["circle-translate-anchor"]);var f=d.elementGroups[b.ref||b.id];if(f){var g=a.gl;g.disable(g.STENCIL_TEST),g.switchShader(a.circleShader,c,d.exMatrix);var h=d.buffers.circleVertex,i=a.circleShader,j=d.buffers.circleElement,k=1/e.devicePixelRatio/b.paint["circle-radius"];g.uniform4fv(i.u_color,b.paint["circle-color"]),g.uniform1f(i.u_blur,Math.max(b.paint["circle-blur"],k)),g.uniform1f(i.u_size,b.paint["circle-radius"]);for(var l=0;l0&&(l=b.paint["line-gap-width"]/2+.5*i,k=b.paint["line-width"],m=l-i/2);var o=m+k+i/2+n,p=b.paint["line-color"],q=a.transform.scale/(1<0?1/(1-a):1+a}function g(a){return a>0?1-1/(1.001-a):-a}function h(a,b,c,d){if(!a.source)return[1,0];var e=(new Date).getTime(),f=c.paint["raster-fade-duration"],g=(e-a.timeAdded)/f,h=b?(e-b.timeAdded)/f:-1,j=a.source._pyramid.coveringZoomLevel(d),k=!!b&&Math.abs(b.coord.z-j)>Math.abs(a.coord.z-j),l=[];!b||k?(l[0]=i.clamp(g,0,1),l[1]=1-l[0]):(l[0]=i.clamp(1-h,0,1),l[1]=1-l[0]);var m=c.paint["raster-opacity"];return l[0]*=m,l[1]*=m,l}var i=a("../util/util");b.exports=d},{"../util/util":106}],32:[function(a,b,c){"use strict";function d(a,b,c,d){if(d.buffers){var f=d.elementGroups[b.ref||b.id];if(f){var g=!(b.layout["text-allow-overlap"]||b.layout["icon-allow-overlap"]||b.layout["text-ignore-placement"]||b.layout["icon-ignore-placement"]),i=a.gl;g&&i.disable(i.STENCIL_TEST),f.text.groups.length&&e(a,b,c,d,f.text,"text",!0),f.icon.groups.length&&e(a,b,c,d,f.icon,"icon",f.sdfIcons),h(a,b,c,d),g&&i.enable(i.STENCIL_TEST)}}}function e(a,b,c,d,e,h,j){var k=a.gl;c=a.translateMatrix(c,d,b.paint[h+"-translate"],b.paint[h+"-translate-anchor"]);var l,m,n,o=a.transform,p="map"===b.layout[h+"-rotation-alignment"],q=p;q?(l=g.create(),m=d.tileExtent/d.tileSize/Math.pow(2,a.transform.zoom-d.coord.z),n=1/Math.cos(o._pitch)):(l=g.clone(d.exMatrix),m=a.transform.altitude,n=1),g.scale(l,l,[m,m,1]);var r=b.paint[h+"-size"],s=r/i[h];g.scale(l,l,[s,s,1]);var t,u,v,w,x=Math.sqrt(o.height*o.height/4*(1+o.altitude*o.altitude)),y=o.height/2*Math.tan(o._pitch),z=(x+y)/x-1,A="text"===h;if(A||a.style.sprite.loaded()){k.activeTexture(k.TEXTURE0),t=j?a.sdfShader:a.iconShader,A?(a.glyphAtlas.updateTexture(k),u=d.buffers.glyphVertex,v=d.buffers.glyphElement,w=[a.glyphAtlas.width/4,a.glyphAtlas.height/4]):(a.spriteAtlas.bind(k,p||a.options.rotating||a.options.zooming||1!==s||j||a.transform.pitch),u=d.buffers.iconVertex,v=d.buffers.iconElement,w=[a.spriteAtlas.width/4,a.spriteAtlas.height/4]),k.switchShader(t,c,l),k.uniform1i(t.u_texture,0),k.uniform2fv(t.u_texsize,w),k.uniform1i(t.u_skewed,q),k.uniform1f(t.u_extra,z);var B=Math.log(r/e[h+"-size"])/Math.LN2||0;k.uniform1f(t.u_zoom,10*(a.transform.zoom-B));var C=a.frameHistory.getFadeProperties(300);k.uniform1f(t.u_fadedist,10*C.fadedist),k.uniform1f(t.u_minfadezoom,Math.floor(10*C.minfadezoom)),k.uniform1f(t.u_maxfadezoom,Math.floor(10*C.maxfadezoom)),k.uniform1f(t.u_fadezoom,10*(a.transform.zoom+C.bump));var D,E,F,G;if(v.bind(k),j){var H=8,I=1.19,J=6,K=.105*i[h]/r/f.devicePixelRatio;k.uniform1f(t.u_gamma,K*n),k.uniform4fv(t.u_color,b.paint[h+"-color"]),k.uniform1f(t.u_buffer,.75);for(var L=0;L3&&this.frameHistory[1].time+ac&&console.warn("there should never be less than three frames in the history");var d=this.frameHistory[0].z,e=this.frameHistory[c-1],f=e.z,g=Math.min(d,f),h=Math.max(d,f),i=e.z-this.frameHistory[1].z,j=e.time-this.frameHistory[1].time,k=i/(j/a);isNaN(k)&&console.warn("fadedist should never be NaN");var l=(b-e.time)/a*k;return{fadedist:k,minfadezoom:g,maxfadezoom:h,bump:l}},d.prototype.record=function(a){var b=(new Date).getTime();this.frameHistory.length||this.frameHistory.push({time:0,z:a},{time:0,z:a}),(2===this.frameHistory.length||this.frameHistory[this.frameHistory.length-1].z!==a)&&this.frameHistory.push({time:b,z:a})}},{}],35:[function(a,b,c){"use strict";var d=a("./shaders"),e=a("../util/util");c.extend=function(a){var b=a.lineWidth,c=a.getParameter(a.ALIASED_LINE_WIDTH_RANGE);return a.lineWidth=function(d){b.call(a,e.clamp(d,c[0],c[1]))},a.getShader=function(a,b){var c=b===this.FRAGMENT_SHADER?"fragment":"vertex";if(!d[a]||!d[a][c])throw new Error("Could not find shader "+a);var e=this.createShader(b),f=d[a][c];if("undefined"==typeof orientation&&(f=f.replace(/ highp /g," ")),this.shaderSource(e,f),this.compileShader(e),!this.getShaderParameter(e,this.COMPILE_STATUS))throw new Error(this.getShaderInfoLog(e));return e},a.initializeShader=function(a,b,c){var d={program:this.createProgram(),fragment:this.getShader(a,this.FRAGMENT_SHADER),vertex:this.getShader(a,this.VERTEX_SHADER),attributes:[]};if(this.attachShader(d.program,d.vertex),this.attachShader(d.program,d.fragment),this.linkProgram(d.program),this.getProgramParameter(d.program,this.LINK_STATUS)){for(var e=0;ethis.height)return console.warn("LineAtlas out of space"),null;for(var f=0,g=0;g=k;k++)for(var l=this.nextRow+c+k,m=this.width*l,n=j?-a[a.length-1]:0,o=a[0],p=1,q=0;qo;)n=o,o+=a[p],j&&p===a.length-1&&(o+=a[0]),p++;var r,s=Math.abs(q-n*h),t=Math.abs(q-o*h),u=Math.min(s,t),v=p%2===1;if(b){var w=c?k/c*(i+1):0;if(v){var x=i-Math.abs(w);r=Math.sqrt(u*u+x*x)}else r=i-Math.sqrt(u*u+w*w)}else r=(v?1:-1)*u;this.data[3+4*(m+q)]=Math.max(0,Math.min(255,r+e))}var y={y:(this.nextRow+c+.5)/this.height,height:2*c/this.height,width:f};return this.nextRow+=d,this.dirty=!0,y},d.prototype.bind=function(a){this.texture?(a.bindTexture(a.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,a.texSubImage2D(a.TEXTURE_2D,0,0,0,this.width,this.height,a.RGBA,a.UNSIGNED_BYTE,this.data))):(this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,this.width,this.height,0,a.RGBA,a.UNSIGNED_BYTE,this.data))},d.prototype.debug=function(){var a=document.createElement("canvas");document.body.appendChild(a),a.style.position="absolute",a.style.top=0,a.style.left=0,a.style.background="#ff0",a.width=this.width,a.height=this.height;for(var b=a.getContext("2d"),c=b.getImageData(0,0,this.width,this.height),d=0;d=0;c--){var d=a._groups[c],e=a.sources[d.source];e?(this.clearStencil(),e.render(d,this)):void 0===d.source&&this.drawLayers(d,this.identityMatrix)}},d.prototype.drawTile=function(a,b){this.setExtent(a.tileExtent),this.drawClippingMask(a),this.drawLayers(b,a.posMatrix,a),this.options.debug&&i.debug(this,a)},d.prototype.drawLayers=function(a,b,c){for(var d=a.length-1;d>=0;d--){var e=a[d];e.hidden||(i[e.type](this,e,b,c),this.options.vertices&&i.vertices(this,e,b,c))}},d.prototype.drawStencilBuffer=function(){var a=this.gl;a.switchShader(this.fillShader,this.identityMatrix),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),a.stencilMask(0),a.stencilFunc(a.EQUAL,128,128),a.bindBuffer(a.ARRAY_BUFFER,this.backgroundBuffer),a.vertexAttribPointer(this.fillShader.a_pos,this.backgroundBuffer.itemSize,a.SHORT,!1,0,0),a.uniform4fv(this.fillShader.u_color,[0,0,0,.5]),a.drawArrays(a.TRIANGLE_STRIP,0,this.tileExtentBuffer.itemCount),a.blendFunc(a.ONE_MINUS_DST_ALPHA,a.ONE)},d.prototype.translateMatrix=function(a,b,c,d){if(!c[0]&&!c[1])return a;if("viewport"===d){var e=Math.sin(-this.transform.angle),f=Math.cos(-this.transform.angle);c=[c[0]*f-c[1]*e,c[0]*e+c[1]*f]}var h=this.transform.scale/(1<0?b.pop():null}},{"../util/browser":95,"./draw_background":25,"./draw_circle":26,"./draw_debug":28,"./draw_fill":29,"./draw_line":30,"./draw_raster":31,"./draw_symbol":32,"./draw_vertices":33,"./frame_history":34,"./gl_util":35,"gl-matrix":119}],38:[function(a,b,c){"use strict";b.exports={debug:{vertex:"precision mediump float;attribute vec2 a_pos;uniform mat4 u_matrix;void main(){gl_Position=u_matrix*vec4(a_pos,step(32767.,a_pos.x),1);}",fragment:"precision mediump float;uniform vec4 u_color;void main(){gl_FragColor=u_color;}"},dot:{vertex:"precision mediump float;uniform mat4 u_matrix;uniform float u_size;attribute vec2 a_pos;void main(){gl_Position=u_matrix*vec4(a_pos,0,1);gl_PointSize=u_size;}",fragment:"precision mediump float;uniform vec4 u_color;uniform float u_blur;void main(){float a,b;a=length(gl_PointCoord-.5);b=smoothstep(.5,.5-u_blur,a);gl_FragColor=u_color*b;}"},fill:{vertex:"precision mediump float;attribute vec2 a_pos;uniform mat4 u_matrix;void main(){gl_Position=u_matrix*vec4(a_pos,0,1);}",fragment:"precision mediump float;uniform vec4 u_color;void main(){gl_FragColor=u_color;}"},circle:{vertex:"precision mediump float;uniform float u_size;attribute vec2 a_pos;uniform mat4 u_matrix,u_exmatrix;varying vec2 a;void main(){a=vec2(mod(a_pos,2.)*2.-1.);vec4 b=u_exmatrix*vec4(a*u_size,0,0);gl_Position=u_matrix*vec4(floor(a_pos*.5),0,1);gl_Position+=b*gl_Position.w;}",fragment:"precision mediump float;uniform vec4 u_color;uniform float u_blur,u_size;varying vec2 a;void main(){float b=smoothstep(1.-u_blur,1.,length(a));gl_FragColor=u_color*(1.-b);}"},line:{vertex:"precision mediump float;attribute vec2 a_pos;attribute vec4 a_data;uniform highp mat4 u_matrix;uniform float u_ratio,u_extra;uniform vec2 u_linewidth;uniform mat2 u_antialiasingmatrix;varying vec2 a;varying float b,c;void main(){vec2 d,e;d=a_data.xy;e=mod(a_pos,2.);e.y=sign(e.y-.5);a=e;vec4 f=vec4(u_linewidth.s*d*.015873016,0,0);gl_Position=u_matrix*vec4(floor(a_pos*.5)+f.xy/u_ratio,0,1);float g,h,i;g=gl_Position.y/gl_Position.w;h=length(d)/length(u_antialiasingmatrix*d);i=1./(1.-min(g*u_extra,.9));c=i*h;}",fragment:"precision mediump float;uniform vec2 u_linewidth;uniform vec4 u_color;uniform float u_blur;varying vec2 a;varying float b,c;void main(){float d,e,f;d=length(a)*u_linewidth.s;e=u_blur*c;f=clamp(min(d-(u_linewidth.t-e),u_linewidth.s-d)/e,0.,1.);gl_FragColor=u_color*f;}"},linepattern:{vertex:"precision mediump float;attribute vec2 a_pos;attribute vec4 a_data;uniform highp mat4 u_matrix;uniform float u_ratio,u_extra;uniform vec2 u_linewidth;uniform vec4 u_color;uniform mat2 u_antialiasingmatrix;varying vec2 a;varying float b,c;void main(){vec2 d,f,g,h;d=a_data.xy;float e,i,j,k;e=a_data.z*128.+a_data.w;f=mod(a_pos,2.);f.y=sign(f.y-.5);a=f;g=d*.015873016;h=u_linewidth.s*g;gl_Position=u_matrix*vec4(floor(a_pos*.5)+h.xy/u_ratio,0,1);b=e;i=gl_Position.y/gl_Position.w;j=length(d)/length(u_antialiasingmatrix*d);k=1./(1.-min(i*u_extra,.9));c=k*j;}",fragment:"precision mediump float;uniform vec2 u_linewidth,u_pattern_size_a,u_pattern_size_b,u_pattern_tl_a,u_pattern_br_a,u_pattern_tl_b,u_pattern_br_b;uniform float u_point,u_blur,u_fade,u_opacity;uniform sampler2D u_image;varying vec2 a;varying float b,c;void main(){float d,e,f,g,h,i,j;d=length(a)*u_linewidth.s;e=u_blur*c;f=clamp(min(d-(u_linewidth.t-e),u_linewidth.s-d)/e,0.,1.);g=mod(b/u_pattern_size_a.x,1.);h=mod(b/u_pattern_size_b.x,1.);i=.5+a.y*u_linewidth.s/u_pattern_size_a.y;j=.5+a.y*u_linewidth.s/u_pattern_size_b.y;vec2 k,l;k=mix(u_pattern_tl_a,u_pattern_br_a,vec2(g,i));l=mix(u_pattern_tl_b,u_pattern_br_b,vec2(h,j));vec4 m=mix(texture2D(u_image,k),texture2D(u_image,l),u_fade);f*=u_opacity;gl_FragColor=m*f;}"},linesdfpattern:{vertex:"precision mediump float;attribute vec2 a_pos;attribute vec4 a_data;uniform highp mat4 u_matrix;uniform vec2 u_linewidth,u_patternscale_a,u_patternscale_b;uniform float u_ratio,u_tex_y_a,u_tex_y_b,u_extra;uniform mat2 u_antialiasingmatrix;varying vec2 a,b,c;varying float d;void main(){vec2 e,g;e=a_data.xy;float f,i,j,k;f=a_data.z*128.+a_data.w;g=mod(a_pos,2.);g.y=sign(g.y-.5);a=g;vec4 h=vec4(u_linewidth.s*e*.015873016,0,0);gl_Position=u_matrix*vec4(floor(a_pos*.5)+h.xy/u_ratio,0,1);b=vec2(f*u_patternscale_a.x,g.y*u_patternscale_a.y+u_tex_y_a);c=vec2(f*u_patternscale_b.x,g.y*u_patternscale_b.y+u_tex_y_b);i=gl_Position.y/gl_Position.w;j=length(e)/length(u_antialiasingmatrix*e);k=1./(1.-min(i*u_extra,.9));d=k*j;}",fragment:"precision mediump float;uniform vec2 u_linewidth;uniform vec4 u_color;uniform float u_blur,u_sdfgamma,u_mix;uniform sampler2D u_image;varying vec2 a,b,c;varying float d;void main(){float e,f,g,h,i,j;e=length(a)*u_linewidth.s;f=u_blur*d;g=clamp(min(e-(u_linewidth.t-f),u_linewidth.s-e)/f,0.,1.);h=texture2D(u_image,b).a;i=texture2D(u_image,c).a;j=mix(h,i,u_mix);g*=smoothstep(.5-u_sdfgamma,.5+u_sdfgamma,j);gl_FragColor=u_color*g;}"},outline:{vertex:"precision mediump float;attribute vec2 a_pos;uniform highp mat4 u_matrix;uniform vec2 u_world;varying vec2 a;void main(){gl_Position=u_matrix*vec4(a_pos,0,1);a=(gl_Position.xy/gl_Position.w+1.)/2.*u_world;}",fragment:"precision mediump float;uniform vec4 u_color;varying vec2 a;void main(){float b,c;b=length(a-gl_FragCoord.xy);c=smoothstep(1.,0.,b);gl_FragColor=u_color*c;}"},pattern:{vertex:"precision mediump float;uniform mat4 u_matrix;uniform mat3 u_patternmatrix_a,u_patternmatrix_b;attribute vec2 a_pos;varying vec2 a,b;void main(){gl_Position=u_matrix*vec4(a_pos,0,1);a=(u_patternmatrix_a*vec3(a_pos,1)).xy;b=(u_patternmatrix_b*vec3(a_pos,1)).xy;}",fragment:"precision mediump float;uniform float u_opacity,u_mix;uniform vec2 u_pattern_tl_a,u_pattern_br_a,u_pattern_tl_b,u_pattern_br_b;uniform sampler2D u_image;varying vec2 a,b;void main(){vec2 c,d,f,g;c=mod(a,1.);d=mix(u_pattern_tl_a,u_pattern_br_a,c);vec4 e,h;e=texture2D(u_image,d);f=mod(b,1.);g=mix(u_pattern_tl_b,u_pattern_br_b,f);h=texture2D(u_image,g);gl_FragColor=mix(e,h,u_mix)*u_opacity;}"},raster:{vertex:"precision mediump float;uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent,u_buffer_scale;attribute vec2 a_pos,a_texture_pos;varying vec2 a,b;void main(){gl_Position=u_matrix*vec4(a_pos,0,1);a=(a_texture_pos/32767.-.5)/u_buffer_scale+.5;b=a*u_scale_parent+u_tl_parent;}",fragment:"precision mediump float;uniform float u_opacity0,u_opacity1,u_brightness_low,u_brightness_high,u_saturation_factor,u_contrast_factor;uniform sampler2D u_image0,u_image1;varying vec2 a,b;uniform vec3 u_spin_weights;void main(){vec4 c,d,e;c=texture2D(u_image0,a);d=texture2D(u_image1,b);e=c*u_opacity0+d*u_opacity1;vec3 f,h,i;f=e.rgb;f=vec3(dot(f,u_spin_weights.xyz),dot(f,u_spin_weights.zxy),dot(f,u_spin_weights.yzx));float g=(e.r+e.g+e.b)/3.;f+=(g-f)*u_saturation_factor;f=(f-.5)*u_contrast_factor+.5;h=vec3(u_brightness_low);i=vec3(u_brightness_high);gl_FragColor=vec4(mix(h,i,f),e.a);}"},icon:{vertex:"precision mediump float;attribute vec2 a_pos,a_offset;attribute vec4 a_data1,a_data2;uniform highp mat4 u_matrix;uniform mat4 u_exmatrix;uniform float u_zoom,u_fadedist,u_minfadezoom,u_maxfadezoom,u_fadezoom,u_opacity,u_extra;uniform bool u_skewed;uniform vec2 u_texsize;varying vec2 a;varying float b;void main(){vec2 c,e;c=a_data1.xy;float d,f,g,h,i,j;d=a_data1[2];e=a_data2.st;f=e[0];g=e[1];h=10.;i=2.-step(f,u_zoom)-(1.-step(g,u_zoom));j=clamp((u_fadezoom-d)/u_fadedist,0.,1.);if(u_fadedist>=0.)b=j;else b=1.-j;if(u_maxfadezoom=d)b=1.;i+=step(b,0.);if(u_skewed){vec4 k=u_exmatrix*vec4(a_offset/64.,0,0);gl_Position=u_matrix*vec4(a_pos+k.xy,0,1);gl_Position.z+=i*gl_Position.w;}else{vec4 k=u_exmatrix*vec4(a_offset/64.,i,0);gl_Position=u_matrix*vec4(a_pos,0,1)+k;}a=c/u_texsize;b*=u_opacity;}",fragment:"precision mediump float;uniform sampler2D u_texture;varying vec2 a;varying float b;void main(){gl_FragColor=texture2D(u_texture,a)*b;}"},sdf:{vertex:"precision mediump float;attribute vec2 a_pos,a_offset;attribute vec4 a_data1,a_data2;uniform highp mat4 u_matrix;uniform mat4 u_exmatrix;uniform float u_zoom,u_fadedist,u_minfadezoom,u_maxfadezoom,u_fadezoom,u_extra;uniform bool u_skewed;uniform vec2 u_texsize;varying vec2 a;varying float b,c;void main(){vec2 d,f;d=a_data1.xy;float e,g,h,i,j,k,l;e=a_data1[2];f=a_data2.st;g=f[0];h=f[1];i=2.-step(g,u_zoom)-(1.-step(h,u_zoom));j=clamp((u_fadezoom-e)/u_fadedist,0.,1.);if(u_fadedist>=0.)b=j;else b=1.-j;if(u_maxfadezoom=e)b=1.;i+=step(b,0.);if(u_skewed){vec4 k=u_exmatrix*vec4(a_offset/64.,0,0);gl_Position=u_matrix*vec4(a_pos+k.xy,0,1);gl_Position.z+=i*gl_Position.w;}else{vec4 k=u_exmatrix*vec4(a_offset/64.,i,0);gl_Position=u_matrix*vec4(a_pos,0,1)+k;}k=gl_Position.y/gl_Position.w;l=1./(1.-k*u_extra);c=l;a=d/u_texsize;}",fragment:"precision mediump float;uniform sampler2D u_texture;uniform vec4 u_color;uniform float u_buffer,u_gamma;varying vec2 a;varying float b,c;void main(){float d,e,f;d=u_gamma*c;e=texture2D(u_texture,a).a;f=smoothstep(u_buffer-d,u_buffer+d,e)*b;gl_FragColor=u_color*f;}"},collisionbox:{vertex:"precision mediump float;attribute vec2 a_pos,a_extrude,a_data;uniform mat4 u_matrix;uniform float u_scale;varying float a,b;void main(){gl_Position=u_matrix*vec4(a_pos+a_extrude/u_scale,0,1);a=a_data.x;b=a_data.y;}",fragment:"precision mediump float;uniform float u_zoom,u_maxzoom;varying float a,b;void main(){float c=.5;gl_FragColor=vec4(0,1,0,1)*c;if(b>u_zoom)gl_FragColor=vec4(1,0,0,1)*c;if(u_zoom>=a)gl_FragColor=vec4(0,0,0,1)*c*.25;if(b>=u_maxzoom)gl_FragColor=vec4(0,0,1,1)*c*.2;}"}}},{}],39:[function(a,b,c){"use strict";function d(a){a=a||{},this._data=a.data,void 0!==a.maxzoom&&(this.maxzoom=a.maxzoom),this.geojsonVtOptions={maxZoom:this.maxzoom},void 0!==a.buffer&&(this.geojsonVtOptions.buffer=a.buffer),void 0!==a.tolerance&&(this.geojsonVtOptions.tolerance=a.tolerance),this._pyramid=new g({tileSize:512,minzoom:this.minzoom,maxzoom:this.maxzoom,cacheSize:20,load:this._loadTile.bind(this),abort:this._abortTile.bind(this),unload:this._unloadTile.bind(this),add:this._addTile.bind(this),remove:this._removeTile.bind(this)})}var e=a("../util/util"),f=a("../util/evented"),g=a("./tile_pyramid"),h=a("./source"),i=a("resolve-url");b.exports=d,d.prototype=e.inherit(f,{minzoom:0,maxzoom:14,_dirty:!0,setData:function(a){return this._data=a,this._dirty=!0,this.fire("change"),this.map&&this.update(this.map.transform),this},onAdd:function(a){this.map=a},loaded:function(){return this._loaded&&this._pyramid.loaded()},update:function(a){this._dirty&&this._updateData(),this._loaded&&this._pyramid.update(this.used,a)},reload:function(){this._loaded&&this._pyramid.reload()},render:h._renderTiles,featuresAt:h._vectorFeaturesAt,featuresIn:h._vectorFeaturesIn,_updateData:function(){this._dirty=!1;var a=this._data;"string"==typeof a&&(a=i(window.location.href,a)),this.workerID=this.dispatcher.send("parse geojson",{data:a,tileSize:512,source:this.id,geojsonVtOptions:this.geojsonVtOptions},function(a){return a?void this.fire("error",{error:a}):(this._loaded=!0,this._pyramid.reload(),void this.fire("change"))}.bind(this))},_loadTile:function(a){var b=a.coord.z>this.maxzoom?Math.pow(2,a.coord.z-this.maxzoom):1,c={uid:a.uid,coord:a.coord,zoom:a.coord.z,maxZoom:this.maxzoom,tileSize:512,source:this.id,overscaling:b,angle:this.map.transform.angle,pitch:this.map.transform.pitch,collisionDebug:this.map.collisionDebug};a.workerID=this.dispatcher.send("load geojson tile",c,function(b,c){if(a.unloadVectorData(this.map.painter),!a.aborted){if(b)return void this.fire("tile.error",{tile:a});a.loadVectorData(c),this.fire("tile.load",{tile:a})}}.bind(this),this.workerID)},_abortTile:function(a){a.aborted=!0},_addTile:function(a){this.fire("tile.add",{tile:a})},_removeTile:function(a){this.fire("tile.remove",{tile:a})},_unloadTile:function(a){a.unloadVectorData(this.map.painter),this.glyphAtlas.removeGlyphs(a.uid),this.dispatcher.send("remove tile",{uid:a.uid,source:this.id},null,a.workerID)}})},{"../util/evented":100,"../util/util":106,"./source":43,"./tile_pyramid":46,"resolve-url":139}],40:[function(a,b,c){"use strict";function d(a){this.features=a,this.length=a.length}function e(a){this.type=a.type,this.rawGeometry=1===a.type?[a.geometry]:a.geometry,this.properties=a.tags,this.extent=4096}var f=a("point-geometry"),g=a("vector-tile").VectorTileFeature;b.exports=d,d.prototype.feature=function(a){return new e(this.features[a])},e.prototype.loadGeometry=function(){var a=this.rawGeometry;this.geometry=[];for(var b=0;bd&&(d=-1*d-1);var e=1<b.row){var c=a;a=b,b=c}return{x0:a.column,y0:a.row,x1:b.column,y1:b.row,dx:b.column-a.column,dy:b.row-a.row}}function f(a,b,c,d,e){var f=Math.max(c,Math.floor(b.y0)),g=Math.min(d,Math.ceil(b.y1));if(a.x0===b.x0&&a.y0===b.y0?a.x0+b.dy/a.dy*a.dx0,l=b.dx<0,m=f;g>m;m++){var n=i*Math.max(0,Math.min(a.dy,m+k-a.y0))+a.x0,o=j*Math.max(0,Math.min(b.dy,m+l-b.y0))+b.x0;e(Math.floor(o),Math.ceil(n),m)}}function g(a,b,c,d,g,h){var i,j=e(a,b),k=e(b,c),l=e(c,a);j.dy>k.dy&&(i=j,j=k,k=i),j.dy>l.dy&&(i=j,j=l,l=i),k.dy>l.dy&&(i=k,k=l,l=i),j.dy&&f(l,j,d,g,h),k.dy&&f(l,k,d,g,h)}b.exports=d,d.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},d.fromID=function(a){var b=a%32,c=1<a?new d(this.z-1,this.x,this.y,this.w):new d(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},d.prototype.wrapped=function(){return new d(this.z,this.x,this.y,0)},d.prototype.children=function(a){if(this.z>=a)return[new d(this.z+1,this.x,this.y,this.w)];var b=this.z+1,c=2*this.x,e=2*this.y;return[new d(b,c,e,this.w),new d(b,c+1,e,this.w),new d(b,c,e+1,this.w),new d(b,c+1,e+1,this.w)]},d.cover=function(a,b,c){function e(a,b,e){var g,i;if(e>=0&&f>=e)for(g=a;b>g;g++){i=(g+f)%f;var j=new d(c,i,e,Math.floor(g/f));h[j.id]=j}}var f=1<this.maxzoom&&(b=this.maxzoom);var d=a,e=d.locationCoordinate(d.center)._zoomTo(b),h=new g(e.column-.5,e.row-.5);return f.cover(b,[d.pointCoordinate(new g(0,0))._zoomTo(b),d.pointCoordinate(new g(d.width,0))._zoomTo(b),d.pointCoordinate(new g(d.width,d.height))._zoomTo(b),d.pointCoordinate(new g(0,d.height))._zoomTo(b)],this.reparseOverscaled?c:b).sort(function(a,b){return h.dist(a)-h.dist(b)})},findLoadedChildren:function(a,b,c){for(var d=!0,e=a.z,f=a.children(this.maxzoom),g=0;ge&&this.findLoadedChildren(f[g],b,c))}return d},findLoadedParent:function(a,b,c){for(var d=a.z-1;d>=b;d--){a=a.parent(this.maxzoom);var e=this._tiles[a.id];if(e&&e.loaded)return c[a.id]=!0,e}},update:function(a,b,c){var d,e,g,h=(this.roundZoom?Math.round:Math.floor)(this.getZoom(b)),j=i.clamp(h-10,this.minzoom,this.maxzoom),k=i.clamp(h+1,this.minzoom,this.maxzoom),l={},m=(new Date).getTime();this._coveredTiles={};var n=a?this.coveringTiles(b):[];for(d=0;dm-(c||0)&&(this.findLoadedChildren(e,k,l)?(this._coveredTiles[o]=!0,l[o]=!0):this.findLoadedParent(e,j,l));var p=i.keysDifference(this._tiles,l);for(d=0;dthis.maxzoom?Math.pow(2,d-this.maxzoom):1;b=new e(c,this.tileSize*f),this._load(b)}return b.uses++,this._tiles[a.id]=b,this._add(b,a),b},removeTile:function(a){var b=this._tiles[a];b&&(b.uses--,delete this._tiles[a],this._remove(b),b.uses>0||(b.loaded?this._cache.add(b.coord.wrapped().id,b):(this._abort(b),this._unload(b))))},clearTiles:function(){for(var a in this._tiles)this.removeTile(a);this._cache.reset()},tileAt:function(a){for(var b=this.orderedIDs(),c=0;c=0&&e.x<4096&&e.y>=0&&e.y<4096)return{tile:d,x:e.x,y:e.y,scale:e.scale}}},tilesIn:function(a){for(var b=[],c=this.orderedIDs(),d=0;d=0&&f[1].y>=0&&b.push({tile:e,minX:f[0].x,maxX:f[1].x,minY:f[0].y,maxY:f[1].y})}return b}}},{"../util/mru_cache":104,"../util/util":106,"./tile":44,"./tile_coord":45,"point-geometry":137}],47:[function(a,b,c){"use strict";function d(a){if(e.extend(this,e.pick(a,["url","tileSize"])),512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");g._loadTileJSON.call(this,a)}var e=a("../util/util"),f=a("../util/evented"),g=a("./source");b.exports=d,d.prototype=e.inherit(f,{minzoom:0,maxzoom:22,tileSize:512,reparseOverscaled:!0,_loaded:!1,onAdd:function(a){this.map=a},loaded:function(){return this._pyramid&&this._pyramid.loaded()},update:function(a){this._pyramid&&this._pyramid.update(this.used,a)},reload:function(){this._pyramid&&this._pyramid.reload()},redoPlacement:function(){if(this._pyramid)for(var a=this._pyramid.orderedIDs(),b=0;bthis.maxzoom?Math.pow(2,a.coord.z-this.maxzoom):1,c={url:a.coord.url(this.tiles,this.maxzoom),uid:a.uid,coord:a.coord,zoom:a.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize*b,source:this.id,overscaling:b, -angle:this.map.transform.angle,pitch:this.map.transform.pitch,collisionDebug:this.map.collisionDebug};a.workerID?this.dispatcher.send("reload tile",c,this._tileLoaded.bind(this,a),a.workerID):a.workerID=this.dispatcher.send("load tile",c,this._tileLoaded.bind(this,a))},_tileLoaded:function(a,b,c){if(!a.aborted){if(b)return void this.fire("tile.error",{tile:a});a.loadVectorData(c),a.redoWhenDone&&(a.redoWhenDone=!1,this._redoTilePlacement(a)),this.fire("tile.load",{tile:a})}},_abortTile:function(a){a.aborted=!0,this.dispatcher.send("abort tile",{uid:a.uid,source:this.id},null,a.workerID)},_addTile:function(a){this.fire("tile.add",{tile:a})},_removeTile:function(a){this.fire("tile.remove",{tile:a})},_unloadTile:function(a){a.unloadVectorData(this.map.painter),this.glyphAtlas.removeGlyphs(a.uid),this.dispatcher.send("remove tile",{uid:a.uid,source:this.id},null,a.workerID)},_redoTilePlacement:function(a){function b(b,c){a.reloadSymbolData(c,this.map.painter),this.fire("tile.load",{tile:a}),a.redoingPlacement=!1,a.redoWhenDone&&(this._redoTilePlacement(a),a.redoWhenDone=!1)}return!a.loaded||a.redoingPlacement?void(a.redoWhenDone=!0):(a.redoingPlacement=!0,void this.dispatcher.send("redo placement",{uid:a.uid,source:this.id,angle:this.map.transform.angle,pitch:this.map.transform.pitch,collisionDebug:this.map.collisionDebug},b.bind(this),a.workerID))}})},{"../util/evented":100,"../util/util":106,"./source":43}],48:[function(a,b,c){"use strict";function d(a){this.coordinates=a.coordinates,j.getVideo(a.urls,function(a,b){if(!a){this.video=b,this.video.loop=!0;var c;this.video.addEventListener("playing",function(){c=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(c)}.bind(this)),this._loaded=!0,this.map&&(this.video.play(),this.createTile(),this.fire("change"))}}.bind(this))}var e=a("../util/util"),f=a("./tile"),g=a("../geo/lng_lat"),h=a("point-geometry"),i=a("../util/evented"),j=a("../util/ajax");b.exports=d,d.prototype=e.inherit(i,{roundZoom:!0,getVideo:function(){return this.video},onAdd:function(a){this.map=a,this.video&&(this.video.play(),this.createTile())},createTile:function(){var a=this.map,b=this.coordinates.map(function(b){var c=g.convert(b);return a.transform.locationCoordinate(c).zoomTo(0)}),c=e.getCoordinatesCenter(b),d=4096,i=b.map(function(a){var b=a.zoomTo(c.zoom);return new h(Math.round((b.column-c.column)*d),Math.round((b.row-c.row)*d))}),j=a.painter.gl,k=32767,l=new Int16Array([i[0].x,i[0].y,0,0,i[1].x,i[1].y,k,0,i[3].x,i[3].y,0,k,i[2].x,i[2].y,k,k]);this.tile=new f,this.tile.buckets={},this.tile.boundsBuffer=j.createBuffer(),j.bindBuffer(j.ARRAY_BUFFER,this.tile.boundsBuffer),j.bufferData(j.ARRAY_BUFFER,l,j.STATIC_DRAW),this.center=c},loaded:function(){return this.video&&this.video.readyState>=2},update:function(){},reload:function(){},render:function(a,b){if(this._loaded&&!(this.video.readyState<2)){var c=this.center;this.tile.calculateMatrices(c.zoom,c.column,c.row,this.map.transform,b);var d=b.gl;this.tile.texture?(d.bindTexture(d.TEXTURE_2D,this.tile.texture),d.texSubImage2D(d.TEXTURE_2D,0,0,0,d.RGBA,d.UNSIGNED_BYTE,this.video)):(this.tile.texture=d.createTexture(),d.bindTexture(d.TEXTURE_2D,this.tile.texture),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,this.video)),b.drawLayers(a,this.tile.posMatrix,this.tile)}},featuresAt:function(a,b,c){return c(null,[])},featuresIn:function(a,b,c){return c(null,[])}})},{"../geo/lng_lat":20,"../util/ajax":94,"../util/evented":100,"../util/util":106,"./tile":44,"point-geometry":137}],49:[function(a,b,c){"use strict";function d(a){this.self=a,this.actor=new e(a,this),this.loading={},this.loaded={},this.layers=[],this.geoJSONIndexes={}}var e=a("../util/actor"),f=a("./worker_tile"),g=a("../util/util"),h=a("../util/ajax"),i=a("vector-tile"),j=a("pbf"),k=a("geojson-vt"),l=a("./geojson_wrapper");b.exports=function(a){return new d(a)},g.extend(d.prototype,{"set layers":function(a){this.layers=a},"load tile":function(a,b){function c(a,c){return delete this.loading[d][e],a?b(a):(g.data=new i.VectorTile(new j(new Uint8Array(c))),g.parse(g.data,this.layers,this.actor,b),this.loaded[d]=this.loaded[d]||{},void(this.loaded[d][e]=g))}var d=a.source,e=a.uid;this.loading[d]||(this.loading[d]={});var g=this.loading[d][e]=new f(a);g.xhr=h.getArrayBuffer(a.url,c.bind(this))},"reload tile":function(a,b){var c=this.loaded[a.source],d=a.uid;if(c&&c[d]){var e=c[d];e.parse(e.data,this.layers,this.actor,b)}},"abort tile":function(a){var b=this.loading[a.source],c=a.uid;b&&b[c]&&(b[c].xhr.abort(),delete b[c])},"remove tile":function(a){var b=this.loaded[a.source],c=a.uid;b&&b[c]&&delete b[c]},"redo placement":function(a,b){var c=this.loaded[a.source],d=this.loading[a.source],e=a.uid;if(c&&c[e]){var f=c[e],g=f.redoPlacement(a.angle,a.pitch,a.collisionDebug);g.result&&b(null,g.result,g.transferables)}else d&&d[e]&&(d[e].angle=a.angle)},"parse geojson":function(a,b){var c=function(c,d){return c?b(c):(this.geoJSONIndexes[a.source]=k(d,a.geojsonVtOptions),void b(null))}.bind(this);"string"==typeof a.data?h.getJSON(a.data,c):c(null,a.data)},"load geojson tile":function(a,b){var c=a.source,d=a.coord,e=this.geoJSONIndexes[c].getTile(d.z,d.x,d.y);if(!e)return b(null,null);var g=new f(a);g.parse(new l(e.features),this.layers,this.actor,b),this.loaded[c]=this.loaded[c]||{},this.loaded[c][a.uid]=g},"query features":function(a,b){var c=this.loaded[a.source]&&this.loaded[a.source][a.uid];c?c.featureTree.query(a,b):b(null,[])}})},{"../util/actor":93,"../util/ajax":94,"../util/util":106,"./geojson_wrapper":40,"./worker_tile":50,"geojson-vt":115,pbf:135,"vector-tile":141}],50:[function(a,b,c){"use strict";function d(a){this.coord=a.coord,this.uid=a.uid,this.zoom=a.zoom,this.maxZoom=a.maxZoom,this.tileSize=a.tileSize,this.source=a.source,this.overscaling=a.overscaling,this.angle=a.angle,this.pitch=a.pitch,this.collisionDebug=a.collisionDebug,this.stacks={}}var e=a("../data/feature_tree"),f=a("../symbol/collision_tile"),g=a("../data/buffer/buffer_set"),h=a("../data/create_bucket");b.exports=d,d.prototype.parse=function(a,b,c,d){function i(a,b){for(var c=0;c=x)){var y=o.layout.visibility;if("none"!==y)if(p=h(o,r,this.zoom,this.overscaling,this.collisionDebug),p.layers=[o.id],t[p.id]=p,u.push(p),a.layers){var z=o["source-layer"];v[z]||(v[z]={}),v[z][p.id]=p}else v[p.id]=p}}}for(m=0;m=0;m--)p=u[m],p.needsPlacement&&(B?B.next=p:p.previousPlaced=!0,B=p),p.getDependencies&&p.getDependencies(this,c,j(p)),p.needsPlacement||p.getDependencies||k(q,p)},d.prototype.redoPlacement=function(a,b,c){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=a,{};for(var d=new g,e=[],h={},i=new f(a,b),j=this.bucketsInOrder,k=j.length-1;k>=0;k--){var l=j[k];"symbol"===l.type&&(l.placeFeatures(i,d,c),h[l.id]=l.elementGroups)}for(var m in d)e.push(d[m].array);return{result:{elementGroups:h,buffers:d},transferables:e}}},{"../data/buffer/buffer_set":2,"../data/create_bucket":13,"../data/feature_tree":15,"../symbol/collision_tile":68}],51:[function(a,b,c){"use strict";function d(){this.n=0,this.times=[]}b.exports=d,d.prototype.stopped=function(){return this.times=this.times.filter(function(a){return a.time>=(new Date).getTime()}),!this.times.length},d.prototype.set=function(a){return this.times.push({id:this.n,time:a+(new Date).getTime()}),this.n++},d.prototype.cancel=function(a){this.times=this.times.filter(function(b){return b.id!==a})}},{}],52:[function(a,b,c){"use strict";function d(a){this.base=a,this.retina=h.devicePixelRatio>1;var b=this.retina?"@2x":"";g.getJSON(i(a,b,".json"),function(a,b){return a?void this.fire("error",{error:a}):(this.data=b,void(this.img&&this.fire("load")))}.bind(this)),g.getImage(i(a,b,".png"),function(a,b){if(a)return void this.fire("error",{error:a});for(var c=b.getData(),d=b.data=new Uint8Array(c.length),e=0;e1!==this.retina){var a=new d(this.base);a.on("load",function(){this.img=a.img,this.data=a.data,this.retina=a.retina}.bind(this))}},e.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},d.prototype.getSpritePosition=function(a){if(!this.loaded())return new e;var b=this.data&&this.data[a];return b&&this.img?b:new e}},{"../util/ajax":94,"../util/browser":95,"../util/evented":100,"../util/mapbox":103}],53:[function(a,b,c){"use strict";var d=a("./reference");b.exports={},d.layout.forEach(function(a){var c=function(a){for(var b in a)this[b]=a[b]},e=d[a];for(var f in e)void 0!==e[f]["default"]&&(c.prototype[f]=e[f]["default"]);b.exports[a.replace("layout_","")]=c})},{"./reference":55}],54:[function(a,b,c){"use strict";var d=a("./reference"),e=a("csscolorparser").parseCSSColor;b.exports={},d.paint.forEach(function(a){var c=function(){},f=d[a];for(var g in f){var h=f[g],i=h["default"];void 0!==i&&("color"===h.type&&(i=e(i)),c.prototype[g]=i)}c.prototype.hidden=!1,b.exports[a.replace("paint_","")]=c})},{"./reference":55,csscolorparser:111}],55:[function(a,b,c){b.exports=a("mapbox-gl-style-spec/reference/latest")},{"mapbox-gl-style-spec/reference/latest":132}],56:[function(a,b,c){"use strict";function d(a,b){this.animationLoop=b||new r,this.dispatcher=new q(Math.max(p.hardwareConcurrency-1,1),this),this.glyphAtlas=new j(1024,1024),this.spriteAtlas=new k(512,512),this.spriteAtlas.resize(p.devicePixelRatio),this.lineAtlas=new l(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},m.bindAll(["_forwardSourceEvent","_forwardTileEvent","_redoPlacement"],this);var c=function(a,b){if(a)return void this.fire("error",{error:a});var c=s(b);if(c.length)for(var d=0;dMath.floor(a)&&(b.lastIntegerZoom=Math.floor(a+1),b.lastIntegerZoomTime=Date.now()),b.lastZoom=a},batch:function(a){f(this,a)},addSource:function(a,b){return this.batch(function(c){c.addSource(a,b)}),this},removeSource:function(a){return this.batch(function(b){b.removeSource(a)}),this},getSource:function(a){return this.sources[a]},addLayer:function(a,b){return this.batch(function(c){c.addLayer(a,b)}),this},removeLayer:function(a){return this.batch(function(b){b.removeLayer(a)}),this},getLayer:function(a){return this._layers[a]},getReferentLayer:function(a){var b=this.getLayer(a);return b.ref&&(b=this.getLayer(b.ref)),b},setFilter:function(a,b){return this.batch(function(c){c.setFilter(a,b)}),this},setLayerZoomRange:function(a,b,c){return this.batch(function(d){d.setLayerZoomRange(a,b,c)}),this},getFilter:function(a){return this.getReferentLayer(a).filter},getLayoutProperty:function(a,b){return this.getReferentLayer(a).getLayoutProperty(b)},getPaintProperty:function(a,b,c){return this.getLayer(a).getPaintProperty(b,c)},featuresAt:function(a,b,c){var d=[],e=null;b.layer&&(b.layerIds=Array.isArray(b.layer)?b.layer:[b.layer]),m.asyncEach(Object.keys(this.sources),function(c,f){var g=this.sources[c];g.featuresAt(a,b,function(a,b){b&&(d=d.concat(b)),a&&(e=a),f()})}.bind(this),function(){return e?c(e):void c(null,d.filter(function(a){return void 0!==this._layers[a.layer]}.bind(this)).map(function(a){return a.layer=this._layers[a.layer].json(),a}.bind(this)))}.bind(this))},featuresIn:function(a,b,c){var d=[],e=null;b.layer&&(b.layer={id:b.layer}),m.asyncEach(Object.keys(this.sources),function(c,f){var g=this.sources[c];g.featuresIn(a,b,function(a,b){b&&(d=d.concat(b)),a&&(e=a),f()})}.bind(this),function(){return e?c(e):void c(null,d.filter(function(a){return void 0!==this._layers[a.layer]}.bind(this)).map(function(a){return a.layer=this._layers[a.layer].json(),a}.bind(this)))}.bind(this))},_remove:function(){this.dispatcher.remove()},_reloadSource:function(a){this.sources[a].reload()},_updateSources:function(a){for(var b in this.sources)this.sources[b].update(a)},_redoPlacement:function(){for(var a in this.sources)this.sources[a].redoPlacement&&this.sources[a].redoPlacement()},_forwardSourceEvent:function(a){this.fire("source."+a.type,m.extend({source:a.target},a))},_forwardTileEvent:function(a){this.fire(a.type,m.extend({source:a.target},a))},"get sprite json":function(a,b){var c=this.sprite;c.loaded()?b(null,{sprite:c.data,retina:c.retina}):c.on("load",function(){b(null,{sprite:c.data,retina:c.retina})})},"get icons":function(a,b){var c=this.sprite,d=this.spriteAtlas;c.loaded()?(d.setSprite(c),d.addIcons(a.icons,b)):c.on("load",function(){d.setSprite(c),d.addIcons(a.icons,b)})},"get glyphs":function(a,b){this.glyphSource.getSimpleGlyphs(a.fontstack,a.codepoints,a.uid,b)}})},{"../render/line_atlas":36,"../symbol/glyph_atlas":70,"../symbol/glyph_source":71,"../symbol/sprite_atlas":77,"../util/ajax":94,"../util/browser":95,"../util/dispatcher":97,"../util/evented":100,"../util/mapbox":103,"../util/util":106,"./animation_loop":51,"./image_sprite":52,"./style_batch":57,"./style_layer":60,"mapbox-gl-style-spec/lib/validate/latest":130}],57:[function(a,b,c){"use strict";function d(a,b){if(!a._loaded)throw new Error("Style is not done loading");var c=Object.create(d.prototype);c._style=a,c._groupLayers=!1,c._broadcastLayers=!1,c._reloadSources={},c._events=[],c._change=!1,b(c),c._groupLayers&&c._style._groupLayers(),c._broadcastLayers&&c._style._broadcastLayers(),Object.keys(c._reloadSources).forEach(function(a){c._style._reloadSource(a)}),c._events.forEach(function(a){c._style.fire.apply(c._style,a)}),c._change&&c._style.fire("change")}var e=a("../source/source"),f=a("./style_layer");d.prototype={addLayer:function(a,b){if(void 0!==this._style._layers[a.id])throw new Error("There is already a layer with this ID");return a instanceof f||(a=new f(a)),this._style._layers[a.id]=a,this._style._order.splice(b?this._style._order.indexOf(b):1/0,0,a.id),a.resolveLayout(),a.resolveReference(this._style._layers),a.resolvePaint(),this._groupLayers=!0,this._broadcastLayers=!0,a.source&&(this._reloadSources[a.source]=!0),this._events.push(["layer.add",{layer:a}]),this._change=!0,this},removeLayer:function(a){var b=this._style._layers[a];if(void 0===b)throw new Error("There is no layer with this ID");for(var c in this._style._layers)this._style._layers[c].ref===a&&this.removeLayer(c);return delete this._style._layers[a],this._style._order.splice(this._style._order.indexOf(a),1),this._groupLayers=!0,this._broadcastLayers=!0,this._events.push(["layer.remove",{layer:b}]),this._change=!0,this},setPaintProperty:function(a,b,c,d){return this._style.getLayer(a).setPaintProperty(b,c,d),this._change=!0,this},setLayoutProperty:function(a,b,c){return a=this._style.getReferentLayer(a),a.setLayoutProperty(b,c),this._broadcastLayers=!0,a.source&&(this._reloadSources[a.source]=!0),this._change=!0,this},setFilter:function(a,b){return a=this._style.getReferentLayer(a),a.filter=b,this._broadcastLayers=!0,a.source&&(this._reloadSources[a.source]=!0),this._change=!0,this},setLayerZoomRange:function(a,b,c){var d=this._style.getReferentLayer(a);return null!=b&&(d.minzoom=b),null!=c&&(d.maxzoom=c),this._broadcastLayers=!0,d.source&&(this._reloadSources[d.source]=!0),this._change=!0,this},addSource:function(a,b){if(!this._style._loaded)throw new Error("Style is not done loading");if(void 0!==this._style.sources[a])throw new Error("There is already a source with this ID");return b=e.create(b),this._style.sources[a]=b,b.id=a,b.style=this._style,b.dispatcher=this._style.dispatcher,b.glyphAtlas=this._style.glyphAtlas,b.on("load",this._style._forwardSourceEvent).on("error",this._style._forwardSourceEvent).on("change",this._style._forwardSourceEvent).on("tile.add",this._style._forwardTileEvent).on("tile.load",this._style._forwardTileEvent).on("tile.error",this._style._forwardTileEvent).on("tile.remove",this._style._forwardTileEvent),this._events.push(["source.add",{source:b}]),this._change=!0,this},removeSource:function(a){if(void 0===this._style.sources[a])throw new Error("There is no source with this ID");var b=this._style.sources[a];return delete this._style.sources[a],b.off("load",this._style._forwardSourceEvent).off("error",this._style._forwardSourceEvent).off("change",this._style._forwardSourceEvent).off("tile.add",this._style._forwardTileEvent).off("tile.load",this._style._forwardTileEvent).off("tile.error",this._style._forwardTileEvent).off("tile.remove",this._style._forwardTileEvent),this._events.push(["source.remove",{source:b}]),this._change=!0,this}},b.exports=d},{"../source/source":43,"./style_layer":60}],58:[function(a,b,c){"use strict";function d(a,b){this.type=a.type,this.transitionable=a.transition,null==b&&(b=a["default"]),this.json=JSON.stringify(b),"color"===this.type?this.value=f(b):this.value=b,"interpolated"===a["function"]?this.calculate=i.interpolated(this.value):(this.calculate=i["piecewise-constant"](this.value),a.transition&&(this.calculate=e(this.calculate)))}function e(a){return function(b,c,d){var e,f,g,h=b%1,i=Math.min((Date.now()-c.lastIntegerZoomTime)/d,1),j=1,k=1;return b>c.lastIntegerZoom?(e=h+(1-h)*i,j*=2,f=a(b-1),g=a(b)):(e=1-(1-i)*h,g=a(b),f=a(b+1),j/=2),{from:f,fromScale:j,to:g,toScale:k,t:e}}}function f(a){if(k[a])return k[a];if(Array.isArray(a))return a;if(a.stops)return j.extend({},a,{stops:a.stops.map(function(a){return[a[0],f(a[1])]})});if("string"==typeof a){var b=g(h(a));return k[a]=b,b}throw new Error("Invalid color "+a)}function g(a){return[a[0]/255,a[1]/255,a[2]/255,a[3]/1]}var h=a("csscolorparser").parseCSSColor,i=a("mapbox-gl-function"),j=a("../util/util");b.exports=d;var k={}},{"../util/util":106,csscolorparser:111,"mapbox-gl-function":129}],59:[function(a,b,c){"use strict";function d(a){function b(a){this._values={},this._transitions={};for(var b in a)this[b]=a[b]}return Object.keys(a).forEach(function(c){var d=a[c];Object.defineProperty(b.prototype,c,{set:function(a){this._values[c]=new g(d,a)},get:function(){return this._values[c].value}}),d.transition&&Object.defineProperty(b.prototype,c+"-transition",{set:function(a){this._transitions[c]=a},get:function(){return this._transitions[c]}})}),b.prototype.values=function(){return this._values},b.prototype.transition=function(a,b){var c=this._transitions[a]||{};return{duration:e.coalesce(c.duration,b.duration,300),delay:e.coalesce(c.delay,b.delay,0)}},b.prototype.json=function(){var a={};for(var b in this._values)a[b]=this._values[b].value;for(var c in this._transitions)a[c+"-transition"]=this._transitions[b];return a},b}var e=a("../util/util"),f=a("./reference"),g=a("./style_declaration"),h={paint:{},layout:{}};f.layer.type.values.forEach(function(a){h.paint[a]=d(f["paint_"+a]),h.layout[a]=d(f["layout_"+a])}),b.exports=function(a,b,c){return new h[a][b](c)}},{"../util/util":106,"./reference":55,"./style_declaration":58}],60:[function(a,b,c){"use strict";function d(a){this._layer=a,this.id=a.id,this.ref=a.ref,this._resolved={},this._cascaded={},this.assign(a)}function e(a,b){var c=b+"-color",d=b+"-halo-color",e=b+"-outline-color",g=a[c],h=a[d],i=a[e],j=a[b+"-opacity"],k=g&&j*g[3],l=h&&j*h[3],m=i&&j*i[3];void 0!==k&&1>k&&(a[c]=f.premultiply([g[0],g[1],g[2],k])),void 0!==l&&1>l&&(a[d]=f.premultiply([h[0],h[1],h[2],l])),void 0!==m&&1>m&&(a[e]=f.premultiply([i[0],i[1],i[2],m]))}var f=a("../util/util"),g=a("./style_transition"),h=a("./style_declaration_set"),i=a("./layout_properties"),j=a("./paint_properties");b.exports=d,d.prototype={resolveLayout:function(){this.ref||(this.layout=new i[this.type](this._layer.layout),"line"===this.layout["symbol-placement"]&&(this.layout.hasOwnProperty("text-rotation-alignment")||(this.layout["text-rotation-alignment"]="map"),this.layout.hasOwnProperty("icon-rotation-alignment")||(this.layout["icon-rotation-alignment"]="map"),this.layout["symbol-avoid-edges"]=!0))},setLayoutProperty:function(a,b){null==b?delete this.layout[a]:this.layout[a]=b},getLayoutProperty:function(a){return this.layout[a]},resolveReference:function(a){this.ref&&this.assign(a[this.ref])},resolvePaint:function(){for(var a in this._layer){var b=a.match(/^paint(?:\.(.*))?$/);b&&(this._resolved[b[1]||""]=new h("paint",this.type,this._layer[a]))}},setPaintProperty:function(a,b,c){var d=this._resolved[c||""];d||(d=this._resolved[c||""]=new h("paint",this.type,{})),d[a]=b},getPaintProperty:function(a,b){var c=this._resolved[b||""];return c?c[a]:void 0},cascade:function(a,b,c,d){for(var e in this._resolved)if(""===e||a[e]){var f=this._resolved[e],i=f.values();for(var j in i){var k=i[j],l=b.transition?this._cascaded[j]:void 0;if(!l||l.declaration.json!==k.json){var m=f.transition(j,c),n=this._cascaded[j]=new g(k,l,m);n.instant()||(n.loopID=d.set(n.endTime-(new Date).getTime())),l&&d.cancel(l.loopID)}}}if("symbol"===this.type){var o=new h("layout",this.type,this.layout);this._cascaded["text-size"]=new g(o.values()["text-size"],(void 0),c),this._cascaded["icon-size"]=new g(o.values()["icon-size"],(void 0),c)}},recalculate:function(a,b){var c=this.type,d=this.paint=new j[c];for(var f in this._cascaded)d[f]=this._cascaded[f].at(a,b);if(this.hidden=this.minzoom&&a=this.maxzoom||"none"===this.layout.visibility,"symbol"===c?0!==d["text-opacity"]&&this.layout["text-field"]||0!==d["icon-opacity"]&&this.layout["icon-image"]?(e(d,"text"),e(d,"icon")):this.hidden=!0:0===d[c+"-opacity"]?this.hidden=!0:e(d,c),this._cascaded["line-dasharray"]){var g=d["line-dasharray"],h=this._cascaded["line-width"]?this._cascaded["line-width"].at(Math.floor(a),1/0):d["line-width"];g.fromScale*=h,g.toScale*=h}return!this.hidden},assign:function(a){f.extend(this,f.pick(a,["type","source","source-layer","minzoom","maxzoom","filter","layout"]))},json:function(){return f.extend({},this._layer,f.pick(this,["type","source","source-layer","minzoom","maxzoom","filter","layout","paint"]))}}},{"../util/util":106,"./layout_properties":53,"./paint_properties":54,"./style_declaration_set":59,"./style_transition":61}],61:[function(a,b,c){"use strict";function d(a,b,c){this.declaration=a,this.startTime=this.endTime=(new Date).getTime();var d=a.type;"string"!==d&&"array"!==d||!a.transitionable?this.interp=g[d]:this.interp=e,this.oldTransition=b,this.duration=c.duration||0,this.delay=c.delay||0,this.instant()||(this.endTime=this.startTime+this.duration+this.delay,this.ease=f.easeCubicInOut),b&&b.endTime<=this.startTime&&delete b.oldTransition}function e(a,b,c){return{from:a.to,fromScale:a.toScale,to:b.to,toScale:b.toScale,t:c}}var f=a("../util/util"),g=a("../util/interpolate");b.exports=d,d.prototype.instant=function(){return!this.oldTransition||!this.interp||0===this.duration&&0===this.delay},d.prototype.at=function(a,b,c){var d=this.declaration.calculate(a,b,this.duration);if(this.instant())return d;if(c=c||Date.now(),cd?{x:-1,y:-1}:(this.free.splice(d,1),c.wa&&this.free.push({x:c.x+a,y:c.y,w:c.w-a,h:b}),c.h>b&&this.free.push({x:c.x,y:c.y+b,w:c.w,h:c.h-b})):(c.w>a&&this.free.push({x:c.x+a,y:c.y,w:c.w-a,h:c.h}),c.h>b&&this.free.push({x:c.x,y:c.y+b,w:a,h:c.h-b})),{x:c.x,y:c.y,w:a,h:b})}},{}],64:[function(a,b,c){"use strict";function d(a,b,c,d,e){if(void 0===b.segment)return!0;for(var f=b,g=b.segment+1,h=0;h>-c/2;){if(g--,0>g)return!1;h-=a[g].dist(f),f=a[g]}h+=a[g].dist(a[g+1]),g++;for(var i=[],j=0;c/2>h;){var k=a[g-1],l=a[g],m=a[g+1];if(!m)return!1;var n=k.angleTo(l)-l.angleTo(m);for(n=(n+3*Math.PI)%(2*Math.PI)-Math.PI,i.push({distance:h,angleDelta:n}),j+=n;h-i[0].distance>d;)j-=i.shift().angleDelta;if(Math.abs(j)>e)return!1;g++,h+=l.dist(m)}return!0}b.exports=d},{}],65:[function(a,b,c){"use strict";function d(a,b,c,d,f){for(var g=[],h=0;h=d&&m.x>=d||(l.x>=d?l=new e(d,l.y+(m.y-l.y)*((d-l.x)/(m.x-l.x))):m.x>=d&&(m=new e(d,l.y+(m.y-l.y)*((d-l.x)/(m.x-l.x)))),l.y>=f&&m.y>=f||(l.y>=f?l=new e(l.x+(m.x-l.x)*((f-l.y)/(m.y-l.y)),f):m.y>=f&&(m=new e(l.x+(m.x-l.x)*((f-l.y)/(m.y-l.y)),f)),i&&l.equals(i[i.length-1])||(i=[l],g.push(i)),i.push(m)))))}return g}var e=a("point-geometry");b.exports=d},{"point-geometry":137}],66:[function(a,b,c){"use strict";function d(a,b,c,d,e,f){this.anchorPoint=a,this.x1=b,this.y1=c,this.x2=d,this.y2=e,this.maxScale=f,this.placementScale=0,this[0]=this[1]=this[2]=this[3]=0}b.exports=d},{}],67:[function(a,b,c){"use strict";function d(a,b,c,d,g,h){var i=c.top*d-g,j=c.bottom*d+g,k=c.left*d-g,l=c.right*d+g;if(this.boxes=[],h){var m=j-i,n=l-k;if(0>=m)return;m=Math.max(10*d,m),this._addLineCollisionBoxes(a,b,n,m)}else this.boxes.push(new e(new f(b.x,b.y),k,i,l,j,1/0))}var e=a("./collision_box"),f=a("point-geometry");b.exports=d,d.prototype._addLineCollisionBoxes=function(a,b,c,d){var f=d/2,g=Math.floor(c/f),h=-d/2,i=this.boxes,j=b,k=b.segment+1,l=h;do{if(k--,0>k)return i;l-=a[k].dist(j),j=a[k]}while(l>-c/2);for(var m=a[k].dist(a[k+1]),n=0;g>n;n++){for(var o=-c/2+n*f;o>l+m;){if(l+=m,k++,k+1>=a.length)return i;m=a[k].dist(a[k+1])}var p=o-l,q=a[k],r=a[k+1],s=r.sub(q)._unit()._mult(p)._add(q),t=Math.max(Math.abs(o-h)-f/2,0),u=c/2/t;i.push(new e(s,-d/2,-d/2,d/2,d/2,u))}return i}},{"./collision_box":66,"point-geometry":137}],68:[function(a,b,c){"use strict";function d(a,b){this.tree=e(),this.angle=a;var c=Math.sin(a),d=Math.cos(a);this.rotationMatrix=[d,-c,c,d],this.yStretch=1/Math.cos(b/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3)}var e=a("rbush");b.exports=d,d.prototype.minScale=.25,d.prototype.maxScale=2,d.prototype.placeCollisionFeature=function(a){for(var b=this.minScale,c=this.rotationMatrix,d=this.yStretch,e=0;el.maxScale&&(r=l.maxScale),r>f.maxScale&&(r=f.maxScale), -r>b&&r>=l.placementScale&&(b=r),b>=this.maxScale)return b}}return b},d.prototype.insertCollisionFeature=function(a,b){for(var c=a.boxes,d=0;db-k*h&&(b=k*h+b/4);var m=2*g,n=l?b/2*i%b:(k/2+m)*h*i%b;return e(a,n,b,j,c,k*h,l,!1)}function e(a,b,c,d,i,j,k,l){for(var m=0,n=b-c,o=[],p=0;pn+c;){n+=c;var u=(n-m)/s,v=f(q.x,r.x,u),w=f(q.y,r.y,u);if(v>=0&&4096>v&&w>=0&&4096>w){v=Math.round(v),w=Math.round(w);var x=new g(v,w,t,p);(!d||h(a,x,j,d,i))&&o.push(x)}}m+=s}return l||o.length||k||(o=e(a,m/2,c,d,i,j,k,!0)),o}var f=a("../util/interpolate"),g=a("../symbol/anchor"),h=a("./check_max_angle");b.exports=d},{"../symbol/anchor":62,"../util/interpolate":102,"./check_max_angle":64}],70:[function(a,b,c){"use strict";function d(a,b){this.width=a,this.height=b,this.bin=new e(a,b),this.index={},this.ids={},this.data=new Uint8Array(a*b)}var e=a("./bin_pack");b.exports=d,d.prototype={get debug(){return"canvas"in this},set debug(a){a&&!this.canvas?(this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,document.body.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d")):!a&&this.canvas&&(this.canvas.parentNode.removeChild(this.canvas),delete this.ctx,delete this.canvas)}},d.prototype.getGlyphs=function(){var a,b,c,d={};for(var e in this.ids)a=e.split("#"),b=a[0],c=a[1],d[b]||(d[b]=[]),d[b].push(c);return d},d.prototype.getRects=function(){var a,b,c,d={};for(var e in this.ids)a=e.split("#"),b=a[0],c=a[1],d[b]||(d[b]={}),d[b][c]=this.index[e];return d},d.prototype.removeGlyphs=function(a){for(var b in this.ids){var c=this.ids[b],d=c.indexOf(a);if(d>=0&&c.splice(d,1),this.ids[b]=c,!c.length){for(var e=this.index[b],f=this.data,g=0;gn;n++)for(var o=this.width*(k.y+n+h)+k.x+h,p=f*n,q=0;f>q;q++)l[o+q]=m[p+q];return this.dirty=!0,k},d.prototype.bind=function(a){this.gl=a,this.texture?a.bindTexture(a.TEXTURE_2D,this.texture):(this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texImage2D(a.TEXTURE_2D,0,a.ALPHA,this.width,this.height,0,a.ALPHA,a.UNSIGNED_BYTE,null))},d.prototype.updateTexture=function(a){if(this.bind(a),this.dirty){if(a.texSubImage2D(a.TEXTURE_2D,0,0,0,this.width,this.height,a.ALPHA,a.UNSIGNED_BYTE,this.data),this.ctx){for(var b=this.ctx.getImageData(0,0,this.width,this.height),c=0,d=0;c65535)return c("gyphs > 65535 not supported");void 0===this.loading[a]&&(this.loading[a]={});var d=this.loading[a];if(d[b])d[b].push(c);else{d[b]=[c];var e=256*b+"-"+(256*b+255),g=f(a,e,this.url);h(g,function(a,c){for(var e=!a&&new i(new j(new Uint8Array(c))),f=0;fc&&(f=!f),f&&e++;var j=new h(b.x,b.y),k=d[e],l=1/0;c=Math.abs(c);for(var m=i;;){var n=j.dist(k),o=c/n,p=Math.atan2(k.y-j.y,k.x-j.x);if(f||(p+=Math.PI),g&&(p+=Math.PI),a.push({anchorPoint:j,offset:g?Math.PI:0,minScale:o,maxScale:l,angle:(p+2*Math.PI)%(2*Math.PI)}),m>=o)break;for(j=k;j.equals(k);)if(e+=f?1:-1,k=d[e],!k)return o;var q=k.sub(j)._unit();j=j.sub(q._mult(n)),l=o}return m}var h=a("point-geometry");b.exports={getIconQuads:e,getGlyphQuads:f};var i=.5},{"point-geometry":137}],74:[function(a,b,c){"use strict";function d(a,b){for(var c=[],d=0,f=a.length;f>d;d++){var g=e(a[d].properties,b["icon-image"]);g&&c.indexOf(g)<0&&c.push(g)}return c}var e=a("../util/token");b.exports=d},{"../util/token":105}],75:[function(a,b,c){"use strict";function d(a,b,c){for(var d=[],f=[],h=0,i=a.length;i>h;h++){var j=g(a[h].properties,b["text-field"]);if(j){j=j.toString();var k=b["text-transform"];"uppercase"===k?j=j.toLocaleUpperCase():"lowercase"===k&&(j=j.toLocaleLowerCase());for(var l=0,m=j.length;m>l;l++)f.push(j.charCodeAt(l));d[h]=j}else d[h]=null}return f=e(f,c),{textFeatures:d,codepoints:f}}function e(a,b){var c,d=[];a.sort(f);for(var e=0;ed&&null!==j){var s=p[j+1].x;o=Math.max(s,o);for(var t=j+1;q>=t;t++)p[t].y+=c,p[t].x-=s;g&&h(p,b,m,j-1,g),m=j+1,j=null,k+=s,n++}l[r.codePoint]&&(j=q)}var u=p[p.length-1],v=u.x+b[u.codePoint].advance;o=Math.max(o,v);var w=(n+1)*c;h(p,b,m,p.length-1,g),i(p,g,e,f,o,c,n),a.top+=-f*w,a.bottom=a.top+w,a.left+=-e*o,a.right=a.left+o}function h(a,b,c,d,e){for(var f=b[a[d].codePoint].advance,g=(a[d].x+f)*e,h=c;d>=h;h++)a[h].x-=g}function i(a,b,c,d,e,f,g){for(var h=(b-c)*e,i=(-d*(g+1)+.5)*f,j=0;j=m;m++,n=((m+j)%j+d)*b+c,o+=f)for(l=-1;i>=l;l++)e[o+l]=a[n+(l+i)%i];else for(m=0;j>m;m++,n+=b,o+=f)for(l=0;i>l;l++)e[o+l]=a[n+l]}function f(a,b,c,d){this.rect=a,this.width=b,this.height=c,this.sdf=d}var g=a("./bin_pack");b.exports=d,d.prototype={get debug(){return"canvas"in this},set debug(a){a&&!this.canvas?(this.canvas=document.createElement("canvas"),this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio,this.canvas.style.width=this.width+"px",this.canvas.style.width=this.width+"px",document.body.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d")):!a&&this.canvas&&(this.canvas.parentNode.removeChild(this.canvas),delete this.ctx,delete this.canvas)}},d.prototype.resize=function(a){if(this.pixelRatio===a)return!1;var b=this.pixelRatio;if(this.pixelRatio=a,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio),this.data){var c=this.data;this.data=!1,this.allocate(),this.texture=!1;for(var d=this.width*b,e=this.height*b,f=this.width*a,g=this.height*a,h=this.data,i=c,j=0;g>j;j++)for(var k=Math.floor(j*e/g)*d,l=j*f,m=0;f>m;m++){var n=Math.floor(m*d/f);h[l+m]=i[k+n]}c=null,this.dirty=!0}return this.dirty},d.prototype.allocateImage=function(a,b){var c=2,d=a+c+(4-(a+c)%4),e=b+c+(4-(b+c)%4),f=this.bin.allocate(d,e);return 0===f.w?f:(f.originalWidth=a,f.originalHeight=b,f)},d.prototype.getImage=function(a,b){if(this.images[a])return this.images[a];if(!this.sprite)return null;var c=this.sprite.getSpritePosition(a);if(!c.width||!c.height)return null;var d=c.width/c.pixelRatio,e=c.height/c.pixelRatio,g=this.allocateImage(d,e);if(0===g.w)return g;var h=new f(g,d,e,c.sdf);return this.images[a]=h,this.copy(g,c,b),h},d.prototype.getPosition=function(a,b){var c=this.getImage(a,b),d=c&&c.rect;if(!d)return null;var e=b?c.width:d.w,f=b?c.height:d.h,g=1;return{size:[e,f],tl:[(d.x+g)/this.width,(d.y+g)/this.height],br:[(d.x+g+e)/this.width,(d.y+g+f)/this.height]}},d.prototype.allocate=function(){if(!this.data){var a=Math.floor(this.width*this.pixelRatio),b=Math.floor(this.height*this.pixelRatio);this.data=new Uint32Array(a*b);for(var c=0;c=200&&(this.zooming=!1,this.fire("moveend"))},b),b.duration<200&&(clearTimeout(this._onZoomEnd),this._onZoomEnd=setTimeout(function(){this.zooming=!1,this.fire("moveend")}.bind(this),200)),this},zoomIn:function(a){return this.zoomTo(this.getZoom()+1,a),this},zoomOut:function(a){return this.zoomTo(this.getZoom()-1,a),this},getBearing:function(){return this.transform.bearing},setBearing:function(a){return this.jumpTo({bearing:a}),this},rotateTo:function(a,b){this.stop(),b=d.extend({duration:500,easing:d.ease},b);var c=this.transform,f=this.getBearing(),h=c.center;return b.around?h=g.convert(b.around):b.offset&&(h=c.pointLocation(c.centerPoint.add(i.convert(b.offset)))),a=this._normalizeBearing(a,f),this.rotating=!0,this.fire("movestart"),this._ease(function(b){c.setBearingAround(e(f,a,b),h),this.fire("move").fire("rotate")},function(){this.rotating=!1,this.fire("moveend")},b),this},resetNorth:function(a){return this.rotateTo(0,d.extend({duration:1e3},a)),this},snapToNorth:function(a){return Math.abs(this.getBearing())x?-1:1;D=Math.abs(Math.log(x/w))/u,C=function(){return 0},B=function(a){return Math.exp(E*u*a)}}return a.duration=1e3*D/v,this.zooming=!0,m!==p&&(this.rotating=!0),this.fire("movestart"),this._ease(function(a){var b=a*D,c=C(b);j.zoom=l+j.scaleZoom(1/B(b)),j.center=j.unproject(r.add(s.sub(r).mult(c)),t),p!==m&&(j.bearing=e(m,p,a)),this.fire("move").fire("zoom"),p!==m&&this.fire("rotate")},function(){this.zooming=!1,this.rotating=!1,this.fire("moveend")},a),this},isEasing:function(){return!!this._abortFn},stop:function(){return this._abortFn&&(this._abortFn.call(this),this._finishEase()),this},_ease:function(a,b,c){this._finishFn=b,this._abortFn=f.timed(function(b){a.call(this,c.easing(b)),1===b&&this._finishEase()},c.animate===!1?0:c.duration,this)},_finishEase:function(){delete this._abortFn;var a=this._finishFn;delete this._finishFn,a.call(this)},_normalizeBearing:function(a,b){a=d.wrap(a,-180,180);var c=Math.abs(a-b);return Math.abs(a-360-b)b?-5:b>window.screen.width-2?5:(b-this._prevX)/4;this._map.setBearing(this._map.getBearing()-c),this._prevX=a.screenX,this._moved=!0,a.preventDefault()},_onCompassUp:function(){document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),f.enableDrag(),this._moved&&(this._moved=!1,f.suppressClick()),this._map.snapToNorth()},_createButton:function(a,b){var c=f.create("button",a,this._container);return c.addEventListener("click",function(){b()}),c},_drawNorth:function(){var a=20,b=8,c=26,d=this._map.transform.angle+Math.PI/2,e=this._compassCtx;this._compassCanvas.width=this._compassCanvas.width,e.translate(c,c),e.rotate(d),e.beginPath(),e.fillStyle="#000",e.lineTo(0,-b),e.lineTo(-a,0),e.lineTo(0,b),e.fill(),e.beginPath(),e.fillStyle="#bbb",e.moveTo(0,0),e.lineTo(0,b),e.lineTo(a,0),e.lineTo(0,-b),e.fill(),e.beginPath(),e.strokeStyle="#fff",e.lineWidth=4,e.moveTo(0,-b),e.lineTo(0,b),e.stroke()}})},{"../../util/dom":98,"../../util/util":106,"./control":80}],82:[function(a,b,c){"use strict";function d(a){this._map=a,this._el=a.getCanvasContainer(),this._container=a.getContainer(),g.bindHandlers(this)}var e=a("../../util/dom"),f=a("../../geo/lng_lat_bounds"),g=a("../../util/util");b.exports=d,d.prototype={enable:function(){this._el.addEventListener("mousedown",this._onMouseDown,!1)},disable:function(){this._el.removeEventListener("mousedown",this._onMouseDown)},_onMouseDown:function(a){(a.shiftKey||1===a.which&&1===a.button)&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),this._startPos=e.mousePos(this._el,a),this.active=!0)},_onMouseMove:function(a){var b=this._startPos,c=e.mousePos(this._el,a);this._box||(this._box=e.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),e.disableDrag(),this._map.fire("boxzoomstart"));var d=Math.min(b.x,c.x),f=Math.max(b.x,c.x),g=Math.min(b.y,c.y),h=Math.max(b.y,c.y);e.setTransform(this._box,"translate("+d+"px,"+g+"px)"),this._box.style.width=f-d+"px",this._box.style.height=h-g+"px"},_onMouseUp:function(a){var b=this._startPos,c=e.mousePos(this._el,a),d=new f(this._map.unproject(b),this._map.unproject(c));this._finish(),this._map.fitBounds(d,{linear:!0}).fire("boxzoomend",{boxZoomBounds:d})},_onKeyDown:function(a){27===a.keyCode&&(this._finish(),this._map.fire("boxzoomcancel"))},_finish:function(){this._box&&(this.active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box.parentNode.removeChild(this._box),this._box=null,e.enableDrag())}}},{"../../geo/lng_lat_bounds":21,"../../util/dom":98,"../../util/util":106}],83:[function(a,b,c){"use strict";function d(a){this._map=a,this._onDblClick=this._onDblClick.bind(this)}b.exports=d,d.prototype={enable:function(){this._map.on("dblclick",this._onDblClick)},disable:function(){this._map.off("dblclick",this._onDblClick)},_onDblClick:function(a){this._map.zoomTo(Math.round(this._map.getZoom())+1,{around:a.lngLat})}}},{}],84:[function(a,b,c){"use strict";function d(a){this._map=a,this._el=a.getCanvasContainer(),f.bindHandlers(this)}var e=a("../../util/dom"),f=a("../../util/util");b.exports=d;var g=.25,h=f.bezier(0,0,g,1),i=3e3,j=4e3;d.prototype={enable:function(){this._el.addEventListener("mousedown",this._onDown,!1),this._el.addEventListener("touchstart",this._onDown,!1)},disable:function(){this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown)},_onDown:function(a){this._startPos=this._pos=e.mousePos(this._el,a),this._inertia=[[Date.now(),this._pos]],a.touches?1===a.touches.length&&(document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onTouchEnd,!1)):(document.addEventListener("mousemove",this._onMove,!1),document.addEventListener("mouseup",this._onMouseUp,!1))},_onMove:function(a){var b=this._map;if(!(b.boxZoom.active||b.dragRotate.active||a.touches&&a.touches.length>1)){var c=e.mousePos(this._el,a),d=this._inertia,f=Date.now();for(d.push([f,c]);d.length>2&&f-d[0][0]>50;)d.shift();b.stop(),b.transform.setLocationAtPoint(b.transform.pointLocation(this._pos),c),b.fire("move"),this._pos=c,a.preventDefault()}},_onUp:function(){var a=this._inertia;if(a.length<2)return void this._map.fire("moveend");var b=a[a.length-1],c=a[0],d=b[1].sub(c[1]),e=(b[0]-c[0])/1e3,f=d.mult(g/e),k=f.mag();k>i&&(k=i,f._unit()._mult(k));var l=k/(j*g),m=f.mult(-l/2);this._map.panBy(m,{duration:1e3*l,easing:h,noMoveStart:!0})},_onMouseUp:function(){this._onUp(),document.removeEventListener("mousemove",this._onMove,!1),document.removeEventListener("mouseup",this._onMouseUp,!1)},_onTouchEnd:function(){this._onUp(),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd)}}},{"../../util/dom":98,"../../util/util":106}],85:[function(a,b,c){"use strict";function d(a){this._map=a,this._el=a.getCanvasContainer(),g.bindHandlers(this)}var e=a("../../util/dom"),f=a("point-geometry"),g=a("../../util/util");b.exports=d,d.prototype={enable:function(){this._el.addEventListener("contextmenu",this._onContextMenu,!1)},disable:function(){this._el.removeEventListener("contextmenu",this._onContextMenu)},_onContextMenu:function(a){this._map.stop(),this.active=!0,this._startPos=this._pos=e.mousePos(this._el,a),document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("mouseup",this._onMouseUp,!1),a.preventDefault()},_onMouseMove:function(a){var b=this._startPos,c=this._pos,d=e.mousePos(this._el,a),g=this._map,h=g.transform.centerPoint,i=b.sub(h),j=i.mag();g.rotating||(g.fire("movestart"),g.rotating=!0),200>j&&(h=b.add(new f((-200),0)._rotate(i.angle())));var k=c.sub(h).angleWith(d.sub(h))/Math.PI*180;g.transform.bearing=g.getBearing()-k,g.fire("move").fire("rotate"),clearTimeout(this._timeout),this._timeout=setTimeout(this._onTimeout,200),this._pos=d},_onTimeout:function(){var a=this._map;a.rotating=!1,a.snapToNorth(),a.rotating||(a._rerender(),a.fire("moveend"))},_onMouseUp:function(){this.active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("mouseup",this._onMouseUp,!1)}}},{"../../util/dom":98,"../../util/util":106,"point-geometry":137}],86:[function(a,b,c){"use strict";function d(a){this._map=a,this._el=a.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}b.exports=d;var e=80,f=2;d.prototype={enable:function(){this._el.addEventListener("keydown",this._onKeyDown,!1)},disable:function(){this._el.removeEventListener("keydown",this._onKeyDown)},_onKeyDown:function(a){if(!(a.altKey||a.ctrlKey||a.metaKey)){var b=this._map;switch(a.keyCode){case 61:case 107:case 171:case 187:b.zoomTo(Math.round(b.getZoom())+(a.shiftKey?2:1));break;case 189:case 109:case 173:b.zoomTo(Math.round(b.getZoom())-(a.shiftKey?2:1));break;case 37:a.shiftKey?b.setBearing(b.getBearing()-f):b.panBy([-e,0]);break;case 39:a.shiftKey?b.setBearing(b.getBearing()+f):b.panBy([e,0]);break;case 38:b.panBy([0,-e]);break;case 40:b.panBy([0,e])}}}}},{}],87:[function(a,b,c){"use strict";function d(a){this._map=a,this._el=a.getCanvasContainer(),f.bindHandlers(this)}var e=a("../../util/dom"),f=a("../../util/util");b.exports=d,d.prototype={enable:function(){this._el.addEventListener("touchstart",this._onStart,!1)},disable:function(){this._el.removeEventListener("touchstart",this._onStart)},_onStart:function(a){if(2===a.touches.length){var b=e.mousePos(this._el,a.touches[0]),c=e.mousePos(this._el,a.touches[1]);this._startVec=b.sub(c),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(a){if(2===a.touches.length){var b=e.mousePos(this._el,a.touches[0]),c=e.mousePos(this._el,a.touches[1]),d=b.add(c).div(2),f=b.sub(c),g=f.mag()/this._startVec.mag(),h=180*f.angleWith(this._startVec)/Math.PI,i=this._map;i.easeTo({zoom:i.transform.scaleZoom(this._startScale*g),bearing:this._startBearing+h,duration:0,around:i.unproject(d) -}),a.preventDefault()}},_onEnd:function(){this._map.snapToNorth(),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd)}}},{"../../util/dom":98,"../../util/util":106}],88:[function(a,b,c){"use strict";function d(a){this._map=a,this._el=a.getCanvasContainer(),g.bindHandlers(this)}var e=a("../../util/dom"),f=a("../../util/browser"),g=a("../../util/util");b.exports=d;var h="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",i=-1!==h.indexOf("firefox"),j=-1!==h.indexOf("safari")&&-1===h.indexOf("chrom");d.prototype={enable:function(){this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1)},disable:function(){this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel)},_onWheel:function(a){var b;"wheel"===a.type?(b=a.deltaY,i&&a.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(b/=f.devicePixelRatio),a.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(b*=40)):"mousewheel"===a.type&&(b=-a.wheelDeltaY,j&&(b/=3));var c=(window.performance||Date).now(),d=c-(this._time||0);this._pos=e.mousePos(this._el,a),this._time=c,0!==b&&b%4.000244140625===0?(this._type="wheel",b=Math.floor(b/4)):0!==b&&Math.abs(b)<4?this._type="trackpad":d>400?(this._type=null,this._lastValue=b,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(d*b)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,b+=this._lastValue)),a.shiftKey&&b&&(b/=4),this._type&&this._zoom(-b),a.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(a){var b=this._map,c=2/(1+Math.exp(-Math.abs(a/100)));0>a&&0!==c&&(c=1/c);var d=b.ease?b.ease.to:b.transform.scale,e=b.transform.scaleZoom(d*c);b.zoomTo(e,{duration:0,around:b.unproject(this._pos)})}}},{"../../util/browser":95,"../../util/dom":98,"../../util/util":106}],89:[function(a,b,c){"use strict";function d(){e.bindAll(["_onHashChange","_updateHash"],this)}b.exports=d;var e=a("../util/util");d.prototype={addTo:function(a){return this._map=a,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var a=location.hash.replace("#","").split("/");return a.length>=3&&(this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:+(a[3]||0)}),!0)},_updateHash:function(){var a=this._map.getCenter(),b=this._map.getZoom(),c=this._map.getBearing(),d=Math.max(0,Math.ceil(Math.log(b)/Math.LN2)),e="#"+Math.round(100*b)/100+"/"+a.lat.toFixed(d)+"/"+a.lng.toFixed(d)+(c?"/"+Math.round(10*c)/10:"");window.history.replaceState("","",e)}}},{"../util/util":106}],90:[function(a,b,c){"use strict";function d(a){this._map=a,this._el=a.getCanvasContainer();for(var b in e)a[b]=new e[b](a);g.bindHandlers(this)}var e={scrollZoom:a("./handler/scroll_zoom"),boxZoom:a("./handler/box_zoom"),dragRotate:a("./handler/drag_rotate"),dragPan:a("./handler/drag_pan"),keyboard:a("./handler/keyboard"),doubleClickZoom:a("./handler/dblclick_zoom"),pinch:a("./handler/pinch")},f=a("../util/dom"),g=a("../util/util");b.exports=d,d.prototype={enable:function(){var a=this._map.options,b=this._el;for(var c in e)a[c]&&this._map[c].enable();b.addEventListener("mousedown",this._onMouseDown,!1),b.addEventListener("touchstart",this._onTouchStart,!1),b.addEventListener("click",this._onClick,!1),b.addEventListener("mousemove",this._onMouseMove,!1),b.addEventListener("dblclick",this._onDblClick,!1)},disable:function(){var a=this._map.options,b=this._el;for(var c in e)a[c]&&this._map[c].disable();b.removeEventListener("mousedown",this._onMouseDown),b.removeEventListener("touchstart",this._onTouchStart),b.removeEventListener("click",this._onClick),b.removeEventListener("mousemove",this._onMouseMove),b.removeEventListener("dblclick",this._onDblClick)},_onMouseDown:function(a){this._startPos=f.mousePos(this._el,a)},_onTouchStart:function(a){!a.touches||a.touches.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._fireEvent("dblclick",a)):this._tapped=setTimeout(this._onTimeout,300))},_onTimeout:function(){this._tapped=null},_onMouseMove:function(a){var b=this._map,c=this._el;if(!b.dragPan.active&&!b.dragRotate.active){for(var d=a.toElement||a.target;d&&d!==c;)d=d.parentNode;d===c&&this._fireEvent("mousemove",a)}},_onClick:function(a){var b=f.mousePos(this._el,a);b.equals(this._startPos)&&this._fireEvent("click",a)},_onDblClick:function(a){this._fireEvent("dblclick",a),a.preventDefault()},_fireEvent:function(a,b){var c=f.mousePos(this._el,b);this._map.fire(a,{lngLat:this._map.unproject(c),point:c,originalEvent:b})}}},{"../util/dom":98,"../util/util":106,"./handler/box_zoom":82,"./handler/dblclick_zoom":83,"./handler/drag_pan":84,"./handler/drag_rotate":85,"./handler/keyboard":86,"./handler/pinch":87,"./handler/scroll_zoom":88}],91:[function(a,b,c){"use strict";var d=a("../util/canvas"),e=a("../util/util"),f=a("../util/browser"),g=a("../util/evented"),h=a("../util/dom"),i=a("../style/style"),j=a("../style/animation_loop"),k=a("../render/painter"),l=a("../geo/transform"),m=a("./hash"),n=a("./interaction"),o=a("./camera"),p=a("../geo/lng_lat"),q=a("../geo/lng_lat_bounds"),r=a("point-geometry"),s=a("./control/attribution"),t=b.exports=function(a){if(a=this.options=e.inherit(this.options,a),this.animationLoop=new j,this.transform=new l(a.minZoom,a.maxZoom),a.maxBounds){var b=q.convert(a.maxBounds);this.transform.lngRange=[b.getWest(),b.getEast()],this.transform.latRange=[b.getSouth(),b.getNorth()]}e.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowResize","onError","update","render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this.update),this.on("zoom",this.update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),"undefined"!=typeof window&&window.addEventListener("resize",this._onWindowResize,!1),this.interaction=new n(this),a.interactive&&this.interaction.enable(),this._hash=a.hash&&(new m).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo(a),this.sources={},this.stacks={},this._classes={},this.resize(),a.classes&&this.setClasses(a.classes),a.style&&this.setStyle(a.style),a.attributionControl&&this.addControl(new s),this.on("style.error",this.onError),this.on("source.error",this.onError),this.on("tile.error",this.onError)};e.extend(t.prototype,g),e.extend(t.prototype,o.prototype),e.extend(t.prototype,{options:{center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,pinch:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1},addControl:function(a){return a.addTo(this),this},addClass:function(a,b){this._classes[a]||(this._classes[a]=!0,this.style&&this.style._cascade(this._classes,b))},removeClass:function(a,b){this._classes[a]&&(delete this._classes[a],this.style&&this.style._cascade(this._classes,b))},setClasses:function(a,b){this._classes={};for(var c=0;cthis._map.transform.height-d?["bottom"]:[],a.xthis._map.transform.width-c/2&&b.push("right"),b=0===b.length?"bottom":b.join("-"),this.options.anchor=b}var e={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},f=this._container.classList;for(var h in e)f.remove("mapboxgl-popup-anchor-"+h);f.add("mapboxgl-popup-anchor-"+b),g.setTransform(this._container,e[b]+" translate("+a.x+"px,"+a.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":20,"../util/dom":98,"../util/evented":100,"../util/util":106}],93:[function(a,b,c){"use strict";function d(a,b){this.target=a,this.parent=b,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}b.exports=d,d.prototype.receive=function(a){var b,c=a.data;if(""===c.type)b=this.callbacks[c.id],delete this.callbacks[c.id],b(c.error||null,c.data);else if("undefined"!=typeof c.id){var d=c.id;this.parent[c.type](c.data,function(a,b,c){this.postMessage({type:"",id:String(d),error:a?String(a):null,data:b},c)}.bind(this))}else this.parent[c.type](c.data)},d.prototype.send=function(a,b,c,d){var e=null;c&&(this.callbacks[e=this.callbackID++]=c),this.postMessage({type:a,id:String(e),data:b},d)},d.prototype.postMessage=function(a,b){try{this.target.postMessage(a,b)}catch(c){this.target.postMessage(a)}}},{}],94:[function(a,b,c){"use strict";function d(a){var b=document.createElement("a");return b.href=a,b.protocol===document.location.protocol&&b.host===document.location.host}c.getJSON=function(a,b){var c=new XMLHttpRequest;return c.open("GET",a,!0),c.setRequestHeader("Accept","application/json"),c.onerror=function(a){b(a)},c.onload=function(){if(c.status>=200&&c.status<300&&c.response){var a;try{a=JSON.parse(c.response)}catch(d){return b(d)}b(null,a)}else b(new Error(c.statusText))},c.send(),c},c.getArrayBuffer=function(a,b){var c=new XMLHttpRequest;return c.open("GET",a,!0),c.responseType="arraybuffer",c.onerror=function(a){b(a)},c.onload=function(){c.status>=200&&c.status<300&&c.response?b(null,c.response):b(new Error(c.statusText))},c.send(),c},c.getImage=function(a,b){return c.getArrayBuffer(a,function(a,c){a&&b(a);var d=new Image;d.onload=function(){b(null,d),(window.URL||window.webkitURL).revokeObjectURL(d.src)};var e=new Blob([new Uint8Array(c)],{type:"image/png"});return d.src=(window.URL||window.webkitURL).createObjectURL(e),d.getData=function(){var a=document.createElement("canvas"),b=a.getContext("2d");return a.width=d.width,a.height=d.height,b.drawImage(d,0,0),b.getImageData(0,0,d.width,d.height).data},d})},c.getVideo=function(a,b){var c=document.createElement("video");c.onloadstart=function(){b(null,c)};for(var e=0;e=g+b?a.call(d,1):(a.call(d,(h-g)/b),c.frame(e)))}if(!b)return a.call(d,1),null;var f=!1,g=window.performance?window.performance.now():Date.now();return c.frame(e),function(){f=!0}},c.supported=function(a){for(var b=([function(){return"undefined"!=typeof window},function(){return"undefined"!=typeof document},function(){return!!(Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray)},function(){return!(!Function.prototype||!Function.prototype.bind||!(Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions))},function(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON},function(){return(new d).supportsWebGLContext(a&&a.failIfMajorPerformanceCaveat||!1)},function(){return"Worker"in window}]),c=0;cd;d++){var g=new f(a("../../source/worker")),h=new e(g,c);h.name="Worker "+d,this.actors.push(h)}}var e=a("../actor"),f=a("webworkify");b.exports=d,d.prototype={broadcast:function(a,b){for(var c=0;c=0&&this._events[a].splice(c,1),this._events[a].length||delete this._events[a]}else delete this._events[a];return this},once:function(a,b){var c=function(d){this.off(a,c),b.call(this,d)}.bind(this);return this.on(a,c),this},fire:function(a,b){if(!this.listens(a))return this;b=d.extend({},b),d.extend(b,{type:a,target:this});for(var c=this._events[a].slice(),e=0;e=2?"@2x.$1":".$1"):a}},{"./browser":95,"./config":99}],104:[function(a,b,c){"use strict";function d(a,b){this.max=a,this.onRemove=b,this.reset()}b.exports=d,d.prototype.reset=function(){for(var a in this.list)this.onRemove(this.list[a]);return this.list={},this.order=[],this},d.prototype.add=function(a,b){if(this.list[a]=b,this.order.push(a),this.order.length>this.max){var c=this.get(this.order[0]);c&&this.onRemove(c)}return this},d.prototype.has=function(a){return a in this.list},d.prototype.keys=function(){return this.order},d.prototype.get=function(a){if(!this.has(a))return null;var b=this.list[a];return delete this.list[a],this.order.splice(this.order.indexOf(a),1),b}},{}],105:[function(a,b,c){"use strict";function d(a,b){return b.replace(/{([^{}()\[\]<>$=:;.,^]+)}/g,function(b,c){return c in a?a[c]:""})}b.exports=d},{}],106:[function(a,b,c){"use strict";var d=a("unitbezier"),e=a("../geo/coordinate");c.easeCubicInOut=function(a){if(0>=a)return 0;if(a>=1)return 1;var b=a*a,c=b*a;return 4*(.5>a?c:3*(a-b)+c-.75)},c.bezier=function(a,b,c,e){var f=new d(a,b,c,e);return function(a){return f.solve(a)}},c.ease=c.bezier(.25,.1,.25,1),c.premultiply=function(a){return a[0]*=a[3],a[1]*=a[3],a[2]*=a[3],a},c.clamp=function(a,b,c){return Math.min(c,Math.max(b,a))},c.wrap=function(a,b,c){var d=c-b;return a===c?a:((a-b)%d+d)%d+b},c.coalesce=function(){for(var a=0;a1)for(var c=1;c=3&&(d.depth=arguments[2]),arguments.length>=4&&(d.colors=arguments[3]),p(b)?d.showHidden=b:b&&c._extend(d,b),v(d.showHidden)&&(d.showHidden=!1),v(d.depth)&&(d.depth=2),v(d.colors)&&(d.colors=!1),v(d.customInspect)&&(d.customInspect=!0),d.colors&&(d.stylize=f),i(d,a,d.depth)}function f(a,b){var c=e.styles[b];return c?"["+e.colors[c][0]+"m"+a+"["+e.colors[c][1]+"m":a}function g(a,b){return a}function h(a){var b={};return a.forEach(function(a,c){b[a]=!0}),b}function i(a,b,d){if(a.customInspect&&b&&A(b.inspect)&&b.inspect!==c.inspect&&(!b.constructor||b.constructor.prototype!==b)){var e=b.inspect(d,a);return t(e)||(e=i(a,e,d)),e}var f=j(a,b);if(f)return f;var g=Object.keys(b),p=h(g);if(a.showHidden&&(g=Object.getOwnPropertyNames(b)),z(b)&&(g.indexOf("message")>=0||g.indexOf("description")>=0))return k(b);if(0===g.length){if(A(b)){var q=b.name?": "+b.name:"";return a.stylize("[Function"+q+"]","special")}if(w(b))return a.stylize(RegExp.prototype.toString.call(b),"regexp");if(y(b))return a.stylize(Date.prototype.toString.call(b),"date");if(z(b))return k(b)}var r="",s=!1,u=["{","}"];if(o(b)&&(s=!0,u=["[","]"]),A(b)){var v=b.name?": "+b.name:"";r=" [Function"+v+"]"}if(w(b)&&(r=" "+RegExp.prototype.toString.call(b)),y(b)&&(r=" "+Date.prototype.toUTCString.call(b)),z(b)&&(r=" "+k(b)),0===g.length&&(!s||0==b.length))return u[0]+r+u[1];if(0>d)return w(b)?a.stylize(RegExp.prototype.toString.call(b),"regexp"):a.stylize("[Object]","special");a.seen.push(b);var x;return x=s?l(a,b,d,p,g):g.map(function(c){return m(a,b,d,p,c,s)}),a.seen.pop(),n(x,r,u)}function j(a,b){if(v(b))return a.stylize("undefined","undefined");if(t(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}return s(b)?a.stylize(""+b,"number"):p(b)?a.stylize(""+b,"boolean"):q(b)?a.stylize("null","null"):void 0}function k(a){return"["+Error.prototype.toString.call(a)+"]"}function l(a,b,c,d,e){for(var f=[],g=0,h=b.length;h>g;++g)F(b,String(g))?f.push(m(a,b,c,d,String(g),!0)):f.push("");return e.forEach(function(e){e.match(/^\d+$/)||f.push(m(a,b,c,d,e,!0))}),f}function m(a,b,c,d,e,f){var g,h,j;if(j=Object.getOwnPropertyDescriptor(b,e)||{value:b[e]},j.get?h=j.set?a.stylize("[Getter/Setter]","special"):a.stylize("[Getter]","special"):j.set&&(h=a.stylize("[Setter]","special")),F(d,e)||(g="["+e+"]"),h||(a.seen.indexOf(j.value)<0?(h=q(c)?i(a,j.value,null):i(a,j.value,c-1),h.indexOf("\n")>-1&&(h=f?h.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+h.split("\n").map(function(a){return" "+a}).join("\n"))):h=a.stylize("[Circular]","special")),v(g)){if(f&&e.match(/^\d+$/))return h;g=JSON.stringify(""+e),g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=a.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=a.stylize(g,"string"))}return g+": "+h}function n(a,b,c){var d=0,e=a.reduce(function(a,b){return d++,b.indexOf("\n")>=0&&d++,a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0);return e>60?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function o(a){return Array.isArray(a)}function p(a){return"boolean"==typeof a}function q(a){return null===a}function r(a){return null==a}function s(a){return"number"==typeof a}function t(a){return"string"==typeof a}function u(a){return"symbol"==typeof a}function v(a){return void 0===a}function w(a){return x(a)&&"[object RegExp]"===C(a)}function x(a){return"object"==typeof a&&null!==a}function y(a){return x(a)&&"[object Date]"===C(a)}function z(a){return x(a)&&("[object Error]"===C(a)||a instanceof Error)}function A(a){return"function"==typeof a}function B(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||"undefined"==typeof a}function C(a){return Object.prototype.toString.call(a)}function D(a){return 10>a?"0"+a.toString(10):a.toString(10)}function E(){var a=new Date,b=[D(a.getHours()),D(a.getMinutes()),D(a.getSeconds())].join(":");return[a.getDate(),J[a.getMonth()],b].join(" ")}function F(a,b){return Object.prototype.hasOwnProperty.call(a,b)}var G=/%[sdj%]/g;c.format=function(a){if(!t(a)){for(var b=[],c=0;c=f)return a;switch(a){case"%s":return String(d[c++]);case"%d":return Number(d[c++]);case"%j":try{return JSON.stringify(d[c++])}catch(b){return"[Circular]"}default:return a}}),h=d[c];f>c;h=d[++c])g+=q(h)||!x(h)?" "+h:" "+e(h);return g},c.deprecate=function(a,e){function f(){if(!g){if(b.throwDeprecation)throw new Error(e);b.traceDeprecation?console.trace(e):console.error(e),g=!0}return a.apply(this,arguments)}if(v(d.process))return function(){return c.deprecate(a,e).apply(this,arguments)};if(b.noDeprecation===!0)return a;var g=!1;return f};var H,I={};c.debuglog=function(a){if(v(H)&&(H=b.env.NODE_DEBUG||""),a=a.toUpperCase(),!I[a])if(new RegExp("\\b"+a+"\\b","i").test(H)){var d=b.pid;I[a]=function(){var b=c.format.apply(c,arguments);console.error("%s %d: %s",a,d,b)}}else I[a]=function(){};return I[a]},c.inspect=e,e.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]},e.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},c.isArray=o,c.isBoolean=p,c.isNull=q,c.isNullOrUndefined=r,c.isNumber=s,c.isString=t,c.isSymbol=u,c.isUndefined=v,c.isRegExp=w,c.isObject=x,c.isDate=y,c.isError=z,c.isFunction=A,c.isPrimitive=B,c.isBuffer=a("./support/isBuffer");var J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];c.log=function(){console.log("%s - %s",E(),c.format.apply(c,arguments))},c.inherits=a("inherits"),c._extend=function(a,b){if(!b||!x(b))return a;for(var c=Object.keys(b),d=c.length;d--;)a[c[d]]=b[c[d]];return a}}).call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":109,_process:108,inherits:107}],111:[function(a,b,c){function d(a){return a=Math.round(a),0>a?0:a>255?255:a}function e(a){return 0>a?0:a>1?1:a}function f(a){return d("%"===a[a.length-1]?parseFloat(a)/100*255:parseInt(a))}function g(a){return e("%"===a[a.length-1]?parseFloat(a)/100:parseFloat(a))}function h(a,b,c){return 0>c?c+=1:c>1&&(c-=1),1>6*c?a+(b-a)*c*6:1>2*c?b:2>3*c?a+(b-a)*(2/3-c)*6:a}function i(a){var b=a.replace(/ /g,"").toLowerCase();if(b in j)return j[b].slice();if("#"===b[0]){if(4===b.length){var c=parseInt(b.substr(1),16);return c>=0&&4095>=c?[(3840&c)>>4|(3840&c)>>8,240&c|(240&c)>>4,15&c|(15&c)<<4,1]:null}if(7===b.length){var c=parseInt(b.substr(1),16);return c>=0&&16777215>=c?[(16711680&c)>>16,(65280&c)>>8,255&c,1]:null}return null}var e=b.indexOf("("),i=b.indexOf(")");if(-1!==e&&i+1===b.length){var k=b.substr(0,e),l=b.substr(e+1,i-(e+1)).split(","),m=1;switch(k){case"rgba":if(4!==l.length)return null;m=g(l.pop());case"rgb":return 3!==l.length?null:[f(l[0]),f(l[1]),f(l[2]),m];case"hsla":if(4!==l.length)return null;m=g(l.pop());case"hsl":if(3!==l.length)return null;var n=(parseFloat(l[0])%360+360)%360/360,o=g(l[1]),p=g(l[2]),q=.5>=p?p*(o+1):p+o-p*o,r=2*p-q;return[d(255*h(r,q,n+1/3)),d(255*h(r,q,n)),d(255*h(r,q,n-1/3)),m];default:return null}}return null}var j={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],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{c.parseCSSColor=i}catch(k){}},{}],112:[function(a,b,c){"use strict";function d(a){return function(b,c,d){return"$type"===c?"t"+a+h.indexOf(d):"p["+JSON.stringify(c)+"]"+a+JSON.stringify(d)}}function e(a){var b=d(a);return function(a,c,d){return"$type"===c?b(a,c,d):"typeof(p["+JSON.stringify(c)+"]) === typeof("+JSON.stringify(d)+") && "+b(a,c,d)}}function f(a){return i[a[0]].apply(a,a)}function g(){return!0}var h=["Unknown","Point","LineString","Polygon"],i={"==":d("==="),"!=":d("!=="),">":e(">"),"<":e("<"),"<=":e("<="),">=":e(">="),"in":function(a,b){return Array.prototype.slice.call(arguments,2).map(function(c){return"("+i["=="](a,b,c)+")"}).join("||")||"false"},"!in":function(){return"!("+i["in"].apply(this,arguments)+")"},any:function(){return Array.prototype.slice.call(arguments,1).map(function(a){return"("+f(a)+")"}).join("||")||"false"},all:function(){return Array.prototype.slice.call(arguments,1).map(function(a){return"("+f(a)+")"}).join("&&")||"true"},none:function(){return"!("+i.any.apply(this,arguments)+")"}};b.exports=function(a){if(!a)return g;var b="var p = f.properties || f.tags || {}, t = f.type; return "+f(a)+";";return new Function("f",b)}},{}],113:[function(a,b,c){"use strict";function d(a,b,c,d,g,h,i,j){if(c/=b,d/=b,i>=c&&d>=j)return a;if(i>d||c>j)return null;for(var k=[],l=0;l=c&&d>=n)k.push(o);else if(!(m>d||c>n)){var r=1===q?e(p,c,d,g):f(p,c,d,g,h,3===q);r.length&&k.push({geometry:r,type:q,tags:a[l].tags||null,min:o.min,max:o.max})}}return k.length?k:null}function e(a,b,c,d){for(var e=[],f=0;f=b&&c>=h&&e.push(g)}return e}function f(a,b,c,d,e,f){for(var h=[],i=0;ik;k++)j=n||o[k],n=o[k+1],l=m||j[d],m=n[d],b>l?m>c?(s.push(e(j,n,b),e(j,n,c)),f||(s=g(h,s,p,q))):m>=b&&s.push(e(j,n,b)):l>c?b>m?(s.push(e(j,n,c),e(j,n,b)),f||(s=g(h,s,p,q))):c>=m&&s.push(e(j,n,c)):(s.push(j),b>m?(s.push(e(j,n,b)),f||(s=g(h,s,p,q))):m>c&&(s.push(e(j,n,c)),f||(s=g(h,s,p,q))));j=o[r-1],l=j[d],l>=b&&c>=l&&s.push(j),f&&s[0]!==s[s.length-1]&&s.push(s[0]),g(h,s,p,q)}return h}function g(a,b,c,d){return b.length&&(b.area=c,b.dist=d,a.push(b)),[]}b.exports=d},{}],114:[function(a,b,c){"use strict";function d(a,b){var c=[];if("FeatureCollection"===a.type)for(var d=0;dd?-1:d>1?1:d,[c,d,0]}function i(a){for(var b,c,d=0,e=0,f=0;f1)return!1;for(var e=0;e1&&console.time("creation"),u=this.tiles[t]=p(a,s,c,d,v,b===m.maxZoom),o)){o>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",b,c,d,u.numFeatures,u.numPoints,u.numSimplified),console.timeEnd("creation"));var w="z"+b;this.stats[w]=(this.stats[w]||0)+1,this.total++}if(u.source=a,!h(u.features,q,r)){if(e){if(b===m.maxZoom||b===e)continue;var x=1<1&&console.time("clipping");var y,z,A,B,C,D,E=.5*r/q,F=.5-E,G=.5+E,H=1+E;y=z=A=B=null,C=n(a,s,c-E,c+G,0,j,u.min[0],u.max[0]),D=n(a,s,c+F,c+H,0,j,u.min[0],u.max[0]),C&&(y=n(C,s,d-E,d+G,1,k,u.min[1],u.max[1]),z=n(C,s,d+F,d+H,1,k,u.min[1],u.max[1])),D&&(A=n(D,s,d-E,d+G,1,k,u.min[1],u.max[1]),B=n(D,s,d+F,d+H,1,k,u.min[1],u.max[1])),o>1&&console.timeEnd("clipping"),y&&l.push(y,b+1,2*c,2*d),z&&l.push(z,b+1,2*c,2*d+1),A&&l.push(A,b+1,2*c+1,2*d),B&&l.push(B,b+1,2*c+1,2*d+1)}}},e.prototype.getTile=function(a,b,c){var d=this.options,e=d.extent,g=d.debug,j=1<1&&console.log("drilling down to z%d-%d-%d",a,b,c);for(var l,m=a,n=b,o=c;!l&&m>0;)m--,n=Math.floor(n/2),o=Math.floor(o/2),l=this.tiles[i(m,n,o)];if(g>1&&console.log("found parent tile z%d-%d-%d",m,n,o),l.source){if(h(l.features,d.extent,d.buffer))return f(l,e);g>1&&console.time("drilling down"),this.splitTile(l.source,m,n,o,a,b,c),g>1&&console.timeEnd("drilling down")}return f(this.tiles[k],e)}},{"./clip":113,"./convert":114,"./tile":117,"./wrap":118}],116:[function(a,b,c){"use strict";function d(a,b){var c,d,f,g,h=b*b,i=a.length,j=0,k=i-1,l=[];for(a[j][2]=1,a[k][2]=1;k;){for(d=0,c=j+1;k>c;c++)f=e(a[c],a[j],a[k]),f>d&&(g=c,d=f);d>h?(a[g][2]=d,l.push(j),l.push(g),j=g):(k=l.pop(),j=l.pop())}}function e(a,b,c){var d=b[0],e=b[1],f=c[0],g=c[1],h=a[0],i=a[1],j=f-d,k=g-e;if(0!==j||0!==k){var l=((h-d)*j+(i-e)*k)/(j*j+k*k);l>1?(d=f,e=g):l>0&&(d+=j*l,e+=k*l)}return j=h-d,k=i-e,j*j+k*k}b.exports=d},{}],117:[function(a,b,c){"use strict";function d(a,b,c,d,f,g){for(var h={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:c,y:d,z2:b,transformed:!1,min:[2,1],max:[-1,0]},i=0;ih.max[0]&&(h.max[0]=k[0]),k[1]>h.max[1]&&(h.max[1]=k[1])}return h}function e(a,b,c,d){var e,f,g,h,i=b.geometry,j=b.type,k=[],l=c*c;if(1===j)for(e=0;el)&&(m.push(h),a.numSimplified++),a.numPoints++;k.push(m)}else a.numPoints+=g.length;k.length&&a.features.push({geometry:k,type:j,tags:b.tags||null})}b.exports=d},{}],118:[function(a,b,c){"use strict";function d(a,b,c){var d=a,f=g(a,1,-1-b,b,0,c,-1,2),h=g(a,1,1-b,2+b,0,c,-1,2);return(f||h)&&(d=g(a,1,-b,1+b,0,c,-1,2),f&&(d=e(f,1).concat(d)),h&&(d=d.concat(e(h,-1)))),d}function e(a,b){for(var c=[],d=0;di?(f.cross(a,b,e),f.length(a)<1e-6&&f.cross(a,c,e),f.normalize(a,a),h.setAxisAngle(d,a,Math.PI),d):i>.999999?(d[0]=0,d[1]=0,d[2]=0,d[3]=1,d):(f.cross(a,e,g),d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=1+i,h.normalize(d,d))}}(),h.setAxes=function(){var a=e.create();return function(b,c,d,e){return a[0]=d[0],a[3]=d[1],a[6]=d[2],a[1]=e[0],a[4]=e[1],a[7]=e[2],a[2]=-c[0],a[5]=-c[1],a[8]=-c[2],h.normalize(b,h.fromMat3(b,a))}}(),h.clone=g.clone,h.fromValues=g.fromValues,h.copy=g.copy,h.set=g.set,h.identity=function(a){return a[0]=0,a[1]=0,a[2]=0,a[3]=1,a},h.setAxisAngle=function(a,b,c){c=.5*c;var d=Math.sin(c);return a[0]=d*b[0],a[1]=d*b[1],a[2]=d*b[2],a[3]=Math.cos(c),a},h.add=g.add,h.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=c[0],i=c[1],j=c[2],k=c[3];return a[0]=d*k+g*h+e*j-f*i,a[1]=e*k+g*i+f*h-d*j,a[2]=f*k+g*j+d*i-e*h,a[3]=g*k-d*h-e*i-f*j,a},h.mul=h.multiply,h.scale=g.scale,h.rotateX=function(a,b,c){c*=.5;var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i+g*h,a[1]=e*i+f*h,a[2]=f*i-e*h,a[3]=g*i-d*h,a},h.rotateY=function(a,b,c){c*=.5;var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i-f*h,a[1]=e*i+g*h,a[2]=f*i+d*h,a[3]=g*i-e*h,a},h.rotateZ=function(a,b,c){c*=.5;var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i+e*h,a[1]=e*i-d*h,a[2]=f*i+g*h,a[3]=g*i-f*h,a},h.calculateW=function(a,b){var c=b[0],d=b[1],e=b[2];return a[0]=c,a[1]=d,a[2]=e,a[3]=Math.sqrt(Math.abs(1-c*c-d*d-e*e)),a},h.dot=g.dot,h.lerp=g.lerp,h.slerp=function(a,b,c,d){var e,f,g,h,i,j=b[0],k=b[1],l=b[2],m=b[3],n=c[0],o=c[1],p=c[2],q=c[3];return f=j*n+k*o+l*p+m*q,0>f&&(f=-f,n=-n,o=-o,p=-p,q=-q),1-f>1e-6?(e=Math.acos(f),g=Math.sin(e),h=Math.sin((1-d)*e)/g,i=Math.sin(d*e)/g):(h=1-d,i=d),a[0]=h*j+i*n,a[1]=h*k+i*o,a[2]=h*l+i*p,a[3]=h*m+i*q,a},h.sqlerp=function(){var a=h.create(),b=h.create();return function(c,d,e,f,g,i){return h.slerp(a,d,g,i),h.slerp(b,e,f,i),h.slerp(c,a,b,2*i*(1-i)),c}}(),h.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*c+d*d+e*e+f*f,h=g?1/g:0;return a[0]=-c*h,a[1]=-d*h,a[2]=-e*h,a[3]=f*h,a},h.conjugate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a[3]=b[3],a},h.length=g.length,h.len=h.length,h.squaredLength=g.squaredLength,h.sqrLen=h.squaredLength,h.normalize=g.normalize,h.fromMat3=function(a,b){var c,d=b[0]+b[4]+b[8];if(d>0)c=Math.sqrt(d+1),a[3]=.5*c,c=.5/c,a[0]=(b[5]-b[7])*c,a[1]=(b[6]-b[2])*c,a[2]=(b[1]-b[3])*c;else{var e=0;b[4]>b[0]&&(e=1),b[8]>b[3*e+e]&&(e=2);var f=(e+1)%3,g=(e+2)%3;c=Math.sqrt(b[3*e+e]-b[3*f+f]-b[3*g+g]+1),a[e]=.5*c,c=.5/c,a[3]=(b[3*f+g]-b[3*g+f])*c,a[f]=(b[3*f+e]+b[3*e+f])*c,a[g]=(b[3*g+e]+b[3*e+g])*c}return a},h.str=function(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},b.exports=h},{"./common.js":120,"./mat3.js":123,"./vec3.js":127,"./vec4.js":128}],126:[function(a,b,c){var d=a("./common.js"),e={};e.create=function(){var a=new d.ARRAY_TYPE(2);return a[0]=0,a[1]=0,a},e.clone=function(a){var b=new d.ARRAY_TYPE(2);return b[0]=a[0],b[1]=a[1],b},e.fromValues=function(a,b){var c=new d.ARRAY_TYPE(2);return c[0]=a,c[1]=b,c},e.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a},e.set=function(a,b,c){return a[0]=b,a[1]=c,a},e.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a},e.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a},e.sub=e.subtract,e.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a},e.mul=e.multiply,e.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a},e.div=e.divide,e.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a},e.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a},e.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a},e.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a},e.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)},e.dist=e.distance,e.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return c*c+d*d},e.sqrDist=e.squaredDistance,e.length=function(a){var b=a[0],c=a[1];return Math.sqrt(b*b+c*c)},e.len=e.length,e.squaredLength=function(a){var b=a[0],c=a[1];return b*b+c*c},e.sqrLen=e.squaredLength,e.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a},e.inverse=function(a,b){return a[0]=1/b[0],a[1]=1/b[1],a},e.normalize=function(a,b){var c=b[0],d=b[1],e=c*c+d*d;return e>0&&(e=1/Math.sqrt(e),a[0]=b[0]*e,a[1]=b[1]*e),a},e.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]},e.cross=function(a,b,c){var d=b[0]*c[1]-b[1]*c[0];return a[0]=a[1]=0,a[2]=d,a},e.lerp=function(a,b,c,d){var e=b[0],f=b[1];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a},e.random=function(a,b){b=b||1;var c=2*d.RANDOM()*Math.PI;return a[0]=Math.cos(c)*b,a[1]=Math.sin(c)*b,a},e.transformMat2=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[2]*e,a[1]=c[1]*d+c[3]*e,a},e.transformMat2d=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[2]*e+c[4],a[1]=c[1]*d+c[3]*e+c[5],a},e.transformMat3=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[3]*e+c[6],a[1]=c[1]*d+c[4]*e+c[7],a},e.transformMat4=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[4]*e+c[12],a[1]=c[1]*d+c[5]*e+c[13],a},e.forEach=function(){var a=e.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=2),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],f(a,a,g),b[h]=a[0],b[h+1]=a[1];return b}}(),e.str=function(a){return"vec2("+a[0]+", "+a[1]+")"},b.exports=e},{"./common.js":120}],127:[function(a,b,c){var d=a("./common.js"),e={};e.create=function(){var a=new d.ARRAY_TYPE(3);return a[0]=0,a[1]=0,a[2]=0,a},e.clone=function(a){var b=new d.ARRAY_TYPE(3);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b},e.fromValues=function(a,b,c){var e=new d.ARRAY_TYPE(3);return e[0]=a,e[1]=b,e[2]=c,e},e.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a},e.set=function(a,b,c,d){return a[0]=b,a[1]=c,a[2]=d,a},e.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a[2]=b[2]+c[2],a},e.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a[2]=b[2]-c[2],a},e.sub=e.subtract,e.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a[2]=b[2]*c[2],a},e.mul=e.multiply,e.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a[2]=b[2]/c[2],a},e.div=e.divide,e.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a[2]=Math.min(b[2],c[2]),a},e.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a[2]=Math.max(b[2],c[2]),a},e.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c,a},e.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a[2]=b[2]+c[2]*d,a},e.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return Math.sqrt(c*c+d*d+e*e)},e.dist=e.distance,e.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return c*c+d*d+e*e},e.sqrDist=e.squaredDistance,e.length=function(a){var b=a[0],c=a[1],d=a[2];return Math.sqrt(b*b+c*c+d*d)},e.len=e.length,e.squaredLength=function(a){var b=a[0],c=a[1],d=a[2];return b*b+c*c+d*d},e.sqrLen=e.squaredLength,e.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a},e.inverse=function(a,b){return a[0]=1/b[0],a[1]=1/b[1],a[2]=1/b[2],a},e.normalize=function(a,b){var c=b[0],d=b[1],e=b[2],f=c*c+d*d+e*e;return f>0&&(f=1/Math.sqrt(f),a[0]=b[0]*f,a[1]=b[1]*f,a[2]=b[2]*f),a},e.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},e.cross=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2];return a[0]=e*i-f*h,a[1]=f*g-d*i,a[2]=d*h-e*g,a},e.lerp=function(a,b,c,d){var e=b[0],f=b[1],g=b[2];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a[2]=g+d*(c[2]-g),a},e.hermite=function(a,b,c,d,e,f){var g=f*f,h=g*(2*f-3)+1,i=g*(f-2)+f,j=g*(f-1),k=g*(3-2*f);return a[0]=b[0]*h+c[0]*i+d[0]*j+e[0]*k,a[1]=b[1]*h+c[1]*i+d[1]*j+e[1]*k,a[2]=b[2]*h+c[2]*i+d[2]*j+e[2]*k,a},e.bezier=function(a,b,c,d,e,f){var g=1-f,h=g*g,i=f*f,j=h*g,k=3*f*h,l=3*i*g,m=i*f;return a[0]=b[0]*j+c[0]*k+d[0]*l+e[0]*m,a[1]=b[1]*j+c[1]*k+d[1]*l+e[1]*m,a[2]=b[2]*j+c[2]*k+d[2]*l+e[2]*m,a},e.random=function(a,b){b=b||1;var c=2*d.RANDOM()*Math.PI,e=2*d.RANDOM()-1,f=Math.sqrt(1-e*e)*b;return a[0]=Math.cos(c)*f,a[1]=Math.sin(c)*f,a[2]=e*b,a},e.transformMat4=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[3]*d+c[7]*e+c[11]*f+c[15];return g=g||1,a[0]=(c[0]*d+c[4]*e+c[8]*f+c[12])/g,a[1]=(c[1]*d+c[5]*e+c[9]*f+c[13])/g,a[2]=(c[2]*d+c[6]*e+c[10]*f+c[14])/g,a},e.transformMat3=function(a,b,c){var d=b[0],e=b[1],f=b[2];return a[0]=d*c[0]+e*c[3]+f*c[6],a[1]=d*c[1]+e*c[4]+f*c[7],a[2]=d*c[2]+e*c[5]+f*c[8],a},e.transformQuat=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2],j=c[3],k=j*d+h*f-i*e,l=j*e+i*d-g*f,m=j*f+g*e-h*d,n=-g*d-h*e-i*f;return a[0]=k*j+n*-g+l*-i-m*-h,a[1]=l*j+n*-h+m*-g-k*-i,a[2]=m*j+n*-i+k*-h-l*-g,a},e.rotateX=function(a,b,c,d){var e=[],f=[];return e[0]=b[0]-c[0],e[1]=b[1]-c[1],e[2]=b[2]-c[2],f[0]=e[0],f[1]=e[1]*Math.cos(d)-e[2]*Math.sin(d),f[2]=e[1]*Math.sin(d)+e[2]*Math.cos(d),a[0]=f[0]+c[0],a[1]=f[1]+c[1],a[2]=f[2]+c[2],a},e.rotateY=function(a,b,c,d){var e=[],f=[];return e[0]=b[0]-c[0],e[1]=b[1]-c[1],e[2]=b[2]-c[2],f[0]=e[2]*Math.sin(d)+e[0]*Math.cos(d),f[1]=e[1],f[2]=e[2]*Math.cos(d)-e[0]*Math.sin(d),a[0]=f[0]+c[0],a[1]=f[1]+c[1],a[2]=f[2]+c[2],a},e.rotateZ=function(a,b,c,d){var e=[],f=[];return e[0]=b[0]-c[0],e[1]=b[1]-c[1],e[2]=b[2]-c[2],f[0]=e[0]*Math.cos(d)-e[1]*Math.sin(d),f[1]=e[0]*Math.sin(d)+e[1]*Math.cos(d),f[2]=e[2],a[0]=f[0]+c[0],a[1]=f[1]+c[1],a[2]=f[2]+c[2],a},e.forEach=function(){var a=e.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=3),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],a[2]=b[h+2],f(a,a,g),b[h]=a[0],b[h+1]=a[1],b[h+2]=a[2];return b}}(),e.angle=function(a,b){var c=e.fromValues(a[0],a[1],a[2]),d=e.fromValues(b[0],b[1],b[2]);e.normalize(c,c),e.normalize(d,d);var f=e.dot(c,d);return f>1?0:Math.acos(f)},e.str=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"},b.exports=e},{"./common.js":120}],128:[function(a,b,c){var d=a("./common.js"),e={};e.create=function(){var a=new d.ARRAY_TYPE(4);return a[0]=0,a[1]=0,a[2]=0,a[3]=0,a},e.clone=function(a){var b=new d.ARRAY_TYPE(4);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},e.fromValues=function(a,b,c,e){var f=new d.ARRAY_TYPE(4);return f[0]=a,f[1]=b,f[2]=c,f[3]=e,f},e.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a},e.set=function(a,b,c,d,e){return a[0]=b,a[1]=c,a[2]=d,a[3]=e,a},e.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a[2]=b[2]+c[2],a[3]=b[3]+c[3],a},e.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a[2]=b[2]-c[2],a[3]=b[3]-c[3],a},e.sub=e.subtract,e.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a[2]=b[2]*c[2],a[3]=b[3]*c[3],a},e.mul=e.multiply,e.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a[2]=b[2]/c[2],a[3]=b[3]/c[3],a},e.div=e.divide,e.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a[2]=Math.min(b[2],c[2]),a[3]=Math.min(b[3],c[3]),a},e.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a[2]=Math.max(b[2],c[2]),a[3]=Math.max(b[3],c[3]),a},e.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c,a[3]=b[3]*c,a},e.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a[2]=b[2]+c[2]*d,a[3]=b[3]+c[3]*d,a},e.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2],f=b[3]-a[3];return Math.sqrt(c*c+d*d+e*e+f*f)},e.dist=e.distance,e.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2],f=b[3]-a[3];return c*c+d*d+e*e+f*f},e.sqrDist=e.squaredDistance,e.length=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return Math.sqrt(b*b+c*c+d*d+e*e)},e.len=e.length,e.squaredLength=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return b*b+c*c+d*d+e*e},e.sqrLen=e.squaredLength,e.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a[3]=-b[3],a},e.inverse=function(a,b){return a[0]=1/b[0],a[1]=1/b[1],a[2]=1/b[2],a[3]=1/b[3],a},e.normalize=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*c+d*d+e*e+f*f;return g>0&&(g=1/Math.sqrt(g),a[0]=c*g,a[1]=d*g,a[2]=e*g,a[3]=f*g),a},e.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},e.lerp=function(a,b,c,d){var e=b[0],f=b[1],g=b[2],h=b[3];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a[2]=g+d*(c[2]-g),a[3]=h+d*(c[3]-h),a},e.random=function(a,b){return b=b||1,a[0]=d.RANDOM(),a[1]=d.RANDOM(),a[2]=d.RANDOM(),a[3]=d.RANDOM(),e.normalize(a,a),e.scale(a,a,b),a},e.transformMat4=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12]*g,a[1]=c[1]*d+c[5]*e+c[9]*f+c[13]*g,a[2]=c[2]*d+c[6]*e+c[10]*f+c[14]*g,a[3]=c[3]*d+c[7]*e+c[11]*f+c[15]*g,a},e.transformQuat=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2],j=c[3],k=j*d+h*f-i*e,l=j*e+i*d-g*f,m=j*f+g*e-h*d,n=-g*d-h*e-i*f;return a[0]=k*j+n*-g+l*-i-m*-h,a[1]=l*j+n*-h+m*-g-k*-i,a[2]=m*j+n*-i+k*-h-l*-g,a[3]=b[3],a},e.forEach=function(){var a=e.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=4),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],a[2]=b[h+2],a[3]=b[h+3],f(a,a,g),b[h]=a[0],b[h+1]=a[1],b[h+2]=a[2],b[h+3]=a[3];return b}}(),e.str=function(a){return"vec4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},b.exports=e},{"./common.js":120}],129:[function(a,b,c){"use strict";function d(a){return function(){return a}}function e(a,b,c){return a*(1-c)+b*c}function f(a,b,c){for(var d=[],f=0;fa){e=h;break}}if(d&&e){var i=e[0]-d[0],j=a-d[0],k=1===c?j/i:(Math.pow(c,j)-1)/(Math.pow(c,i)-1);return g(d[1],e[1],k)}return d?d[1]:e?e[1]:void 0}},c["piecewise-constant"]=function(a){if(!a.stops)return d(a);var b=a.stops;return function(a){for(var c=0;ca)return b[0===c?0:c-1][1];return b[b.length-1][1]}}},{}],130:[function(a,b,c){"use strict";var d=a("../../reference/latest.js"),e=a("./parsed");b.exports=function(a){return e(a,d)}},{"../../reference/latest.js":132,"./parsed":131}],131:[function(a,b,c){"use strict";function d(a){return a instanceof Number?"number":a instanceof String?"string":a instanceof Boolean?"boolean":Array.isArray(a)?"array":null===a?"null":typeof a}function e(a){return a instanceof Number||a instanceof String||a instanceof Boolean?a.valueOf():a}var f=a("csscolorparser").parseCSSColor,g=a("util").format;b.exports=function(a,b){function c(a,b){var c={message:(a?a+": ":"")+g.apply(g,Array.prototype.slice.call(arguments,2))};null!==b&&void 0!==b&&b.__line__&&(c.line=b.__line__),l.push(c)}function h(a,e,f){var g=d(e);if("string"===g&&"@"===e[0]){if(b.$version>7)return c(a,e,"constants have been deprecated as of v8");if(!(e in j))return c(a,e,'constant "%s" not found',e);e=j[e],g=d(e)}if(f["function"]&&"object"===g)return h["function"](a,e,f);if(f.type){var i=h[f.type];if(i)return i(a,e,f);f=b[f.type]}h.object(a,e,f)}function i(a){return function(b,e,f){var g=d(e);g!==a&&c(b,e,"%s expected, %s found",a,g),"minimum"in f&&ef.maximum&&c(b,e,"%s is greater than the maximum value %s",e,f.maximum)}}var j=a.constants||{},k={},l=[];return h.constants=function(a,e){if(b.$version>7){if(e)return c(a,e,"constants have been deprecated as of v8")}else{var f=d(e);if("object"!==f)return c(a,e,"object expected, %s found",f);for(var g in e)"@"!==g[0]&&c(a+"."+g,e[g],'constants must start with "@"')}},h.source=function(a,d){if(!d.type)return void c(a,d,'"type" is required');var f=e(d.type);switch(f){case"vector":case"raster":if(h.object(a,d,b.source_tile),"url"in d)for(var g in d)["type","url","tileSize"].indexOf(g)<0&&c(a+"."+g,d[g],'a source with a "url" property may not include a "%s" property',g);break;case"geojson":h.object(a,d,b.source_geojson);break;case"video":h.object(a,d,b.source_video);break;case"image":h.object(a,d,b.source_image);break;default:h["enum"](a+".type",d.type,{values:["vector","raster","geojson","video","image"]})}},h.layer=function(d,f){f.type||f.ref||c(d,f,'either "type" or "ref" is required');var g=e(f.type),i=e(f.ref);if(f.id&&(k[f.id]?c(d,f.id,'duplicate layer id "%s", previously used at line %d',f.id,k[f.id]):k[f.id]=f.id.__line__),"ref"in f){["type","source","source-layer","filter","layout"].forEach(function(a){a in f&&c(d,f[a],'"%s" is prohibited for ref layers',a)});var j;a.layers.forEach(function(a){a.id==i&&(j=a)}),j?j.ref?c(d,f.ref,"ref cannot reference another ref layer"):g=j.type:c(d,f.ref,'ref layer "%s" not found',i)}else if("background"!==g)if(f.source){var l=a.sources[f.source];l?"vector"==l.type&&"raster"==g?c(d,f.source,'layer "%s" requires a raster source',f.id):"raster"==l.type&&"raster"!=g&&c(d,f.source,'layer "%s" requires a vector source',f.id):c(d,f.source,'source "%s" not found',f.source)}else c(d,f,'missing required property "source"');h.object(d,f,b.layer,{filter:h.filter,layout:function(a,c){var d=b["layout_"+g];return g&&d&&h(a,c,d)},paint:function(a,c){var d=b["paint_"+g];return g&&d&&h(a,c,d)}})},h.object=function(a,e,f,g){g=g||{};var i=d(e);if("object"!==i)return c(a,e,"object expected, %s found",i);for(var j in e){var k=j.split(".")[0],l=f[k]||f["*"],m=k.match(/^(.*)-transition$/);l?(g[k]||h)((a?a+".":a)+j,e[j],l):m&&f[m[1]]&&f[m[1]].transition?h((a?a+".":a)+j,e[j],b.transition):""!==a&&1!==a.split(".").length&&c(a,e[j],'unknown property "%s"',j)}for(var n in f)f[n].required&&void 0===f[n]["default"]&&void 0===e[n]&&c(a,e,'missing required property "%s"',n)},h.array=function(b,e,f,g){if("array"!==d(e))return c(b,e,"array expected, %s found",d(e));if(f.length&&e.length!==f.length)return c(b,e,"array length %d expected, length %d found",f.length,e.length);if(f["min-length"]&&e.length":case">=":f.length>=2&&"$type"==f[1]&&c(a,f,'"$type" cannot be use with operator "%s"',f[0]);case"==":case"!=":3!=f.length&&c(a,f,'filter array for operator "%s" must have 3 elements',f[0]);case"in":case"!in":f.length>=2&&(g=d(f[1]),"string"!==g?c(a+"[1]",f[1],"string expected, %s found",g):"@"===f[1][0]&&c(a+"[1]",f[1],"filter key cannot be a constant"));for(var i=2;i7&&a.constants&&h.constants("constants",a.constants),l.sort(function(a,b){return a.line-b.line}),l}},{csscolorparser:111,util:110}],132:[function(a,b,c){b.exports=a("./v8.json")},{"./v8.json":133}],133:[function(a,b,c){b.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Stylesheet version number. Must be 8."},name:{type:"string",doc:"A human-readable name for the style."},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default centerpoint in longitude and latitude."},zoom:{type:"number",doc:"Default zoom level."},bearing:{type:"number","default":0,period:360,units:"degrees",doc:"Default bearing, in degrees."},pitch:{type:"number","default":0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface"},sources:{required:!0,type:"sources",doc:"Data source specifications."},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended."},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. Valid tokens are {fontstack} and {range}."},transition:{type:"transition",doc:"A global transition definition to use as a default across properties."},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array."}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For GeoJSON and video sources, a URL must be provided."}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"],doc:"The data type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},minzoom:{type:"number","default":0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number","default":22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number", -"default":512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number","default":14,doc:"Maximum zoom to preserve detail at."},buffer:{type:"number","default":64,doc:"Tile buffer on each side."},tolerance:{type:"number","default":3,doc:"Simplification tolerance (higher means simpler)."}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",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",doc:"URL that points to an image"},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",doc:"Unique layer name."},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"],doc:"Rendering type of this layer."},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},ref:{type:"string",doc:"References another layer to copy `type`, `source`, `source-layer`, `minzoom`, `maxzoom`, `filter`, and `layout` properties from. This allows the layers to share processing and be more efficient."},source:{type:"string",doc:"Name of a source description to be used for this layer."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required if the source supports multiple layers."},minzoom:{type:"number",minimum:0,maximum:22,doc:"The minimum zoom level on which the layer gets parsed and appears on."},maxzoom:{type:"number",minimum:0,maximum:22,doc:"The maximum zoom level on which the layer gets parsed and appears on."},interactive:{type:"boolean",doc:"Enable querying of feature data from this layer for interactivity.","default":!1},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."},"paint.*":{type:"paint",doc:"Class-specific paint properties for this layer. The class name is the part after the first dot."}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},layout_fill:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},layout_circle:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},layout_line:{"line-cap":{type:"enum","function":"piecewise-constant",values:["butt","round","square"],"default":"butt",doc:"The display of line endings."},"line-join":{type:"enum","function":"piecewise-constant",values:["bevel","round","miter"],"default":"miter",doc:"The display of lines when joining."},"line-miter-limit":{type:"number","default":2,"function":"interpolated",doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number","default":1.05,"function":"interpolated",doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}]},visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},layout_symbol:{"symbol-placement":{type:"enum","function":"piecewise-constant",values:["point","line"],"default":"point",doc:"Label placement relative to its geometry. `line` can only be used on LineStrings and Polygons."},"symbol-spacing":{type:"number","default":250,minimum:1,"function":"interpolated",units:"pixels",doc:"Minimum distance between two symbol anchors.",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer."},"icon-allow-overlap":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the icon will be visible even if it collides with other icons and text.",requires:["icon-image"]},"icon-ignore-placement":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the icon won't affect placement of other icons and text.",requires:["icon-image"]},"icon-optional":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the symbol will appear without its icon, in spaces where the icon would make it too large to fit.",requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"viewport",doc:"Orientation of icon when map is rotated.",requires:["icon-image"]},"icon-size":{type:"number","default":1,minimum:0,"function":"interpolated",doc:"Scale factor for icon. 1 is original size, 3 triples the size.",requires:["icon-image"]},"icon-image":{type:"string","function":"piecewise-constant",doc:"A string with {tokens} replaced, referencing the data property to pull from.",tokens:!0},"icon-rotate":{type:"number","default":0,period:360,"function":"interpolated",units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"]},"icon-padding":{type:"number","default":2,minimum:0,"function":"interpolated",units:"pixels",doc:"Padding value around icon bounding box to avoid icon collisions.",requires:["icon-image"]},"icon-keep-upright":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",doc:"Icon's offset distance. Values are [x, y] where negatives indicate left and up, respectively.",requires:["icon-image"]},"text-rotation-alignment":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"viewport",doc:"Orientation of icon or text when map is rotated.",requires:["text-field"]},"text-field":{type:"string","function":"piecewise-constant","default":"",tokens:!0,doc:"Value to use for a text label. Feature properties are specified using tokens like {field_name}."},"text-font":{type:"array",value:"string","function":"piecewise-constant","default":["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"]},"text-size":{type:"number","default":16,minimum:0,units:"pixels","function":"interpolated",doc:"Font size. If unspecified, the text will be as big as allowed by the layer definition.",requires:["text-field"]},"text-max-width":{type:"number","default":10,minimum:0,units:"em","function":"interpolated",doc:"The maximum line width for text wrapping.",requires:["text-field"]},"text-line-height":{type:"number","default":1.2,units:"em","function":"interpolated",doc:"Text leading value for multi-line text.",requires:["text-field"]},"text-letter-spacing":{type:"number","default":0,units:"em","function":"interpolated",doc:"Text kerning value.",requires:["text-field"]},"text-justify":{type:"enum","function":"piecewise-constant",values:["left","center","right"],"default":"center",doc:"Text justification options.",requires:["text-field"]},"text-anchor":{type:"enum","function":"piecewise-constant",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],"default":"center",doc:"Which part of the text to place closest to the anchor.",requires:["text-field"]},"text-max-angle":{type:"number","default":45,units:"degrees","function":"interpolated",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number","default":0,period:360,units:"degrees","function":"interpolated",doc:"Rotates the text clockwise.",requires:["text-field"]},"text-padding":{type:"number","default":2,minimum:0,units:"pixels","function":"interpolated",doc:"Padding value around text bounding box to avoid label collisions.",requires:["text-field"]},"text-keep-upright":{type:"boolean","function":"piecewise-constant","default":!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum","function":"piecewise-constant",values:["none","uppercase","lowercase"],"default":"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"]},"text-offset":{type:"array",doc:"Specifies the distance that text is offset from its anchor horizontally and vertically.",value:"number",units:"ems","function":"interpolated",length:2,"default":[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the text will be visible even if it collides with other icons and labels.",requires:["text-field"]},"text-ignore-placement":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, the text won't affect placement of other icons and labels.",requires:["text-field"]},"text-optional":{type:"boolean","function":"piecewise-constant","default":!1,doc:"If true, icons can be shown without their corresponding text.",requires:["text-field","icon-image"]},visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},layout_raster:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible",doc:"The display of this layer. `none` hides this layer."}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},"function":{stops:{type:"array",required:!0,doc:"An array of stops.",value:"function_stop"},base:{type:"number","default":1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2,doc:"Zoom level and value pair."},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean","function":"piecewise-constant","default":!0,doc:"Whether or not the fill should be antialiased."},"fill-opacity":{type:"number","function":"interpolated","default":1,minimum:0,maximum:1,doc:"The opacity given to the fill color.",transition:!0},"fill-color":{type:"color","default":"#000000",doc:"The color of the fill.","function":"interpolated",transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.","function":"interpolated",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively."},"fill-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],doc:"Control whether the translation is relative to the map (north) or viewport (screen)","default":"map",requires:["fill-translate"]},"fill-pattern":{type:"string","function":"piecewise-constant",transition:!0,doc:"Name of image in sprite to use for drawing image fills."}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.","function":"interpolated","default":1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",doc:"The color with which the line will be drawn.","default":"#000000","function":"interpolated",transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively."},"line-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],doc:"Control whether the translation is relative to the map (north) or viewport (screen)","default":"map",requires:["line-translate"]},"line-width":{type:"number","default":1,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Stroke thickness."},"line-gap-width":{type:"number","default":0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.","function":"interpolated",transition:!0,units:"pixels"},"line-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels."},"line-dasharray":{type:"array",value:"number","function":"piecewise-constant",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string","function":"piecewise-constant",transition:!0,doc:"Name of image in sprite to use for drawing image lines."}},paint_circle:{"circle-radius":{type:"number","default":5,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Circle radius."},"circle-color":{type:"color","default":"#000000",doc:"The color of the circle.","function":"interpolated",transition:!0},"circle-blur":{type:"number","default":0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.","function":"interpolated",transition:!0},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0},"circle-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively."},"circle-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],doc:"Control whether the translation is relative to the map (north) or viewport (screen)","default":"map",requires:["circle-translate"]}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0,requires:["icon-image"]},"icon-color":{type:"color","default":"#000000","function":"interpolated",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"]},"icon-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with sdf icons.",requires:["icon-image"]},"icon-halo-width":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"]},"icon-halo-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",doc:"An icon's offset distance. Values are [x, y] where negatives indicate left and up, respectively.",requires:["icon-image"]},"icon-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],doc:"Control whether the translation is relative to the map (north) or viewport (screen)","default":"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0,requires:["text-field"]},"text-color":{type:"color",doc:"The color with which the text will be drawn.","default":"#000000","function":"interpolated",transition:!0,requires:["text-field"]},"text-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"]},"text-halo-width":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"]},"text-halo-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:!0,units:"pixels",doc:"Label offset. Values are [x, y] where negatives indicate left and up, respectively.",requires:["text-field"]},"text-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],doc:"Control whether the translation is relative to the map (north) or viewport (screen)","default":"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.","default":1,minimum:0,maximum:1,"function":"interpolated",transition:!0},"raster-hue-rotate":{type:"number","default":0,period:360,"function":"interpolated",transition:!0,units:"degrees",doc:"Rotates hues around the color wheel."},"raster-brightness-min":{type:"number","function":"interpolated",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.","default":0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number","function":"interpolated",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.","default":1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.","default":0,minimum:-1,maximum:1,"function":"interpolated",transition:!0},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.","default":0,minimum:-1,maximum:1,"function":"interpolated",transition:!0},"raster-fade-duration":{type:"number","default":300,minimum:0,"function":"interpolated",transition:!0,units:"milliseconds",doc:"Fade duration when a new tile is added."}},paint_background:{"background-color":{type:"color","default":"#000000",doc:"The color with which the background will be drawn.","function":"interpolated",transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string","function":"piecewise-constant",transition:!0,doc:"Optionally an image which is drawn as the background."},"background-opacity":{type:"number","default":1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.","function":"interpolated",transition:!0}},transition:{duration:{type:"number","default":300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number","default":0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}}}},{}],134:[function(a,b,c){"use strict";function d(a){var b;a&&a.length&&(b=a,a=b.length);var c=new Uint8Array(a||0);return b&&c.set(b),c.readUInt32LE=f.readUInt32LE,c.writeUInt32LE=f.writeUInt32LE,c.readInt32LE=f.readInt32LE,c.writeInt32LE=f.writeInt32LE,c.readFloatLE=f.readFloatLE,c.writeFloatLE=f.writeFloatLE,c.readDoubleLE=f.readDoubleLE,c.writeDoubleLE=f.writeDoubleLE,c.toString=f.toString,c.write=f.write,c.slice=f.slice,c.copy=f.copy,c._isBuffer=!0,c}function e(a){for(var b,c,d=a.length,e=[],f=0;d>f;f++){if(b=a.charCodeAt(f),b>55295&&57344>b){if(!c){b>56319||f+1===d?e.push(239,191,189):c=b;continue}if(56320>b){e.push(239,191,189),c=b;continue}b=c-55296<<10|b-56320|65536,c=null}else c&&(e.push(239,191,189),c=null);128>b?e.push(b):2048>b?e.push(b>>6|192,63&b|128):65536>b?e.push(b>>12|224,b>>6&63|128,63&b|128):e.push(b>>18|240,b>>12&63|128,b>>6&63|128,63&b|128)}return e}b.exports=d;var f,g,h,i=a("ieee754");f={readUInt32LE:function(a){return(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},writeUInt32LE:function(a,b){this[b]=a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24},readInt32LE:function(a){return(this[a]|this[a+1]<<8|this[a+2]<<16)+(this[a+3]<<24)},readFloatLE:function(a){return i.read(this,a,!0,23,4)},readDoubleLE:function(a){return i.read(this,a,!0,52,8)},writeFloatLE:function(a,b){return i.write(this,a,b,!0,23,4)},writeDoubleLE:function(a,b){return i.write(this,a,b,!0,52,8)},toString:function(a,b,c){var d="",e="";b=b||0,c=Math.min(this.length,c||this.length);for(var f=b;c>f;f++){var g=this[f];127>=g?(d+=decodeURIComponent(e)+String.fromCharCode(g),e=""):e+="%"+g.toString(16)}return d+=decodeURIComponent(e)},write:function(a,b){for(var c=a===g?h:e(a),d=0;d>3,f=this.pos;a(e,b,this),this.pos===f&&this.skip(d)}return b},readMessage:function(a,b){return this.readFields(a,b,this.readVarint()+this.pos)},readFixed32:function(){var a=this.buf.readUInt32LE(this.pos);return this.pos+=4,a},readSFixed32:function(){var a=this.buf.readInt32LE(this.pos);return this.pos+=4,a},readFixed64:function(){var a=this.buf.readUInt32LE(this.pos)+this.buf.readUInt32LE(this.pos+4)*o;return this.pos+=8,a},readSFixed64:function(){var a=this.buf.readUInt32LE(this.pos)+this.buf.readInt32LE(this.pos+4)*o;return this.pos+=8,a},readFloat:function(){var a=this.buf.readFloatLE(this.pos);return this.pos+=4,a},readDouble:function(){var a=this.buf.readDoubleLE(this.pos);return this.pos+=8,a},readVarint:function(){var a,b,c,d,e,f,g=this.buf;if(c=g[this.pos++],128>c)return c;if(c=127&c,d=g[this.pos++],128>d)return c|d<<7;if(d=(127&d)<<7,e=g[this.pos++],128>e)return c|d|e<<14;if(e=(127&e)<<14,f=g[this.pos++],128>f)return c|d|e|f<<21;if(a=c|d|e|(127&f)<<21,b=g[this.pos++],a+=268435456*(127&b),128>b)return a;if(b=g[this.pos++],a+=34359738368*(127&b),128>b)return a;if(b=g[this.pos++],a+=4398046511104*(127&b),128>b)return a;if(b=g[this.pos++],a+=562949953421312*(127&b),128>b)return a;if(b=g[this.pos++],a+=72057594037927940*(127&b),128>b)return a;if(b=g[this.pos++],a+=0x8000000000000000*(127&b),128>b)return a;throw new Error("Expected varint not more than 10 bytes")},readVarint64:function(){var a=this.pos,b=this.readVarint();if(q>b)return b;for(var c=this.pos-2;255===this.buf[c];)c--;a>c&&(c=a),b=0;for(var d=0;c-a+1>d;d++){var e=127&~this.buf[a+d];b+=4>d?e<<7*d:e*Math.pow(2,7*d)}return-b-1},readSVarint:function(){var a=this.readVarint();return a%2===1?(a+1)/-2:a/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var a=this.readVarint()+this.pos,b=this.buf.toString("utf8",this.pos,a);return this.pos=a,b},readBytes:function(){var a=this.readVarint()+this.pos,b=this.buf.slice(this.pos,a);return this.pos=a,b},readPackedVarint:function(){for(var a=this.readVarint()+this.pos,b=[];this.pos127;);else if(b===d.Bytes)this.pos=this.readVarint()+this.pos;else if(b===d.Fixed32)this.pos+=4;else{if(b!==d.Fixed64)throw new Error("Unimplemented type: "+b);this.pos+=8}},writeTag:function(a,b){this.writeVarint(a<<3|b)},realloc:function(a){for(var b=this.length||16;b=a)this.realloc(1),this.buf[this.pos++]=a;else if(16383>=a)this.realloc(2),this.buf[this.pos++]=a>>>0&127|128,this.buf[this.pos++]=a>>>7&127;else if(2097151>=a)this.realloc(3),this.buf[this.pos++]=a>>>0&127|128,this.buf[this.pos++]=a>>>7&127|128,this.buf[this.pos++]=a>>>14&127;else if(268435455>=a)this.realloc(4),this.buf[this.pos++]=a>>>0&127|128,this.buf[this.pos++]=a>>>7&127|128,this.buf[this.pos++]=a>>>14&127|128,this.buf[this.pos++]=a>>>21&127;else{for(var b=this.pos;a>=128;)this.realloc(1),this.buf[this.pos++]=255&a|128,a/=128;if(this.realloc(1),this.buf[this.pos++]=0|a,this.pos-b>10)throw new Error("Given varint doesn't fit into 10 bytes")}},writeSVarint:function(a){this.writeVarint(0>a?2*-a-1:2*a)},writeBoolean:function(a){this.writeVarint(Boolean(a))},writeString:function(a){a=String(a);var b=n.byteLength(a);this.writeVarint(b),this.realloc(b),this.buf.write(a,this.pos),this.pos+=b},writeFloat:function(a){this.realloc(4),this.buf.writeFloatLE(a,this.pos),this.pos+=4},writeDouble:function(a){this.realloc(8),this.buf.writeDoubleLE(a,this.pos),this.pos+=8},writeBytes:function(a){var b=a.length;this.writeVarint(b),this.realloc(b);for(var c=0;b>c;c++)this.buf[this.pos++]=a[c]},writeMessage:function(a,b,c){this.writeTag(a,d.Bytes),this.pos++;var e=this.pos;b(c,this);var f=this.pos-e,g=127>=f?1:16383>=f?2:2097151>=f?3:268435455>=f?4:Math.ceil(Math.log(f)/(7*Math.LN2));if(g>1){this.realloc(g-1);for(var h=this.pos-1;h>=e;h--)this.buf[h+g-1]=this.buf[h]}this.pos=e-1,this.writeVarint(f),this.pos+=f},writePackedVarint:function(a,b){this.writeMessage(a,e,b)},writePackedSVarint:function(a,b){this.writeMessage(a,f,b)},writePackedBoolean:function(a,b){this.writeMessage(a,i,b)},writePackedFloat:function(a,b){this.writeMessage(a,g,b)},writePackedDouble:function(a,b){this.writeMessage(a,h,b)},writePackedFixed32:function(a,b){this.writeMessage(a,j,b)},writePackedSFixed32:function(a,b){this.writeMessage(a,k,b)},writePackedFixed64:function(a,b){this.writeMessage(a,l,b)},writePackedSFixed64:function(a,b){this.writeMessage(a,m,b)},writeBytesField:function(a,b){this.writeTag(a,d.Bytes),this.writeBytes(b)},writeFixed32Field:function(a,b){this.writeTag(a,d.Fixed32),this.writeFixed32(b)},writeSFixed32Field:function(a,b){this.writeTag(a,d.Fixed32),this.writeSFixed32(b)},writeFixed64Field:function(a,b){this.writeTag(a,d.Fixed64),this.writeFixed64(b)},writeSFixed64Field:function(a,b){this.writeTag(a,d.Fixed64),this.writeSFixed64(b)},writeVarintField:function(a,b){this.writeTag(a,d.Varint),this.writeVarint(b)},writeSVarintField:function(a,b){this.writeTag(a,d.Varint),this.writeSVarint(b)},writeStringField:function(a,b){this.writeTag(a,d.Bytes),this.writeString(b)},writeFloatField:function(a,b){this.writeTag(a,d.Fixed32),this.writeFloat(b)},writeDoubleField:function(a,b){this.writeTag(a,d.Fixed64),this.writeDouble(b)},writeBooleanField:function(a,b){this.writeVarintField(a,Boolean(b))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":134}],136:[function(a,b,c){c.read=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<>1,k=-7,l=c?e-1:0,m=c?-1:1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?NaN:(n?-1:1)*(1/0);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.write=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?0:f-1,o=d?1:-1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-g))<1&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],137:[function(a,b,c){"use strict";function d(a,b){this.x=a,this.y=b}b.exports=d,d.prototype={clone:function(){return new d(this.x,this.y)},add:function(a){return this.clone()._add(a)},sub:function(a){return this.clone()._sub(a)},mult:function(a){return this.clone()._mult(a)},div:function(a){return this.clone()._div(a)},rotate:function(a){return this.clone()._rotate(a)},matMult:function(a){return this.clone()._matMult(a)},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(a){return this.x===a.x&&this.y===a.y},dist:function(a){return Math.sqrt(this.distSqr(a))},distSqr:function(a){var b=a.x-this.x,c=a.y-this.y;return b*b+c*c},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(a){return Math.atan2(this.y-a.y,this.x-a.x)},angleWith:function(a){return this.angleWithSep(a.x,a.y)},angleWithSep:function(a,b){return Math.atan2(this.x*b-this.y*a,this.x*a+this.y*b)},_matMult:function(a){var b=a[0]*this.x+a[1]*this.y,c=a[2]*this.x+a[3]*this.y;return this.x=b,this.y=c,this},_add:function(a){return this.x+=a.x,this.y+=a.y,this},_sub:function(a){return this.x-=a.x,this.y-=a.y,this},_mult:function(a){return this.x*=a,this.y*=a,this},_div:function(a){return this.x/=a,this.y/=a,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var a=this.y;return this.y=this.x,this.x=-a,this},_rotate:function(a){var b=Math.cos(a),c=Math.sin(a),d=b*this.x-c*this.y,e=c*this.x+b*this.y;return this.x=d,this.y=e,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},d.convert=function(a){return a instanceof d?a:Array.isArray(a)?new d(a[0],a[1]):a}},{}],138:[function(b,c,d){!function(){"use strict";function b(a,c){return this instanceof b?(this._maxEntries=Math.max(4,a||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),c&&this._initFormat(c),void this.clear()):new b(a,c)}function d(a,b){a.bbox=e(a,0,a.children.length,b)}function e(a,b,c,d){for(var e,h=f(),i=b;c>i;i++)e=a.children[i],g(h,a.leaf?d(e):e.bbox);return h}function f(){return[1/0,1/0,-(1/0),-(1/0)]}function g(a,b){return a[0]=Math.min(a[0],b[0]),a[1]=Math.min(a[1],b[1]),a[2]=Math.max(a[2],b[2]),a[3]=Math.max(a[3],b[3]),a}function h(a,b){return a.bbox[0]-b.bbox[0]}function i(a,b){return a.bbox[1]-b.bbox[1]}function j(a){return(a[2]-a[0])*(a[3]-a[1])}function k(a){return a[2]-a[0]+(a[3]-a[1])}function l(a,b){return(Math.max(b[2],a[2])-Math.min(b[0],a[0]))*(Math.max(b[3],a[3])-Math.min(b[1],a[1]))}function m(a,b){var c=Math.max(a[0],b[0]),d=Math.max(a[1],b[1]),e=Math.min(a[2],b[2]),f=Math.min(a[3],b[3]);return Math.max(0,e-c)*Math.max(0,f-d)}function n(a,b){return a[0]<=b[0]&&a[1]<=b[1]&&b[2]<=a[2]&&b[3]<=a[3]}function o(a,b){return b[0]<=a[2]&&b[1]<=a[3]&&b[2]>=a[0]&&b[3]>=a[1]}function p(a,b,c,d,e){for(var f,g=[b,c];g.length;)c=g.pop(),b=g.pop(),d>=c-b||(f=b+Math.ceil((c-b)/d/2)*d,q(a,b,c,f,e),g.push(b,f,f,c))}function q(a,b,c,d,e){for(var f,g,h,i,j,k,l,m,n;c>b;){for(c-b>600&&(f=c-b+1,g=d-b+1,h=Math.log(f),i=.5*Math.exp(2*h/3),j=.5*Math.sqrt(h*i*(f-i)/f)*(0>g-f/2?-1:1),k=Math.max(b,Math.floor(d-g*i/f+j)),l=Math.min(c,Math.floor(d+(f-g)*i/f+j)),q(a,k,l,d,e)),m=a[d],g=b,n=c,r(a,b,d),e(a[c],m)>0&&r(a,b,c);n>g;){for(r(a,g,n),g++,n--;e(a[g],m)<0;)g++;for(;e(a[n],m)>0;)n--}0===e(a[b],m)?r(a,b,n):(n++,r(a,n,c)),d>=n&&(b=n+1),n>=d&&(c=n-1)}}function r(a,b,c){var d=a[b];a[b]=a[c],a[c]=d}b.prototype={all:function(){return this._all(this.data,[])},search:function(a){var b=this.data,c=[],d=this.toBBox;if(!o(a,b.bbox))return c;for(var e,f,g,h,i=[];b;){for(e=0,f=b.children.length;f>e;e++)g=b.children[e],h=b.leaf?d(g):g.bbox,o(a,h)&&(b.leaf?c.push(g):n(a,h)?this._all(g,c):i.push(g));b=i.pop()}return c},collides:function(a){var b=this.data,c=this.toBBox;if(!o(a,b.bbox))return!1;for(var d,e,f,g,h=[];b;){for(d=0,e=b.children.length;e>d;d++)if(f=b.children[d],g=b.leaf?c(f):f.bbox,o(a,g)){if(b.leaf||n(a,g))return!0;h.push(f)}b=h.pop()}return!1},load:function(a){if(!a||!a.length)return this;if(a.lengthb;b++)this.insert(a[b]);return this}var d=this._build(a.slice(),0,a.length-1,0);if(this.data.children.length)if(this.data.height===d.height)this._splitRoot(this.data,d);else{if(this.data.height=g)return f={children:a.slice(b,c+1),height:1,bbox:null,leaf:!0},d(f,this.toBBox),f;e||(e=Math.ceil(Math.log(g)/Math.log(h)),h=Math.ceil(g/Math.pow(h,e-1))),f={children:[],height:e,bbox:null};var i,j,k,l,m=Math.ceil(g/h),n=m*Math.ceil(Math.sqrt(h));for(p(a,b,c,n,this.compareMinX),i=b;c>=i;i+=n)for(k=Math.min(i+n-1,c),p(a,i,k,m,this.compareMinY),j=i;k>=j;j+=m)l=Math.min(j+m-1,k),f.children.push(this._build(a,j,l,e-1));return d(f,this.toBBox),f},_chooseSubtree:function(a,b,c,d){for(var e,f,g,h,i,k,m,n;d.push(b),!b.leaf&&d.length-1!==c;){for(m=n=1/0,e=0,f=b.children.length;f>e;e++)g=b.children[e],i=j(g.bbox),k=l(a,g.bbox)-i,n>k?(n=k,m=m>i?i:m,h=g):k===n&&m>i&&(m=i,h=g);b=h}return b},_insert:function(a,b,c){var d=this.toBBox,e=c?a.bbox:d(a),f=[],h=this._chooseSubtree(e,this.data,b,f);for(h.children.push(a),g(h.bbox,e);b>=0&&f[b].children.length>this._maxEntries;)this._split(f,b),b--;this._adjustParentBBoxes(e,f,b)},_split:function(a,b){var c=a[b],e=c.children.length,f=this._minEntries;this._chooseSplitAxis(c,f,e);var g={children:c.children.splice(this._chooseSplitIndex(c,f,e)),height:c.height};c.leaf&&(g.leaf=!0),d(c,this.toBBox),d(g,this.toBBox),b?a[b-1].children.push(g):this._splitRoot(c,g)},_splitRoot:function(a,b){this.data={children:[a,b],height:a.height+1},d(this.data,this.toBBox)},_chooseSplitIndex:function(a,b,c){var d,f,g,h,i,k,l,n;for(k=l=1/0,d=b;c-b>=d;d++)f=e(a,0,d,this.toBBox),g=e(a,d,c,this.toBBox),h=m(f,g),i=j(f)+j(g),k>h?(k=h,n=d,l=l>i?i:l):h===k&&l>i&&(l=i,n=d);return n},_chooseSplitAxis:function(a,b,c){var d=a.leaf?this.compareMinX:h,e=a.leaf?this.compareMinY:i,f=this._allDistMargin(a,b,c,d),g=this._allDistMargin(a,b,c,e);g>f&&a.children.sort(d)},_allDistMargin:function(a,b,c,d){a.children.sort(d);var f,h,i=this.toBBox,j=e(a,0,b,i),l=e(a,c-b,c,i),m=k(j)+k(l);for(f=b;c-b>f;f++)h=a.children[f],g(j,a.leaf?i(h):h.bbox),m+=k(j);for(f=c-b-1;f>=b;f--)h=a.children[f],g(l,a.leaf?i(h):h.bbox),m+=k(l);return m},_adjustParentBBoxes:function(a,b,c){for(var d=c;d>=0;d--)g(b[d].bbox,a)},_condense:function(a){for(var b,c=a.length-1;c>=0;c--)0===a[c].children.length?c>0?(b=a[c-1].children,b.splice(b.indexOf(a[c]),1)):this.clear():d(a[c],this.toBBox)},_initFormat:function(a){var b=["return a"," - b",";"];this.compareMinX=new Function("a","b",b.join(a[0])),this.compareMinY=new Function("a","b",b.join(a[1])),this.toBBox=new Function("a","return [a"+a.join(", a")+"];")}},"function"==typeof a&&a.amd?a("rbush",function(){return b}):"undefined"!=typeof c?c.exports=b:"undefined"!=typeof self?self.rbush=b:window.rbush=b}()},{}],139:[function(b,c,d){void function(b,e){"function"==typeof a&&a.amd?a(e):"object"==typeof d?c.exports=e():b.resolveUrl=e()}(this,function(){function a(){var a=arguments.length;if(0===a)throw new Error("resolveUrl requires at least one argument; got none.");var b=document.createElement("base");if(b.href=arguments[0],1===a)return b.href;var c=document.getElementsByTagName("head")[0];c.insertBefore(b,c.firstChild);for(var d,e=document.createElement("a"),f=1;a>f;f++)e.href=arguments[f],d=e.href,b.href=d;return c.removeChild(b),d}return a})},{}],140:[function(a,b,c){function d(a,b,c,d){this.cx=3*a,this.bx=3*(c-a)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*b,this.by=3*(d-b)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=d,this.p2x=c,this.p2y=d}b.exports=d,d.prototype.sampleCurveX=function(a){return((this.ax*a+this.bx)*a+this.cx)*a},d.prototype.sampleCurveY=function(a){return((this.ay*a+this.by)*a+this.cy)*a},d.prototype.sampleCurveDerivativeX=function(a){return(3*this.ax*a+2*this.bx)*a+this.cx},d.prototype.solveCurveX=function(a,b){"undefined"==typeof b&&(b=1e-6);var c,d,e,f,g;for(e=a,g=0;8>g;g++){if(f=this.sampleCurveX(e)-a,Math.abs(f)e)return c;if(e>d)return d;for(;d>c;){if(f=this.sampleCurveX(e),Math.abs(f-a)f?c=e:d=e,e=.5*(d-c)+c}return e},d.prototype.solve=function(a,b){return this.sampleCurveY(this.solveCurveX(a,b))}},{}],141:[function(a,b,c){b.exports.VectorTile=a("./lib/vectortile.js"),b.exports.VectorTileFeature=a("./lib/vectortilefeature.js"),b.exports.VectorTileLayer=a("./lib/vectortilelayer.js")},{"./lib/vectortile.js":142,"./lib/vectortilefeature.js":143,"./lib/vectortilelayer.js":144}],142:[function(a,b,c){"use strict";function d(a,b){this.layers=a.readFields(e,{},b)}function e(a,b,c){if(3===a){var d=new f(c,c.readVarint()+c.pos);d.length&&(b[d.name]=d)}}var f=a("./vectortilelayer");b.exports=d},{"./vectortilelayer":144}],143:[function(a,b,c){"use strict";function d(a,b,c,d,f){this.properties={},this.extent=c,this.type=0,this._pbf=a,this._geometry=-1,this._keys=d,this._values=f,a.readFields(e,this,b)}function e(a,b,c){1==a?b._id=c.readVarint():2==a?f(c,b):3==a?b.type=c.readVarint():4==a&&(b._geometry=c.pos)}function f(a,b){for(var c=a.readVarint()+a.pos;a.pos>3}if(e--,1===d||2===d)f+=a.readSVarint(),h+=a.readSVarint(),1===d&&(b&&i.push(b),b=[]),b.push(new g(f,h));else{if(7!==d)throw new Error("unknown command "+d);b&&b.push(b[0].clone())}}return b&&i.push(b),i},d.prototype.bbox=function(){var a=this._pbf;a.pos=this._geometry;for(var b=a.readVarint()+a.pos,c=1,d=0,e=0,f=0,g=1/0,h=-(1/0),i=1/0,j=-(1/0);a.pos>3}if(d--,1===c||2===c)e+=a.readSVarint(),f+=a.readSVarint(),g>e&&(g=e),e>h&&(h=e),i>f&&(i=f),f>j&&(j=f);else if(7!==c)throw new Error("unknown command "+c)}return[g,i,h,j]},d.prototype.toGeoJSON=function(a,b,c){for(var e=this.extent*Math.pow(2,c),f=this.extent*a,g=this.extent*b,h=this.loadGeometry(),i=d.types[this.type],j=0;j>3;b=1===d?a.readString():2===d?a.readFloat():3===d?a.readDouble():4===d?a.readVarint64():5===d?a.readVarint():6===d?a.readSVarint():7===d?a.readBoolean():null}return b}var g=a("./vectortilefeature.js");b.exports=d,d.prototype.feature=function(a){if(0>a||a>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[a];var b=this._pbf.readVarint()+this._pbf.pos;return new g(this._pbf,b,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":143}],145:[function(a,b,c){var d=arguments[3],e=arguments[4],f=arguments[5],g=JSON.stringify;b.exports=function(a){for(var b,c=Object.keys(f),h=0,i=c.length;i>h;h++){var j=c[h];if(f[j].exports===a){b=j;break}}if(!b){b=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var k={},h=0,i=c.length;i>h;h++){var j=c[h];k[j]=j}e[b]=[Function(["require","module","exports"],"("+a+")(self)"),k]}var l=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[b]=b,e[l]=[Function(["require"],"require("+g(b)+")(self)"),m];var n="("+d+")({"+Object.keys(e).map(function(a){return g(a)+":["+e[a][0]+","+g(e[a][1])+"]"}).join(",")+"},{},["+g(l)+"])",o=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(o.createObjectURL(new Blob([n],{type:"text/javascript"})))}},{}]},{},[24])(24)}); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=200&&300>a||304===a}function e(){void 0===h.status||d(h.status)?b.call(h,null,h):b.call(h,h,null)}var f=!1;if("undefined"==typeof window.XMLHttpRequest)return b(Error("Browser not supported"));if("undefined"==typeof c){var g=a.match(/^\s*https?:\/\/[^\/]*/);c=g&&g[0]!==location.protocol+"//"+location.domain+(location.port?":"+location.port:"")}var h=new window.XMLHttpRequest;if(c&&!("withCredentials"in h)){h=new window.XDomainRequest;var i=b;b=function(){if(f)i.apply(this,arguments);else{var a=this,b=arguments;setTimeout(function(){i.apply(a,b)},0)}}}return"onload"in h?h.onload=e:h.onreadystatechange=function(){4===h.readyState&&e()},h.onerror=function(a){b.call(this,a||!0,null),b=function(){}},h.onprogress=function(){},h.ontimeout=function(a){b.call(this,a,null),b=function(){}},h.onabort=function(a){b.call(this,a,null),b=function(){}},h.open("GET",a,!0),h.send(null),f=!0,h}"undefined"!=typeof b&&(b.exports=d)},{}],2:[function(a,b,c){b.exports=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)}},{}],3:[function(a,b,c){!function(a,c,d){var e=a.L,f={};f.version="0.7.7","object"==typeof b&&"object"==typeof b.exports?b.exports=f:"function"==typeof define&&define.amd&&define(f),f.noConflict=function(){return a.L=e,this},a.L=f,f.Util={extend:function(a){var b,c,d,e,f=Array.prototype.slice.call(arguments,1);for(c=0,d=f.length;d>c;c++){e=f[c]||{};for(b in e)e.hasOwnProperty(b)&&(a[b]=e[b])}return a},bind:function(a,b){var c=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return a.apply(b,c||arguments)}},stamp:function(){var a=0,b="_leaflet_id";return function(c){return c[b]=c[b]||++a,c[b]}}(),invokeEach:function(a,b,c){var d,e;if("object"==typeof a){e=Array.prototype.slice.call(arguments,3);for(d in a)b.apply(c,[d,a[d]].concat(e));return!0}return!1},limitExecByInterval:function(a,b,c){var d,e;return function f(){var g=arguments;return d?void(e=!0):(d=!0,setTimeout(function(){d=!1,e&&(f.apply(c,g),e=!1)},b),void a.apply(c,g))}},falseFn:function(){return!1},formatNum:function(a,b){var c=Math.pow(10,b||5);return Math.round(a*c)/c},trim:function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")},splitWords:function(a){return f.Util.trim(a).split(/\s+/)},setOptions:function(a,b){return a.options=f.extend({},a.options,b),a.options},getParamString:function(a,b,c){var d=[];for(var e in a)d.push(encodeURIComponent(c?e.toUpperCase():e)+"="+encodeURIComponent(a[e]));return(b&&-1!==b.indexOf("?")?"&":"?")+d.join("&")},template:function(a,b){return a.replace(/\{ *([\w_]+) *\}/g,function(a,c){var e=b[c];if(e===d)throw new Error("No value provided for variable "+a);return"function"==typeof e&&(e=e(b)),e})},isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function b(b){var c,d,e=["webkit","moz","o","ms"];for(c=0;ca;a++)d._initHooks[a].call(this)}},b},f.Class.include=function(a){f.extend(this.prototype,a)},f.Class.mergeOptions=function(a){f.extend(this.prototype.options,a)},f.Class.addInitHook=function(a){var b=Array.prototype.slice.call(arguments,1),c="function"==typeof a?a:function(){this[a].apply(this,b)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c)};var g="_leaflet_events";f.Mixin={},f.Mixin.Events={addEventListener:function(a,b,c){if(f.Util.invokeEach(a,this.addEventListener,this,b,c))return this;var d,e,h,i,j,k,l,m=this[g]=this[g]||{},n=c&&c!==this&&f.stamp(c);for(a=f.Util.splitWords(a),d=0,e=a.length;e>d;d++)h={action:b,context:c||this},i=a[d],n?(j=i+"_idx",k=j+"_len",l=m[j]=m[j]||{},l[n]||(l[n]=[],m[k]=(m[k]||0)+1),l[n].push(h)):(m[i]=m[i]||[],m[i].push(h));return this},hasEventListeners:function(a){var b=this[g];return!!b&&(a in b&&b[a].length>0||a+"_idx"in b&&b[a+"_idx_len"]>0)},removeEventListener:function(a,b,c){if(!this[g])return this;if(!a)return this.clearAllEventListeners();if(f.Util.invokeEach(a,this.removeEventListener,this,b,c))return this;var d,e,h,i,j,k,l,m,n,o=this[g],p=c&&c!==this&&f.stamp(c);for(a=f.Util.splitWords(a),d=0,e=a.length;e>d;d++)if(h=a[d],k=h+"_idx",l=k+"_len",m=o[k],b){if(i=p&&m?m[p]:o[h]){for(j=i.length-1;j>=0;j--)i[j].action!==b||c&&i[j].context!==c||(n=i.splice(j,1),n[0].action=f.Util.falseFn);c&&m&&0===i.length&&(delete m[p],o[l]--)}}else delete o[h],delete o[k],delete o[l];return this},clearAllEventListeners:function(){return delete this[g],this},fireEvent:function(a,b){if(!this.hasEventListeners(a))return this;var c,d,e,h,i,j=f.Util.extend({},b,{type:a,target:this}),k=this[g];if(k[a])for(c=k[a].slice(),d=0,e=c.length;e>d;d++)c[d].action.call(c[d].context,j);h=k[a+"_idx"];for(i in h)if(c=h[i].slice())for(d=0,e=c.length;e>d;d++)c[d].action.call(c[d].context,j);return this},addOneTimeEventListener:function(a,b,c){if(f.Util.invokeEach(a,this.addOneTimeEventListener,this,b,c))return this;var d=f.bind(function(){this.removeEventListener(a,b,c).removeEventListener(a,d,c)},this);return this.addEventListener(a,b,c).addEventListener(a,d,c)}},f.Mixin.Events.on=f.Mixin.Events.addEventListener,f.Mixin.Events.off=f.Mixin.Events.removeEventListener,f.Mixin.Events.once=f.Mixin.Events.addOneTimeEventListener,f.Mixin.Events.fire=f.Mixin.Events.fireEvent,function(){var b="ActiveXObject"in a,e=b&&!c.addEventListener,g=navigator.userAgent.toLowerCase(),h=-1!==g.indexOf("webkit"),i=-1!==g.indexOf("chrome"),j=-1!==g.indexOf("phantom"),k=-1!==g.indexOf("android"),l=-1!==g.search("android [23]"),m=-1!==g.indexOf("gecko"),n=typeof orientation!=d+"",o=!a.PointerEvent&&a.MSPointerEvent,p=a.PointerEvent&&a.navigator.pointerEnabled||o,q="devicePixelRatio"in a&&a.devicePixelRatio>1||"matchMedia"in a&&a.matchMedia("(min-resolution:144dpi)")&&a.matchMedia("(min-resolution:144dpi)").matches,r=c.documentElement,s=b&&"transition"in r.style,t="WebKitCSSMatrix"in a&&"m11"in new a.WebKitCSSMatrix&&!l,u="MozPerspective"in r.style,v="OTransition"in r.style,w=!a.L_DISABLE_3D&&(s||t||u||v)&&!j,x=!a.L_NO_TOUCH&&!j&&(p||"ontouchstart"in a||a.DocumentTouch&&c instanceof a.DocumentTouch);f.Browser={ie:b,ielt9:e,webkit:h,gecko:m&&!h&&!a.opera&&!b,android:k,android23:l,chrome:i,ie3d:s,webkit3d:t,gecko3d:u,opera3d:v,any3d:w,mobile:n,mobileWebkit:n&&h,mobileWebkit3d:n&&t,mobileOpera:n&&a.opera,touch:x,msPointer:o,pointer:p,retina:q}}(),f.Point=function(a,b,c){this.x=c?Math.round(a):a,this.y=c?Math.round(b):b},f.Point.prototype={clone:function(){return new f.Point(this.x,this.y)},add:function(a){return this.clone()._add(f.point(a))},_add:function(a){return this.x+=a.x,this.y+=a.y,this},subtract:function(a){return this.clone()._subtract(f.point(a))},_subtract:function(a){return this.x-=a.x,this.y-=a.y,this},divideBy:function(a){return this.clone()._divideBy(a)},_divideBy:function(a){return this.x/=a,this.y/=a,this},multiplyBy:function(a){return this.clone()._multiplyBy(a)},_multiplyBy:function(a){return this.x*=a,this.y*=a,this},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},distanceTo:function(a){a=f.point(a);var b=a.x-this.x,c=a.y-this.y;return Math.sqrt(b*b+c*c)},equals:function(a){return a=f.point(a),a.x===this.x&&a.y===this.y},contains:function(a){return a=f.point(a),Math.abs(a.x)<=Math.abs(this.x)&&Math.abs(a.y)<=Math.abs(this.y)},toString:function(){return"Point("+f.Util.formatNum(this.x)+", "+f.Util.formatNum(this.y)+")"}},f.point=function(a,b,c){return a instanceof f.Point?a:f.Util.isArray(a)?new f.Point(a[0],a[1]):a===d||null===a?a:new f.Point(a,b,c)},f.Bounds=function(a,b){if(a)for(var c=b?[a,b]:a,d=0,e=c.length;e>d;d++)this.extend(c[d])},f.Bounds.prototype={extend:function(a){return a=f.point(a),this.min||this.max?(this.min.x=Math.min(a.x,this.min.x),this.max.x=Math.max(a.x,this.max.x),this.min.y=Math.min(a.y,this.min.y),this.max.y=Math.max(a.y,this.max.y)):(this.min=a.clone(),this.max=a.clone()),this},getCenter:function(a){return new f.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,a)},getBottomLeft:function(){return new f.Point(this.min.x,this.max.y)},getTopRight:function(){return new f.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(a){var b,c;return a="number"==typeof a[0]||a instanceof f.Point?f.point(a):f.bounds(a),a instanceof f.Bounds?(b=a.min,c=a.max):b=c=a,b.x>=this.min.x&&c.x<=this.max.x&&b.y>=this.min.y&&c.y<=this.max.y},intersects:function(a){a=f.bounds(a);var b=this.min,c=this.max,d=a.min,e=a.max,g=e.x>=b.x&&d.x<=c.x,h=e.y>=b.y&&d.y<=c.y;return g&&h},isValid:function(){return!(!this.min||!this.max)}},f.bounds=function(a,b){return!a||a instanceof f.Bounds?a:new f.Bounds(a,b)},f.Transformation=function(a,b,c,d){this._a=a,this._b=b,this._c=c,this._d=d},f.Transformation.prototype={transform:function(a,b){return this._transform(a.clone(),b)},_transform:function(a,b){return b=b||1,a.x=b*(this._a*a.x+this._b),a.y=b*(this._c*a.y+this._d),a},untransform:function(a,b){return b=b||1,new f.Point((a.x/b-this._b)/this._a,(a.y/b-this._d)/this._c)}},f.DomUtil={get:function(a){return"string"==typeof a?c.getElementById(a):a},getStyle:function(a,b){var d=a.style[b];if(!d&&a.currentStyle&&(d=a.currentStyle[b]),(!d||"auto"===d)&&c.defaultView){var e=c.defaultView.getComputedStyle(a,null);d=e?e[b]:null}return"auto"===d?null:d},getViewportOffset:function(a){var b,d=0,e=0,g=a,h=c.body,i=c.documentElement;do{if(d+=g.offsetTop||0,e+=g.offsetLeft||0,d+=parseInt(f.DomUtil.getStyle(g,"borderTopWidth"),10)||0,e+=parseInt(f.DomUtil.getStyle(g,"borderLeftWidth"),10)||0,b=f.DomUtil.getStyle(g,"position"),g.offsetParent===h&&"absolute"===b)break;if("fixed"===b){d+=h.scrollTop||i.scrollTop||0,e+=h.scrollLeft||i.scrollLeft||0;break}if("relative"===b&&!g.offsetLeft){var j=f.DomUtil.getStyle(g,"width"),k=f.DomUtil.getStyle(g,"max-width"),l=g.getBoundingClientRect();("none"!==j||"none"!==k)&&(e+=l.left+g.clientLeft),d+=l.top+(h.scrollTop||i.scrollTop||0);break}g=g.offsetParent}while(g);g=a;do{if(g===h)break;d-=g.scrollTop||0,e-=g.scrollLeft||0,g=g.parentNode}while(g);return new f.Point(e,d)},documentIsLtr:function(){return f.DomUtil._docIsLtrCached||(f.DomUtil._docIsLtrCached=!0,f.DomUtil._docIsLtr="ltr"===f.DomUtil.getStyle(c.body,"direction")),f.DomUtil._docIsLtr},create:function(a,b,d){var e=c.createElement(a);return e.className=b,d&&d.appendChild(e),e},hasClass:function(a,b){if(a.classList!==d)return a.classList.contains(b);var c=f.DomUtil._getClass(a);return c.length>0&&new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)},addClass:function(a,b){if(a.classList!==d)for(var c=f.Util.splitWords(b),e=0,g=c.length;g>e;e++)a.classList.add(c[e]);else if(!f.DomUtil.hasClass(a,b)){var h=f.DomUtil._getClass(a);f.DomUtil._setClass(a,(h?h+" ":"")+b)}},removeClass:function(a,b){a.classList!==d?a.classList.remove(b):f.DomUtil._setClass(a,f.Util.trim((" "+f.DomUtil._getClass(a)+" ").replace(" "+b+" "," ")))},_setClass:function(a,b){a.className.baseVal===d?a.className=b:a.className.baseVal=b},_getClass:function(a){return a.className.baseVal===d?a.className:a.className.baseVal},setOpacity:function(a,b){if("opacity"in a.style)a.style.opacity=b;else if("filter"in a.style){var c=!1,d="DXImageTransform.Microsoft.Alpha";try{c=a.filters.item(d)}catch(e){if(1===b)return}b=Math.round(100*b),c?(c.Enabled=100!==b,c.Opacity=b):a.style.filter+=" progid:"+d+"(opacity="+b+")"}},testProp:function(a){for(var b=c.documentElement.style,d=0;dc||c===b?b:a),new f.LatLng(this.lat,c)}},f.latLng=function(a,b){return a instanceof f.LatLng?a:f.Util.isArray(a)?"number"==typeof a[0]||"string"==typeof a[0]?new f.LatLng(a[0],a[1],a[2]):null:a===d||null===a?a:"object"==typeof a&&"lat"in a?new f.LatLng(a.lat,"lng"in a?a.lng:a.lon):b===d?null:new f.LatLng(a,b)},f.LatLngBounds=function(a,b){if(a)for(var c=b?[a,b]:a,d=0,e=c.length;e>d;d++)this.extend(c[d])},f.LatLngBounds.prototype={extend:function(a){if(!a)return this;var b=f.latLng(a);return a=null!==b?b:f.latLngBounds(a),a instanceof f.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(a.lat,this._southWest.lat),this._southWest.lng=Math.min(a.lng,this._southWest.lng),this._northEast.lat=Math.max(a.lat,this._northEast.lat),this._northEast.lng=Math.max(a.lng,this._northEast.lng)):(this._southWest=new f.LatLng(a.lat,a.lng),this._northEast=new f.LatLng(a.lat,a.lng)):a instanceof f.LatLngBounds&&(this.extend(a._southWest),this.extend(a._northEast)),this},pad:function(a){var b=this._southWest,c=this._northEast,d=Math.abs(b.lat-c.lat)*a,e=Math.abs(b.lng-c.lng)*a;return new f.LatLngBounds(new f.LatLng(b.lat-d,b.lng-e),new f.LatLng(c.lat+d,c.lng+e))},getCenter:function(){return new f.LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new f.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new f.LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(a){a="number"==typeof a[0]||a instanceof f.LatLng?f.latLng(a):f.latLngBounds(a);var b,c,d=this._southWest,e=this._northEast;return a instanceof f.LatLngBounds?(b=a.getSouthWest(),c=a.getNorthEast()):b=c=a,b.lat>=d.lat&&c.lat<=e.lat&&b.lng>=d.lng&&c.lng<=e.lng},intersects:function(a){a=f.latLngBounds(a);var b=this._southWest,c=this._northEast,d=a.getSouthWest(),e=a.getNorthEast(),g=e.lat>=b.lat&&d.lat<=c.lat,h=e.lng>=b.lng&&d.lng<=c.lng;return g&&h},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(a){return!!a&&(a=f.latLngBounds(a),this._southWest.equals(a.getSouthWest())&&this._northEast.equals(a.getNorthEast()))},isValid:function(){return!(!this._southWest||!this._northEast)}},f.latLngBounds=function(a,b){return!a||a instanceof f.LatLngBounds?a:new f.LatLngBounds(a,b)},f.Projection={},f.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(a){var b=f.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=Math.max(Math.min(c,a.lat),-c),e=a.lng*b,g=d*b;return g=Math.log(Math.tan(Math.PI/4+g/2)),new f.Point(e,g)},unproject:function(a){var b=f.LatLng.RAD_TO_DEG,c=a.x*b,d=(2*Math.atan(Math.exp(a.y))-Math.PI/2)*b;return new f.LatLng(d,c)}},f.Projection.LonLat={project:function(a){return new f.Point(a.lng,a.lat)},unproject:function(a){return new f.LatLng(a.y,a.x)}},f.CRS={latLngToPoint:function(a,b){var c=this.projection.project(a),d=this.scale(b);return this.transformation._transform(c,d)},pointToLatLng:function(a,b){var c=this.scale(b),d=this.transformation.untransform(a,c);return this.projection.unproject(d)},project:function(a){return this.projection.project(a)},scale:function(a){return 256*Math.pow(2,a)},getSize:function(a){var b=this.scale(a);return f.point(b,b)}},f.CRS.Simple=f.extend({},f.CRS,{projection:f.Projection.LonLat,transformation:new f.Transformation(1,0,(-1),0),scale:function(a){return Math.pow(2,a)}}),f.CRS.EPSG3857=f.extend({},f.CRS,{code:"EPSG:3857",projection:f.Projection.SphericalMercator,transformation:new f.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(a){var b=this.projection.project(a),c=6378137;return b.multiplyBy(c)}}),f.CRS.EPSG900913=f.extend({},f.CRS.EPSG3857,{code:"EPSG:900913"}),f.CRS.EPSG4326=f.extend({},f.CRS,{code:"EPSG:4326",projection:f.Projection.LonLat,transformation:new f.Transformation(1/360,.5,-1/360,.5)}),f.Map=f.Class.extend({includes:f.Mixin.Events,options:{crs:f.CRS.EPSG3857,fadeAnimation:f.DomUtil.TRANSITION&&!f.Browser.android23,trackResize:!0,markerZoomAnimation:f.DomUtil.TRANSITION&&f.Browser.any3d},initialize:function(a,b){b=f.setOptions(this,b),this._initContainer(a),this._initLayout(),this._onResize=f.bind(this._onResize,this),this._initEvents(),b.maxBounds&&this.setMaxBounds(b.maxBounds),b.center&&b.zoom!==d&&this.setView(f.latLng(b.center),b.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(b.layers)},setView:function(a,b){return b=b===d?this.getZoom():b,this._resetView(f.latLng(a),this._limitZoom(b)),this},setZoom:function(a,b){return this._loaded?this.setView(this.getCenter(),a,{zoom:b}):(this._zoom=this._limitZoom(a),this)},zoomIn:function(a,b){return this.setZoom(this._zoom+(a||1),b)},zoomOut:function(a,b){return this.setZoom(this._zoom-(a||1),b)},setZoomAround:function(a,b,c){var d=this.getZoomScale(b),e=this.getSize().divideBy(2),g=a instanceof f.Point?a:this.latLngToContainerPoint(a),h=g.subtract(e).multiplyBy(1-1/d),i=this.containerPointToLatLng(e.add(h));return this.setView(i,b,{zoom:c})},fitBounds:function(a,b){b=b||{},a=a.getBounds?a.getBounds():f.latLngBounds(a);var c=f.point(b.paddingTopLeft||b.padding||[0,0]),d=f.point(b.paddingBottomRight||b.padding||[0,0]),e=this.getBoundsZoom(a,!1,c.add(d));e=b.maxZoom?Math.min(b.maxZoom,e):e;var g=d.subtract(c).divideBy(2),h=this.project(a.getSouthWest(),e),i=this.project(a.getNorthEast(),e),j=this.unproject(h.add(i).divideBy(2).add(g),e);return this.setView(j,e,b)},fitWorld:function(a){return this.fitBounds([[-90,-180],[90,180]],a)},panTo:function(a,b){return this.setView(a,this._zoom,{pan:b})},panBy:function(a){return this.fire("movestart"),this._rawPanBy(f.point(a)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(a){return a=f.latLngBounds(a),this.options.maxBounds=a,a?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(a,b){var c=this.getCenter(),d=this._limitCenter(c,this._zoom,a);return c.equals(d)?this:this.panTo(d,b)},addLayer:function(a){var b=f.stamp(a);return this._layers[b]?this:(this._layers[b]=a,!a.options||isNaN(a.options.maxZoom)&&isNaN(a.options.minZoom)||(this._zoomBoundLayers[b]=a,this._updateZoomLevels()),this.options.zoomAnimation&&f.TileLayer&&a instanceof f.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,a.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(a),this)},removeLayer:function(a){var b=f.stamp(a);return this._layers[b]?(this._loaded&&a.onRemove(this),delete this._layers[b],this._loaded&&this.fire("layerremove",{layer:a}),this._zoomBoundLayers[b]&&(delete this._zoomBoundLayers[b],this._updateZoomLevels()),this.options.zoomAnimation&&f.TileLayer&&a instanceof f.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,a.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(a){return!!a&&f.stamp(a)in this._layers},eachLayer:function(a,b){for(var c in this._layers)a.call(b,this._layers[c]);return this},invalidateSize:function(a){if(!this._loaded)return this;a=f.extend({animate:!1,pan:!0},a===!0?{animate:!0}:a);var b=this.getSize();this._sizeChanged=!0,this._initialCenter=null;var c=this.getSize(),d=b.divideBy(2).round(),e=c.divideBy(2).round(),g=d.subtract(e);return g.x||g.y?(a.animate&&a.pan?this.panBy(g):(a.pan&&this._rawPanBy(g),this.fire("move"),a.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(f.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:b,newSize:c})):this},addHandler:function(a,b){if(!b)return this;var c=this[a]=new b(this);return this._handlers.push(c),this.options[a]&&c.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(a){this._container._leaflet=d}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var a=this.getPixelBounds(),b=this.unproject(a.getBottomLeft()),c=this.unproject(a.getTopRight());return new f.LatLngBounds(b,c)},getMinZoom:function(){return this.options.minZoom===d?this._layersMinZoom===d?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===d?this._layersMaxZoom===d?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(a,b,c){a=f.latLngBounds(a);var d,e=this.getMinZoom()-(b?1:0),g=this.getMaxZoom(),h=this.getSize(),i=a.getNorthWest(),j=a.getSouthEast(),k=!0;c=f.point(c||[0,0]);do e++,d=this.project(j,e).subtract(this.project(i,e)).add(c),k=b?d.x=e);return k&&b?null:b?e:e-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new f.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var a=this._getTopLeftPoint();return new f.Bounds(a,a.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(a){var b=this.options.crs;return b.scale(a)/b.scale(this._zoom)},getScaleZoom:function(a){return this._zoom+Math.log(a)/Math.LN2},project:function(a,b){return b=b===d?this._zoom:b,this.options.crs.latLngToPoint(f.latLng(a),b)},unproject:function(a,b){return b=b===d?this._zoom:b,this.options.crs.pointToLatLng(f.point(a),b)},layerPointToLatLng:function(a){var b=f.point(a).add(this.getPixelOrigin());return this.unproject(b)},latLngToLayerPoint:function(a){var b=this.project(f.latLng(a))._round();return b._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(a){return f.point(a).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(a){return f.point(a).add(this._getMapPanePos())},containerPointToLatLng:function(a){var b=this.containerPointToLayerPoint(f.point(a));return this.layerPointToLatLng(b)},latLngToContainerPoint:function(a){return this.layerPointToContainerPoint(this.latLngToLayerPoint(f.latLng(a)))},mouseEventToContainerPoint:function(a){return f.DomEvent.getMousePosition(a,this._container)},mouseEventToLayerPoint:function(a){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(a))},mouseEventToLatLng:function(a){return this.layerPointToLatLng(this.mouseEventToLayerPoint(a))},_initContainer:function(a){var b=this._container=f.DomUtil.get(a);if(!b)throw new Error("Map container not found.");if(b._leaflet)throw new Error("Map container is already initialized.");b._leaflet=!0},_initLayout:function(){var a=this._container;f.DomUtil.addClass(a,"leaflet-container"+(f.Browser.touch?" leaflet-touch":"")+(f.Browser.retina?" leaflet-retina":"")+(f.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var b=f.DomUtil.getStyle(a,"position");"absolute"!==b&&"relative"!==b&&"fixed"!==b&&(a.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var a=this._panes={};this._mapPane=a.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=a.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),a.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),a.shadowPane=this._createPane("leaflet-shadow-pane"),a.overlayPane=this._createPane("leaflet-overlay-pane"),a.markerPane=this._createPane("leaflet-marker-pane"),a.popupPane=this._createPane("leaflet-popup-pane");var b=" leaflet-zoom-hide";this.options.markerZoomAnimation||(f.DomUtil.addClass(a.markerPane,b),f.DomUtil.addClass(a.shadowPane,b),f.DomUtil.addClass(a.popupPane,b))},_createPane:function(a,b){return f.DomUtil.create("div",a,b||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(a){a=a?f.Util.isArray(a)?a:[a]:[];for(var b=0,c=a.length;c>b;b++)this.addLayer(a[b])},_resetView:function(a,b,c,d){var e=this._zoom!==b;d||(this.fire("movestart"),e&&this.fire("zoomstart")),this._zoom=b,this._initialCenter=a,this._initialTopLeftPoint=this._getNewTopLeftPoint(a),c?this._initialTopLeftPoint._add(this._getMapPanePos()):f.DomUtil.setPosition(this._mapPane,new f.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var g=!this._loaded;this._loaded=!0,this.fire("viewreset",{hard:!c}),g&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("move"),(e||d)&&this.fire("zoomend"),this.fire("moveend",{hard:!c})},_rawPanBy:function(a){f.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(a))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var a,b=1/0,c=-(1/0),e=this._getZoomSpan();for(a in this._zoomBoundLayers){var f=this._zoomBoundLayers[a];isNaN(f.options.minZoom)||(b=Math.min(b,f.options.minZoom)),isNaN(f.options.maxZoom)||(c=Math.max(c,f.options.maxZoom))}a===d?this._layersMaxZoom=this._layersMinZoom=d:(this._layersMaxZoom=c,this._layersMinZoom=b),e!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(b){if(f.DomEvent){b=b||"on",f.DomEvent[b](this._container,"click",this._onMouseClick,this);var c,d,e=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(c=0,d=e.length;d>c;c++)f.DomEvent[b](this._container,e[c],this._fireMouseEvent,this);this.options.trackResize&&f.DomEvent[b](a,"resize",this._onResize,this)}},_onResize:function(){f.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=f.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(a){!this._loaded||!a._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||f.DomEvent._skipped(a)||(this.fire("preclick"),this._fireMouseEvent(a))},_fireMouseEvent:function(a){if(this._loaded&&!f.DomEvent._skipped(a)){var b=a.type;if(b="mouseenter"===b?"mouseover":"mouseleave"===b?"mouseout":b,this.hasEventListeners(b)){"contextmenu"===b&&f.DomEvent.preventDefault(a);var c=this.mouseEventToContainerPoint(a),d=this.containerPointToLayerPoint(c),e=this.layerPointToLatLng(d);this.fire(b,{latlng:e,layerPoint:d,containerPoint:c,originalEvent:a})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var a=0,b=this._handlers.length;b>a;a++)this._handlers[a].disable()},whenReady:function(a,b){return this._loaded?a.call(b||this,this):this.on("load",a,b),this},_layerAdd:function(a){a.onAdd(this),this.fire("layeradd",{layer:a})},_getMapPanePos:function(){return f.DomUtil.getPosition(this._mapPane)},_moved:function(){var a=this._getMapPanePos();return a&&!a.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(a,b){var c=this.getSize()._divideBy(2);return this.project(a,b)._subtract(c)._round()},_latLngToNewLayerPoint:function(a,b,c){var d=this._getNewTopLeftPoint(c,b).add(this._getMapPanePos());return this.project(a,b)._subtract(d)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(a){return this.latLngToLayerPoint(a).subtract(this._getCenterLayerPoint())},_limitCenter:function(a,b,c){if(!c)return a; +var d=this.project(a,b),e=this.getSize().divideBy(2),g=new f.Bounds(d.subtract(e),d.add(e)),h=this._getBoundsOffset(g,c,b);return this.unproject(d.add(h),b)},_limitOffset:function(a,b){if(!b)return a;var c=this.getPixelBounds(),d=new f.Bounds(c.min.add(a),c.max.add(a));return a.add(this._getBoundsOffset(d,b))},_getBoundsOffset:function(a,b,c){var d=this.project(b.getNorthWest(),c).subtract(a.min),e=this.project(b.getSouthEast(),c).subtract(a.max),g=this._rebound(d.x,-e.x),h=this._rebound(d.y,-e.y);return new f.Point(g,h)},_rebound:function(a,b){return a+b>0?Math.round(a-b)/2:Math.max(0,Math.ceil(a))-Math.max(0,Math.floor(b))},_limitZoom:function(a){var b=this.getMinZoom(),c=this.getMaxZoom();return Math.max(b,Math.min(c,a))}}),f.map=function(a,b){return new f.Map(a,b)},f.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(a){var b=f.LatLng.DEG_TO_RAD,c=this.MAX_LATITUDE,d=Math.max(Math.min(c,a.lat),-c),e=this.R_MAJOR,g=this.R_MINOR,h=a.lng*b*e,i=d*b,j=g/e,k=Math.sqrt(1-j*j),l=k*Math.sin(i);l=Math.pow((1-l)/(1+l),.5*k);var m=Math.tan(.5*(.5*Math.PI-i))/l;return i=-e*Math.log(m),new f.Point(h,i)},unproject:function(a){for(var b,c=f.LatLng.RAD_TO_DEG,d=this.R_MAJOR,e=this.R_MINOR,g=a.x*c/d,h=e/d,i=Math.sqrt(1-h*h),j=Math.exp(-a.y/d),k=Math.PI/2-2*Math.atan(j),l=15,m=1e-7,n=l,o=.1;Math.abs(o)>m&&--n>0;)b=i*Math.sin(k),o=Math.PI/2-2*Math.atan(j*Math.pow((1-b)/(1+b),.5*i))-k,k+=o;return new f.LatLng(k*c,g)}},f.CRS.EPSG3395=f.extend({},f.CRS,{code:"EPSG:3395",projection:f.Projection.Mercator,transformation:function(){var a=f.Projection.Mercator,b=a.R_MAJOR,c=.5/(Math.PI*b);return new f.Transformation(c,.5,(-c),.5)}()}),f.TileLayer=f.Class.extend({includes:f.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:f.Browser.mobile,updateWhenIdle:f.Browser.mobile},initialize:function(a,b){b=f.setOptions(this,b),b.detectRetina&&f.Browser.retina&&b.maxZoom>0&&(b.tileSize=Math.floor(b.tileSize/2),b.zoomOffset++,b.minZoom>0&&b.minZoom--,this.options.maxZoom--),b.bounds&&(b.bounds=f.latLngBounds(b.bounds)),this._url=a;var c=this.options.subdomains;"string"==typeof c&&(this.options.subdomains=c.split(""))},onAdd:function(a){this._map=a,this._animated=a._zoomAnimated,this._initContainer(),a.on({viewreset:this._reset,moveend:this._update},this),this._animated&&a.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=f.Util.limitExecByInterval(this._update,150,this),a.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){this._container.parentNode.removeChild(this._container),a.off({viewreset:this._reset,moveend:this._update},this),this._animated&&a.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||a.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var a=this._map._panes.tilePane;return this._container&&(a.appendChild(this._container),this._setAutoZIndex(a,Math.max)),this},bringToBack:function(){var a=this._map._panes.tilePane;return this._container&&(a.insertBefore(this._container,a.firstChild),this._setAutoZIndex(a,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(a){return this.options.opacity=a,this._map&&this._updateOpacity(),this},setZIndex:function(a){return this.options.zIndex=a,this._updateZIndex(),this},setUrl:function(a,b){return this._url=a,b||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==d&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(a,b){var c,d,e,f=a.children,g=-b(1/0,-(1/0));for(d=0,e=f.length;e>d;d++)f[d]!==this._container&&(c=parseInt(f[d].style.zIndex,10),isNaN(c)||(g=b(g,c)));this.options.zIndex=this._container.style.zIndex=(isFinite(g)?g:0)+b(1,-1)},_updateOpacity:function(){var a,b=this._tiles;if(f.Browser.ielt9)for(a in b)f.DomUtil.setOpacity(b[a],this.options.opacity);else f.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var a=this._map._panes.tilePane;if(!this._container){if(this._container=f.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var b="leaflet-tile-container";this._bgBuffer=f.DomUtil.create("div",b,this._container),this._tileContainer=f.DomUtil.create("div",b,this._container)}else this._tileContainer=this._container;a.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(a){for(var b in this._tiles)this.fire("tileunload",{tile:this._tiles[b]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&a&&a.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var a=this._map,b=a.getZoom()+this.options.zoomOffset,c=this.options.maxNativeZoom,d=this.options.tileSize;return c&&b>c&&(d=Math.round(a.getZoomScale(b)/a.getZoomScale(c)*d)),d},_update:function(){if(this._map){var a=this._map,b=a.getPixelBounds(),c=a.getZoom(),d=this._getTileSize();if(!(c>this.options.maxZoom||cd;d++)this._addTile(g[d],j);this._tileContainer.appendChild(j)}},_tileShouldBeLoaded:function(a){if(a.x+":"+a.y in this._tiles)return!1;var b=this.options;if(!b.continuousWorld){var c=this._getWrapTileNum();if(b.noWrap&&(a.x<0||a.x>=c.x)||a.y<0||a.y>=c.y)return!1}if(b.bounds){var d=this._getTileSize(),e=a.multiplyBy(d),f=e.add([d,d]),g=this._map.unproject(e),h=this._map.unproject(f);if(b.continuousWorld||b.noWrap||(g=g.wrap(),h=h.wrap()),!b.bounds.intersects([g,h]))return!1}return!0},_removeOtherTiles:function(a){var b,c,d,e;for(e in this._tiles)b=e.split(":"),c=parseInt(b[0],10),d=parseInt(b[1],10),(ca.max.x||da.max.y)&&this._removeTile(e)},_removeTile:function(a){var b=this._tiles[a];this.fire("tileunload",{tile:b,url:b.src}),this.options.reuseTiles?(f.DomUtil.removeClass(b,"leaflet-tile-loaded"),this._unusedTiles.push(b)):b.parentNode===this._tileContainer&&this._tileContainer.removeChild(b),f.Browser.android||(b.onload=null,b.src=f.Util.emptyImageUrl),delete this._tiles[a]},_addTile:function(a,b){var c=this._getTilePos(a),d=this._getTile();f.DomUtil.setPosition(d,c,f.Browser.chrome),this._tiles[a.x+":"+a.y]=d,this._loadTile(d,a),d.parentNode!==this._tileContainer&&b.appendChild(d)},_getZoomForUrl:function(){var a=this.options,b=this._map.getZoom();return a.zoomReverse&&(b=a.maxZoom-b),b+=a.zoomOffset,a.maxNativeZoom?Math.min(b,a.maxNativeZoom):b},_getTilePos:function(a){var b=this._map.getPixelOrigin(),c=this._getTileSize();return a.multiplyBy(c).subtract(b)},getTileUrl:function(a){return f.Util.template(this._url,f.extend({s:this._getSubdomain(a),z:a.z,x:a.x,y:a.y},this.options))},_getWrapTileNum:function(){var a=this._map.options.crs,b=a.getSize(this._map.getZoom());return b.divideBy(this._getTileSize())._floor()},_adjustTilePoint:function(a){var b=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(a.x=(a.x%b.x+b.x)%b.x),this.options.tms&&(a.y=b.y-a.y-1),a.z=this._getZoomForUrl()},_getSubdomain:function(a){var b=Math.abs(a.x+a.y)%this.options.subdomains.length;return this.options.subdomains[b]},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var a=this._unusedTiles.pop();return this._resetTile(a),a}return this._createTile()},_resetTile:function(){},_createTile:function(){var a=f.DomUtil.create("img","leaflet-tile");return a.style.width=a.style.height=this._getTileSize()+"px",a.galleryimg="no",a.onselectstart=a.onmousemove=f.Util.falseFn,f.Browser.ielt9&&this.options.opacity!==d&&f.DomUtil.setOpacity(a,this.options.opacity),f.Browser.mobileWebkit3d&&(a.style.WebkitBackfaceVisibility="hidden"),a},_loadTile:function(a,b){a._layer=this,a.onload=this._tileOnLoad,a.onerror=this._tileOnError,this._adjustTilePoint(b),a.src=this.getTileUrl(b),this.fire("tileloadstart",{tile:a,url:a.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&f.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(f.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var a=this._layer;this.src!==f.Util.emptyImageUrl&&(f.DomUtil.addClass(this,"leaflet-tile-loaded"),a.fire("tileload",{tile:this,url:this.src})),a._tileLoaded()},_tileOnError:function(){var a=this._layer;a.fire("tileerror",{tile:this,url:this.src});var b=a.options.errorTileUrl;b&&(this.src=b),a._tileLoaded()}}),f.tileLayer=function(a,b){return new f.TileLayer(a,b)},f.TileLayer.WMS=f.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(a,b){this._url=a;var c=f.extend({},this.defaultWmsParams),d=b.tileSize||this.options.tileSize;b.detectRetina&&f.Browser.retina?c.width=c.height=2*d:c.width=c.height=d;for(var e in b)this.options.hasOwnProperty(e)||"crs"===e||(c[e]=b[e]);this.wmsParams=c,f.setOptions(this,b)},onAdd:function(a){this._crs=this.options.crs||a.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var b=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[b]=this._crs.code,f.TileLayer.prototype.onAdd.call(this,a)},getTileUrl:function(a){var b=this._map,c=this.options.tileSize,d=a.multiplyBy(c),e=d.add([c,c]),g=this._crs.project(b.unproject(d,a.z)),h=this._crs.project(b.unproject(e,a.z)),i=this._wmsVersion>=1.3&&this._crs===f.CRS.EPSG4326?[h.y,g.x,g.y,h.x].join(","):[g.x,h.y,h.x,g.y].join(","),j=f.Util.template(this._url,{s:this._getSubdomain(a)});return j+f.Util.getParamString(this.wmsParams,j,!0)+"&BBOX="+i},setParams:function(a,b){return f.extend(this.wmsParams,a),b||this.redraw(),this}}),f.tileLayer.wms=function(a,b){return new f.TileLayer.WMS(a,b)},f.TileLayer.Canvas=f.TileLayer.extend({options:{async:!1},initialize:function(a){f.setOptions(this,a)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var a in this._tiles)this._redrawTile(this._tiles[a]);return this},_redrawTile:function(a){this.drawTile(a,a._tilePoint,this._map._zoom)},_createTile:function(){var a=f.DomUtil.create("canvas","leaflet-tile");return a.width=a.height=this.options.tileSize,a.onselectstart=a.onmousemove=f.Util.falseFn,a},_loadTile:function(a,b){a._layer=this,a._tilePoint=b,this._redrawTile(a),this.options.async||this.tileDrawn(a)},drawTile:function(){},tileDrawn:function(a){this._tileOnLoad.call(a)}}),f.tileLayer.canvas=function(a){return new f.TileLayer.Canvas(a)},f.ImageOverlay=f.Class.extend({includes:f.Mixin.Events,options:{opacity:1},initialize:function(a,b,c){this._url=a,this._bounds=f.latLngBounds(b),f.setOptions(this,c)},onAdd:function(a){this._map=a,this._image||this._initImage(),a._panes.overlayPane.appendChild(this._image),a.on("viewreset",this._reset,this),a.options.zoomAnimation&&f.Browser.any3d&&a.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(a){a.getPanes().overlayPane.removeChild(this._image),a.off("viewreset",this._reset,this),a.options.zoomAnimation&&a.off("zoomanim",this._animateZoom,this)},addTo:function(a){return a.addLayer(this),this},setOpacity:function(a){return this.options.opacity=a,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var a=this._map._panes.overlayPane;return this._image&&a.insertBefore(this._image,a.firstChild),this},setUrl:function(a){this._url=a,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=f.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&f.Browser.any3d?f.DomUtil.addClass(this._image,"leaflet-zoom-animated"):f.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),f.extend(this._image,{galleryimg:"no",onselectstart:f.Util.falseFn,onmousemove:f.Util.falseFn,onload:f.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(a){var b=this._map,c=this._image,d=b.getZoomScale(a.zoom),e=this._bounds.getNorthWest(),g=this._bounds.getSouthEast(),h=b._latLngToNewLayerPoint(e,a.zoom,a.center),i=b._latLngToNewLayerPoint(g,a.zoom,a.center)._subtract(h),j=h._add(i._multiplyBy(.5*(1-1/d)));c.style[f.DomUtil.TRANSFORM]=f.DomUtil.getTranslateString(j)+" scale("+d+") "},_reset:function(){var a=this._image,b=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),c=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(b);f.DomUtil.setPosition(a,b),a.style.width=c.x+"px",a.style.height=c.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){f.DomUtil.setOpacity(this._image,this.options.opacity)}}),f.imageOverlay=function(a,b,c){return new f.ImageOverlay(a,b,c)},f.Icon=f.Class.extend({options:{className:""},initialize:function(a){f.setOptions(this,a)},createIcon:function(a){return this._createIcon("icon",a)},createShadow:function(a){return this._createIcon("shadow",a)},_createIcon:function(a,b){var c=this._getIconUrl(a);if(!c){if("icon"===a)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var d;return d=b&&"IMG"===b.tagName?this._createImg(c,b):this._createImg(c),this._setIconStyles(d,a),d},_setIconStyles:function(a,b){var c,d=this.options,e=f.point(d[b+"Size"]);c="shadow"===b?f.point(d.shadowAnchor||d.iconAnchor):f.point(d.iconAnchor),!c&&e&&(c=e.divideBy(2,!0)),a.className="leaflet-marker-"+b+" "+d.className,c&&(a.style.marginLeft=-c.x+"px",a.style.marginTop=-c.y+"px"),e&&(a.style.width=e.x+"px",a.style.height=e.y+"px")},_createImg:function(a,b){return b=b||c.createElement("img"),b.src=a,b},_getIconUrl:function(a){return f.Browser.retina&&this.options[a+"RetinaUrl"]?this.options[a+"RetinaUrl"]:this.options[a+"Url"]}}),f.icon=function(a){return new f.Icon(a)},f.Icon.Default=f.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(a){var b=a+"Url";if(this.options[b])return this.options[b];f.Browser.retina&&"icon"===a&&(a+="-2x");var c=f.Icon.Default.imagePath;if(!c)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return c+"/marker-"+a+".png"}}),f.Icon.Default.imagePath=function(){var a,b,d,e,f,g=c.getElementsByTagName("script"),h=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(a=0,b=g.length;b>a;a++)if(d=g[a].src,e=d.match(h))return f=d.split(h)[0],(f?f+"/":"")+"images"}(),f.Marker=f.Class.extend({includes:f.Mixin.Events,options:{icon:new f.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(a,b){f.setOptions(this,b),this._latlng=f.latLng(a)},onAdd:function(a){this._map=a,a.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),a.options.zoomAnimation&&a.options.markerZoomAnimation&&a.on("zoomanim",this._animateZoom,this)},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),a.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(a){return this._latlng=f.latLng(a),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(a){return this.options.zIndexOffset=a,this.update(),this},setIcon:function(a){return this.options.icon=a,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){return this._icon&&this._setPos(this._map.latLngToLayerPoint(this._latlng).round()),this},_initIcon:function(){var a=this.options,b=this._map,c=b.options.zoomAnimation&&b.options.markerZoomAnimation,d=c?"leaflet-zoom-animated":"leaflet-zoom-hide",e=a.icon.createIcon(this._icon),g=!1;e!==this._icon&&(this._icon&&this._removeIcon(),g=!0,a.title&&(e.title=a.title),a.alt&&(e.alt=a.alt)),f.DomUtil.addClass(e,d),a.keyboard&&(e.tabIndex="0"),this._icon=e,this._initInteraction(),a.riseOnHover&&f.DomEvent.on(e,"mouseover",this._bringToFront,this).on(e,"mouseout",this._resetZIndex,this);var h=a.icon.createShadow(this._shadow),i=!1;h!==this._shadow&&(this._removeShadow(),i=!0),h&&f.DomUtil.addClass(h,d),this._shadow=h,a.opacity<1&&this._updateOpacity();var j=this._map._panes;g&&j.markerPane.appendChild(this._icon),h&&i&&j.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&f.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(a){f.DomUtil.setPosition(this._icon,a),this._shadow&&f.DomUtil.setPosition(this._shadow,a),this._zIndex=a.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(a){this._icon.style.zIndex=this._zIndex+a},_animateZoom:function(a){var b=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center).round();this._setPos(b)},_initInteraction:function(){if(this.options.clickable){var a=this._icon,b=["dblclick","mousedown","mouseover","mouseout","contextmenu"];f.DomUtil.addClass(a,"leaflet-clickable"),f.DomEvent.on(a,"click",this._onMouseClick,this),f.DomEvent.on(a,"keypress",this._onKeyPress,this);for(var c=0;ce?(b.height=e+"px",f.DomUtil.addClass(a,g)):f.DomUtil.removeClass(a,g),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var a=this._map.latLngToLayerPoint(this._latlng),b=this._animated,c=f.point(this.options.offset);b&&f.DomUtil.setPosition(this._container,a),this._containerBottom=-c.y-(b?0:a.y),this._containerLeft=-Math.round(this._containerWidth/2)+c.x+(b?0:a.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(a){var b=this._map._latLngToNewLayerPoint(this._latlng,a.zoom,a.center);f.DomUtil.setPosition(this._container,b)},_adjustPan:function(){if(this.options.autoPan){var a=this._map,b=this._container.offsetHeight,c=this._containerWidth,d=new f.Point(this._containerLeft,-b-this._containerBottom);this._animated&&d._add(f.DomUtil.getPosition(this._container));var e=a.layerPointToContainerPoint(d),g=f.point(this.options.autoPanPadding),h=f.point(this.options.autoPanPaddingTopLeft||g),i=f.point(this.options.autoPanPaddingBottomRight||g),j=a.getSize(),k=0,l=0;e.x+c+i.x>j.x&&(k=e.x+c-j.x+i.x),e.x-k-h.x<0&&(k=e.x-h.x),e.y+b+i.y>j.y&&(l=e.y+b-j.y+i.y),e.y-l-h.y<0&&(l=e.y-h.y),(k||l)&&a.fire("autopanstart").panBy([k,l])}},_onCloseButtonClick:function(a){this._close(),f.DomEvent.stop(a)}}),f.popup=function(a,b){return new f.Popup(a,b)},f.Map.include({openPopup:function(a,b,c){if(this.closePopup(),!(a instanceof f.Popup)){var d=a;a=new f.Popup(c).setLatLng(b).setContent(d)}return a._isOpen=!0,this._popup=a,this.addLayer(a)},closePopup:function(a){return a&&a!==this._popup||(a=this._popup,this._popup=null),a&&(this.removeLayer(a),a._isOpen=!1),this}}),f.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(a,b){var c=f.point(this.options.icon.options.popupAnchor||[0,0]);return c=c.add(f.Popup.prototype.options.offset),b&&b.offset&&(c=c.add(b.offset)),b=f.extend({offset:c},b),this._popupHandlersAdded||(this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popupHandlersAdded=!0),a instanceof f.Popup?(f.setOptions(a,b),this._popup=a,a._source=this):this._popup=new f.Popup(b,this).setContent(a),this},setPopupContent:function(a){return this._popup&&this._popup.setContent(a),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(a){this._popup.setLatLng(a.latlng)}}),f.LayerGroup=f.Class.extend({initialize:function(a){this._layers={};var b,c;if(a)for(b=0,c=a.length;c>b;b++)this.addLayer(a[b])},addLayer:function(a){var b=this.getLayerId(a);return this._layers[b]=a,this._map&&this._map.addLayer(a),this},removeLayer:function(a){var b=a in this._layers?a:this.getLayerId(a);return this._map&&this._layers[b]&&this._map.removeLayer(this._layers[b]),delete this._layers[b],this},hasLayer:function(a){return!!a&&(a in this._layers||this.getLayerId(a)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(a){var b,c,d=Array.prototype.slice.call(arguments,1);for(b in this._layers)c=this._layers[b],c[a]&&c[a].apply(c,d);return this},onAdd:function(a){this._map=a,this.eachLayer(a.addLayer,a)},onRemove:function(a){this.eachLayer(a.removeLayer,a),this._map=null},addTo:function(a){return a.addLayer(this),this},eachLayer:function(a,b){for(var c in this._layers)a.call(b,this._layers[c]);return this},getLayer:function(a){return this._layers[a]},getLayers:function(){var a=[];for(var b in this._layers)a.push(this._layers[b]);return a},setZIndex:function(a){return this.invoke("setZIndex",a)},getLayerId:function(a){return f.stamp(a)}}),f.layerGroup=function(a){return new f.LayerGroup(a)},f.FeatureGroup=f.LayerGroup.extend({includes:f.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(a){return this.hasLayer(a)?this:("on"in a&&a.on(f.FeatureGroup.EVENTS,this._propagateEvent,this),f.LayerGroup.prototype.addLayer.call(this,a),this._popupContent&&a.bindPopup&&a.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:a}))},removeLayer:function(a){return this.hasLayer(a)?(a in this._layers&&(a=this._layers[a]),"off"in a&&a.off(f.FeatureGroup.EVENTS,this._propagateEvent,this),f.LayerGroup.prototype.removeLayer.call(this,a),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:a})):this},bindPopup:function(a,b){return this._popupContent=a,this._popupOptions=b,this.invoke("bindPopup",a,b)},openPopup:function(a){for(var b in this._layers){this._layers[b].openPopup(a);break}return this},setStyle:function(a){return this.invoke("setStyle",a)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var a=new f.LatLngBounds;return this.eachLayer(function(b){a.extend(b instanceof f.Marker?b.getLatLng():b.getBounds())}),a},_propagateEvent:function(a){a=f.extend({layer:a.target,target:this},a),this.fire(a.type,a)}}),f.featureGroup=function(a){return new f.FeatureGroup(a)},f.Path=f.Class.extend({includes:[f.Mixin.Events],statics:{CLIP_PADDING:function(){var b=f.Browser.mobile?1280:2e3,c=(b/Math.max(a.outerWidth,a.outerHeight)-1)/2;return Math.max(0,Math.min(.5,c))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(a){f.setOptions(this,a)},onAdd:function(a){this._map=a,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),a.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(a){return a.addLayer(this),this},onRemove:function(a){a._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,f.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),a.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(a){return f.setOptions(this,a),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),f.Map.include({_updatePathViewport:function(){var a=f.Path.CLIP_PADDING,b=this.getSize(),c=f.DomUtil.getPosition(this._mapPane),d=c.multiplyBy(-1)._subtract(b.multiplyBy(a)._round()),e=d.add(b.multiplyBy(1+2*a)._round());this._pathViewport=new f.Bounds(d,e)}}),f.Path.SVG_NS="http://www.w3.org/2000/svg",f.Browser.svg=!(!c.createElementNS||!c.createElementNS(f.Path.SVG_NS,"svg").createSVGRect),f.Path=f.Path.extend({statics:{SVG:f.Browser.svg},bringToFront:function(){var a=this._map._pathRoot,b=this._container;return b&&a.lastChild!==b&&a.appendChild(b),this},bringToBack:function(){var a=this._map._pathRoot,b=this._container,c=a.firstChild;return b&&c!==b&&a.insertBefore(b,c),this},getPathString:function(){},_createElement:function(a){return c.createElementNS(f.Path.SVG_NS,a)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&f.DomUtil.addClass(this._path,this.options.className),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap), +this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var a=this.getPathString();a||(a="M0 0"),this._path.setAttribute("d",a)},_initEvents:function(){if(this.options.clickable){(f.Browser.svg||!f.Browser.vml)&&f.DomUtil.addClass(this._path,"leaflet-clickable"),f.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var a=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],b=0;b';var b=a.firstChild;return b.style.behavior="url(#default#VML)",b&&"object"==typeof b.adj}catch(d){return!1}}(),f.Path=f.Browser.svg||!f.Browser.vml?f.Path:f.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return c.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(a){return c.createElement("')}}catch(a){return function(a){return c.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var a=this._container=this._createElement("shape");f.DomUtil.addClass(a,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:"")),this.options.clickable&&f.DomUtil.addClass(a,"leaflet-clickable"),a.coordsize="1 1",this._path=this._createElement("path"),a.appendChild(this._path),this._map._pathRoot.appendChild(a)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var a=this._stroke,b=this._fill,c=this.options,d=this._container;d.stroked=c.stroke,d.filled=c.fill,c.stroke?(a||(a=this._stroke=this._createElement("stroke"),a.endcap="round",d.appendChild(a)),a.weight=c.weight+"px",a.color=c.color,a.opacity=c.opacity,c.dashArray?a.dashStyle=f.Util.isArray(c.dashArray)?c.dashArray.join(" "):c.dashArray.replace(/( *, *)/g," "):a.dashStyle="",c.lineCap&&(a.endcap=c.lineCap.replace("butt","flat")),c.lineJoin&&(a.joinstyle=c.lineJoin)):a&&(d.removeChild(a),this._stroke=null),c.fill?(b||(b=this._fill=this._createElement("fill"),d.appendChild(b)),b.color=c.fillColor||c.color,b.opacity=c.fillOpacity):b&&(d.removeChild(b),this._fill=null)},_updatePath:function(){var a=this._container.style;a.display="none",this._path.v=this.getPathString()+" ",a.display=""}}),f.Map.include(f.Browser.svg||!f.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var a=this._pathRoot=c.createElement("div");a.className="leaflet-vml-container",this._panes.overlayPane.appendChild(a),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),f.Browser.canvas=function(){return!!c.createElement("canvas").getContext}(),f.Path=f.Path.SVG&&!a.L_PREFER_CANVAS||!f.Browser.canvas?f.Path:f.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(a){return f.setOptions(this,a),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(a){a.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this.fire("remove"),this._map=null},_requestUpdate:function(){this._map&&!f.Path._updateRequest&&(f.Path._updateRequest=f.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){f.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var a=this.options;a.stroke&&(this._ctx.lineWidth=a.weight,this._ctx.strokeStyle=a.color),a.fill&&(this._ctx.fillStyle=a.fillColor||a.color),a.lineCap&&(this._ctx.lineCap=a.lineCap),a.lineJoin&&(this._ctx.lineJoin=a.lineJoin)},_drawPath:function(){var a,b,c,d,e,g;for(this._ctx.beginPath(),a=0,c=this._parts.length;c>a;a++){for(b=0,d=this._parts[a].length;d>b;b++)e=this._parts[a][b],g=(0===b?"move":"line")+"To",this._ctx[g](e.x,e.y);this instanceof f.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var a=this._ctx,b=this.options;this._drawPath(),a.save(),this._updateStyle(),b.fill&&(a.globalAlpha=b.fillOpacity,a.fill(b.fillRule||"evenodd")),b.stroke&&(a.globalAlpha=b.opacity,a.stroke()),a.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click dblclick contextmenu",this._fireMouseEvent,this))},_fireMouseEvent:function(a){this._containsPoint(a.layerPoint)&&this.fire(a.type,a)},_onMouseMove:function(a){this._map&&!this._map._animatingZoom&&(this._containsPoint(a.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",a)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",a)))}}),f.Map.include(f.Path.SVG&&!a.L_PREFER_CANVAS||!f.Browser.canvas?{}:{_initPathRoot:function(){var a,b=this._pathRoot;b||(b=this._pathRoot=c.createElement("canvas"),b.style.position="absolute",a=this._canvasCtx=b.getContext("2d"),a.lineCap="round",a.lineJoin="round",this._panes.overlayPane.appendChild(b),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var a=this._pathViewport,b=a.min,c=a.max.subtract(b),d=this._pathRoot;f.DomUtil.setPosition(d,b),d.width=c.x,d.height=c.y,d.getContext("2d").translate(-b.x,-b.y)}}}),f.LineUtil={simplify:function(a,b){if(!b||!a.length)return a.slice();var c=b*b;return a=this._reducePoints(a,c),a=this._simplifyDP(a,c)},pointToSegmentDistance:function(a,b,c){return Math.sqrt(this._sqClosestPointOnSegment(a,b,c,!0))},closestPointOnSegment:function(a,b,c){return this._sqClosestPointOnSegment(a,b,c)},_simplifyDP:function(a,b){var c=a.length,e=typeof Uint8Array!=d+""?Uint8Array:Array,f=new e(c);f[0]=f[c-1]=1,this._simplifyDPStep(a,f,b,0,c-1);var g,h=[];for(g=0;c>g;g++)f[g]&&h.push(a[g]);return h},_simplifyDPStep:function(a,b,c,d,e){var f,g,h,i=0;for(g=d+1;e-1>=g;g++)h=this._sqClosestPointOnSegment(a[g],a[d],a[e],!0),h>i&&(f=g,i=h);i>c&&(b[f]=1,this._simplifyDPStep(a,b,c,d,f),this._simplifyDPStep(a,b,c,f,e))},_reducePoints:function(a,b){for(var c=[a[0]],d=1,e=0,f=a.length;f>d;d++)this._sqDist(a[d],a[e])>b&&(c.push(a[d]),e=d);return f-1>e&&c.push(a[f-1]),c},clipSegment:function(a,b,c,d){var e,f,g,h=d?this._lastCode:this._getBitCode(a,c),i=this._getBitCode(b,c);for(this._lastCode=i;;){if(!(h|i))return[a,b];if(h&i)return!1;e=h||i,f=this._getEdgeIntersection(a,b,e,c),g=this._getBitCode(f,c),e===h?(a=f,h=g):(b=f,i=g)}},_getEdgeIntersection:function(a,b,c,d){var e=b.x-a.x,g=b.y-a.y,h=d.min,i=d.max;return 8&c?new f.Point(a.x+e*(i.y-a.y)/g,i.y):4&c?new f.Point(a.x+e*(h.y-a.y)/g,h.y):2&c?new f.Point(i.x,a.y+g*(i.x-a.x)/e):1&c?new f.Point(h.x,a.y+g*(h.x-a.x)/e):void 0},_getBitCode:function(a,b){var c=0;return a.xb.max.x&&(c|=2),a.yb.max.y&&(c|=8),c},_sqDist:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*c+d*d},_sqClosestPointOnSegment:function(a,b,c,d){var e,g=b.x,h=b.y,i=c.x-g,j=c.y-h,k=i*i+j*j;return k>0&&(e=((a.x-g)*i+(a.y-h)*j)/k,e>1?(g=c.x,h=c.y):e>0&&(g+=i*e,h+=j*e)),i=a.x-g,j=a.y-h,d?i*i+j*j:new f.Point(g,h)}},f.Polyline=f.Path.extend({initialize:function(a,b){f.Path.prototype.initialize.call(this,b),this._latlngs=this._convertLatLngs(a)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var a=0,b=this._latlngs.length;b>a;a++)this._originalPoints[a]=this._map.latLngToLayerPoint(this._latlngs[a])},getPathString:function(){for(var a=0,b=this._parts.length,c="";b>a;a++)c+=this._getPathPartStr(this._parts[a]);return c},getLatLngs:function(){return this._latlngs},setLatLngs:function(a){return this._latlngs=this._convertLatLngs(a),this.redraw()},addLatLng:function(a){return this._latlngs.push(f.latLng(a)),this.redraw()},spliceLatLngs:function(){var a=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),a},closestLayerPoint:function(a){for(var b,c,d=1/0,e=this._parts,g=null,h=0,i=e.length;i>h;h++)for(var j=e[h],k=1,l=j.length;l>k;k++){b=j[k-1],c=j[k];var m=f.LineUtil._sqClosestPointOnSegment(a,b,c,!0);d>m&&(d=m,g=f.LineUtil._sqClosestPointOnSegment(a,b,c))}return g&&(g.distance=Math.sqrt(d)),g},getBounds:function(){return new f.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(a,b){var c,d,e=b?a:[];for(c=0,d=a.length;d>c;c++){if(f.Util.isArray(a[c])&&"number"!=typeof a[c][0])return;e[c]=f.latLng(a[c])}return e},_initEvents:function(){f.Path.prototype._initEvents.call(this)},_getPathPartStr:function(a){for(var b,c=f.Path.VML,d=0,e=a.length,g="";e>d;d++)b=a[d],c&&b._round(),g+=(d?"L":"M")+b.x+" "+b.y;return g},_clipPoints:function(){var a,b,c,d=this._originalPoints,e=d.length;if(this.options.noClip)return void(this._parts=[d]);this._parts=[];var g=this._parts,h=this._map._pathViewport,i=f.LineUtil;for(a=0,b=0;e-1>a;a++)c=i.clipSegment(d[a],d[a+1],h,a),c&&(g[b]=g[b]||[],g[b].push(c[0]),(c[1]!==d[a+1]||a===e-2)&&(g[b].push(c[1]),b++))},_simplifyPoints:function(){for(var a=this._parts,b=f.LineUtil,c=0,d=a.length;d>c;c++)a[c]=b.simplify(a[c],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),f.Path.prototype._updatePath.call(this))}}),f.polyline=function(a,b){return new f.Polyline(a,b)},f.PolyUtil={},f.PolyUtil.clipPolygon=function(a,b){var c,d,e,g,h,i,j,k,l,m=[1,4,2,8],n=f.LineUtil;for(d=0,j=a.length;j>d;d++)a[d]._code=n._getBitCode(a[d],b);for(g=0;4>g;g++){for(k=m[g],c=[],d=0,j=a.length,e=j-1;j>d;e=d++)h=a[d],i=a[e],h._code&k?i._code&k||(l=n._getEdgeIntersection(i,h,k,b),l._code=n._getBitCode(l,b),c.push(l)):(i._code&k&&(l=n._getEdgeIntersection(i,h,k,b),l._code=n._getBitCode(l,b),c.push(l)),c.push(h));a=c}return a},f.Polygon=f.Polyline.extend({options:{fill:!0},initialize:function(a,b){f.Polyline.prototype.initialize.call(this,a,b),this._initWithHoles(a)},_initWithHoles:function(a){var b,c,d;if(a&&f.Util.isArray(a[0])&&"number"!=typeof a[0][0])for(this._latlngs=this._convertLatLngs(a[0]),this._holes=a.slice(1),b=0,c=this._holes.length;c>b;b++)d=this._holes[b]=this._convertLatLngs(this._holes[b]),d[0].equals(d[d.length-1])&&d.pop();a=this._latlngs,a.length>=2&&a[0].equals(a[a.length-1])&&a.pop()},projectLatlngs:function(){if(f.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var a,b,c,d;for(a=0,c=this._holes.length;c>a;a++)for(this._holePoints[a]=[],b=0,d=this._holes[a].length;d>b;b++)this._holePoints[a][b]=this._map.latLngToLayerPoint(this._holes[a][b])}},setLatLngs:function(a){return a&&f.Util.isArray(a[0])&&"number"!=typeof a[0][0]?(this._initWithHoles(a),this.redraw()):f.Polyline.prototype.setLatLngs.call(this,a)},_clipPoints:function(){var a=this._originalPoints,b=[];if(this._parts=[a].concat(this._holePoints),!this.options.noClip){for(var c=0,d=this._parts.length;d>c;c++){var e=f.PolyUtil.clipPolygon(this._parts[c],this._map._pathViewport);e.length&&b.push(e)}this._parts=b}},_getPathPartStr:function(a){var b=f.Polyline.prototype._getPathPartStr.call(this,a);return b+(f.Browser.svg?"z":"x")}}),f.polygon=function(a,b){return new f.Polygon(a,b)},function(){function a(a){return f.FeatureGroup.extend({initialize:function(a,b){this._layers={},this._options=b,this.setLatLngs(a)},setLatLngs:function(b){var c=0,d=b.length;for(this.eachLayer(function(a){d>c?a.setLatLngs(b[c++]):this.removeLayer(a)},this);d>c;)this.addLayer(new a(b[c++],this._options));return this},getLatLngs:function(){var a=[];return this.eachLayer(function(b){a.push(b.getLatLngs())}),a}})}f.MultiPolyline=a(f.Polyline),f.MultiPolygon=a(f.Polygon),f.multiPolyline=function(a,b){return new f.MultiPolyline(a,b)},f.multiPolygon=function(a,b){return new f.MultiPolygon(a,b)}}(),f.Rectangle=f.Polygon.extend({initialize:function(a,b){f.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(a),b)},setBounds:function(a){this.setLatLngs(this._boundsToLatLngs(a))},_boundsToLatLngs:function(a){return a=f.latLngBounds(a),[a.getSouthWest(),a.getNorthWest(),a.getNorthEast(),a.getSouthEast()]}}),f.rectangle=function(a,b){return new f.Rectangle(a,b)},f.Circle=f.Path.extend({initialize:function(a,b,c){f.Path.prototype.initialize.call(this,c),this._latlng=f.latLng(a),this._mRadius=b},options:{fill:!0},setLatLng:function(a){return this._latlng=f.latLng(a),this.redraw()},setRadius:function(a){return this._mRadius=a,this.redraw()},projectLatlngs:function(){var a=this._getLngRadius(),b=this._latlng,c=this._map.latLngToLayerPoint([b.lat,b.lng-a]);this._point=this._map.latLngToLayerPoint(b),this._radius=Math.max(this._point.x-c.x,1)},getBounds:function(){var a=this._getLngRadius(),b=this._mRadius/40075017*360,c=this._latlng;return new f.LatLngBounds([c.lat-b,c.lng-a],[c.lat+b,c.lng+a])},getLatLng:function(){return this._latlng},getPathString:function(){var a=this._point,b=this._radius;return this._checkIfEmpty()?"":f.Browser.svg?"M"+a.x+","+(a.y-b)+"A"+b+","+b+",0,1,1,"+(a.x-.1)+","+(a.y-b)+" z":(a._round(),b=Math.round(b),"AL "+a.x+","+a.y+" "+b+","+b+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(f.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var a=this._map._pathViewport,b=this._radius,c=this._point;return c.x-b>a.max.x||c.y-b>a.max.y||c.x+bc;c++)for(j=this._parts[c],d=0,h=j.length,e=h-1;h>d;e=d++)if((b||0!==d)&&(i=f.LineUtil.pointToSegmentDistance(a,j[e],j[d]),k>=i))return!0;return!1}}:{}),f.Polygon.include(f.Path.CANVAS?{_containsPoint:function(a){var b,c,d,e,g,h,i,j,k=!1;if(f.Polyline.prototype._containsPoint.call(this,a,!0))return!0;for(e=0,i=this._parts.length;i>e;e++)for(b=this._parts[e],g=0,j=b.length,h=j-1;j>g;h=g++)c=b[g],d=b[h],c.y>a.y!=d.y>a.y&&a.x<(d.x-c.x)*(a.y-c.y)/(d.y-c.y)+c.x&&(k=!k);return k}}:{}),f.Circle.include(f.Path.CANVAS?{_drawPath:function(){var a=this._point;this._ctx.beginPath(),this._ctx.arc(a.x,a.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(a){var b=this._point,c=this.options.stroke?this.options.weight/2:0;return a.distanceTo(b)<=this._radius+c}}:{}),f.CircleMarker.include(f.Path.CANVAS?{_updateStyle:function(){f.Path.prototype._updateStyle.call(this)}}:{}),f.GeoJSON=f.FeatureGroup.extend({initialize:function(a,b){f.setOptions(this,b),this._layers={},a&&this.addData(a)},addData:function(a){var b,c,d,e=f.Util.isArray(a)?a:a.features;if(e){for(b=0,c=e.length;c>b;b++)d=e[b],(d.geometries||d.geometry||d.features||d.coordinates)&&this.addData(e[b]);return this}var g=this.options;if(!g.filter||g.filter(a)){var h=f.GeoJSON.geometryToLayer(a,g.pointToLayer,g.coordsToLatLng,g);return h.feature=f.GeoJSON.asFeature(a),h.defaultOptions=h.options,this.resetStyle(h),g.onEachFeature&&g.onEachFeature(a,h),this.addLayer(h)}},resetStyle:function(a){var b=this.options.style;b&&(f.Util.extend(a.options,a.defaultOptions),this._setLayerStyle(a,b))},setStyle:function(a){this.eachLayer(function(b){this._setLayerStyle(b,a)},this)},_setLayerStyle:function(a,b){"function"==typeof b&&(b=b(a.feature)),a.setStyle&&a.setStyle(b)}}),f.extend(f.GeoJSON,{geometryToLayer:function(a,b,c,d){var e,g,h,i,j="Feature"===a.type?a.geometry:a,k=j.coordinates,l=[];switch(c=c||this.coordsToLatLng,j.type){case"Point":return e=c(k),b?b(a,e):new f.Marker(e);case"MultiPoint":for(h=0,i=k.length;i>h;h++)e=c(k[h]),l.push(b?b(a,e):new f.Marker(e));return new f.FeatureGroup(l);case"LineString":return g=this.coordsToLatLngs(k,0,c),new f.Polyline(g,d);case"Polygon":if(2===k.length&&!k[1].length)throw new Error("Invalid GeoJSON object.");return g=this.coordsToLatLngs(k,1,c),new f.Polygon(g,d);case"MultiLineString":return g=this.coordsToLatLngs(k,1,c),new f.MultiPolyline(g,d);case"MultiPolygon":return g=this.coordsToLatLngs(k,2,c),new f.MultiPolygon(g,d);case"GeometryCollection":for(h=0,i=j.geometries.length;i>h;h++)l.push(this.geometryToLayer({geometry:j.geometries[h],type:"Feature",properties:a.properties},b,c,d));return new f.FeatureGroup(l);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(a){return new f.LatLng(a[1],a[0],a[2])},coordsToLatLngs:function(a,b,c){var d,e,f,g=[];for(e=0,f=a.length;f>e;e++)d=b?this.coordsToLatLngs(a[e],b-1,c):(c||this.coordsToLatLng)(a[e]),g.push(d);return g},latLngToCoords:function(a){var b=[a.lng,a.lat];return a.alt!==d&&b.push(a.alt),b},latLngsToCoords:function(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(f.GeoJSON.latLngToCoords(a[c]));return b},getFeature:function(a,b){return a.feature?f.extend({},a.feature,{geometry:b}):f.GeoJSON.asFeature(b)},asFeature:function(a){return"Feature"===a.type?a:{type:"Feature",properties:{},geometry:a}}});var h={toGeoJSON:function(){return f.GeoJSON.getFeature(this,{type:"Point",coordinates:f.GeoJSON.latLngToCoords(this.getLatLng())})}};f.Marker.include(h),f.Circle.include(h),f.CircleMarker.include(h),f.Polyline.include({toGeoJSON:function(){return f.GeoJSON.getFeature(this,{type:"LineString",coordinates:f.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),f.Polygon.include({toGeoJSON:function(){var a,b,c,d=[f.GeoJSON.latLngsToCoords(this.getLatLngs())];if(d[0].push(d[0][0]),this._holes)for(a=0,b=this._holes.length;b>a;a++)c=f.GeoJSON.latLngsToCoords(this._holes[a]),c.push(c[0]),d.push(c);return f.GeoJSON.getFeature(this,{type:"Polygon",coordinates:d})}}),function(){function a(a){return function(){var b=[];return this.eachLayer(function(a){b.push(a.toGeoJSON().geometry.coordinates)}),f.GeoJSON.getFeature(this,{type:a,coordinates:b})}}f.MultiPolyline.include({toGeoJSON:a("MultiLineString")}),f.MultiPolygon.include({toGeoJSON:a("MultiPolygon")}),f.LayerGroup.include({toGeoJSON:function(){var b,c=this.feature&&this.feature.geometry,d=[];if(c&&"MultiPoint"===c.type)return a("MultiPoint").call(this);var e=c&&"GeometryCollection"===c.type;return this.eachLayer(function(a){a.toGeoJSON&&(b=a.toGeoJSON(),d.push(e?b.geometry:f.GeoJSON.asFeature(b)))}),e?f.GeoJSON.getFeature(this,{geometries:d,type:"GeometryCollection"}):{type:"FeatureCollection",features:d}}})}(),f.geoJson=function(a,b){return new f.GeoJSON(a,b)},f.DomEvent={addListener:function(a,b,c,d){var e,g,h,i=f.stamp(c),j="_leaflet_"+b+i;return a[j]?this:(e=function(b){return c.call(d||a,b||f.DomEvent._getEvent())},f.Browser.pointer&&0===b.indexOf("touch")?this.addPointerListener(a,b,e,i):(f.Browser.touch&&"dblclick"===b&&this.addDoubleTapListener&&this.addDoubleTapListener(a,e,i),"addEventListener"in a?"mousewheel"===b?(a.addEventListener("DOMMouseScroll",e,!1),a.addEventListener(b,e,!1)):"mouseenter"===b||"mouseleave"===b?(g=e,h="mouseenter"===b?"mouseover":"mouseout",e=function(b){return f.DomEvent._checkMouse(a,b)?g(b):void 0},a.addEventListener(h,e,!1)):"click"===b&&f.Browser.android?(g=e,e=function(a){return f.DomEvent._filterClick(a,g)},a.addEventListener(b,e,!1)):a.addEventListener(b,e,!1):"attachEvent"in a&&a.attachEvent("on"+b,e),a[j]=e,this))},removeListener:function(a,b,c){var d=f.stamp(c),e="_leaflet_"+b+d,g=a[e];return g?(f.Browser.pointer&&0===b.indexOf("touch")?this.removePointerListener(a,b,d):f.Browser.touch&&"dblclick"===b&&this.removeDoubleTapListener?this.removeDoubleTapListener(a,d):"removeEventListener"in a?"mousewheel"===b?(a.removeEventListener("DOMMouseScroll",g,!1),a.removeEventListener(b,g,!1)):"mouseenter"===b||"mouseleave"===b?a.removeEventListener("mouseenter"===b?"mouseover":"mouseout",g,!1):a.removeEventListener(b,g,!1):"detachEvent"in a&&a.detachEvent("on"+b,g),a[e]=null,this):this},stopPropagation:function(a){return a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,f.DomEvent._skipped(a),this},disableScrollPropagation:function(a){var b=f.DomEvent.stopPropagation;return f.DomEvent.on(a,"mousewheel",b).on(a,"MozMousePixelScroll",b)},disableClickPropagation:function(a){for(var b=f.DomEvent.stopPropagation,c=f.Draggable.START.length-1;c>=0;c--)f.DomEvent.on(a,f.Draggable.START[c],b);return f.DomEvent.on(a,"click",f.DomEvent._fakeStop).on(a,"dblclick",b)},preventDefault:function(a){return a.preventDefault?a.preventDefault():a.returnValue=!1,this},stop:function(a){return f.DomEvent.preventDefault(a).stopPropagation(a)},getMousePosition:function(a,b){if(!b)return new f.Point(a.clientX,a.clientY);var c=b.getBoundingClientRect();return new f.Point(a.clientX-c.left-b.clientLeft,a.clientY-c.top-b.clientTop)},getWheelDelta:function(a){var b=0;return a.wheelDelta&&(b=a.wheelDelta/120),a.detail&&(b=-a.detail/3),b},_skipEvents:{},_fakeStop:function(a){f.DomEvent._skipEvents[a.type]=!0},_skipped:function(a){var b=this._skipEvents[a.type];return this._skipEvents[a.type]=!1,b},_checkMouse:function(a,b){var c=b.relatedTarget;if(!c)return!0;try{for(;c&&c!==a;)c=c.parentNode}catch(d){return!1}return c!==a},_getEvent:function(){var b=a.event;if(!b)for(var c=arguments.callee.caller;c&&(b=c.arguments[0],!b||a.Event!==b.constructor);)c=c.caller;return b},_filterClick:function(a,b){var c=a.timeStamp||a.originalEvent.timeStamp,d=f.DomEvent._lastClick&&c-f.DomEvent._lastClick;return d&&d>100&&500>d||a.target._simulatedClick&&!a._simulated?void f.DomEvent.stop(a):(f.DomEvent._lastClick=c,b(a))}},f.DomEvent.on=f.DomEvent.addListener,f.DomEvent.off=f.DomEvent.removeListener,f.Draggable=f.Class.extend({includes:f.Mixin.Events,statics:{START:f.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(a,b){this._element=a,this._dragStartTarget=b||a},enable:function(){if(!this._enabled){for(var a=f.Draggable.START.length-1;a>=0;a--)f.DomEvent.on(this._dragStartTarget,f.Draggable.START[a],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var a=f.Draggable.START.length-1;a>=0;a--)f.DomEvent.off(this._dragStartTarget,f.Draggable.START[a],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(a){if(this._moved=!1,!a.shiftKey&&(1===a.which||1===a.button||a.touches)&&(f.DomEvent.stopPropagation(a),!f.Draggable._disabled&&(f.DomUtil.disableImageDrag(),f.DomUtil.disableTextSelection(),!this._moving))){var b=a.touches?a.touches[0]:a;this._startPoint=new f.Point(b.clientX,b.clientY),this._startPos=this._newPos=f.DomUtil.getPosition(this._element),f.DomEvent.on(c,f.Draggable.MOVE[a.type],this._onMove,this).on(c,f.Draggable.END[a.type],this._onUp,this)}},_onMove:function(a){if(a.touches&&a.touches.length>1)return void(this._moved=!0);var b=a.touches&&1===a.touches.length?a.touches[0]:a,d=new f.Point(b.clientX,b.clientY),e=d.subtract(this._startPoint);(e.x||e.y)&&(f.Browser.touch&&Math.abs(e.x)+Math.abs(e.y)<3||(f.DomEvent.preventDefault(a),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=f.DomUtil.getPosition(this._element).subtract(e),f.DomUtil.addClass(c.body,"leaflet-dragging"),this._lastTarget=a.target||a.srcElement,f.DomUtil.addClass(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,f.Util.cancelAnimFrame(this._animRequest),this._animRequest=f.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)))},_updatePosition:function(){this.fire("predrag"),f.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(){f.DomUtil.removeClass(c.body,"leaflet-dragging"),this._lastTarget&&(f.DomUtil.removeClass(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null);for(var a in f.Draggable.MOVE)f.DomEvent.off(c,f.Draggable.MOVE[a],this._onMove).off(c,f.Draggable.END[a],this._onUp);f.DomUtil.enableImageDrag(),f.DomUtil.enableTextSelection(),this._moved&&this._moving&&(f.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),f.Handler=f.Class.extend({initialize:function(a){this._map=a},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),f.Map.mergeOptions({dragging:!0,inertia:!f.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:f.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),f.Map.Drag=f.Handler.extend({addHooks:function(){if(!this._draggable){var a=this._map;this._draggable=new f.Draggable(a._mapPane,a._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),a.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),a.on("viewreset",this._onViewReset,this),a.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var a=this._map;a._panAnim&&a._panAnim.stop(),a.fire("movestart").fire("dragstart"),a.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var a=this._lastTime=+new Date,b=this._lastPos=this._draggable._newPos;this._positions.push(b),this._times.push(a),a-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var a=this._map.getSize()._divideBy(2),b=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=b.subtract(a).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag:function(){var a=this._worldWidth,b=Math.round(a/2),c=this._initialWorldOffset,d=this._draggable._newPos.x,e=(d-b+c)%a+b-c,f=(d+b+c)%a-b-c,g=Math.abs(e+c)c.inertiaThreshold||!this._positions[0];if(b.fire("dragend",a),e)b.fire("moveend");else{var g=this._lastPos.subtract(this._positions[0]),h=(this._lastTime+d-this._times[0])/1e3,i=c.easeLinearity,j=g.multiplyBy(i/h),k=j.distanceTo([0,0]),l=Math.min(c.inertiaMaxSpeed,k),m=j.multiplyBy(l/k),n=l/(c.inertiaDeceleration*i),o=m.multiplyBy(-n/2).round();o.x&&o.y?(o=b._limitOffset(o,b.options.maxBounds),f.Util.requestAnimFrame(function(){b.panBy(o,{duration:n,easeLinearity:i,noMoveStart:!0})})):b.fire("moveend")}}}),f.Map.addInitHook("addHandler","dragging",f.Map.Drag),f.Map.mergeOptions({doubleClickZoom:!0}),f.Map.DoubleClickZoom=f.Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(a){var b=this._map,c=b.getZoom()+(a.originalEvent.shiftKey?-1:1);"center"===b.options.doubleClickZoom?b.setZoom(c):b.setZoomAround(a.containerPoint,c)}}),f.Map.addInitHook("addHandler","doubleClickZoom",f.Map.DoubleClickZoom),f.Map.mergeOptions({scrollWheelZoom:!0}),f.Map.ScrollWheelZoom=f.Handler.extend({addHooks:function(){f.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),f.DomEvent.on(this._map._container,"MozMousePixelScroll",f.DomEvent.preventDefault),this._delta=0},removeHooks:function(){f.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),f.DomEvent.off(this._map._container,"MozMousePixelScroll",f.DomEvent.preventDefault)},_onWheelScroll:function(a){var b=f.DomEvent.getWheelDelta(a);this._delta+=b,this._lastMousePos=this._map.mouseEventToContainerPoint(a),this._startTime||(this._startTime=+new Date);var c=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(f.bind(this._performZoom,this),c),f.DomEvent.preventDefault(a),f.DomEvent.stopPropagation(a)},_performZoom:function(){var a=this._map,b=this._delta,c=a.getZoom();b=b>0?Math.ceil(b):Math.floor(b),b=Math.max(Math.min(b,4),-4),b=a._limitZoom(c+b)-c,this._delta=0,this._startTime=null,b&&("center"===a.options.scrollWheelZoom?a.setZoom(c+b):a.setZoomAround(this._lastMousePos,c+b))}}),f.Map.addInitHook("addHandler","scrollWheelZoom",f.Map.ScrollWheelZoom),f.extend(f.DomEvent,{_touchstart:f.Browser.msPointer?"MSPointerDown":f.Browser.pointer?"pointerdown":"touchstart",_touchend:f.Browser.msPointer?"MSPointerUp":f.Browser.pointer?"pointerup":"touchend", +addDoubleTapListener:function(a,b,d){function e(a){var b;if(f.Browser.pointer?(o.push(a.pointerId),b=o.length):b=a.touches.length,!(b>1)){var c=Date.now(),d=c-(h||c);i=a.touches?a.touches[0]:a,j=d>0&&k>=d,h=c}}function g(a){if(f.Browser.pointer){var c=o.indexOf(a.pointerId);if(-1===c)return;o.splice(c,1)}if(j){if(f.Browser.pointer){var d,e={};for(var g in i)d=i[g],"function"==typeof d?e[g]=d.bind(i):e[g]=d;i=e}i.type="dblclick",b(i),h=null}}var h,i,j=!1,k=250,l="_leaflet_",m=this._touchstart,n=this._touchend,o=[];a[l+m+d]=e,a[l+n+d]=g;var p=f.Browser.pointer?c.documentElement:a;return a.addEventListener(m,e,!1),p.addEventListener(n,g,!1),f.Browser.pointer&&p.addEventListener(f.DomEvent.POINTER_CANCEL,g,!1),this},removeDoubleTapListener:function(a,b){var d="_leaflet_";return a.removeEventListener(this._touchstart,a[d+this._touchstart+b],!1),(f.Browser.pointer?c.documentElement:a).removeEventListener(this._touchend,a[d+this._touchend+b],!1),f.Browser.pointer&&c.documentElement.removeEventListener(f.DomEvent.POINTER_CANCEL,a[d+this._touchend+b],!1),this}}),f.extend(f.DomEvent,{POINTER_DOWN:f.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:f.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:f.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:f.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(a,b,c,d){switch(b){case"touchstart":return this.addPointerListenerStart(a,b,c,d);case"touchend":return this.addPointerListenerEnd(a,b,c,d);case"touchmove":return this.addPointerListenerMove(a,b,c,d);default:throw"Unknown touch event type"}},addPointerListenerStart:function(a,b,d,e){var g="_leaflet_",h=this._pointers,i=function(a){"mouse"!==a.pointerType&&a.pointerType!==a.MSPOINTER_TYPE_MOUSE&&f.DomEvent.preventDefault(a);for(var b=!1,c=0;c1))&&(this._moved||(f.DomUtil.addClass(b._mapPane,"leaflet-touching"),b.fire("movestart").fire("zoomstart"),this._moved=!0),f.Util.cancelAnimFrame(this._animRequest),this._animRequest=f.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),f.DomEvent.preventDefault(a))}},_updateOnMove:function(){var a=this._map,b=this._getScaleOrigin(),c=a.layerPointToLatLng(b),d=a.getScaleZoom(this._scale);a._animateZoom(c,d,this._startCenter,this._scale,this._delta,!1,!0)},_onTouchEnd:function(){if(!this._moved||!this._zooming)return void(this._zooming=!1);var a=this._map;this._zooming=!1,f.DomUtil.removeClass(a._mapPane,"leaflet-touching"),f.Util.cancelAnimFrame(this._animRequest),f.DomEvent.off(c,"touchmove",this._onTouchMove).off(c,"touchend",this._onTouchEnd);var b=this._getScaleOrigin(),d=a.layerPointToLatLng(b),e=a.getZoom(),g=a.getScaleZoom(this._scale)-e,h=g>0?Math.ceil(g):Math.floor(g),i=a._limitZoom(e+h),j=a.getZoomScale(i)/this._scale;a._animateZoom(d,i,b,j)},_getScaleOrigin:function(){var a=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(a)}}),f.Map.addInitHook("addHandler","touchZoom",f.Map.TouchZoom),f.Map.mergeOptions({tap:!0,tapTolerance:15}),f.Map.Tap=f.Handler.extend({addHooks:function(){f.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){f.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(a){if(a.touches){if(f.DomEvent.preventDefault(a),this._fireClick=!0,a.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var b=a.touches[0],d=b.target;this._startPos=this._newPos=new f.Point(b.clientX,b.clientY),d.tagName&&"a"===d.tagName.toLowerCase()&&f.DomUtil.addClass(d,"leaflet-active"),this._holdTimeout=setTimeout(f.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",b))},this),1e3),f.DomEvent.on(c,"touchmove",this._onMove,this).on(c,"touchend",this._onUp,this)}},_onUp:function(a){if(clearTimeout(this._holdTimeout),f.DomEvent.off(c,"touchmove",this._onMove,this).off(c,"touchend",this._onUp,this),this._fireClick&&a&&a.changedTouches){var b=a.changedTouches[0],d=b.target;d&&d.tagName&&"a"===d.tagName.toLowerCase()&&f.DomUtil.removeClass(d,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",b)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(a){var b=a.touches[0];this._newPos=new f.Point(b.clientX,b.clientY)},_simulateEvent:function(b,d){var e=c.createEvent("MouseEvents");e._simulated=!0,d.target._simulatedClick=!0,e.initMouseEvent(b,!0,!0,a,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),d.target.dispatchEvent(e)}}),f.Browser.touch&&!f.Browser.pointer&&f.Map.addInitHook("addHandler","tap",f.Map.Tap),f.Map.mergeOptions({boxZoom:!0}),f.Map.BoxZoom=f.Handler.extend({initialize:function(a){this._map=a,this._container=a._container,this._pane=a._panes.overlayPane,this._moved=!1},addHooks:function(){f.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){f.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(a){return this._moved=!1,!(!a.shiftKey||1!==a.which&&1!==a.button)&&(f.DomUtil.disableTextSelection(),f.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(a),void f.DomEvent.on(c,"mousemove",this._onMouseMove,this).on(c,"mouseup",this._onMouseUp,this).on(c,"keydown",this._onKeyDown,this))},_onMouseMove:function(a){this._moved||(this._box=f.DomUtil.create("div","leaflet-zoom-box",this._pane),f.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var b=this._startLayerPoint,c=this._box,d=this._map.mouseEventToLayerPoint(a),e=d.subtract(b),g=new f.Point(Math.min(d.x,b.x),Math.min(d.y,b.y));f.DomUtil.setPosition(c,g),this._moved=!0,c.style.width=Math.max(0,Math.abs(e.x)-4)+"px",c.style.height=Math.max(0,Math.abs(e.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),f.DomUtil.enableTextSelection(),f.DomUtil.enableImageDrag(),f.DomEvent.off(c,"mousemove",this._onMouseMove).off(c,"mouseup",this._onMouseUp).off(c,"keydown",this._onKeyDown)},_onMouseUp:function(a){this._finish();var b=this._map,c=b.mouseEventToLayerPoint(a);if(!this._startLayerPoint.equals(c)){var d=new f.LatLngBounds(b.layerPointToLatLng(this._startLayerPoint),b.layerPointToLatLng(c));b.fitBounds(d),b.fire("boxzoomend",{boxZoomBounds:d})}},_onKeyDown:function(a){27===a.keyCode&&this._finish()}}),f.Map.addInitHook("addHandler","boxZoom",f.Map.BoxZoom),f.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),f.Map.Keyboard=f.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(a){this._map=a,this._setPanOffset(a.options.keyboardPanOffset),this._setZoomOffset(a.options.keyboardZoomOffset)},addHooks:function(){var a=this._map._container;-1===a.tabIndex&&(a.tabIndex="0"),f.DomEvent.on(a,"focus",this._onFocus,this).on(a,"blur",this._onBlur,this).on(a,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var a=this._map._container;f.DomEvent.off(a,"focus",this._onFocus,this).off(a,"blur",this._onBlur,this).off(a,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var b=c.body,d=c.documentElement,e=b.scrollTop||d.scrollTop,f=b.scrollLeft||d.scrollLeft;this._map._container.focus(),a.scrollTo(f,e)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(a){var b,c,d=this._panKeys={},e=this.keyCodes;for(b=0,c=e.left.length;c>b;b++)d[e.left[b]]=[-1*a,0];for(b=0,c=e.right.length;c>b;b++)d[e.right[b]]=[a,0];for(b=0,c=e.down.length;c>b;b++)d[e.down[b]]=[0,a];for(b=0,c=e.up.length;c>b;b++)d[e.up[b]]=[0,-1*a]},_setZoomOffset:function(a){var b,c,d=this._zoomKeys={},e=this.keyCodes;for(b=0,c=e.zoomIn.length;c>b;b++)d[e.zoomIn[b]]=a;for(b=0,c=e.zoomOut.length;c>b;b++)d[e.zoomOut[b]]=-a},_addHooks:function(){f.DomEvent.on(c,"keydown",this._onKeyDown,this)},_removeHooks:function(){f.DomEvent.off(c,"keydown",this._onKeyDown,this)},_onKeyDown:function(a){var b=a.keyCode,c=this._map;if(b in this._panKeys){if(c._panAnim&&c._panAnim._inProgress)return;c.panBy(this._panKeys[b]),c.options.maxBounds&&c.panInsideBounds(c.options.maxBounds)}else{if(!(b in this._zoomKeys))return;c.setZoom(c.getZoom()+this._zoomKeys[b])}f.DomEvent.stop(a)}}),f.Map.addInitHook("addHandler","keyboard",f.Map.Keyboard),f.Handler.MarkerDrag=f.Handler.extend({initialize:function(a){this._marker=a},addHooks:function(){var a=this._marker._icon;this._draggable||(this._draggable=new f.Draggable(a,a)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),f.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),f.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var a=this._marker,b=a._shadow,c=f.DomUtil.getPosition(a._icon),d=a._map.layerPointToLatLng(c);b&&f.DomUtil.setPosition(b,c),a._latlng=d,a.fire("move",{latlng:d}).fire("drag")},_onDragEnd:function(a){this._marker.fire("moveend").fire("dragend",a)}}),f.Control=f.Class.extend({options:{position:"topright"},initialize:function(a){f.setOptions(this,a)},getPosition:function(){return this.options.position},setPosition:function(a){var b=this._map;return b&&b.removeControl(this),this.options.position=a,b&&b.addControl(this),this},getContainer:function(){return this._container},addTo:function(a){this._map=a;var b=this._container=this.onAdd(a),c=this.getPosition(),d=a._controlCorners[c];return f.DomUtil.addClass(b,"leaflet-control"),-1!==c.indexOf("bottom")?d.insertBefore(b,d.firstChild):d.appendChild(b),this},removeFrom:function(a){var b=this.getPosition(),c=a._controlCorners[b];return c.removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(a),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),f.control=function(a){return new f.Control(a)},f.Map.include({addControl:function(a){return a.addTo(this),this},removeControl:function(a){return a.removeFrom(this),this},_initControlPos:function(){function a(a,e){var g=c+a+" "+c+e;b[a+e]=f.DomUtil.create("div",g,d)}var b=this._controlCorners={},c="leaflet-",d=this._controlContainer=f.DomUtil.create("div",c+"control-container",this._container);a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),f.Control.Zoom=f.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(a){var b="leaflet-control-zoom",c=f.DomUtil.create("div",b+" leaflet-bar");return this._map=a,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,b+"-in",c,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,b+"-out",c,this._zoomOut,this),this._updateDisabled(),a.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(a){a.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(a){this._map.zoomIn(a.shiftKey?3:1)},_zoomOut:function(a){this._map.zoomOut(a.shiftKey?3:1)},_createButton:function(a,b,c,d,e,g){var h=f.DomUtil.create("a",c,d);h.innerHTML=a,h.href="#",h.title=b;var i=f.DomEvent.stopPropagation;return f.DomEvent.on(h,"click",i).on(h,"mousedown",i).on(h,"dblclick",i).on(h,"click",f.DomEvent.preventDefault).on(h,"click",e,g).on(h,"click",this._refocusOnMap,g),h},_updateDisabled:function(){var a=this._map,b="leaflet-disabled";f.DomUtil.removeClass(this._zoomInButton,b),f.DomUtil.removeClass(this._zoomOutButton,b),a._zoom===a.getMinZoom()&&f.DomUtil.addClass(this._zoomOutButton,b),a._zoom===a.getMaxZoom()&&f.DomUtil.addClass(this._zoomInButton,b)}}),f.Map.mergeOptions({zoomControl:!0}),f.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new f.Control.Zoom,this.addControl(this.zoomControl))}),f.control.zoom=function(a){return new f.Control.Zoom(a)},f.Control.Attribution=f.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(a){f.setOptions(this,a),this._attributions={}},onAdd:function(a){this._container=f.DomUtil.create("div","leaflet-control-attribution"),f.DomEvent.disableClickPropagation(this._container);for(var b in a._layers)a._layers[b].getAttribution&&this.addAttribution(a._layers[b].getAttribution());return a.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(a){a.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},setPrefix:function(a){return this.options.prefix=a,this._update(),this},addAttribution:function(a){return a?(this._attributions[a]||(this._attributions[a]=0),this._attributions[a]++,this._update(),this):void 0},removeAttribution:function(a){return a?(this._attributions[a]&&(this._attributions[a]--,this._update()),this):void 0},_update:function(){if(this._map){var a=[];for(var b in this._attributions)this._attributions[b]&&a.push(b);var c=[];this.options.prefix&&c.push(this.options.prefix),a.length&&c.push(a.join(", ")),this._container.innerHTML=c.join(" | ")}},_onLayerAdd:function(a){a.layer.getAttribution&&this.addAttribution(a.layer.getAttribution())},_onLayerRemove:function(a){a.layer.getAttribution&&this.removeAttribution(a.layer.getAttribution())}}),f.Map.mergeOptions({attributionControl:!0}),f.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new f.Control.Attribution).addTo(this))}),f.control.attribution=function(a){return new f.Control.Attribution(a)},f.Control.Scale=f.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(a){this._map=a;var b="leaflet-control-scale",c=f.DomUtil.create("div",b),d=this.options;return this._addScales(d,b,c),a.on(d.updateWhenIdle?"moveend":"move",this._update,this),a.whenReady(this._update,this),c},onRemove:function(a){a.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(a,b,c){a.metric&&(this._mScale=f.DomUtil.create("div",b+"-line",c)),a.imperial&&(this._iScale=f.DomUtil.create("div",b+"-line",c))},_update:function(){var a=this._map.getBounds(),b=a.getCenter().lat,c=6378137*Math.PI*Math.cos(b*Math.PI/180),d=c*(a.getNorthEast().lng-a.getSouthWest().lng)/180,e=this._map.getSize(),f=this.options,g=0;e.x>0&&(g=d*(f.maxWidth/e.x)),this._updateScales(f,g)},_updateScales:function(a,b){a.metric&&b&&this._updateMetric(b),a.imperial&&b&&this._updateImperial(b)},_updateMetric:function(a){var b=this._getRoundNum(a);this._mScale.style.width=this._getScaleWidth(b/a)+"px",this._mScale.innerHTML=1e3>b?b+" m":b/1e3+" km"},_updateImperial:function(a){var b,c,d,e=3.2808399*a,f=this._iScale;e>5280?(b=e/5280,c=this._getRoundNum(b),f.style.width=this._getScaleWidth(c/b)+"px",f.innerHTML=c+" mi"):(d=this._getRoundNum(e),f.style.width=this._getScaleWidth(d/e)+"px",f.innerHTML=d+" ft")},_getScaleWidth:function(a){return Math.round(this.options.maxWidth*a)-10},_getRoundNum:function(a){var b=Math.pow(10,(Math.floor(a)+"").length-1),c=a/b;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,b*c}}),f.control.scale=function(a){return new f.Control.Scale(a)},f.Control.Layers=f.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(a,b,c){f.setOptions(this,c),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var d in a)this._addLayer(a[d],d);for(d in b)this._addLayer(b[d],d,!0)},onAdd:function(a){return this._initLayout(),this._update(),a.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(a){a.off("layeradd",this._onLayerChange,this).off("layerremove",this._onLayerChange,this)},addBaseLayer:function(a,b){return this._addLayer(a,b),this._update(),this},addOverlay:function(a,b){return this._addLayer(a,b,!0),this._update(),this},removeLayer:function(a){var b=f.stamp(a);return delete this._layers[b],this._update(),this},_initLayout:function(){var a="leaflet-control-layers",b=this._container=f.DomUtil.create("div",a);b.setAttribute("aria-haspopup",!0),f.Browser.touch?f.DomEvent.on(b,"click",f.DomEvent.stopPropagation):f.DomEvent.disableClickPropagation(b).disableScrollPropagation(b);var c=this._form=f.DomUtil.create("form",a+"-list");if(this.options.collapsed){f.Browser.android||f.DomEvent.on(b,"mouseover",this._expand,this).on(b,"mouseout",this._collapse,this);var d=this._layersLink=f.DomUtil.create("a",a+"-toggle",b);d.href="#",d.title="Layers",f.Browser.touch?f.DomEvent.on(d,"click",f.DomEvent.stop).on(d,"click",this._expand,this):f.DomEvent.on(d,"focus",this._expand,this),f.DomEvent.on(c,"click",function(){setTimeout(f.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=f.DomUtil.create("div",a+"-base",c),this._separator=f.DomUtil.create("div",a+"-separator",c),this._overlaysList=f.DomUtil.create("div",a+"-overlays",c),b.appendChild(c)},_addLayer:function(a,b,c){var d=f.stamp(a);this._layers[d]={layer:a,name:b,overlay:c},this.options.autoZIndex&&a.setZIndex&&(this._lastZIndex++,a.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var a,b,c=!1,d=!1;for(a in this._layers)b=this._layers[a],this._addItem(b),d=d||b.overlay,c=c||!b.overlay;this._separator.style.display=d&&c?"":"none"}},_onLayerChange:function(a){var b=this._layers[f.stamp(a.layer)];if(b){this._handlingClick||this._update();var c=b.overlay?"layeradd"===a.type?"overlayadd":"overlayremove":"layeradd"===a.type?"baselayerchange":null;c&&this._map.fire(c,b)}},_createRadioElement:function(a,b){var d='a;a++)b=d[a],c=this._layers[b.layerId],b.checked&&!this._map.hasLayer(c.layer)?this._map.addLayer(c.layer):!b.checked&&this._map.hasLayer(c.layer)&&this._map.removeLayer(c.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){f.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),f.control.layers=function(a,b,c){return new f.Control.Layers(a,b,c)},f.PosAnimation=f.Class.extend({includes:f.Mixin.Events,run:function(a,b,c,d){this.stop(),this._el=a,this._inProgress=!0,this._newPos=b,this.fire("start"),a.style[f.DomUtil.TRANSITION]="all "+(c||.25)+"s cubic-bezier(0,0,"+(d||.5)+",1)",f.DomEvent.on(a,f.DomUtil.TRANSITION_END,this._onTransitionEnd,this),f.DomUtil.setPosition(a,b),f.Util.falseFn(a.offsetWidth),this._stepTimer=setInterval(f.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(f.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),f.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var a=this._getPos();return a?(this._el._leaflet_pos=a,void this.fire("step")):void this._onTransitionEnd()},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var b,c,d,e=this._el,g=a.getComputedStyle(e);if(f.Browser.any3d){if(d=g[f.DomUtil.TRANSFORM].match(this._transformRe),!d)return;b=parseFloat(d[1]),c=parseFloat(d[2])}else b=parseFloat(g.left),c=parseFloat(g.top);return new f.Point(b,c,(!0))},_onTransitionEnd:function(){f.DomEvent.off(this._el,f.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[f.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),f.Map.include({setView:function(a,b,c){if(b=b===d?this._zoom:this._limitZoom(b),a=this._limitCenter(f.latLng(a),b,this.options.maxBounds),c=c||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!c.reset&&c!==!0){c.animate!==d&&(c.zoom=f.extend({animate:c.animate},c.zoom),c.pan=f.extend({animate:c.animate},c.pan));var e=this._zoom!==b?this._tryAnimatedZoom&&this._tryAnimatedZoom(a,b,c.zoom):this._tryAnimatedPan(a,c.pan);if(e)return clearTimeout(this._sizeTimer),this}return this._resetView(a,b),this},panBy:function(a,b){if(a=f.point(a).round(),b=b||{},!a.x&&!a.y)return this;if(this._panAnim||(this._panAnim=new f.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),b.noMoveStart||this.fire("movestart"),b.animate!==!1){f.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(a);this._panAnim.run(this._mapPane,c,b.duration||.25,b.easeLinearity)}else this._rawPanBy(a),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){f.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(a,b){var c=this._getCenterOffset(a)._floor();return!((b&&b.animate)!==!0&&!this.getSize().contains(c))&&(this.panBy(c,b),!0)}}),f.PosAnimation=f.DomUtil.TRANSITION?f.PosAnimation:f.PosAnimation.extend({run:function(a,b,c,d){this.stop(),this._el=a,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(d||.5,.2),this._startPos=f.DomUtil.getPosition(a),this._offset=b.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=f.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var a=+new Date-this._startTime,b=1e3*this._duration;b>a?this._runFrame(this._easeOut(a/b)):(this._runFrame(1),this._complete())},_runFrame:function(a){var b=this._startPos.add(this._offset.multiplyBy(a));f.DomUtil.setPosition(this._el,b),this.fire("step")},_complete:function(){f.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(a){return 1-Math.pow(1-a,this._easeOutPower)}}),f.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),f.DomUtil.TRANSITION&&f.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&f.DomUtil.TRANSITION&&f.Browser.any3d&&!f.Browser.android23&&!f.Browser.mobileOpera,this._zoomAnimated&&f.DomEvent.on(this._mapPane,f.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),f.Map.include(f.DomUtil.TRANSITION?{_catchTransitionEnd:function(a){this._animatingZoom&&a.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(a,b,c){if(this._animatingZoom)return!0;if(c=c||{},!this._zoomAnimated||c.animate===!1||this._nothingToAnimate()||Math.abs(b-this._zoom)>this.options.zoomAnimationThreshold)return!1;var d=this.getZoomScale(b),e=this._getCenterOffset(a)._divideBy(1-1/d),f=this._getCenterLayerPoint()._add(e);return!(c.animate!==!0&&!this.getSize().contains(e))&&(this.fire("movestart").fire("zoomstart"),this._animateZoom(a,b,f,d,null,!0),!0)},_animateZoom:function(a,b,c,d,e,g,h){h||(this._animatingZoom=!0),f.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=a,this._animateToZoom=b,f.Draggable&&(f.Draggable._disabled=!0),f.Util.requestAnimFrame(function(){this.fire("zoomanim",{center:a,zoom:b,origin:c,scale:d,delta:e,backwards:g}),setTimeout(f.bind(this._onZoomTransitionEnd,this),250)},this)},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._animatingZoom=!1,f.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),f.Util.requestAnimFrame(function(){this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),f.Draggable&&(f.Draggable._disabled=!1)},this))}}:{}),f.TileLayer.include({_animateZoom:function(a){this._animating||(this._animating=!0,this._prepareBgBuffer());var b=this._bgBuffer,c=f.DomUtil.TRANSFORM,d=a.delta?f.DomUtil.getTranslateString(a.delta):b.style[c],e=f.DomUtil.getScaleString(a.scale,a.origin);b.style[c]=a.backwards?e+" "+d:d+" "+e},_endZoomAnim:function(){var a=this._tileContainer,b=this._bgBuffer;a.style.visibility="",a.parentNode.appendChild(a),f.Util.falseFn(b.offsetWidth);var c=this._map.getZoom();(c>this.options.maxZoom||c.5&&.5>d?(a.style.visibility="hidden",void this._stopLoadingImages(a)):(b.style.visibility="hidden",b.style[f.DomUtil.TRANSFORM]="",this._tileContainer=b,b=this._bgBuffer=a,this._stopLoadingImages(b),void clearTimeout(this._clearBgBufferTimer))},_getLoadedTilesPercentage:function(a){var b,c,d=a.getElementsByTagName("img"),e=0;for(b=0,c=d.length;c>b;b++)d[b].complete&&e++;return e/c},_stopLoadingImages:function(a){var b,c,d,e=Array.prototype.slice.call(a.getElementsByTagName("img"));for(b=0,c=e.length;c>b;b++)d=e[b],d.complete||(d.onload=f.Util.falseFn,d.onerror=f.Util.falseFn,d.src=f.Util.emptyImageUrl,d.parentNode.removeChild(d))}}),f.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(a){if(a=this._locateOptions=f.extend(this._defaultLocateOptions,a),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var b=f.bind(this._handleGeolocationResponse,this),c=f.bind(this._handleGeolocationError,this);return a.watch?this._locationWatchId=navigator.geolocation.watchPosition(b,c,a):navigator.geolocation.getCurrentPosition(b,c,a),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(a){var b=a.code,c=a.message||(1===b?"permission denied":2===b?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:b,message:"Geolocation error: "+c+"."})},_handleGeolocationResponse:function(a){var b=a.coords.latitude,c=a.coords.longitude,d=new f.LatLng(b,c),e=180*a.coords.accuracy/40075017,g=e/Math.cos(f.LatLng.DEG_TO_RAD*b),h=f.latLngBounds([b-e,c-g],[b+e,c+g]),i=this._locateOptions;if(i.setView){var j=Math.min(this.getBoundsZoom(h),i.maxZoom);this.setView(d,j)}var k={latlng:d,bounds:h,timestamp:a.timestamp};for(var l in a.coords)"number"==typeof a.coords[l]&&(k[l]=a.coords[l]);this.fire("locationfound",k)}})}(window,document)},{}],4:[function(a,b,c){!function(a,b){"object"==typeof c&&c&&"string"!=typeof c.nodeName?b(c):"function"==typeof define&&define.amd?define(["exports"],b):(a.Mustache={},b(a.Mustache))}(this,function(a){function b(a){return"function"==typeof a}function c(a){return p(a)?"array":typeof a}function d(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function e(a,b){return null!=a&&"object"==typeof a&&b in a}function f(a,b){return q.call(a,b)}function g(a){return!f(r,a)}function h(a){return String(a).replace(/[&<>"'`=\/]/g,function(a){return s[a]})}function i(b,c){function e(){if(r&&!s)for(;q.length;)delete o[q.pop()];else q=[];r=!1,s=!1}function f(a){if("string"==typeof a&&(a=a.split(u,2)),!p(a)||2!==a.length)throw new Error("Invalid tags: "+a);h=new RegExp(d(a[0])+"\\s*"),i=new RegExp("\\s*"+d(a[1])),m=new RegExp("\\s*"+d("}"+a[1]))}if(!b)return[];var h,i,m,n=[],o=[],q=[],r=!1,s=!1;f(c||a.tags);for(var y,z,A,B,C,D,E=new l(b);!E.eos();){if(y=E.pos,A=E.scanUntil(h))for(var F=0,G=A.length;G>F;++F)B=A.charAt(F),g(B)?q.push(o.length):s=!0, +o.push(["text",B,y,y+1]),y+=1,"\n"===B&&e();if(!E.scan(h))break;if(r=!0,z=E.scan(x)||"name",E.scan(t),"="===z?(A=E.scanUntil(v),E.scan(v),E.scanUntil(i)):"{"===z?(A=E.scanUntil(m),E.scan(w),E.scanUntil(i),z="&"):A=E.scanUntil(i),!E.scan(i))throw new Error("Unclosed tag at "+E.pos);if(C=[z,A,y,E.pos],o.push(C),"#"===z||"^"===z)n.push(C);else if("/"===z){if(D=n.pop(),!D)throw new Error('Unopened section "'+A+'" at '+y);if(D[1]!==A)throw new Error('Unclosed section "'+D[1]+'" at '+y)}else"name"===z||"{"===z||"&"===z?s=!0:"="===z&&f(A)}if(D=n.pop())throw new Error('Unclosed section "'+D[1]+'" at '+E.pos);return k(j(o))}function j(a){for(var b,c,d=[],e=0,f=a.length;f>e;++e)b=a[e],b&&("text"===b[0]&&c&&"text"===c[0]?(c[1]+=b[1],c[3]=b[3]):(d.push(b),c=b));return d}function k(a){for(var b,c,d=[],e=d,f=[],g=0,h=a.length;h>g;++g)switch(b=a[g],b[0]){case"#":case"^":e.push(b),f.push(b),e=b[4]=[];break;case"/":c=f.pop(),c[5]=b[2],e=f.length>0?f[f.length-1][4]:d;break;default:e.push(b)}return d}function l(a){this.string=a,this.tail=a,this.pos=0}function m(a,b){this.view=a,this.cache={".":this.view},this.parent=b}function n(){this.cache={}}var o=Object.prototype.toString,p=Array.isArray||function(a){return"[object Array]"===o.call(a)},q=RegExp.prototype.test,r=/\S/,s={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},t=/\s*/,u=/\s+/,v=/\s*=/,w=/\s*\}/,x=/#|\^|\/|>|\{|&|=|!/;l.prototype.eos=function(){return""===this.tail},l.prototype.scan=function(a){var b=this.tail.match(a);if(!b||0!==b.index)return"";var c=b[0];return this.tail=this.tail.substring(c.length),this.pos+=c.length,c},l.prototype.scanUntil=function(a){var b,c=this.tail.search(a);switch(c){case-1:b=this.tail,this.tail="";break;case 0:b="";break;default:b=this.tail.substring(0,c),this.tail=this.tail.substring(c)}return this.pos+=b.length,b},m.prototype.push=function(a){return new m(a,this)},m.prototype.lookup=function(a){var c,d=this.cache;if(d.hasOwnProperty(a))c=d[a];else{for(var f,g,h=this,i=!1;h;){if(a.indexOf(".")>0)for(c=h.view,f=a.split("."),g=0;null!=c&&gi;++i)g=void 0,e=a[i],f=e[0],"#"===f?g=this.renderSection(e,b,c,d):"^"===f?g=this.renderInverted(e,b,c,d):">"===f?g=this.renderPartial(e,b,c,d):"&"===f?g=this.unescapedValue(e,b):"name"===f?g=this.escapedValue(e,b):"text"===f&&(g=this.rawValue(e)),void 0!==g&&(h+=g);return h},n.prototype.renderSection=function(a,c,d,e){function f(a){return g.render(a,c,d)}var g=this,h="",i=c.lookup(a[1]);if(i){if(p(i))for(var j=0,k=i.length;k>j;++j)h+=this.renderTokens(a[4],c.push(i[j]),d,e);else if("object"==typeof i||"string"==typeof i||"number"==typeof i)h+=this.renderTokens(a[4],c.push(i),d,e);else if(b(i)){if("string"!=typeof e)throw new Error("Cannot use higher-order sections without the original template");i=i.call(c.view,e.slice(a[3],a[5]),f),null!=i&&(h+=i)}else h+=this.renderTokens(a[4],c,d,e);return h}},n.prototype.renderInverted=function(a,b,c,d){var e=b.lookup(a[1]);return!e||p(e)&&0===e.length?this.renderTokens(a[4],b,c,d):void 0},n.prototype.renderPartial=function(a,c,d){if(d){var e=b(d)?d(a[1]):d[a[1]];return null!=e?this.renderTokens(this.parse(e),c,d,e):void 0}},n.prototype.unescapedValue=function(a,b){var c=b.lookup(a[1]);return null!=c?c:void 0},n.prototype.escapedValue=function(b,c){var d=c.lookup(b[1]);return null!=d?a.escape(d):void 0},n.prototype.rawValue=function(a){return a[1]},a.name="mustache.js",a.version="2.2.1",a.tags=["{{","}}"];var y=new n;a.clearCache=function(){return y.clearCache()},a.parse=function(a,b){return y.parse(a,b)},a.render=function(a,b,d){if("string"!=typeof a)throw new TypeError('Invalid template! Template should be a "string" but "'+c(a)+'" was given as the first argument for mustache#render(template, view, partials)');return y.render(a,b,d)},a.to_html=function(c,d,e,f){var g=a.render(c,d,e);return b(f)?void f(g):g},a.escape=h,a.Scanner=l,a.Context=m,a.Writer=n})},{}],5:[function(a,b,c){function d(a){"use strict";return/^https?/.test(a.getScheme())?a.toString():/^mailto?/.test(a.getScheme())?a.toString():"data"==a.getScheme()&&/^image/.test(a.getPath())?a.toString():void 0}function e(a){return a}var f=a("./sanitizer-bundle.js");b.exports=function(a){return a?f(a,d,e):""}},{"./sanitizer-bundle.js":6}],6:[function(a,b,c){var d=function(){function a(a){var b=(""+a).match(n);return b?new i(j(b[1]),j(b[2]),j(b[3]),j(b[4]),j(b[5]),j(b[6]),j(b[7])):null}function b(a,b,f,g,h,j,k){var l=new i(d(a,o),d(b,o),c(f),g>0?g.toString():null,d(h,p),null,c(k));return j&&("string"==typeof j?l.setRawQuery(j.replace(/[^?&=0-9A-Za-z_\-~.%]/g,e)):l.setAllParameters(j)),l}function c(a){return"string"==typeof a?encodeURIComponent(a):null}function d(a,b){return"string"==typeof a?encodeURI(a).replace(b,e):null}function e(a){var b=a.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(b>>4&15)+"0123456789ABCDEF".charAt(15&b)}function f(a){return a.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/")}function g(a){if(null===a)return null;for(var b,c=f(a),d=l;(b=c.replace(d,"$1"))!=c;c=b);return c}function h(a,b){var c=a.clone(),d=b.hasScheme();d?c.setRawScheme(b.getRawScheme()):d=b.hasCredentials(),d?c.setRawCredentials(b.getRawCredentials()):d=b.hasDomain(),d?c.setRawDomain(b.getRawDomain()):d=b.hasPort();var e=b.getRawPath(),f=g(e);if(d)c.setPort(b.getPort()),f=f&&f.replace(m,"");else if(d=!!e){if(47!==f.charCodeAt(0)){var h=g(c.getRawPath()||"").replace(m,""),i=h.lastIndexOf("/")+1;f=g((i?h.substring(0,i):"")+g(e)).replace(m,"")}}else f=f&&f.replace(m,""),f!==e&&c.setRawPath(f);return d?c.setRawPath(f):d=b.hasQuery(),d?c.setRawQuery(b.getRawQuery()):d=b.hasFragment(),d&&c.setRawFragment(b.getRawFragment()),c}function i(a,b,c,d,e,f,g){this.scheme_=a,this.credentials_=b,this.domain_=c,this.port_=d,this.path_=e,this.query_=f,this.fragment_=g,this.paramCache_=null}function j(a){return"string"==typeof a&&a.length>0?a:null}var k=new RegExp("(/|^)(?:[^./][^/]*|\\.{2,}(?:[^./][^/]*)|\\.{3,}[^/]*)/\\.\\.(?:/|$)"),l=new RegExp(k),m=/^(?:\.\.\/)*(?:\.\.$)?/;i.prototype.toString=function(){var a=[];return null!==this.scheme_&&a.push(this.scheme_,":"),null!==this.domain_&&(a.push("//"),null!==this.credentials_&&a.push(this.credentials_,"@"),a.push(this.domain_),null!==this.port_&&a.push(":",this.port_.toString())),null!==this.path_&&a.push(this.path_),null!==this.query_&&a.push("?",this.query_),null!==this.fragment_&&a.push("#",this.fragment_),a.join("")},i.prototype.clone=function(){return new i(this.scheme_,this.credentials_,this.domain_,this.port_,this.path_,this.query_,this.fragment_)},i.prototype.getScheme=function(){return this.scheme_&&decodeURIComponent(this.scheme_).toLowerCase()},i.prototype.getRawScheme=function(){return this.scheme_},i.prototype.setScheme=function(a){return this.scheme_=d(a,o),this},i.prototype.setRawScheme=function(a){return this.scheme_=a?a:null,this},i.prototype.hasScheme=function(){return null!==this.scheme_},i.prototype.getCredentials=function(){return this.credentials_&&decodeURIComponent(this.credentials_)},i.prototype.getRawCredentials=function(){return this.credentials_},i.prototype.setCredentials=function(a){return this.credentials_=d(a,o),this},i.prototype.setRawCredentials=function(a){return this.credentials_=a?a:null,this},i.prototype.hasCredentials=function(){return null!==this.credentials_},i.prototype.getDomain=function(){return this.domain_&&decodeURIComponent(this.domain_)},i.prototype.getRawDomain=function(){return this.domain_},i.prototype.setDomain=function(a){return this.setRawDomain(a&&encodeURIComponent(a))},i.prototype.setRawDomain=function(a){return this.domain_=a?a:null,this.setRawPath(this.path_)},i.prototype.hasDomain=function(){return null!==this.domain_},i.prototype.getPort=function(){return this.port_&&decodeURIComponent(this.port_)},i.prototype.setPort=function(a){if(a){if(a=Number(a),a!==(65535&a))throw new Error("Bad port number "+a);this.port_=""+a}else this.port_=null;return this},i.prototype.hasPort=function(){return null!==this.port_},i.prototype.getPath=function(){return this.path_&&decodeURIComponent(this.path_)},i.prototype.getRawPath=function(){return this.path_},i.prototype.setPath=function(a){return this.setRawPath(d(a,p))},i.prototype.setRawPath=function(a){return a?(a=String(a),this.path_=!this.domain_||/^\//.test(a)?a:"/"+a):this.path_=null,this},i.prototype.hasPath=function(){return null!==this.path_},i.prototype.getQuery=function(){return this.query_&&decodeURIComponent(this.query_).replace(/\+/g," ")},i.prototype.getRawQuery=function(){return this.query_},i.prototype.setQuery=function(a){return this.paramCache_=null,this.query_=c(a),this},i.prototype.setRawQuery=function(a){return this.paramCache_=null,this.query_=a?a:null,this},i.prototype.hasQuery=function(){return null!==this.query_},i.prototype.setAllParameters=function(a){if("object"==typeof a&&!(a instanceof Array)&&(a instanceof Object||"[object Array]"!==Object.prototype.toString.call(a))){var b=[],c=-1;for(var d in a){var e=a[d];"string"==typeof e&&(b[++c]=d,b[++c]=e)}a=b}this.paramCache_=null;for(var f=[],g="",h=0;hj;){var m=c[j++],q=c[j];switch(m){case"&":M.test(q)?(b.pcdata&&b.pcdata("&"+q,f,V,k(b,c,j,e,f)),j++):b.pcdata&&b.pcdata("&",f,V,k(b,c,j,e,f));break;case""===c[j+1]?(j+=2,i=g[1].toLowerCase(),b.endTag&&b.endTag(i,f,V,k(b,c,j,e,f))):j=n(c,j,b,f,V,e):b.pcdata&&b.pcdata("</",f,V,k(b,c,j,e,f));break;case"<":if(g=/^([-\w:]+)\s*\/?/.exec(q))if(g[0].length===q.length&&">"===c[j+1]){j+=2,i=g[1].toLowerCase(),b.startTag&&b.startTag(i,[],f,V,k(b,c,j,e,f));var r=a.ELEMENTS[i];if(r&U){var s={name:i,next:j,eflags:r};j=p(c,s,b,f,V,e)}}else j=o(c,j,b,f,V,e);else b.pcdata&&b.pcdata("<",f,V,k(b,c,j,e,f));break;case"