Added minified resources
authorThierry Florac <thierry.florac@onf.fr>
Thu, 12 Jul 2018 17:40:07 +0200
changeset 56 37970a213463
parent 55 829abfdd6d27
child 57 35c64c85e5f5
Added minified resources
src/pyams_gis/resources/js/leaflet-esri-2.0.8.min.js
src/pyams_gis/resources/js/leaflet-esri-cluster-2.0.0.min.js
src/pyams_gis/resources/js/leaflet-esri-geocoder-2.2.4.min.js
src/pyams_gis/resources/js/leaflet-esri-gp-2.0.1.min.js
src/pyams_gis/resources/js/leaflet-esri-heatmap-2.0.0.min.js
src/pyams_gis/resources/js/leaflet-esri-renderers-2.0.2.min.js
src/pyams_gis/resources/js/leaflet-esri-vector-1.0.6.min.js
src/pyams_gis/resources/js/leaflet-google-mutant.min.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_gis/resources/js/leaflet-esri-2.0.8.min.js	Thu Jul 12 17:40:07 2018 +0200
@@ -0,0 +1,1 @@
+(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?a(exports,require("leaflet")):typeof define==="function"&&define.amd?define(["exports","leaflet"],a):(a((b.L=b.L||{},b.L.esri=b.L.esri||{}),b.L))}(this,function(O,S){var Y="default" in S?S["default"]:S;var s="2.0.8";var aJ=((window.XMLHttpRequest&&"withCredentials" in new window.XMLHttpRequest()));var a=document.documentElement.style.pointerEvents==="";var ag={cors:aJ,pointerEvents:a};var W={attributionWidthOffset:55};var o=0;function c(aP){var aN="";aP.f=aP.f||"json";for(var aK in aP){if(aP.hasOwnProperty(aK)){var aO=aP[aK];var aL=Object.prototype.toString.call(aO);var aM;if(aN.length){aN+="&"}if(aL==="[object Array]"){aM=(Object.prototype.toString.call(aO[0])==="[object Object]")?JSON.stringify(aO):aO.join(",")}else{if(aL==="[object Object]"){aM=JSON.stringify(aO)}else{if(aL==="[object Date]"){aM=aO.valueOf()}else{aM=aO}}}aN+=encodeURIComponent(aK)+"="+encodeURIComponent(aM)}}return aN}function y(aM,aL){var aK=new window.XMLHttpRequest();aK.onerror=function(aN){aK.onreadystatechange=S.Util.falseFn;aM.call(aL,{error:{code:500,message:"XMLHttpRequest error"}},null)};aK.onreadystatechange=function(){var aN;var aO;if(aK.readyState===4){try{aN=JSON.parse(aK.responseText)}catch(aP){aN=null;aO={code:500,message:"Could not parse response as JSON. This could also be caused by a CORS or XMLHttpRequest error."}}if(!aO&&aN.error){aO=aN.error;aN=null}aK.onerror=S.Util.falseFn;aM.call(aL,aO,aN)}};aK.ontimeout=function(){this.onerror()};return aK}function aA(aL,aN,aO,aM){var aK=y(aO,aM);aK.open("POST",aL);if(typeof aM!=="undefined"&&aM!==null){if(typeof aM.options!=="undefined"){aK.timeout=aM.options.timeout}}aK.setRequestHeader("Content-Type","application/x-www-form-urlencoded");aK.send(c(aN));return aK}function b(aL,aN,aO,aM){var aK=y(aO,aM);aK.open("GET",aL+"?"+c(aN),true);if(typeof aM!=="undefined"&&aM!==null){if(typeof aM.options!=="undefined"){aK.timeout=aM.options.timeout}}aK.send(null);return aK}function ah(aL,aP,aQ,aN){var aO=c(aP);var aK=y(aQ,aN);var aM=(aL+"?"+aO).length;if(aM<=2000&&ag.cors){aK.open("GET",aL+"?"+aO)}else{if(aM>2000&&ag.cors){aK.open("POST",aL);aK.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}}if(typeof aN!=="undefined"&&aN!==null){if(typeof aN.options!=="undefined"){aK.timeout=aN.options.timeout}}if(aM<=2000&&ag.cors){aK.send(null)}else{if(aM>2000&&ag.cors){aK.send(aO)}else{if(aM<=2000&&!ag.cors){return g(aL,aP,aQ,aN)}else{aF("a request to "+aL+" was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html");return}}}return aK}function g(aL,aO,aP,aM){window._EsriLeafletCallbacks=window._EsriLeafletCallbacks||{};var aN="c"+o;aO.callback="window._EsriLeafletCallbacks."+aN;window._EsriLeafletCallbacks[aN]=function(aQ){if(window._EsriLeafletCallbacks[aN]!==true){var aS;var aR=Object.prototype.toString.call(aQ);if(!(aR==="[object Object]"||aR==="[object Array]")){aS={error:{code:500,message:"Expected array or object as JSONP response"}};aQ=null}if(!aS&&aQ.error){aS=aQ;aQ=null}aP.call(aM,aS,aQ);window._EsriLeafletCallbacks[aN]=true}};var aK=S.DomUtil.create("script",null,document.body);aK.type="text/javascript";aK.src=aL+"?"+c(aO);aK.id=aN;o++;return{id:aN,url:aK.src,abort:function(){window._EsriLeafletCallbacks._callback[aN]({code:0,message:"Request aborted."})}}}var al=((ag.cors)?b:g);al.CORS=b;al.JSONP=g;var G={request:ah,get:al,post:aA};function af(aL,aK){for(var aM=0;aM<aL.length;aM++){if(aL[aM]!==aK[aM]){return false}}return true}function D(aK){if(!af(aK[0],aK[aK.length-1])){aK.push(aK[0])}return aK}function t(aL){var aM=0;var aK=0;var aO=aL.length;var aP=aL[aK];var aN;for(aK;aK<aO-1;aK++){aN=aL[aK+1];aM+=(aN[0]-aP[0])*(aN[1]+aP[1]);aP=aN}return(aM>=0)}function u(aO,aN,aS,aR){var aL=(aR[0]-aS[0])*(aO[1]-aS[1])-(aR[1]-aS[1])*(aO[0]-aS[0]);var aQ=(aN[0]-aO[0])*(aO[1]-aS[1])-(aN[1]-aO[1])*(aO[0]-aS[0]);var aP=(aR[1]-aS[1])*(aN[0]-aO[0])-(aR[0]-aS[0])*(aN[1]-aO[1]);if(aP!==0){var aM=aL/aP;var aK=aQ/aP;if(aM>=0&&aM<=1&&aK>=0&&aK<=1){return true}}return false}function h(aL,aK){for(var aN=0;aN<aL.length-1;aN++){for(var aM=0;aM<aK.length-1;aM++){if(u(aL[aN],aL[aN+1],aK[aM],aK[aM+1])){return true}}}return false}function aE(aP,aK){var aO=false;for(var aN=-1,aL=aP.length,aM=aL-1;++aN<aL;aM=aN){if(((aP[aN][1]<=aK[1]&&aK[1]<aP[aM][1])||(aP[aM][1]<=aK[1]&&aK[1]<aP[aN][1]))&&(aK[0]<(aP[aM][0]-aP[aN][0])*(aK[1]-aP[aN][1])/(aP[aM][1]-aP[aN][1])+aP[aN][0])){aO=!aO}}return aO}function an(aM,aK){var aN=h(aM,aK);var aL=aE(aM,aK[0]);if(!aN&&aL){return true}return false}function k(aT){var aQ=[];var aN=[];var aU;var aP;var aK;for(var aL=0;aL<aT.length;aL++){var aM=D(aT[aL].slice(0));if(aM.length<4){continue}if(t(aM)){var aS=[aM];aQ.push(aS)}else{aN.push(aM)}}var aV=[];while(aN.length){aK=aN.pop();var aR=false;for(aU=aQ.length-1;aU>=0;aU--){aP=aQ[aU][0];if(an(aP,aK)){aQ[aU].push(aK);aR=true;break}}if(!aR){aV.push(aK)}}while(aV.length){aK=aV.pop();var aO=false;for(aU=aQ.length-1;aU>=0;aU--){aP=aQ[aU][0];if(h(aP,aK)){aQ[aU].push(aK);aO=true;break}}if(!aO){aQ.push([aK.reverse()])}}if(aQ.length===1){return{type:"Polygon",coordinates:aQ[0]}}else{return{type:"MultiPolygon",coordinates:aQ}}}function I(aP){var aL=[];var aN=aP.slice(0);var aK=D(aN.shift().slice(0));if(aK.length>=4){if(!t(aK)){aK.reverse()}aL.push(aK);for(var aM=0;aM<aN.length;aM++){var aO=D(aN[aM].slice(0));if(aO.length>=4){if(t(aO)){aO.reverse()}aL.push(aO)}}}return aL}function p(aP){var aL=[];for(var aO=0;aO<aP.length;aO++){var aN=I(aP[aO]);for(var aK=aN.length-1;aK>=0;aK--){var aM=aN[aK].slice(0);aL.push(aM)}}return aL}function ak(aM){var aL={};for(var aK in aM){if(aM.hasOwnProperty(aK)){aL[aK]=aM[aK]}}return aL}function e(aM,aL){var aK={};if(typeof aM.x==="number"&&typeof aM.y==="number"){aK.type="Point";aK.coordinates=[aM.x,aM.y]}if(aM.points){aK.type="MultiPoint";aK.coordinates=aM.points.slice(0)}if(aM.paths){if(aM.paths.length===1){aK.type="LineString";aK.coordinates=aM.paths[0].slice(0)}else{aK.type="MultiLineString";aK.coordinates=aM.paths.slice(0)}}if(aM.rings){aK=k(aM.rings.slice(0))}if(aM.geometry||aM.attributes){aK.type="Feature";aK.geometry=(aM.geometry)?e(aM.geometry):null;aK.properties=(aM.attributes)?ak(aM.attributes):null;if(aM.attributes){aK.id=aM.attributes[aL]||aM.attributes.OBJECTID||aM.attributes.FID}}return aK}function v(aL,aO){aO=aO||"OBJECTID";var aN={wkid:4326};var aK={};var aM;switch(aL.type){case"Point":aK.x=aL.coordinates[0];aK.y=aL.coordinates[1];aK.spatialReference=aN;break;case"MultiPoint":aK.points=aL.coordinates.slice(0);aK.spatialReference=aN;break;case"LineString":aK.paths=[aL.coordinates.slice(0)];aK.spatialReference=aN;break;case"MultiLineString":aK.paths=aL.coordinates.slice(0);aK.spatialReference=aN;break;case"Polygon":aK.rings=I(aL.coordinates.slice(0));aK.spatialReference=aN;break;case"MultiPolygon":aK.rings=p(aL.coordinates.slice(0));aK.spatialReference=aN;break;case"Feature":if(aL.geometry){aK.geometry=v(aL.geometry,aO)}aK.attributes=(aL.properties)?ak(aL.properties):{};if(aL.id){aK.attributes[aO]=aL.id}break;case"FeatureCollection":aK=[];for(aM=0;aM<aL.features.length;aM++){aK.push(v(aL.features[aM],aO))}break;case"GeometryCollection":aK=[];for(aM=0;aM<aL.geometries.length;aM++){aK.push(v(aL.geometries[aM],aO))}break}return aK}function ap(aK,aL){return v(aK,aL)}function ac(aK,aL){return e(aK,aL)}function aD(aM){var aL={};for(var aK in aM){if(aM.hasOwnProperty(aK)){aL[aK]=aM[aK]}}return aL}function Q(aL){if(aL.xmin!=="NaN"&&aL.ymin!=="NaN"&&aL.xmax!=="NaN"&&aL.ymax!=="NaN"){var aK=S.latLng(aL.ymin,aL.xmin);var aM=S.latLng(aL.ymax,aL.xmax);return S.latLngBounds(aK,aM)}else{return null}}function aj(aK){aK=S.latLngBounds(aK);return{xmin:aK.getSouthWest().lng,ymin:aK.getSouthWest().lat,xmax:aK.getNorthEast().lng,ymax:aK.getNorthEast().lat,spatialReference:{wkid:4326}}}function r(aM,aR){var aQ;var aL=aM.features||aM.results;var aP=aL.length;if(aR){aQ=aR}else{if(aM.objectIdFieldName){aQ=aM.objectIdFieldName}else{if(aM.fields){for(var aN=0;aN<=aM.fields.length-1;aN++){if(aM.fields[aN].type==="esriFieldTypeOID"){aQ=aM.fields[aN].name;break}}}else{if(aP){for(var aS in aL[0].attributes){if(aS.match(/^(OBJECTID|FID|OID|ID)$/i)){aQ=aS;break}}}}}}var aK={type:"FeatureCollection",features:[]};if(aP){for(var aO=aL.length-1;aO>=0;aO--){var aT=ac(aL[aO],aQ);aK.features.push(aT)}}return aK}function T(aK){aK=S.Util.trim(aK);if(aK[aK.length-1]!=="/"){aK+="/"}return aK}function z(aK){return(/^(?!.*utility\.arcgis\.com).*\.arcgis\.com.*FeatureServer/i).test(aK)}function aI(aK){var aL;switch(aK){case"Point":aL="esriGeometryPoint";break;case"MultiPoint":aL="esriGeometryMultipoint";break;case"LineString":aL="esriGeometryPolyline";break;case"MultiLineString":aL="esriGeometryPolyline";break;case"Polygon":aL="esriGeometryPolygon";break;case"MultiPolygon":aL="esriGeometryPolygon";break}return aL}function aF(){if(console&&console.warn){console.warn.apply(console,arguments)}}function C(aK){return(aK.getSize().x-W.attributionWidthOffset)+"px"}function ay(aM){if(aM.attributionControl&&!aM.attributionControl._esriAttributionAdded){aM.attributionControl.setPrefix('<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a> | Powered by <a href="https://www.esri.com">Esri</a>');var aL=document.createElement("style");aL.type="text/css";aL.innerHTML=".esri-truncated-attribution:hover {white-space: normal;}";document.getElementsByTagName("head")[0].appendChild(aL);S.DomUtil.addClass(aM.attributionControl._container,"esri-truncated-attribution:hover");var aK=document.createElement("style");aK.type="text/css";aK.innerHTML=".esri-truncated-attribution {vertical-align: -3px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;display: inline-block;transition: 0s white-space;transition-delay: 1s;max-width: "+C(aM)+";}";document.getElementsByTagName("head")[0].appendChild(aK);S.DomUtil.addClass(aM.attributionControl._container,"esri-truncated-attribution");aM.on("resize",function(aN){aM.attributionControl._container.style.maxWidth=C(aN.target)});aM.attributionControl._esriAttributionAdded=true}}function V(aK,aL){g(aK,{},S.Util.bind(function(aU,aM){if(aU){return}aL._esriAttributions=[];for(var aT=0;aT<aM.contributors.length;aT++){var aP=aM.contributors[aT];for(var aS=0;aS<aP.coverageAreas.length;aS++){var aQ=aP.coverageAreas[aS];var aN=S.latLng(aQ.bbox[0],aQ.bbox[1]);var aO=S.latLng(aQ.bbox[2],aQ.bbox[3]);aL._esriAttributions.push({attribution:aP.attribution,score:aQ.score,bounds:S.latLngBounds(aN,aO),minZoom:aQ.zoomMin,maxZoom:aQ.zoomMax})}}aL._esriAttributions.sort(function(aW,aV){return aV.score-aW.score});var aR={target:aL};aB(aR)},this))}function aB(aQ){var aM=aQ.target;var aP=aM._esriAttributions;if(aM&&aM.attributionControl&&aP){var aO="";var aL=aM.getBounds();var aK=S.latLngBounds(aL.getSouthWest().wrap(),aL.getNorthEast().wrap());var aU=aM.getZoom();for(var aN=0;aN<aP.length;aN++){var aS=aP[aN];var aR=aS.attribution;if(!aO.match(aR)&&aS.bounds.intersects(aK)&&aU>=aS.minZoom&&aU<=aS.maxZoom){aO+=(", "+aR)}}aO=aO.substr(2);var aT=aM.attributionControl._container.querySelector(".esri-dynamic-attribution");aT.innerHTML=aO;aT.style.maxWidth=C(aM);aM.fire("attributionupdated",{attribution:aO})}}var X={shallowClone:aD,warn:aF,cleanUrl:T,isArcgisOnline:z,geojsonTypeToArcGIS:aI,responseToFeatureCollection:r,geojsonToArcGIS:ap,arcgisToGeoJSON:ac,boundsToExtent:aj,extentToBounds:Q,calcAttributionWidth:C,setEsriAttribution:ay,_getAttributionData:V,_updateMapAttribution:aB};var aC=S.Class.extend({options:{proxy:false,useCors:aJ},generateSetter:function(aL,aK){return S.Util.bind(function(aM){this.params[aL]=aM;return this},aK)},initialize:function(aL){if(aL.request&&aL.options){this._service=aL;S.Util.setOptions(this,aL.options)}else{S.Util.setOptions(this,aL);this.options.url=T(aL.url)}this.params=S.Util.extend({},this.params||{});if(this.setters){for(var aM in this.setters){var aK=this.setters[aM];this[aM]=this.generateSetter(aK,this)}}},token:function(aK){if(this._service){this._service.authenticate(aK)}else{this.params.token=aK}return this},request:function(aL,aK){if(this._service){return this._service.request(this.path,this.params,aL,aK)}return this._request("request",this.path,this.params,aL,aK)},_request:function(aP,aM,aN,aO,aL){var aK=(this.options.proxy)?this.options.proxy+"?"+this.options.url+aM:this.options.url+aM;if((aP==="get"||aP==="request")&&!this.options.useCors){return G.get.JSONP(aK,aN,aO,aL)}return G[aP](aK,aN,aO,aL)}});function am(aK){return new aC(aK)}var R=aC.extend({setters:{offset:"resultOffset",limit:"resultRecordCount",fields:"outFields",precision:"geometryPrecision",featureIds:"objectIds",returnGeometry:"returnGeometry",token:"token"},path:"query",params:{returnGeometry:true,where:"1=1",outSr:4326,outFields:"*"},within:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelContains";return this},intersects:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelIntersects";return this},contains:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelWithin";return this},crosses:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelCrosses";return this},touches:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelTouches";return this},overlaps:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelOverlaps";return this},bboxIntersects:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelEnvelopeIntersects";return this},indexIntersects:function(aK){this._setGeometry(aK);this.params.spatialRel="esriSpatialRelIndexIntersects";return this},nearby:function(aL,aK){aL=S.latLng(aL);this.params.geometry=[aL.lng,aL.lat];this.params.geometryType="esriGeometryPoint";this.params.spatialRel="esriSpatialRelIntersects";this.params.units="esriSRUnit_Meter";this.params.distance=aK;this.params.inSr=4326;return this},where:function(aK){this.params.where=aK;return this},between:function(aL,aK){this.params.time=[aL.valueOf(),aK.valueOf()];return this},simplify:function(aM,aL){var aK=Math.abs(aM.getBounds().getWest()-aM.getBounds().getEast());this.params.maxAllowableOffset=(aK/aM.getSize().y)*aL;return this},orderBy:function(aL,aK){aK=aK||"ASC";this.params.orderByFields=(this.params.orderByFields)?this.params.orderByFields+",":"";this.params.orderByFields+=([aL,aK]).join(" ");return this},run:function(aL,aK){this._cleanParams();if(this.options.isModern||z(this.options.url)){this.params.f="geojson";return this.request(function(aN,aM){this._trapSQLerrors(aN);aL.call(aK,aN,aM,aM)},this)}else{return this.request(function(aN,aM){this._trapSQLerrors(aN);aL.call(aK,aN,(aM&&r(aM)),aM)},this)}},count:function(aL,aK){this._cleanParams();this.params.returnCountOnly=true;return this.request(function(aN,aM){aL.call(this,aN,(aM&&aM.count),aM)},aK)},ids:function(aL,aK){this._cleanParams();this.params.returnIdsOnly=true;return this.request(function(aN,aM){aL.call(this,aN,(aM&&aM.objectIds),aM)},aK)},bounds:function(aL,aK){this._cleanParams();this.params.returnExtentOnly=true;return this.request(function(aN,aM){if(aM&&aM.extent&&Q(aM.extent)){aL.call(aK,aN,Q(aM.extent),aM)}else{aN={message:"Invalid Bounds"};aL.call(aK,aN,null,aM)}},aK)},pixelSize:function(aK){var aL=S.point(aK);this.params.pixelSize=[aL.x,aL.y];return this},layer:function(aK){this.path=aK+"/query";return this},_trapSQLerrors:function(aK){if(aK){if(aK.code==="400"){aF("one common syntax error in query requests is encasing string values in double quotes instead of single quotes")}}},_cleanParams:function(){delete this.params.returnIdsOnly;delete this.params.returnExtentOnly;delete this.params.returnCountOnly},_setGeometry:function(aK){this.params.inSr=4326;if(aK instanceof S.LatLngBounds){this.params.geometry=aj(aK);this.params.geometryType="esriGeometryEnvelope";return}if(aK.getLatLng){aK=aK.getLatLng()}if(aK instanceof S.LatLng){aK={type:"Point",coordinates:[aK.lng,aK.lat]}}if(aK instanceof S.GeoJSON){aK=aK.getLayers()[0].feature.geometry;this.params.geometry=ap(aK);this.params.geometryType=aI(aK.type)}if(aK.toGeoJSON){aK=aK.toGeoJSON()}if(aK.type==="Feature"){aK=aK.geometry}if(aK.type==="Point"||aK.type==="LineString"||aK.type==="Polygon"||aK.type==="MultiPolygon"){this.params.geometry=ap(aK);this.params.geometryType=aI(aK.type);return}aF("invalid geometry passed to spatial query. Should be L.LatLng, L.LatLngBounds, L.Marker or a GeoJSON Point, Line, Polygon or MultiPolygon object");return}});function K(aK){return new R(aK)}var l=aC.extend({setters:{contains:"contains",text:"searchText",fields:"searchFields",spatialReference:"sr",sr:"sr",layers:"layers",returnGeometry:"returnGeometry",maxAllowableOffset:"maxAllowableOffset",precision:"geometryPrecision",dynamicLayers:"dynamicLayers",returnZ:"returnZ",returnM:"returnM",gdbVersion:"gdbVersion",token:"token"},path:"find",params:{sr:4326,contains:true,returnGeometry:true,returnZ:true,returnM:false},layerDefs:function(aL,aK){this.params.layerDefs=(this.params.layerDefs)?this.params.layerDefs+";":"";this.params.layerDefs+=([aL,aK]).join(":");return this},simplify:function(aM,aL){var aK=Math.abs(aM.getBounds().getWest()-aM.getBounds().getEast());this.params.maxAllowableOffset=(aK/aM.getSize().y)*aL;return this},run:function(aL,aK){return this.request(function(aN,aM){aL.call(aK,aN,(aM&&r(aM)),aM)},aK)}});function aH(aK){return new l(aK)}var ax=aC.extend({path:"identify",between:function(aL,aK){this.params.time=[aL.valueOf(),aK.valueOf()];return this}});function ao(aK){return new ax(aK)}var au=ax.extend({setters:{layers:"layers",precision:"geometryPrecision",tolerance:"tolerance",returnGeometry:"returnGeometry"},params:{sr:4326,layers:"all",tolerance:3,returnGeometry:true},on:function(aM){var aL=aj(aM.getBounds());var aK=aM.getSize();this.params.imageDisplay=[aK.x,aK.y,96];this.params.mapExtent=[aL.xmin,aL.ymin,aL.xmax,aL.ymax];return this},at:function(aK){aK=S.latLng(aK);this.params.geometry=[aK.lng,aK.lat];this.params.geometryType="esriGeometryPoint";return this},layerDef:function(aL,aK){this.params.layerDefs=(this.params.layerDefs)?this.params.layerDefs+";":"";this.params.layerDefs+=([aL,aK]).join(":");return this},simplify:function(aM,aL){var aK=Math.abs(aM.getBounds().getWest()-aM.getBounds().getEast());this.params.maxAllowableOffset=(aK/aM.getSize().y)*aL;return this},run:function(aL,aK){return this.request(function(aN,aM){if(aN){aL.call(aK,aN,undefined,aM);return}else{var aQ=r(aM);aM.results=aM.results.reverse();for(var aP=0;aP<aQ.features.length;aP++){var aO=aQ.features[aP];aO.layerId=aM.results[aP].layerId}aL.call(aK,undefined,aQ,aM)}})}});function N(aK){return new au(aK)}var d=ax.extend({setters:{setMosaicRule:"mosaicRule",setRenderingRule:"renderingRule",setPixelSize:"pixelSize",returnCatalogItems:"returnCatalogItems",returnGeometry:"returnGeometry"},params:{returnGeometry:false},at:function(aK){aK=S.latLng(aK);this.params.geometry=JSON.stringify({x:aK.lng,y:aK.lat,spatialReference:{wkid:4326}});this.params.geometryType="esriGeometryPoint";return this},getMosaicRule:function(){return this.params.mosaicRule},getRenderingRule:function(){return this.params.renderingRule},getPixelSize:function(){return this.params.pixelSize},run:function(aL,aK){return this.request(function(aN,aM){aL.call(aK,aN,(aM&&this._responseToGeoJSON(aM)),aM)},this)},_responseToGeoJSON:function(aL){var aK=aL.location;var aN=aL.catalogItems;var aO=aL.catalogItemVisibilities;var aP={pixel:{type:"Feature",geometry:{type:"Point",coordinates:[aK.x,aK.y]},crs:{type:"EPSG",properties:{code:aK.spatialReference.wkid}},properties:{OBJECTID:aL.objectId,name:aL.name,value:aL.value},id:aL.objectId}};if(aL.properties&&aL.properties.Values){aP.pixel.properties.values=aL.properties.Values}if(aN&&aN.features){aP.catalogItems=r(aN);if(aO&&aO.length===aP.catalogItems.features.length){for(var aM=aO.length-1;aM>=0;aM--){aP.catalogItems.features[aM].properties.catalogItemVisibility=aO[aM]}}}return aP}});function n(aK){return new d(aK)}var ae=S.Evented.extend({options:{proxy:false,useCors:aJ,timeout:0},initialize:function(aK){aK=aK||{};this._requestQueue=[];this._authenticating=false;S.Util.setOptions(this,aK);this.options.url=T(this.options.url)},get:function(aL,aM,aN,aK){return this._request("get",aL,aM,aN,aK)},post:function(aL,aM,aN,aK){return this._request("post",aL,aM,aN,aK)},request:function(aL,aM,aN,aK){return this._request("request",aL,aM,aN,aK)},metadata:function(aL,aK){return this._request("get","",{},aL,aK)},authenticate:function(aK){this._authenticating=false;this.options.token=aK;this._runQueue();return this},getTimeout:function(){return this.options.timeout},setTimeout:function(aK){this.options.timeout=aK},_request:function(aQ,aM,aO,aP,aL){this.fire("requeststart",{url:this.options.url+aM,params:aO,method:aQ},true);var aN=this._createServiceCallback(aQ,aM,aO,aP,aL);if(this.options.token){aO.token=this.options.token}if(this._authenticating){this._requestQueue.push([aQ,aM,aO,aP,aL]);return}else{var aK=(this.options.proxy)?this.options.proxy+"?"+this.options.url+aM:this.options.url+aM;if((aQ==="get"||aQ==="request")&&!this.options.useCors){return G.get.JSONP(aK,aO,aN,aL)}else{return G[aQ](aK,aO,aN,aL)}}},_createServiceCallback:function(aO,aL,aM,aN,aK){return S.Util.bind(function(aQ,aP){if(aQ&&(aQ.code===499||aQ.code===498)){this._authenticating=true;this._requestQueue.push([aO,aL,aM,aN,aK]);this.fire("authenticationrequired",{authenticate:S.Util.bind(this.authenticate,this)},true);aQ.authenticate=S.Util.bind(this.authenticate,this)}aN.call(aK,aQ,aP);if(aQ){this.fire("requesterror",{url:this.options.url+aL,params:aM,message:aQ.message,code:aQ.code,method:aO},true)}else{this.fire("requestsuccess",{url:this.options.url+aL,params:aM,response:aP,method:aO},true)}this.fire("requestend",{url:this.options.url+aL,params:aM,method:aO},true)},this)},_runQueue:function(){for(var aK=this._requestQueue.length-1;aK>=0;aK--){var aL=this._requestQueue[aK];var aM=aL.shift();this[aM].apply(this,aL)}this._requestQueue=[]}});function aG(aK){return new ae(aK)}var m=ae.extend({identify:function(){return N(this)},find:function(){return aH(this)},query:function(){return K(this)}});function f(aK){return new m(aK)}var ar=ae.extend({query:function(){return K(this)},identify:function(){return n(this)}});function P(aK){return new ar(aK)}var az=ae.extend({options:{idAttribute:"OBJECTID"},query:function(){return K(this)},addFeature:function(aL,aM,aK){delete aL.id;aL=ap(aL);return this.post("addFeatures",{features:[aL]},function(aP,aO){var aN=(aO&&aO.addResults)?aO.addResults[0]:undefined;if(aM){aM.call(aK,aP||aO.addResults[0].error,aN)}},aK)},updateFeature:function(aL,aM,aK){aL=ap(aL,this.options.idAttribute);return this.post("updateFeatures",{features:[aL]},function(aP,aO){var aN=(aO&&aO.updateResults)?aO.updateResults[0]:undefined;if(aM){aM.call(aK,aP||aO.updateResults[0].error,aN)}},aK)},deleteFeature:function(aM,aL,aK){return this.post("deleteFeatures",{objectIds:aM},function(aP,aO){var aN=(aO&&aO.deleteResults)?aO.deleteResults[0]:undefined;if(aL){aL.call(aK,aP||aO.deleteResults[0].error,aN)}},aK)},deleteFeatures:function(aL,aM,aK){return this.post("deleteFeatures",{objectIds:aL},function(aP,aO){var aN=(aO&&aO.deleteResults)?aO.deleteResults:undefined;if(aM){aM.call(aK,aP||aO.deleteResults[0].error,aN)}},aK)}});function ab(aK){return new az(aK)}var x=(window.location.protocol!=="https:")?"http:":"https:";var ad=S.TileLayer.extend({statics:{TILES:{Streets:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Street_Map"}},Topographic:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/World_Topo_Map"}},Oceans:{urlTemplate:x+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"USGS, NOAA",attributionUrl:"https://static.arcgis.com/attribution/Ocean_Basemap"}},OceansLabels:{urlTemplate:x+"//{s}.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:(a)?"esri-labels":"tilePane"}},NationalGeographic:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"National Geographic, DeLorme, HERE, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, increment P Corp."}},DarkGray:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, &copy; OpenStreetMap contributors"}},DarkGrayLabels:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:(a)?"esri-labels":"tilePane",attribution:""}},Gray:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],attribution:"HERE, DeLorme, MapmyIndia, &copy; OpenStreetMap contributors"}},GrayLabels:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:16,subdomains:["server","services"],pane:(a)?"esri-labels":"tilePane",attribution:""}},Imagery:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],attribution:"DigitalGlobe, GeoEye, i-cubed, USDA, USGS, AEX, Getmapping, Aerogrid, IGN, IGP, swisstopo, and the GIS User Community"}},ImageryLabels:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:(a)?"esri-labels":"tilePane",attribution:""}},ImageryTransportation:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:19,subdomains:["server","services"],pane:(a)?"esri-labels":"tilePane"}},ShadedRelief:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS"}},ShadedReliefLabels:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places_Alternate/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:12,subdomains:["server","services"],pane:(a)?"esri-labels":"tilePane",attribution:""}},Terrain:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],attribution:"USGS, NOAA"}},TerrainLabels:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:13,subdomains:["server","services"],pane:(a)?"esri-labels":"tilePane",attribution:""}},USATopo:{urlTemplate:x+"//{s}.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}",options:{minZoom:1,maxZoom:15,subdomains:["server","services"],attribution:"USGS, National Geographic Society, i-cubed"}}}},initialize:function(aM,aL){var aK;if(typeof aM==="object"&&aM.urlTemplate&&aM.options){aK=aM}else{if(typeof aM==="string"&&ad.TILES[aM]){aK=ad.TILES[aM]}else{throw new Error('L.esri.BasemapLayer: Invalid parameter. Use one of "Streets", "Topographic", "Oceans", "OceansLabels", "NationalGeographic", "Gray", "GrayLabels", "DarkGray", "DarkGrayLabels", "Imagery", "ImageryLabels", "ImageryTransportation", "ShadedRelief", "ShadedReliefLabels", "Terrain", "TerrainLabels" or "USATopo"')}}var aN=S.Util.extend(aK.options,aL);S.Util.setOptions(this,aN);if(this.options.token){aK.urlTemplate+=("?token="+this.options.token)}S.TileLayer.prototype.initialize.call(this,aK.urlTemplate,aN)},onAdd:function(aK){ay(aK);if(this.options.pane==="esri-labels"){this._initPane()}if(this.options.attributionUrl){V(this.options.attributionUrl,aK)}aK.on("moveend",aB);S.TileLayer.prototype.onAdd.call(this,aK)},onRemove:function(aK){aK.off("moveend",aB);S.TileLayer.prototype.onRemove.call(this,aK)},_initPane:function(){if(!this._map.getPane(this.options.pane)){var aK=this._map.createPane(this.options.pane);aK.style.pointerEvents="none";aK.style.zIndex=500}},getAttribution:function(){if(this.options.attribution){var aK='<span class="esri-dynamic-attribution">'+this.options.attribution+"</span>"}return aK}});function w(aL,aK){return new ad(aL,aK)}var q=S.TileLayer.extend({options:{zoomOffsetAllowance:0.1,errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEABAMAAACuXLVVAAAAA1BMVEUzNDVszlHHAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAAAAAAAAAB6mUWpAAAADZJREFUeJztwQEBAAAAgiD/r25IQAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA7waBAAABw08RwAAAAABJRU5ErkJggg=="},statics:{MercatorZoomLevels:{"0":156543.033928,"1":78271.5169639999,"2":39135.7584820001,"3":19567.8792409999,"4":9783.93962049996,"5":4891.96981024998,"6":2445.98490512499,"7":1222.99245256249,"8":611.49622628138,"9":305.748113140558,"10":152.874056570411,"11":76.4370282850732,"12":38.2185141425366,"13":19.1092570712683,"14":9.55462853563415,"15":4.77731426794937,"16":2.38865713397468,"17":1.19432856685505,"18":0.597164283559817,"19":0.298582141647617,"20":0.14929107082381,"21":0.07464553541191,"22":0.0373227677059525,"23":0.0186613838529763}},initialize:function(aK){aK.url=T(aK.url);aK=S.Util.setOptions(this,aK);this.tileUrl=aK.url+"tile/{z}/{y}/{x}";this.service=f(aK);this.service.addEventParent(this);var aL=new RegExp(/tiles.arcgis(online)?\.com/g);if(aL.test(aK.url)){this.tileUrl=this.tileUrl.replace("://tiles","://tiles{s}");aK.subdomains=["1","2","3","4"]}if(this.options.token){this.tileUrl+=("?token="+this.options.token)}S.TileLayer.prototype.initialize.call(this,this.tileUrl,aK)},getTileUrl:function(aK){var aL=this._getZoomForUrl();return S.Util.template(this.tileUrl,S.Util.extend({s:this._getSubdomain(aK),x:aK.x,y:aK.y,z:(this._lodMap&&this._lodMap[aL])?this._lodMap[aL]:aL},this.options))},createTile:function(aM,aK){var aL=document.createElement("img");L.DomEvent.on(aL,"load",L.bind(this._tileOnLoad,this,aK,aL));L.DomEvent.on(aL,"error",L.bind(this._tileOnError,this,aK,aL));if(this.options.crossOrigin){aL.crossOrigin=""}aL.alt="";if(!this._lodMap||(this._lodMap&&this._lodMap[this._getZoomForUrl()])){aL.src=this.getTileUrl(aM)}else{this.once("lodmap",function(){aL.src=this.getTileUrl(aM)},this)}return aL},onAdd:function(aK){ay(aK);if(!this._lodMap){this.metadata(function(aP,aQ){if(!aP&&aQ.spatialReference){var aL=aQ.spatialReference.latestWkid||aQ.spatialReference.wkid;if(!this.options.attribution&&aK.attributionControl&&aQ.copyrightText){this.options.attribution=aQ.copyrightText;aK.attributionControl.addAttribution(this.getAttribution())}if(aK.options.crs===L.CRS.EPSG3857&&aL===102100||aL===3857){this._lodMap={};var aM=aQ.tileInfo.lods;var aN=q.MercatorZoomLevels;for(var aO=0;aO<aM.length;aO++){var aR=aM[aO];for(var aT in aN){var aS=aN[aT];if(this._withinPercentage(aR.resolution,aS,this.options.zoomOffsetAllowance)){this._lodMap[aT]=aR.level;break}}}this.fire("lodmap")}else{if(!proj4){aF("L.esri.TiledMapLayer is using a non-mercator spatial reference. Support may be available through Proj4Leaflet http://esri.github.io/esri-leaflet/examples/non-mercator-projection.html")}}}},this)}S.TileLayer.prototype.onAdd.call(this,aK)},metadata:function(aL,aK){this.service.metadata(aL,aK);return this},identify:function(){return this.service.identify()},find:function(){return this.service.find()},query:function(){return this.service.query()},authenticate:function(aK){var aL="?token="+aK;this.tileUrl=(this.options.token)?this.tileUrl.replace(/\?token=(.+)/g,aL):this.tileUrl+aL;this.options.token=aK;this.service.authenticate(aK);return this},_withinPercentage:function(aM,aK,aL){var aN=Math.abs((aM/aK)-1);return aN<aL}});function U(aL,aK){return new q(aL,aK)}var M=S.ImageOverlay.extend({onAdd:function(aK){this._topLeft=aK.getPixelBounds().min;S.ImageOverlay.prototype.onAdd.call(this,aK)},_reset:function(){if(this._map.options.crs===S.CRS.EPSG3857){S.ImageOverlay.prototype._reset.call(this)}else{S.DomUtil.setPosition(this._image,this._topLeft.subtract(this._map.getPixelOrigin()))}}});var aw=S.Layer.extend({options:{opacity:1,position:"front",f:"image",useCors:aJ,attribution:null,interactive:false,alt:""},onAdd:function(aK){ay(aK);this._update=S.Util.throttle(this._update,this.options.updateInterval,this);aK.on("moveend",this._update,this);if(this._currentImage&&this._currentImage._bounds.equals(this._map.getBounds())){aK.addLayer(this._currentImage)}else{if(this._currentImage){this._map.removeLayer(this._currentImage);this._currentImage=null}}this._update();if(this._popup){this._map.on("click",this._getPopupData,this);this._map.on("dblclick",this._resetPopupState,this)}this.metadata(function(aM,aL){if(!aM&&!this.options.attribution&&aK.attributionControl&&aL.copyrightText){this.options.attribution=aL.copyrightText;aK.attributionControl.addAttribution(this.getAttribution())}},this)},onRemove:function(aK){if(this._currentImage){this._map.removeLayer(this._currentImage)}if(this._popup){this._map.off("click",this._getPopupData,this);this._map.off("dblclick",this._resetPopupState,this)}this._map.off("moveend",this._update,this)},bindPopup:function(aK,aL){this._shouldRenderPopup=false;this._lastClick=false;this._popup=S.popup(aL);this._popupFunction=aK;if(this._map){this._map.on("click",this._getPopupData,this);this._map.on("dblclick",this._resetPopupState,this)}return this},unbindPopup:function(){if(this._map){this._map.closePopup(this._popup);this._map.off("click",this._getPopupData,this);this._map.off("dblclick",this._resetPopupState,this)}this._popup=false;return this},bringToFront:function(){this.options.position="front";if(this._currentImage){this._currentImage.bringToFront()}return this},bringToBack:function(){this.options.position="back";if(this._currentImage){this._currentImage.bringToBack()}return this},getAttribution:function(){return this.options.attribution},getOpacity:function(){return this.options.opacity},setOpacity:function(aK){this.options.opacity=aK;if(this._currentImage){this._currentImage.setOpacity(aK)}return this},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(aL,aK){this.options.from=aL;this.options.to=aK;this._update();return this},metadata:function(aL,aK){this.service.metadata(aL,aK);return this},authenticate:function(aK){this.service.authenticate(aK);return this},redraw:function(){this._update()},_renderImage:function(aK,aL,aN){if(this._map){if(aN){aK="data:"+aN+";base64,"+aK}var aM=new M(aK,aL,{opacity:0,crossOrigin:this.options.useCors,alt:this.options.alt,pane:this.options.pane||this.getPane(),interactive:this.options.interactive}).addTo(this._map);aM.once("load",function(aP){if(this._map){var aQ=aP.target;var aO=this._currentImage;if(aQ._bounds.equals(aL)&&aQ._bounds.equals(this._map.getBounds())){this._currentImage=aQ;if(this.options.position==="front"){this.bringToFront()}else{this.bringToBack()}if(this._map&&this._currentImage._map){this._currentImage.setOpacity(this.options.opacity)}else{this._currentImage._map.removeLayer(this._currentImage)}if(aO&&this._map){this._map.removeLayer(aO)}if(aO&&aO._map){aO._map.removeLayer(aO)}}else{this._map.removeLayer(aQ)}}this.fire("load",{bounds:aL})},this);this.fire("loading",{bounds:aL})}},_update:function(){if(!this._map){return}var aL=this._map.getZoom();var aK=this._map.getBounds();if(this._animatingZoom){return}if(this._map._panTransition&&this._map._panTransition._inProgress){return}if(aL>this.options.maxZoom||aL<this.options.minZoom){if(this._currentImage){this._currentImage._map.removeLayer(this._currentImage);this._currentImage=null}return}var aM=this._buildExportParams();this._requestExport(aM,aK)},_renderPopup:function(aO,aL,aM,aK){aO=S.latLng(aO);if(this._shouldRenderPopup&&this._lastClick.equals(aO)){var aN=this._popupFunction(aL,aM,aK);if(aN){this._popup.setLatLng(aO).setContent(aN).openOn(this._map)}}},_resetPopupState:function(aK){this._shouldRenderPopup=false;this._lastClick=aK.latlng}});var at=aw.extend({options:{updateInterval:150,format:"jpgpng",transparent:true,f:"json"},query:function(){return this.service.query()},identify:function(){return this.service.identify()},initialize:function(aK){aK.url=T(aK.url);this.service=P(aK);this.service.addEventParent(this);S.Util.setOptions(this,aK)},setPixelType:function(aK){this.options.pixelType=aK;this._update();return this},getPixelType:function(){return this.options.pixelType},setBandIds:function(aK){if(S.Util.isArray(aK)){this.options.bandIds=aK.join(",")}else{this.options.bandIds=aK.toString()}this._update();return this},getBandIds:function(){return this.options.bandIds},setNoData:function(aK,aL){if(S.Util.isArray(aK)){this.options.noData=aK.join(",")}else{this.options.noData=aK.toString()}if(aL){this.options.noDataInterpretation=aL}this._update();return this},getNoData:function(){return this.options.noData},getNoDataInterpretation:function(){return this.options.noDataInterpretation},setRenderingRule:function(aK){this.options.renderingRule=aK;this._update()},getRenderingRule:function(){return this.options.renderingRule},setMosaicRule:function(aK){this.options.mosaicRule=aK;this._update()},getMosaicRule:function(){return this.options.mosaicRule},_getPopupData:function(aL){var aM=S.Util.bind(function(aO,aP,aN){if(aO){return}setTimeout(S.Util.bind(function(){this._renderPopup(aL.latlng,aO,aP,aN)},this),300)},this);var aK=this.identify().at(aL.latlng);if(this.options.mosaicRule){aK.setMosaicRule(this.options.mosaicRule)}aK.run(aM);this._shouldRenderPopup=true;this._lastClick=aL.latlng},_buildExportParams:function(){var aO=this._map.getBounds();var aM=this._map.getSize();var aQ=this._map.options.crs.project(aO._northEast);var aK=this._map.options.crs.project(aO._southWest);var aP=this._map.latLngToLayerPoint(aO._northEast);var aL=this._map.latLngToLayerPoint(aO._southWest);if(aP.y>0||aL.y<aM.y){aM.y=aL.y-aP.y}var aN=parseInt(this._map.options.crs.code.split(":")[1],10);var aR={bbox:[aK.x,aK.y,aQ.x,aQ.y].join(","),size:aM.x+","+aM.y,format:this.options.format,transparent:this.options.transparent,bboxSR:aN,imageSR:aN};if(this.options.from&&this.options.to){aR.time=this.options.from.valueOf()+","+this.options.to.valueOf()}if(this.options.pixelType){aR.pixelType=this.options.pixelType}if(this.options.interpolation){aR.interpolation=this.options.interpolation}if(this.options.compressionQuality){aR.compressionQuality=this.options.compressionQuality}if(this.options.bandIds){aR.bandIds=this.options.bandIds}if(this.options.noData){aR.noData=this.options.noData}if(this.options.noDataInterpretation){aR.noDataInterpretation=this.options.noDataInterpretation}if(this.service.options.token){aR.token=this.service.options.token}if(this.options.renderingRule){aR.renderingRule=JSON.stringify(this.options.renderingRule)}if(this.options.mosaicRule){aR.mosaicRule=JSON.stringify(this.options.mosaicRule)}return aR},_requestExport:function(aL,aK){if(this.options.f==="json"){this.service.request("exportImage",aL,function(aN,aM){if(aN){return}if(this.options.token){aM.href+=("?token="+this.options.token)}this._renderImage(aM.href,aK)},this)}else{aL.f="image";this._renderImage(this.options.url+"exportImage"+S.Util.getParamString(aL),aK)}}});function j(aL,aK){return new at(aL,aK)}var J=aw.extend({options:{updateInterval:150,layers:false,layerDefs:false,timeOptions:false,format:"png24",transparent:true,f:"json"},initialize:function(aK){aK.url=T(aK.url);this.service=f(aK);this.service.addEventParent(this);if((aK.proxy||aK.token)&&aK.f!=="json"){aK.f="json"}S.Util.setOptions(this,aK)},getDynamicLayers:function(){return this.options.dynamicLayers},setDynamicLayers:function(aK){this.options.dynamicLayers=aK;this._update();return this},getLayers:function(){return this.options.layers},setLayers:function(aK){this.options.layers=aK;this._update();return this},getLayerDefs:function(){return this.options.layerDefs},setLayerDefs:function(aK){this.options.layerDefs=aK;this._update();return this},getTimeOptions:function(){return this.options.timeOptions},setTimeOptions:function(aK){this.options.timeOptions=aK;this._update();return this},query:function(){return this.service.query()},identify:function(){return this.service.identify()},find:function(){return this.service.find()},_getPopupData:function(aL){var aM=S.Util.bind(function(aO,aP,aN){if(aO){return}setTimeout(S.Util.bind(function(){this._renderPopup(aL.latlng,aO,aP,aN)},this),300)},this);var aK=this.identify().on(this._map).at(aL.latlng);aK.simplify(this._map,0.5);if(this.options.layers){aK.layers("visible:"+this.options.layers.join(","))}else{aK.layers("visible")}aK.run(aM);this._shouldRenderPopup=true;this._lastClick=aL.latlng},_buildExportParams:function(){var aO=this._map.getBounds();var aM=this._map.getSize();var aQ=this._map.options.crs.project(aO.getNorthEast());var aK=this._map.options.crs.project(aO.getSouthWest());var aN=parseInt(this._map.options.crs.code.split(":")[1],10);var aP=this._map.latLngToLayerPoint(aO._northEast);var aL=this._map.latLngToLayerPoint(aO._southWest);if(aP.y>0||aL.y<aM.y){aM.y=aL.y-aP.y}var aR={bbox:[aK.x,aK.y,aQ.x,aQ.y].join(","),size:aM.x+","+aM.y,dpi:96,format:this.options.format,transparent:this.options.transparent,bboxSR:aN,imageSR:aN};if(this.options.dynamicLayers){aR.dynamicLayers=this.options.dynamicLayers}if(this.options.layers){aR.layers="show:"+this.options.layers.join(",")}if(this.options.layerDefs){aR.layerDefs=typeof this.options.layerDefs==="string"?this.options.layerDefs:JSON.stringify(this.options.layerDefs)}if(this.options.timeOptions){aR.timeOptions=JSON.stringify(this.options.timeOptions)}if(this.options.from&&this.options.to){aR.time=this.options.from.valueOf()+","+this.options.to.valueOf()}if(this.service.options.token){aR.token=this.service.options.token}if(this.options.proxy){aR.proxy=this.options.proxy}return aR},_requestExport:function(aL,aK){if(this.options.f==="json"){this.service.request("export",aL,function(aN,aM){if(aN){return}if(this.options.token){aM.href+=("?token="+this.options.token)}if(this.options.proxy){aM.href=this.options.proxy+"?"+aM.href}if(aM.href){this._renderImage(aM.href,aK)}else{this._renderImage(aM.imageData,aK,aM.contentType)}},this)}else{aL.f="image";this._renderImage(this.options.url+"export"+S.Util.getParamString(aL),aK)}}});function aq(aL,aK){return new J(aL,aK)}var Z=Y.Layer.extend({options:{cellSize:512,updateInterval:150},initialize:function(aK){aK=Y.setOptions(this,aK);this._zooming=false},onAdd:function(aK){this._map=aK;this._update=Y.Util.throttle(this._update,this.options.updateInterval,this);this._reset();this._update()},onRemove:function(){this._map.removeEventListener(this.getEvents(),this);this._removeCells()},getEvents:function(){var aK={moveend:this._update,zoomstart:this._zoomstart,zoomend:this._reset};return aK},addTo:function(aK){aK.addLayer(this);return this},removeFrom:function(aK){aK.removeLayer(this);return this},_zoomstart:function(){this._zooming=true},_reset:function(){this._removeCells();this._cells={};this._activeCells={};this._cellsToLoad=0;this._cellsTotal=0;this._cellNumBounds=this._getCellNumBounds();this._resetWrap();this._zooming=false},_resetWrap:function(){var aL=this._map;var aK=aL.options.crs;if(aK.infinite){return}var aM=this._getCellSize();if(aK.wrapLng){this._wrapLng=[Math.floor(aL.project([0,aK.wrapLng[0]]).x/aM),Math.ceil(aL.project([0,aK.wrapLng[1]]).x/aM)]}if(aK.wrapLat){this._wrapLat=[Math.floor(aL.project([aK.wrapLat[0],0]).y/aM),Math.ceil(aL.project([aK.wrapLat[1],0]).y/aM)]}},_getCellSize:function(){return this.options.cellSize},_update:function(){if(!this._map){return}var aL=this._map.getPixelBounds();var aM=this._getCellSize();var aK=Y.bounds(aL.min.divideBy(aM).floor(),aL.max.divideBy(aM).floor());this._removeOtherCells(aK);this._addCells(aK);this.fire("cellsupdated")},_addCells:function(aQ){var aM=[];var aL=aQ.getCenter();var aP=this._map.getZoom();var aN,aO,aR;for(aN=aQ.min.y;aN<=aQ.max.y;aN++){for(aO=aQ.min.x;aO<=aQ.max.x;aO++){aR=Y.point(aO,aN);aR.z=aP;if(this._isValidCell(aR)){aM.push(aR)}}}var aK=aM.length;if(aK===0){return}this._cellsToLoad+=aK;this._cellsTotal+=aK;aM.sort(function(aT,aS){return aT.distanceTo(aL)-aS.distanceTo(aL)});for(aO=0;aO<aK;aO++){this._addCell(aM[aO])}},_isValidCell:function(aN){var aK=this._map.options.crs;if(!aK.infinite){var aM=this._cellNumBounds;if((!aK.wrapLng&&(aN.x<aM.min.x||aN.x>aM.max.x))||(!aK.wrapLat&&(aN.y<aM.min.y||aN.y>aM.max.y))){return false}}if(!this.options.bounds){return true}var aL=this._cellCoordsToBounds(aN);return Y.latLngBounds(this.options.bounds).intersects(aL)},_cellCoordsToBounds:function(aO){var aP=this._map;var aQ=this.options.cellSize;var aM=aO.multiplyBy(aQ);var aK=aM.add([aQ,aQ]);var aL=aP.wrapLatLng(aP.unproject(aM,aO.z));var aN=aP.wrapLatLng(aP.unproject(aK,aO.z));return Y.latLngBounds(aL,aN)},_cellCoordsToKey:function(aK){return aK.x+":"+aK.y},_keyToCellCoords:function(aL){var aM=aL.split(":");var aK=parseInt(aM[0],10);var aN=parseInt(aM[1],10);return Y.point(aK,aN)},_removeOtherCells:function(aL){for(var aK in this._cells){if(!aL.contains(this._keyToCellCoords(aK))){this._removeCell(aK)}}},_removeCell:function(aL){var aK=this._activeCells[aL];if(aK){delete this._activeCells[aL];if(this.cellLeave){this.cellLeave(aK.bounds,aK.coords)}this.fire("cellleave",{bounds:aK.bounds,coords:aK.coords})}},_removeCells:function(){for(var aK in this._cells){var aL=this._cells[aK].bounds;var aM=this._cells[aK].coords;if(this.cellLeave){this.cellLeave(aL,aM)}this.fire("cellleave",{bounds:aL,coords:aM})}},_addCell:function(aM){this._wrapCoords(aM);var aL=this._cellCoordsToKey(aM);var aK=this._cells[aL];if(aK&&!this._activeCells[aL]){if(this.cellEnter){this.cellEnter(aK.bounds,aM)}this.fire("cellenter",{bounds:aK.bounds,coords:aM});this._activeCells[aL]=aK}if(!aK){aK={coords:aM,bounds:this._cellCoordsToBounds(aM)};this._cells[aL]=aK;this._activeCells[aL]=aK;if(this.createCell){this.createCell(aK.bounds,aM)}this.fire("cellcreate",{bounds:aK.bounds,coords:aM})}},_wrapCoords:function(aK){aK.x=this._wrapLng?Y.Util.wrapNum(aK.x,this._wrapLng):aK.x;aK.y=this._wrapLat?Y.Util.wrapNum(aK.y,this._wrapLat):aK.y},_getCellNumBounds:function(){var aL=this._map.getPixelWorldBounds();var aK=this._getCellSize();return aL?Y.bounds(aL.min.divideBy(aK).floor(),aL.max.divideBy(aK).ceil().subtract([1,1])):null}});function aa(aK){this.values=[].concat(aK||[])}aa.prototype.query=function(aL){var aK=this.getIndex(aL);return this.values[aK]};aa.prototype.getIndex=function i(aO){if(this.dirty){this.sort()}var aM=0;var aN=this.values.length-1;var aK;var aL;while(aM<=aN){aK=(aM+aN)/2|0;aL=this.values[Math.round(aK)];if(+aL.value<+aO){aM=aK+1}else{if(+aL.value>+aO){aN=aK-1}else{return aK}}}return Math.abs(~aN)};aa.prototype.between=function H(aN,aK){var aM=this.getIndex(aN);var aL=this.getIndex(aK);if(aM===0&&aL===0){return[]}while(this.values[aM-1]&&this.values[aM-1].value===aN){aM--}while(this.values[aL+1]&&this.values[aL+1].value===aK){aL++}if(this.values[aL]&&this.values[aL].value===aK&&this.values[aL+1]){aL++}return this.values.slice(aM,aL)};aa.prototype.insert=function B(aK){this.values.splice(this.getIndex(aK.value),0,aK);return this};aa.prototype.bulkAdd=function A(aK,aL){this.values=this.values.concat([].concat(aK||[]));if(aL){this.sort()}else{this.dirty=true}return this};aa.prototype.sort=function F(){this.values.sort(function(aL,aK){return +aK.value-+aL.value}).reverse();this.dirty=false;return this};var av=Z.extend({options:{attribution:null,where:"1=1",fields:["*"],from:false,to:false,timeField:false,timeFilterMode:"server",simplifyFactor:0,precision:6},initialize:function(aK){Z.prototype.initialize.call(this,aK);aK.url=T(aK.url);aK=S.setOptions(this,aK);this.service=ab(aK);this.service.addEventParent(this);if(this.options.fields[0]!=="*"){var aM=false;for(var aL=0;aL<this.options.fields.length;aL++){if(this.options.fields[aL].match(/^(OBJECTID|FID|OID|ID)$/i)){aM=true}}if(aM===false){aF("no known esriFieldTypeOID field detected in fields Array.  Please add an attribute field containing unique IDs to ensure the layer can be drawn correctly.")}}if(this.options.timeField.start&&this.options.timeField.end){this._startTimeIndex=new aa();this._endTimeIndex=new aa()}else{if(this.options.timeField){this._timeIndex=new aa()}}this._cache={};this._currentSnapshot=[];this._activeRequests=0},onAdd:function(aK){ay(aK);this.service.metadata(function(aM,aL){if(!aM){var aO=aL.supportedQueryFormats;var aN=false;if(this.service.options.isModern===false){aN=true}if(!aN&&aO&&aO.indexOf("geoJSON")!==-1){this.service.options.isModern=true}if(!this.options.attribution&&aK.attributionControl&&aL.copyrightText){this.options.attribution=aL.copyrightText;aK.attributionControl.addAttribution(this.getAttribution())}}},this);aK.on("zoomend",this._handleZoomChange,this);return Z.prototype.onAdd.call(this,aK)},onRemove:function(aK){aK.off("zoomend",this._handleZoomChange,this);return Z.prototype.onRemove.call(this,aK)},getAttribution:function(){return this.options.attribution},createCell:function(aK,aL){if(this._visibleZoom()){this._requestFeatures(aK,aL)}},_requestFeatures:function(aK,aL,aM){this._activeRequests++;if(this._activeRequests===1){this.fire("loading",{bounds:aK},true)}return this._buildQuery(aK).run(function(aO,aP,aN){if(aN&&aN.exceededTransferLimit){this.fire("drawlimitexceeded")}if(!aO&&aP&&aP.features.length){S.Util.requestAnimFrame(S.Util.bind(function(){this._addFeatures(aP.features,aL);this._postProcessFeatures(aK)},this))}if(!aO&&aP&&!aP.features.length){this._postProcessFeatures(aK)}if(aO){this._postProcessFeatures(aK)}if(aM){aM.call(this,aO,aP)}},this)},_postProcessFeatures:function(aK){this._activeRequests--;if(this._activeRequests<=0){this.fire("load",{bounds:aK})}},_cacheKey:function(aK){return aK.z+":"+aK.x+":"+aK.y},_addFeatures:function(aM,aN){var aL=this._cacheKey(aN);this._cache[aL]=this._cache[aL]||[];for(var aK=aM.length-1;aK>=0;aK--){var aO=aM[aK].id;if(this._currentSnapshot.indexOf(aO)===-1){this._currentSnapshot.push(aO)}if(this._cache[aL].indexOf(aO)===-1){this._cache[aL].push(aO)}}if(this.options.timeField){this._buildTimeIndexes(aM)}this.createLayers(aM)},_buildQuery:function(aK){var aL=this.service.query().intersects(aK).where(this.options.where).fields(this.options.fields).precision(this.options.precision);if(this.options.simplifyFactor){aL.simplify(this._map,this.options.simplifyFactor)}if(this.options.timeFilterMode==="server"&&this.options.from&&this.options.to){aL.between(this.options.from,this.options.to)}return aL},setWhere:function(aP,aU,aL){this.options.where=(aP&&aP.length)?aP:"1=1";var aN=[];var aT=[];var aM=0;var aR=null;var aV=S.Util.bind(function(aW,aY){if(aW){aR=aW}if(aY){for(var aX=aY.features.length-1;aX>=0;aX--){aT.push(aY.features[aX].id)}}aM--;if(aM<=0){this._currentSnapshot=aT;S.Util.requestAnimFrame(S.Util.bind(function(){this.removeLayers(aN);this.addLayers(aT);if(aU){aU.call(aL,aR)}},this))}},this);for(var aO=this._currentSnapshot.length-1;aO>=0;aO--){aN.push(this._currentSnapshot[aO])}for(var aS in this._activeCells){aM++;var aQ=this._keyToCellCoords(aS);var aK=this._cellCoordsToBounds(aQ);this._requestFeatures(aK,aS,aV)}return this},getWhere:function(){return this.options.where},getTimeRange:function(){return[this.options.from,this.options.to]},setTimeRange:function(aO,aP,aU,aL){var aT=this.options.from;var aS=this.options.to;var aM=0;var aQ=null;var aV=S.Util.bind(function(aW){if(aW){aQ=aW}this._filterExistingFeatures(aT,aS,aO,aP);aM--;if(aU&&aM<=0){aU.call(aL,aQ)}},this);this.options.from=aO;this.options.to=aP;this._filterExistingFeatures(aT,aS,aO,aP);if(this.options.timeFilterMode==="server"){for(var aR in this._activeCells){aM++;var aN=this._keyToCellCoords(aR);var aK=this._cellCoordsToBounds(aN);this._requestFeatures(aK,aR,aV)}}return this},refresh:function(){for(var aK in this._activeCells){var aM=this._keyToCellCoords(aK);var aL=this._cellCoordsToBounds(aM);this._requestFeatures(aL,aK)}if(this.redraw){this.once("load",function(){this.eachFeature(function(aN){this._redraw(aN.feature.id)},this)},this)}},_filterExistingFeatures:function(aL,aR,aP,aM){var aO=(aL&&aR)?this._getFeaturesInTimeRange(aL,aR):this._currentSnapshot;var aQ=this._getFeaturesInTimeRange(aP,aM);if(aQ.indexOf){for(var aN=0;aN<aQ.length;aN++){var aK=aO.indexOf(aQ[aN]);if(aK>=0){aO.splice(aK,1)}}}S.Util.requestAnimFrame(S.Util.bind(function(){this.removeLayers(aO);this.addLayers(aQ)},this))},_getFeaturesInTimeRange:function(aQ,aK){var aP=[];var aO;if(this.options.timeField.start&&this.options.timeField.end){var aN=this._startTimeIndex.between(aQ,aK);var aL=this._endTimeIndex.between(aQ,aK);aO=aN.concat(aL)}else{aO=this._timeIndex.between(aQ,aK)}for(var aM=aO.length-1;aM>=0;aM--){aP.push(aO[aM].id)}return aP},_buildTimeIndexes:function(aL){var aO;var aN;if(this.options.timeField.start&&this.options.timeField.end){var aP=[];var aK=[];for(aO=aL.length-1;aO>=0;aO--){aN=aL[aO];aP.push({id:aN.id,value:new Date(aN.properties[this.options.timeField.start])});aK.push({id:aN.id,value:new Date(aN.properties[this.options.timeField.end])})}this._startTimeIndex.bulkAdd(aP);this._endTimeIndex.bulkAdd(aK)}else{var aM=[];for(aO=aL.length-1;aO>=0;aO--){aN=aL[aO];aM.push({id:aN.id,value:new Date(aN.properties[this.options.timeField])})}this._timeIndex.bulkAdd(aM)}},_featureWithinTimeRange:function(aM){if(!this.options.from||!this.options.to){return true}var aP=+this.options.from.valueOf();var aO=+this.options.to.valueOf();if(typeof this.options.timeField==="string"){var aL=+aM.properties[this.options.timeField];return(aL>=aP)&&(aL<=aO)}if(this.options.timeField.start&&this.options.timeField.end){var aK=+aM.properties[this.options.timeField.start];var aN=+aM.properties[this.options.timeField.end];return((aK>=aP)&&(aK<=aO))||((aN>=aP)&&(aN<=aO))}},_visibleZoom:function(){if(!this._map){return false}var aK=this._map.getZoom();if(aK>this.options.maxZoom||aK<this.options.minZoom){return false}else{return true}},_handleZoomChange:function(){if(!this._visibleZoom()){this.removeLayers(this._currentSnapshot);this._currentSnapshot=[]}else{for(var aL in this._activeCells){var aM=this._activeCells[aL].coords;var aK=this._cacheKey(aM);if(this._cache[aK]){this.addLayers(this._cache[aK])}}}},authenticate:function(aK){this.service.authenticate(aK);return this},metadata:function(aL,aK){this.service.metadata(aL,aK);return this},query:function(){return this.service.query()},_getMetadata:function(aL){if(this._metadata){var aK;aL(aK,this._metadata)}else{this.metadata(S.Util.bind(function(aN,aM){this._metadata=aM;aL(aN,this._metadata)},this))}},addFeature:function(aL,aM,aK){this._getMetadata(S.Util.bind(function(aN,aO){if(aN){if(aM){aM.call(this,aN,null)}return}this.service.addFeature(aL,S.Util.bind(function(aQ,aP){if(!aQ){aL.properties[aO.objectIdField]=aP.objectId;aL.id=aP.objectId;this.createLayers([aL])}if(aM){aM.call(aK,aQ,aP)}},this))},this))},updateFeature:function(aL,aM,aK){this.service.updateFeature(aL,function(aO,aN){if(!aO){this.removeLayers([aL.id],true);this.createLayers([aL])}if(aM){aM.call(aK,aO,aN)}},this)},deleteFeature:function(aM,aL,aK){this.service.deleteFeature(aM,function(aO,aN){if(!aO&&aN.objectId){this.removeLayers([aN.objectId],true)}if(aL){aL.call(aK,aO,aN)}},this)},deleteFeatures:function(aL,aM,aK){return this.service.deleteFeatures(aL,function(aO,aN){if(!aO&&aN.length>0){for(var aP=0;aP<aN.length;aP++){this.removeLayers([aN[aP].objectId],true)}}if(aM){aM.call(aK,aO,aN)}},this)}});var ai=av.extend({options:{cacheLayers:true},initialize:function(aK){av.prototype.initialize.call(this,aK);this._originalStyle=this.options.style;this._layers={}},onRemove:function(aL){for(var aK in this._layers){aL.removeLayer(this._layers[aK]);this.fire("removefeature",{feature:this._layers[aK].feature,permanent:false},true)}return av.prototype.onRemove.call(this,aL)},createNewLayer:function(aK){var aL=S.GeoJSON.geometryToLayer(aK,this.options);aL.defaultOptions=aL.options;return aL},_updateLayer:function(aM,aL){var aK=[];var aN=this.options.coordsToLatLng||S.GeoJSON.coordsToLatLng;if(aL.properties){aM.feature.properties=aL.properties}switch(aL.geometry.type){case"Point":aK=S.GeoJSON.coordsToLatLng(aL.geometry.coordinates);aM.setLatLng(aK);break;case"LineString":aK=S.GeoJSON.coordsToLatLngs(aL.geometry.coordinates,0,aN);aM.setLatLngs(aK);break;case"MultiLineString":aK=S.GeoJSON.coordsToLatLngs(aL.geometry.coordinates,1,aN);aM.setLatLngs(aK);break;case"Polygon":aK=S.GeoJSON.coordsToLatLngs(aL.geometry.coordinates,1,aN);aM.setLatLngs(aK);break;case"MultiPolygon":aK=S.GeoJSON.coordsToLatLngs(aL.geometry.coordinates,2,aN);aM.setLatLngs(aK);break}},createLayers:function(aO){for(var aM=aO.length-1;aM>=0;aM--){var aK=aO[aM];var aL=this._layers[aK.id];var aN;if(this._visibleZoom()&&aL&&!this._map.hasLayer(aL)){this._map.addLayer(aL);this.fire("addfeature",{feature:aL.feature},true)}if(aL&&this.options.simplifyFactor>0&&(aL.setLatLngs||aL.setLatLng)){this._updateLayer(aL,aK)}if(!aL){aN=this.createNewLayer(aK);aN.feature=aK;aN.addEventParent(this);if(this.options.onEachFeature){this.options.onEachFeature(aN.feature,aN)}this._layers[aN.feature.id]=aN;this.setFeatureStyle(aN.feature.id,this.options.style);this.fire("createfeature",{feature:aN.feature},true);if(this._visibleZoom()&&(!this.options.timeField||(this.options.timeField&&this._featureWithinTimeRange(aK)))){this._map.addLayer(aN)}}}},addLayers:function(aM){for(var aL=aM.length-1;aL>=0;aL--){var aK=this._layers[aM[aL]];if(aK){this._map.addLayer(aK)}}},removeLayers:function(aM,aN){for(var aL=aM.length-1;aL>=0;aL--){var aO=aM[aL];var aK=this._layers[aO];if(aK){this.fire("removefeature",{feature:aK.feature,permanent:aN},true);this._map.removeLayer(aK)}if(aK&&aN){delete this._layers[aO]}}},cellEnter:function(aK,aL){if(this._visibleZoom()&&!this._zooming&&this._map){S.Util.requestAnimFrame(S.Util.bind(function(){var aN=this._cacheKey(aL);var aO=this._cellCoordsToKey(aL);var aM=this._cache[aN];if(this._activeCells[aO]&&aM){this.addLayers(aM)}},this))}},cellLeave:function(aK,aL){if(!this._zooming){S.Util.requestAnimFrame(S.Util.bind(function(){if(this._map){var aR=this._cacheKey(aL);var aS=this._cellCoordsToKey(aL);var aQ=this._cache[aR];var aM=this._map.getBounds();if(!this._activeCells[aS]&&aQ){var aN=true;for(var aP=0;aP<aQ.length;aP++){var aO=this._layers[aQ[aP]];if(aO&&aO.getBounds&&aM.intersects(aO.getBounds())){aN=false}}if(aN){this.removeLayers(aQ,!this.options.cacheLayers)}if(!this.options.cacheLayers&&aN){delete this._cache[aR];delete this._cells[aS];delete this._activeCells[aS]}}}},this))}},resetStyle:function(){this.options.style=this._originalStyle;this.eachFeature(function(aK){this.resetFeatureStyle(aK.feature.id)},this);return this},setStyle:function(aK){this.options.style=aK;this.eachFeature(function(aL){this.setFeatureStyle(aL.feature.id,aK)},this);return this},resetFeatureStyle:function(aM){var aK=this._layers[aM];var aL=this._originalStyle||L.Path.prototype.options;if(aK){S.Util.extend(aK.options,aK.defaultOptions);this.setFeatureStyle(aM,aL)}return this},setFeatureStyle:function(aM,aL){var aK=this._layers[aM];if(typeof aL==="function"){aL=aL(aK.feature)}if(aK.setStyle){aK.setStyle(aL)}return this},eachActiveFeature:function(aM,aL){if(this._map){var aN=this._map.getBounds();for(var aK in this._layers){if(aN.intersects(this._layers[aK].getBounds())&&this._currentSnapshot.indexOf(this._layers[aK].feature.id)!==-1){aM.call(aL,this._layers[aK])}}}return this},eachFeature:function(aM,aL){for(var aK in this._layers){aM.call(aL,this._layers[aK])}return this},getFeature:function(aK){return this._layers[aK]},bringToBack:function(){this.eachFeature(function(aK){if(aK.bringToBack){aK.bringToBack()}})},bringToFront:function(){this.eachFeature(function(aK){if(aK.bringToFront){aK.bringToFront()}})},redraw:function(aK){if(aK){this._redraw(aK)}return this},_redraw:function(aQ){var aN=this._layers[aQ];var aM=aN.feature;if(aN&&aN.setIcon&&this.options.pointToLayer){if(this.options.pointToLayer){var aP=this.options.pointToLayer(aM,S.latLng(aM.geometry.coordinates[1],aM.geometry.coordinates[0]));var aO=aP.options.icon;aN.setIcon(aO)}}if(aN&&aN.setStyle&&this.options.pointToLayer){var aK=this.options.pointToLayer(aM,S.latLng(aM.geometry.coordinates[1],aM.geometry.coordinates[0]));var aL=aK.options;this.setFeatureStyle(aM.id,aL)}if(aN&&aN.setStyle&&this.options.style){this.resetStyle(aM.id)}}});function E(aK){return new ai(aK)}O.VERSION=s;O.Support=ag;O.options=W;O.Util=X;O.get=al;O.post=aA;O.request=ah;O.Task=aC;O.task=am;O.Query=R;O.query=K;O.Find=l;O.find=aH;O.Identify=ax;O.identify=ao;O.IdentifyFeatures=au;O.identifyFeatures=N;O.IdentifyImage=d;O.identifyImage=n;O.Service=ae;O.service=aG;O.MapService=m;O.mapService=f;O.ImageService=ar;O.imageService=P;O.FeatureLayerService=az;O.featureLayerService=ab;O.BasemapLayer=ad;O.basemapLayer=w;O.TiledMapLayer=q;O.tiledMapLayer=U;O.RasterLayer=aw;O.ImageMapLayer=at;O.imageMapLayer=j;O.DynamicMapLayer=J;O.dynamicMapLayer=aq;O.FeatureManager=av;O.FeatureLayer=ai;O.featureLayer=E}));
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_gis/resources/js/leaflet-esri-cluster-2.0.0.min.js	Thu Jul 12 17:40:07 2018 +0200
@@ -0,0 +1,1 @@
+(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?a(exports,require("leaflet"),require("esri-leaflet")):typeof define==="function"&&define.amd?define(["exports","leaflet","esri-leaflet"],a):(a((b.L=b.L||{},b.L.esri=b.L.esri||{},b.L.esri.Cluster=b.L.esri.Cluster||{}),b.L,b.L.esri))}(this,function(c,a,d){a="default" in a?a["default"]:a;var b="2.0.0";var f=d.FeatureManager.extend({statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose",CLUSTEREVENTS:"clusterclick clusterdblclick clustermouseover clustermouseout clustermousemove clustercontextmenu"},initialize:function(g){d.FeatureManager.prototype.initialize.call(this,g);g=a.setOptions(this,g);this._layers={};this._leafletIds={};this.cluster=a.markerClusterGroup(g);this._key="c"+(Math.random()*1000000000).toString(36).replace(".","_");this.cluster.addEventParent(this)},onAdd:function(g){d.FeatureManager.prototype.onAdd.call(this,g);this._map.addLayer(this.cluster)},onRemove:function(g){d.FeatureManager.prototype.onRemove.call(this,g);this._map.removeLayer(this.cluster)},createLayers:function(l){var m=[];for(var j=l.length-1;j>=0;j--){var g=l[j];var h=this._layers[g.id];if(!h){var k=a.GeoJSON.geometryToLayer(g,this.options);k.feature=a.GeoJSON.asFeature(g);k.defaultOptions=k.options;k._leaflet_id=this._key+"_"+g.id;this.resetStyle(k.feature.id);this._layers[k.feature.id]=k;this._leafletIds[k._leaflet_id]=g.id;if(this.options.onEachFeature){this.options.onEachFeature(k.feature,k)}this.fire("createfeature",{feature:k.feature});if(!this.options.timeField||(this.options.timeField&&this._featureWithinTimeRange(g))){m.push(k)}}}if(m.length){this.cluster.addLayers(m)}},addLayers:function(j){var k=[];for(var h=j.length-1;h>=0;h--){var g=this._layers[j[h]];this.fire("addfeature",{feature:g.feature});k.push(g)}this.cluster.addLayers(k)},removeLayers:function(k,l){var j=[];for(var h=k.length-1;h>=0;h--){var m=k[h];var g=this._layers[m];this.fire("removefeature",{feature:g.feature,permanent:l});j.push(g);if(this._layers[m]&&l){delete this._layers[m]}}this.cluster.removeLayers(j)},resetStyle:function(h){var g=this._layers[h];if(g){g.options=g.defaultOptions;this.setFeatureStyle(g.feature.id,this.options.style)}return this},setStyle:function(g){this.eachFeature(function(h){this.setFeatureStyle(h.feature.id,g)},this);return this},setFeatureStyle:function(i,h){var g=this._layers[i];if(typeof h==="function"){h=h(g.feature)}if(g.setStyle){g.setStyle(h)}},eachFeature:function(j,h){for(var g in this._layers){j.call(h,this._layers[g])}return this},getFeature:function(g){return this._layers[g]}});function e(g){return new f(g)}c.FeatureLayer=f;c.featureLayer=e;c["default"]=e;c.VERSION=b}));
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_gis/resources/js/leaflet-esri-geocoder-2.2.4.min.js	Thu Jul 12 17:40:07 2018 +0200
@@ -0,0 +1,1 @@
+(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?a(exports,require("leaflet"),require("esri-leaflet")):typeof define==="function"&&define.amd?define(["exports","leaflet","esri-leaflet"],a):(a((b.L=b.L||{},b.L.esri=b.L.esri||{},b.L.esri.Geocoding=b.L.esri.Geocoding||{}),b.L,b.L.esri))}(this,function(y,g,w){g="default" in g?g["default"]:g;var d="2.2.4";var t=w.Task.extend({path:"findAddressCandidates",params:{outSr:4326,forStorage:false,outFields:"*",maxLocations:20},setters:{address:"address",neighborhood:"neighborhood",city:"city",subregion:"subregion",region:"region",postal:"postal",country:"country",text:"singleLine",category:"category",token:"token",key:"magicKey",fields:"outFields",forStorage:"forStorage",maxLocations:"maxLocations"},initialize:function(z){z=z||{};z.url=z.url||i;w.Task.prototype.initialize.call(this,z)},within:function(z){z=g.latLngBounds(z);this.params.searchExtent=w.Util.boundsToExtent(z);return this},nearby:function(A,z){A=g.latLng(A);this.params.location=A.lng+","+A.lat;this.params.distance=Math.min(Math.max(z,2000),50000);return this},run:function(A,z){if(this.options.customParam){this.params[this.options.customParam]=this.params.singleLine;delete this.params.singleLine}return this.request(function(C,B){var E=this._processGeocoderResponse;var D=(!C)?E(B):undefined;A.call(z,C,{results:D},B)},this)},_processGeocoderResponse:function(z){var B=[];for(var A=0;A<z.candidates.length;A++){var C=z.candidates[A];if(C.extent){var D=w.Util.extentToBounds(C.extent)}B.push({text:C.address,bounds:D,score:C.score,latlng:g.latLng(C.location.y,C.location.x),properties:C.attributes})}return B}});function e(z){return new t(z)}var x=w.Task.extend({path:"reverseGeocode",params:{outSR:4326,returnIntersection:false},setters:{distance:"distance",language:"langCode",intersection:"returnIntersection"},initialize:function(z){z=z||{};z.url=z.url||i;w.Task.prototype.initialize.call(this,z)},latlng:function(z){z=g.latLng(z);this.params.location=z.lng+","+z.lat;return this},run:function(A,z){return this.request(function(D,C){var B;if(!D){B={latlng:g.latLng(C.location.y,C.location.x),address:C.address}}else{B=undefined}A.call(z,D,B,C)},this)}});function m(z){return new x(z)}var l=w.Task.extend({path:"suggest",params:{},setters:{text:"text",category:"category",countries:"countryCode",maxSuggestions:"maxSuggestions"},initialize:function(z){z=z||{};if(!z.url){z.url=i;z.supportsSuggest=true}w.Task.prototype.initialize.call(this,z)},within:function(A){A=g.latLngBounds(A);A=A.pad(0.5);var z=A.getCenter();var B=A.getNorthWest();this.params.location=z.lng+","+z.lat;this.params.distance=Math.min(Math.max(z.distanceTo(B),2000),50000);this.params.searchExtent=w.Util.boundsToExtent(A);return this},nearby:function(A,z){A=g.latLng(A);this.params.location=A.lng+","+A.lat;this.params.distance=Math.min(Math.max(z,2000),50000);return this},run:function(A,z){if(this.options.supportsSuggest){return this.request(function(C,B){A.call(z,C,B,B)},this)}else{console.warn("this geocoding service does not support asking for suggestions")}}});function h(z){return new l(z)}var c=w.Service.extend({initialize:function(z){z=z||{};if(z.url){w.Service.prototype.initialize.call(this,z);this._confirmSuggestSupport()}else{z.url=i;z.supportsSuggest=true;w.Service.prototype.initialize.call(this,z)}},geocode:function(){return e(this)},reverse:function(){return m(this)},suggest:function(){return h(this)},_confirmSuggestSupport:function(){this.metadata(function(A,z){if(A){return}if(!z.capabilities){this.options.supportsSuggest=false;this.options.customParam=z.singleLineAddressField.name}else{if(z.capabilities.indexOf("Suggest")>-1){this.options.supportsSuggest=true}else{this.options.supportsSuggest=false}}},this)}});function r(z){return new c(z)}var f=g.Evented.extend({options:{zoomToResult:true,useMapBounds:12,searchBounds:null},initialize:function(A,z){g.Util.setOptions(this,z);this._control=A;if(!z||!z.providers||!z.providers.length){throw new Error("You must specify at least one provider")}this._providers=z.providers},_geocode:function(F,C,E){var A=0;var z=[];var D;var G=g.Util.bind(function(H,I){A--;if(H){return}if(I){z=z.concat(I)}if(A<=0){D=this._boundsFromResults(z);this.fire("results",{results:z,bounds:D,latlng:(D)?D.getCenter():undefined,text:F},true);if(this.options.zoomToResult&&D){this._control._map.fitBounds(D)}this.fire("load")}},this);if(C){A++;E.results(F,C,this._searchBounds(),G)}else{for(var B=0;B<this._providers.length;B++){A++;this._providers[B].results(F,C,this._searchBounds(),G)}}},_suggest:function(E){var A=this._providers.length;var z=g.Util.bind(function(G,F){return g.Util.bind(function(I,H){if(I){return}var J;A=A-1;if(G.length<2){this._suggestions.innerHTML="";this._suggestions.style.display="none";return}if(H.length){for(J=0;J<H.length;J++){H[J].provider=F}}else{this._control._renderSuggestions(H)}if(F._lastRender!==G&&F.nodes){for(J=0;J<F.nodes.length;J++){if(F.nodes[J].parentElement){this._control._suggestions.removeChild(F.nodes[J])}}F.nodes=[]}if(H.length&&this._control._input.value===G){this._control.clearSuggestions(F.nodes);F._lastRender=G;F.nodes=this._control._renderSuggestions(H);this._control._nodes=[]}},this)},this);this._pendingSuggestions=[];for(var B=0;B<this._providers.length;B++){var D=this._providers[B];var C=D.suggestions(E,this._searchBounds(),z(E,D));this._pendingSuggestions.push(C)}},_searchBounds:function(){if(this.options.searchBounds!==null){return this.options.searchBounds}if(this.options.useMapBounds===false){return null}if(this.options.useMapBounds===true){return this._control._map.getBounds()}if(this.options.useMapBounds<=this._control._map.getZoom()){return this._control._map.getBounds()}return null},_boundsFromResults:function(E){if(!E.length){return}var B=g.latLngBounds([0,0],[0,0]);var G=[];var A=[];for(var D=E.length-1;D>=0;D--){var z=E[D];A.push(z.latlng);if(z.bounds&&z.bounds.isValid()&&!z.bounds.equals(B)){G.push(z.bounds)}}var F=g.latLngBounds(A);for(var C=0;C<G.length;C++){F.extend(G[C])}return F},_getAttribution:function(){var B=[];var A=this._providers;for(var z=0;z<A.length;z++){if(A[z].options.attribution){B.push(A[z].options.attribution)}}return B.join(", ")}});function k(A,z){return new f(A,z)}var q=c.extend({options:{label:"Places and Addresses",maxResults:5},suggestions:function(B,A,C){var z=this.suggest().text(B);if(A){z.within(A)}if(this.options.countries){z.countries(this.options.countries)}if(this.options.categories){z.category(this.options.categories)}z.maxSuggestions(this.options.maxResults);return z.run(function(G,H,F){var D=[];if(!G){while(F.suggestions.length&&D.length<=(this.options.maxResults-1)){var E=F.suggestions.shift();if(!E.isCollection){D.push({text:E.text,magicKey:E.magicKey})}}}C(G,D)},this)},results:function(C,z,B,D){var A=this.geocode().text(C);if(z){A.key(z)}A.maxLocations(this.options.maxResults);if(B){A.within(B)}if(this.options.forStorage){A.forStorage(true)}return A.run(function(F,E){D(F,E.results)},this)}});function a(z){return new q(z)}var v=g.Control.extend({includes:g.Mixin.Events,options:{position:"topleft",collapseAfterResult:true,expanded:false,allowMultipleResults:true,placeholder:"Search for places or addresses",title:"Location Search"},initialize:function(z){g.Util.setOptions(this,z);if(!z||!z.providers||!z.providers.length){if(!z){z={}}z.providers=[a()]}this._geosearchCore=k(this,z);this._geosearchCore._providers=z.providers;this._geosearchCore.addEventParent(this);for(var A=0;A<this._geosearchCore._providers.length;A++){this._geosearchCore._providers[A].addEventParent(this)}this._geosearchCore._pendingSuggestions=[];g.Control.prototype.initialize.call(z)},_renderSuggestions:function(E){var G;if(E.length>0){this._suggestions.style.display="block"}this._suggestions.style.maxHeight=(this._map.getSize().y-this._suggestions.offsetTop-this._wrapper.offsetTop-10)+"px";var z=[];var F;var D;var H=[];for(var C=0;C<E.length;C++){var B=E[C];if(!D&&this._geosearchCore._providers.length>1&&G!==B.provider.options.label){D=g.DomUtil.create("span","geocoder-control-header",this._suggestions);D.textContent=B.provider.options.label;D.innerText=B.provider.options.label;G=B.provider.options.label;z.push(D)}if(!F){F=g.DomUtil.create("ul","geocoder-control-list",this._suggestions)}if(H.indexOf(B.text)===-1){var I=g.DomUtil.create("li","geocoder-control-suggestion",F);I.innerHTML=B.text;I.provider=B.provider;I["data-magic-key"]=B.magicKey}else{for(var A=0;A<F.childNodes.length;A++){if(F.childNodes[A].innerHTML===B.text){F.childNodes[A]["data-magic-key"]+=","+B.magicKey}}}H.push(B.text)}g.DomUtil.removeClass(this._input,"geocoder-control-loading");z.push(F);return z},_boundsFromResults:function(E){if(!E.length){return}var B=g.latLngBounds([0,0],[0,0]);var G=[];var A=[];for(var D=E.length-1;D>=0;D--){var z=E[D];A.push(z.latlng);if(z.bounds&&z.bounds.isValid()&&!z.bounds.equals(B)){G.push(z.bounds)}}var F=g.latLngBounds(A);for(var C=0;C<G.length;C++){F.extend(G[C])}return F},clear:function(){this._suggestions.innerHTML="";this._suggestions.style.display="none";this._input.value="";if(this.options.collapseAfterResult){this._input.placeholder="";g.DomUtil.removeClass(this._wrapper,"geocoder-control-expanded")}if(!this._map.scrollWheelZoom.enabled()&&this._map.options.scrollWheelZoom){this._map.scrollWheelZoom.enable()}},clearSuggestions:function(){if(this._nodes){for(var z=0;z<this._nodes.length;z++){if(this._nodes[z].parentElement){this._suggestions.removeChild(this._nodes[z])}}}},_setupClick:function(){g.DomUtil.addClass(this._wrapper,"geocoder-control-expanded");this._input.focus()},disable:function(){this._input.disabled=true;g.DomUtil.addClass(this._input,"geocoder-control-input-disabled");g.DomEvent.removeListener(this._wrapper,"click",this._setupClick,this)},enable:function(){this._input.disabled=false;g.DomUtil.removeClass(this._input,"geocoder-control-input-disabled");g.DomEvent.addListener(this._wrapper,"click",this._setupClick,this)},getAttribution:function(){var A=[];for(var z=0;z<this._providers.length;z++){if(this._providers[z].options.attribution){A.push(this._providers[z].options.attribution)}}return A.join(", ")},onAdd:function(A){w.Util.setEsriAttribution(A);this._map=A;this._wrapper=g.DomUtil.create("div","geocoder-control");this._input=g.DomUtil.create("input","geocoder-control-input leaflet-bar",this._wrapper);this._input.title=this.options.title;if(this.options.expanded){g.DomUtil.addClass(this._wrapper,"geocoder-control-expanded");this._input.placeholder=this.options.placeholder}this._suggestions=g.DomUtil.create("div","geocoder-control-suggestions leaflet-bar",this._wrapper);var z=this._geosearchCore._getAttribution();A.attributionControl.addAttribution(z);g.DomEvent.addListener(this._input,"focus",function(B){this._input.placeholder=this.options.placeholder;g.DomUtil.addClass(this._wrapper,"geocoder-control-expanded")},this);g.DomEvent.addListener(this._wrapper,"click",this._setupClick,this);g.DomEvent.addListener(this._suggestions,"mousedown",function(C){var B=C.target||C.srcElement;this._geosearchCore._geocode(B.innerHTML,B["data-magic-key"],B.provider);this.clear()},this);g.DomEvent.addListener(this._input,"blur",function(B){this.clear()},this);g.DomEvent.addListener(this._input,"keydown",function(G){var K=(G.target||G.srcElement).value;g.DomUtil.addClass(this._wrapper,"geocoder-control-expanded");var H=this._suggestions.querySelectorAll(".geocoder-control-suggestion");var D=this._suggestions.querySelectorAll(".geocoder-control-selected")[0];var J;for(var E=0;E<H.length;E++){if(H[E]===D){J=E;break}}switch(G.keyCode){case 13:if(D){this._geosearchCore._geocode(D.innerHTML,D["data-magic-key"],D.provider);this.clear()}else{if(this.options.allowMultipleResults&&K.length>=2){this._geosearchCore._geocode(this._input.value,undefined);this.clear()}else{if(H.length===1){g.DomUtil.addClass(H[0],"geocoder-control-selected");this._geosearchCore._geocode(H[0].innerHTML,H[0]["data-magic-key"],H[0].provider)}else{this.clear();this._input.blur()}}}g.DomEvent.preventDefault(G);break;case 38:if(D){g.DomUtil.removeClass(D,"geocoder-control-selected")}var F=H[J-1];if(D&&F){g.DomUtil.addClass(F,"geocoder-control-selected")}else{g.DomUtil.addClass(H[H.length-1],"geocoder-control-selected")}g.DomEvent.preventDefault(G);break;case 40:if(D){g.DomUtil.removeClass(D,"geocoder-control-selected")}var B=H[J+1];if(D&&B){g.DomUtil.addClass(B,"geocoder-control-selected")}else{g.DomUtil.addClass(H[0],"geocoder-control-selected")}g.DomEvent.preventDefault(G);break;default:for(var I=0;I<this._geosearchCore._pendingSuggestions.length;I++){var C=this._geosearchCore._pendingSuggestions[I];if(C&&C.abort&&!C.id){C.abort()}}break}},this);g.DomEvent.addListener(this._input,"keyup",g.Util.throttle(function(C){var B=C.which||C.keyCode;var D=(C.target||C.srcElement).value;if(D.length<2){this._suggestions.innerHTML="";this._suggestions.style.display="none";g.DomUtil.removeClass(this._input,"geocoder-control-loading");return}if(B===27){this._suggestions.innerHTML="";this._suggestions.style.display="none";return}if(B!==13&&B!==38&&B!==40){if(this._input.value!==this._lastValue){this._lastValue=this._input.value;g.DomUtil.addClass(this._input,"geocoder-control-loading");this._geosearchCore._suggest(D)}}},50,this),this);g.DomEvent.disableClickPropagation(this._wrapper);g.DomEvent.addListener(this._suggestions,"mouseover",function(B){if(A.scrollWheelZoom.enabled()&&A.options.scrollWheelZoom){A.scrollWheelZoom.disable()}});g.DomEvent.addListener(this._suggestions,"mouseout",function(B){if(!A.scrollWheelZoom.enabled()&&A.options.scrollWheelZoom){A.scrollWheelZoom.enable()}});this._geosearchCore.on("load",function(B){g.DomUtil.removeClass(this._input,"geocoder-control-loading");this.clear();this._input.blur()},this);return this._wrapper}});function s(z){return new v(z)}var j=w.FeatureLayerService.extend({options:{label:"Feature Layer",maxResults:5,bufferRadius:1000,formatSuggestion:function(z){return z.properties[this.options.searchFields[0]]}},initialize:function(z){w.FeatureLayerService.prototype.initialize.call(this,z);if(typeof this.options.searchFields==="string"){this.options.searchFields=[this.options.searchFields]}this._suggestionsQuery=this.query();this._resultsQuery=this.query()},suggestions:function(C,A,D){var B=this._suggestionsQuery.where(this._buildQuery(C)).returnGeometry(false);if(A){B.intersects(A)}if(this.options.idField){B.fields([this.options.idField].concat(this.options.searchFields))}var z=B.run(function(G,J,F){if(G){D(G,[])}else{this.options.idField=F.objectIdFieldName;var E=[];for(var I=J.features.length-1;I>=0;I--){var H=J.features[I];E.push({text:this.options.formatSuggestion.call(this,H),magicKey:H.id})}D(G,E.slice(0,this.options.maxResults))}},this);return z},results:function(C,z,A,D){var B=this._resultsQuery;if(z){delete B.params.where;B.featureIds([z])}else{B.where(this._buildQuery(C))}if(A){B.within(A)}return B.run(g.Util.bind(function(F,J){var I=[];for(var H=0;H<J.features.length;H++){var G=J.features[H];if(G){var K=this._featureBounds(G);var E={latlng:K.getCenter(),bounds:K,text:this.options.formatSuggestion.call(this,G),properties:G.properties,geojson:G};I.push(E);delete this._resultsQuery.params.objectIds}}D(F,I)},this))},orderBy:function(A,z){this._suggestionsQuery.orderBy(A,z)},_buildQuery:function(B){var C=[];for(var z=this.options.searchFields.length-1;z>=0;z--){var A='upper("'+this.options.searchFields[z]+'")';C.push(A+" LIKE upper('%"+B+"%')")}if(this.options.where){return this.options.where+" AND ("+C.join(" OR ")+")"}else{return C.join(" OR ")}},_featureBounds:function(B){var A=g.geoJson(B);if(B.geometry.type==="Point"){var z=A.getBounds().getCenter();var D=((this.options.bufferRadius/40075017)*360)/Math.cos((180/Math.PI)*z.lat);var C=(this.options.bufferRadius/40075017)*360;return g.latLngBounds([z.lat-C,z.lng-D],[z.lat+C,z.lng+D])}else{return A.getBounds()}}});function u(z){return new j(z)}var n=w.MapService.extend({options:{layers:[0],label:"Map Service",bufferRadius:1000,maxResults:5,formatSuggestion:function(z){return z.properties[z.displayFieldName]+" <small>"+z.layerName+"</small>"}},initialize:function(z){w.MapService.prototype.initialize.call(this,z);this._getIdFields()},suggestions:function(B,A,C){var z=this.find().text(B).fields(this.options.searchFields).returnGeometry(false).layers(this.options.layers);return z.run(function(J,E,K){var I=[];if(!J){var H=Math.min(this.options.maxResults,E.features.length);K.results=K.results.reverse();for(var F=0;F<H;F++){var L=E.features[F];var M=K.results[F];var G=M.layerId;var D=this._idFields[G];L.layerId=G;L.layerName=this._layerNames[G];L.displayFieldName=this._displayFields[G];if(D){I.push({text:this.options.formatSuggestion.call(this,L),magicKey:M.attributes[D]+":"+G})}}}C(J,I.reverse())},this)},results:function(F,B,D,G){var A=[];var C;if(B){var E=B.split(":")[0];var z=B.split(":")[1];C=this.query().layer(z).featureIds(E)}else{C=this.find().text(F).fields(this.options.searchFields).layers(this.options.layers)}return C.run(function(J,M,I){if(!J){if(I.results){I.results=I.results.reverse()}for(var L=0;L<M.features.length;L++){var K=M.features[L];z=z||I.results[L].layerId;if(K&&z!==undefined){var N=this._featureBounds(K);K.layerId=z;K.layerName=this._layerNames[z];K.displayFieldName=this._displayFields[z];var H={latlng:N.getCenter(),bounds:N,text:this.options.formatSuggestion.call(this,K),properties:K.properties,geojson:K};A.push(H)}}}G(J,A.reverse())},this)},_featureBounds:function(B){var A=g.geoJson(B);if(B.geometry.type==="Point"){var z=A.getBounds().getCenter();var D=((this.options.bufferRadius/40075017)*360)/Math.cos((180/Math.PI)*z.lat);var C=(this.options.bufferRadius/40075017)*360;return g.latLngBounds([z.lat-C,z.lng-D],[z.lat+C,z.lng+D])}else{return A.getBounds()}},_layerMetadataCallback:function(z){return g.Util.bind(function(A,C){if(A){return}this._displayFields[z]=C.displayField;this._layerNames[z]=C.name;for(var B=0;B<C.fields.length;B++){var D=C.fields[B];if(D.type==="esriFieldTypeOID"){this._idFields[z]=D.name;break}}},this)},_getIdFields:function(){this._idFields={};this._displayFields={};this._layerNames={};for(var A=0;A<this.options.layers.length;A++){var z=this.options.layers[A];this.get(z,{},this._layerMetadataCallback(z))}}});function b(z){return new n(z)}var o=c.extend({options:{label:"Geocode Server",maxResults:5},suggestions:function(B,A,C){if(this.options.supportsSuggest){var z=this.suggest().text(B);if(A){z.within(A)}return z.run(function(G,H,F){var D=[];if(!G){while(F.suggestions.length&&D.length<=(this.options.maxResults-1)){var E=F.suggestions.shift();if(!E.isCollection){D.push({text:E.text,magicKey:E.magicKey})}}}C(G,D)},this)}else{C(undefined,[]);return false}},results:function(C,z,B,D){var A=this.geocode().text(C);A.maxLocations(this.options.maxResults);if(B){A.within(B)}return A.run(function(F,E){D(F,E.results)},this)}});function p(z){return new o(z)}var i="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/";y.WorldGeocodingServiceUrl=i;y.VERSION=d;y.Geocode=t;y.geocode=e;y.ReverseGeocode=x;y.reverseGeocode=m;y.Suggest=l;y.suggest=h;y.GeocodeService=c;y.geocodeService=r;y.Geosearch=v;y.geosearch=s;y.GeosearchCore=f;y.geosearchCore=k;y.ArcgisOnlineProvider=q;y.arcgisOnlineProvider=a;y.FeatureLayerProvider=j;y.featureLayerProvider=u;y.MapServiceProvider=n;y.mapServiceProvider=b;y.GeocodeServiceProvider=o;y.geocodeServiceProvider=p}));
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_gis/resources/js/leaflet-esri-gp-2.0.1.min.js	Thu Jul 12 17:40:07 2018 +0200
@@ -0,0 +1,1 @@
+(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?a(exports,require("leaflet"),require("esri-leaflet")):typeof define==="function"&&define.amd?define(["exports","leaflet","esri-leaflet"],a):(a((b.L=b.L||{},b.L.esri=b.L.esri||{},b.L.esri.GP=b.L.esri.GP||{}),b.L,b.L.esri))}(this,function(f,b,g){b="default" in b?b["default"]:b;var c="2.0.1";var e=g.Task.extend({includes:b.Mixin.Events,params:{},resultParams:{},initialize:function(i){g.Task.prototype.initialize.call(this,i);if(!this.options.path){this.options.async=false;this.options.path="execute";this._service.metadata(function(j,k){if(!j){if(k.executionType==="esriExecutionTypeSynchronous"){this.options.async=false;this.options.path="execute"}else{this.options.async=true;this.options.path="submitJob"}this.fire("initialized")}else{this.options.async=false;this.options.path="execute";return}},this)}else{if(this.options.async!==true&&this.options.path!=="submitJob"){this.options.async=false}}},setParam:function(i,j){if(typeof j==="boolean"){this.params[i]=j;return}else{if(typeof j!=="object"){this.params[i]=j;return}else{this._setGeometry(i,j)}}},setOutputParam:function(i){this.params.outputParam=i},gpAsyncResultParam:function(i,j){this.resultParams[i]=j},_setGeometry:function(j,k){var i={geometryType:"",features:[]};if(k instanceof b.LatLngBounds){i.features.push({geometry:b.esri.Util.boundsToExtent(k)});i.geometryType=b.esri.Util.geojsonTypeToArcGIS(k.type)}if(k.getLatLng){k=k.getLatLng()}if(k instanceof b.LatLng){k={type:"Point",coordinates:[k.lng,k.lat]}}if(k instanceof b.GeoJSON){k=k.getLayers()[0].feature.geometry;i.features.push({geometry:g.Util.geojsonToArcGIS(k)});i.geometryType=g.Util.geojsonTypeToArcGIS(k.type)}if(k.toGeoJSON){k=k.toGeoJSON()}if(k.type==="Feature"){k=k.geometry}if(k.type==="Point"||k.type==="LineString"||k.type==="Polygon"){i.features.push({geometry:g.Util.geojsonToArcGIS(k)});i.geometryType=g.Util.geojsonTypeToArcGIS(k.type)}else{if(console&&console.warn){console.warn("invalid geometry passed as GP input. Should be an L.LatLng, L.LatLngBounds, L.Marker or GeoJSON Point Line or Polygon object")}}this.params[j]=i;return},run:function(j,i){this._done=false;if(this.options.async===true){this._service.request(this.options.path,this.params,function(l,k){this._currentJobId=k.jobId;this.checkJob(this._currentJobId,j,i)},this)}else{return this._service.request(this.options.path,this.params,function(l,k){j.call(i,l,(k&&this.processGPOutput(k)),k)},this)}},checkJob:function(i,m,k){var l=function(){this._service.request("jobs/"+i,{},function n(q,o){if(o.jobStatus==="esriJobSucceeded"){if(!this._done){this._done=true;this._service.request("jobs/"+i+"/results/"+this.params.outputParam,this.resultParams,function p(s,r){m.call(k,s,(r&&this.processAsyncOutput(r)),r)},this)}window.clearInterval(j)}else{if(o.jobStatus==="esriJobFailed"){m.call(k,"Job Failed",null);window.clearInterval(j)}}},this)}.bind(this);var j=window.setInterval(l,this._service.options.asyncInterval*1000)},processGPOutput:function(j){var m={};if(this.options.async===false){for(var k=0;k<j.results.length;k++){m[j.results[k].paramName];if(j.results[k].dataType==="GPFeatureRecordSetLayer"){var p=g.Util.responseToFeatureCollection(j.results[k].value);m[j.results[k].paramName]=p}else{m[j.results[k].paramName]=j.results[k].value}}}else{m.jobId=this._currentJobId}if(this.options.async===true&&j.dataType==="GPRasterDataLayer"){var l=this.options.url;var q=l.indexOf("GPServer");var o=l.slice(0,q)+"MapServer/";m.outputMapService=o+"jobs/"+this._currentJobId}return m},processAsyncOutput:function(i){var k={};k.jobId=this._currentJobId;if(this.options.async===true&&i.dataType==="GPRasterDataLayer"){var j=this.options.url;var o=j.indexOf("GPServer");var m=j.slice(0,o)+"MapServer/";k.outputMapService=m+"jobs/"+this._currentJobId}if(i.dataType==="GPFeatureRecordSetLayer"){var l=g.Util.responseToFeatureCollection(i.value);k[i.paramName]=l}else{k[i.paramName]=i.value}return k}});function d(i){return new e(i)}var h=g.Service.extend({options:{asyncInterval:1},createTask:function(){return new e(this,this.options)}});function a(i){return new h(i)}f.VERSION=c;f.Task=e;f.task=d;f.Service=h;f.service=a}));
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_gis/resources/js/leaflet-esri-heatmap-2.0.0.min.js	Thu Jul 12 17:40:07 2018 +0200
@@ -0,0 +1,1 @@
+(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?a(exports,require("leaflet"),require("esri-leaflet")):typeof define==="function"&&define.amd?define(["exports","leaflet","esri-leaflet"],a):(a((b.L=b.L||{},b.L.esri=b.L.esri||{},b.L.esri.Heat=b.L.esri.Heat||{}),b.L,b.L.esri))}(this,function(c,a,d){a="default" in a?a["default"]:a;var b="2.0.0";var f=d.FeatureManager.extend({initialize:function(g){d.FeatureManager.prototype.initialize.call(this,g);g=a.setOptions(this,g);this._cache={};this._active={};this.heat=window.L.heatLayer([],g)},onAdd:function(g){d.FeatureManager.prototype.onAdd.call(this,g);this._map.addLayer(this.heat)},onRemove:function(g){d.FeatureManager.prototype.onRemove.call(this,g);this._map.removeLayer(this.heat)},createLayers:function(j){for(var h=j.length-1;h>=0;h--){var g=j[h];var l=g.id;var k=new a.LatLng(g.geometry.coordinates[1],g.geometry.coordinates[0]);this._cache[l]=k;if(!this._active[l]&&(!this.options.timeField||(this.options.timeField&&this._featureWithinTimeRange(g)))){this._active[l]=k;this.heat._latlngs.push(k)}}this.heat.redraw()},addLayers:function(h){for(var g=h.length-1;g>=0;g--){var k=h[g];if(!this._active[k]){var j=this._cache[k];this.heat._latlngs.push(j);this._active[k]=j}}this.heat.redraw()},removeLayers:function(j,k){var h=[];for(var g=j.length-1;g>=0;g--){var m=j[g];if(this._active[m]){delete this._active[m]}if(this._cache[m]&&k){delete this._cache[m]}}for(var l in this._active){h.push(this._active[l])}this.heat.setLatLngs(h)},setOptions:function(g){this.heat.setOptions(g)},redraw:function(){this.heat.redraw()}});function e(g){return new f(g)}c.FeatureLayer=f;c.featureLayer=e;c["default"]=e;c.VERSION=b}));
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_gis/resources/js/leaflet-esri-renderers-2.0.2.min.js	Thu Jul 12 17:40:07 2018 +0200
@@ -0,0 +1,1 @@
+(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?a(exports,require("leaflet")):typeof define==="function"&&define.amd?define(["exports","leaflet"],a):(a((b.L=b.L||{},b.L.esri=b.L.esri||{},b.L.esri.Renderers=b.L.esri.Renderers||{}),b.L))}(this,function(y,j){j="default" in j?j["default"]:j;var g="2.0.2";var p=j.Class.extend({initialize:function(B,A){this._symbolJson=B;this.val=null;this._styles={};this._isDefault=false;this._layerTransparency=1;if(A&&A.layerTransparency){this._layerTransparency=1-(A.layerTransparency/100)}},pixelValue:function(A){return A*1.333},colorValue:function(A){return"rgb("+A[0]+","+A[1]+","+A[2]+")"},alphaValue:function(A){var B=A[3]/255;return B*this._layerTransparency},getSize:function(L,E){var G=L.properties;var J=E.field;var M=0;var C=null;if(J){C=G[J];var B=E.minSize;var K=E.maxSize;var D=E.minDataValue;var I=E.maxDataValue;var A;var F=E.normalizationField;var H=G?parseFloat(G[F]):undefined;if(C===null||(F&&((isNaN(H)||H===0)))){return null}if(!isNaN(H)){C/=H}if(B!==null&&K!==null&&D!==null&&I!==null){if(C<=D){M=B}else{if(C>=I){M=K}else{A=(C-D)/(I-D);M=B+(A*(K-B))}}}M=isNaN(M)?0:M}return M},getColor:function(E,J){if(!(E.properties&&J&&J.field&&J.stops)){return null}var L=E.properties;var Q=L[J.field];var D,A,F,H;var K=J.normalizationField;var C=L?parseFloat(L[K]):undefined;if(Q===null||(K&&((isNaN(C)||C===0)))){return null}if(!isNaN(C)){Q/=C}if(Q<=J.stops[0].value){return J.stops[0].color}var G=J.stops[J.stops.length-1];if(Q>=G.value){return G.color}for(var N=0;N<J.stops.length;N++){var O=J.stops[N];if(O.value<=Q){D=O.color;F=O.value}else{if(O.value>Q){A=O.color;H=O.value;break}}}if(!isNaN(F)&&!isNaN(H)){var I=H-F;if(I>0){var P=(Q-F)/I;if(P){var R=(H-Q)/I;if(R){var B=[];for(var M=0;M<4;M++){B[M]=Math.round(D[M]*R+A[M]*P)}return B}else{return A}}else{return D}}}return null}});var b=j.Path.extend({initialize:function(C,B,A){j.setOptions(this,A);this._size=B;this._latlng=j.latLng(C);this._svgCanvasIncludes()},_svgCanvasIncludes:function(){},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng)},_update:function(){if(this._map){this._updatePath()}},_updatePath:function(){},setLatLng:function(A){this._latlng=j.latLng(A);this.redraw();return this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setSize:function(A){this._size=A;return this.redraw()},getSize:function(){return this._size}});var m=b.extend({initialize:function(C,B,A){b.prototype.initialize.call(this,C,B,A)},_updatePath:function(){this._renderer._updateCrossMarker(this)},_svgCanvasIncludes:function(){j.Canvas.include({_updateCrossMarker:function(B){var D=B._point;var C=B._size/2;var A=this._ctx;A.beginPath();A.moveTo(D.x,D.y+C);A.lineTo(D.x,D.y-C);this._fillStroke(A,B);A.moveTo(D.x-C,D.y);A.lineTo(D.x+C,D.y);this._fillStroke(A,B)}});j.SVG.include({_updateCrossMarker:function(A){var D=A._point;var C=A._size/2;if(j.Browser.vml){D._round();C=Math.round(C)}var B="M"+D.x+","+(D.y+C)+"L"+D.x+","+(D.y-C)+"M"+(D.x-C)+","+D.y+"L"+(D.x+C)+","+D.y;this._setPath(A,B)}})}});var w=function(C,B,A){return new m(C,B,A)};var o=b.extend({initialize:function(C,B,A){b.prototype.initialize.call(this,C,B,A)},_updatePath:function(){this._renderer._updateXMarker(this)},_svgCanvasIncludes:function(){j.Canvas.include({_updateXMarker:function(B){var D=B._point;var C=B._size/2;var A=this._ctx;A.beginPath();A.moveTo(D.x+C,D.y+C);A.lineTo(D.x-C,D.y-C);this._fillStroke(A,B)}});j.SVG.include({_updateXMarker:function(A){var D=A._point;var C=A._size/2;if(j.Browser.vml){D._round();C=Math.round(C)}var B="M"+(D.x+C)+","+(D.y+C)+"L"+(D.x-C)+","+(D.y-C)+"M"+(D.x-C)+","+(D.y+C)+"L"+(D.x+C)+","+(D.y-C);this._setPath(A,B)}})}});var a=function(C,B,A){return new o(C,B,A)};var u=b.extend({options:{fill:true},initialize:function(C,B,A){b.prototype.initialize.call(this,C,B,A)},_updatePath:function(){this._renderer._updateSquareMarker(this)},_svgCanvasIncludes:function(){j.Canvas.include({_updateSquareMarker:function(B){var D=B._point;var C=B._size/2;var A=this._ctx;A.beginPath();A.moveTo(D.x+C,D.y+C);A.lineTo(D.x-C,D.y+C);A.lineTo(D.x-C,D.y-C);A.lineTo(D.x+C,D.y-C);A.closePath();this._fillStroke(A,B)}});j.SVG.include({_updateSquareMarker:function(A){var D=A._point;var C=A._size/2;if(j.Browser.vml){D._round();C=Math.round(C)}var B="M"+(D.x+C)+","+(D.y+C)+"L"+(D.x-C)+","+(D.y+C)+"L"+(D.x-C)+","+(D.y-C)+"L"+(D.x+C)+","+(D.y-C);B=B+(j.Browser.svg?"z":"x");this._setPath(A,B)}})}});var d=function(C,B,A){return new u(C,B,A)};var n=b.extend({options:{fill:true},initialize:function(C,B,A){b.prototype.initialize.call(this,C,B,A)},_updatePath:function(){this._renderer._updateDiamondMarker(this)},_svgCanvasIncludes:function(){j.Canvas.include({_updateDiamondMarker:function(B){var D=B._point;var C=B._size/2;var A=this._ctx;A.beginPath();A.moveTo(D.x,D.y+C);A.lineTo(D.x-C,D.y);A.lineTo(D.x,D.y-C);A.lineTo(D.x+C,D.y);A.closePath();this._fillStroke(A,B)}});j.SVG.include({_updateDiamondMarker:function(A){var D=A._point;var C=A._size/2;if(j.Browser.vml){D._round();C=Math.round(C)}var B="M"+D.x+","+(D.y+C)+"L"+(D.x-C)+","+D.y+"L"+D.x+","+(D.y-C)+"L"+(D.x+C)+","+D.y;B=B+(j.Browser.svg?"z":"x");this._setPath(A,B)}})}});var v=function(C,B,A){return new n(C,B,A)};var r=p.extend({statics:{MARKERTYPES:["esriSMSCircle","esriSMSCross","esriSMSDiamond","esriSMSSquare","esriSMSX","esriPMS"]},initialize:function(C,B){p.prototype.initialize.call(this,C,B);if(B){this.serviceUrl=B.url}if(C){if(C.type==="esriPMS"){var A=this.serviceUrl+"images/"+this._symbolJson.url;this._iconUrl=B&&B.token?A+"?token="+B.token:A;this._icons={};this.icon=this._createIcon(this._symbolJson)}else{this._fillStyles()}}},_fillStyles:function(){if(this._symbolJson.outline&&this._symbolJson.size>0){this._styles.stroke=true;this._styles.weight=this.pixelValue(this._symbolJson.outline.width);this._styles.color=this.colorValue(this._symbolJson.outline.color);this._styles.opacity=this.alphaValue(this._symbolJson.outline.color)}else{this._styles.stroke=false}if(this._symbolJson.color){this._styles.fillColor=this.colorValue(this._symbolJson.color);this._styles.fillOpacity=this.alphaValue(this._symbolJson.color)}else{this._styles.fillOpacity=0}if(this._symbolJson.style==="esriSMSCircle"){this._styles.radius=this.pixelValue(this._symbolJson.size)/2}},_createIcon:function(B){var E=this.pixelValue(B.width);var A=E;if(B.height){A=this.pixelValue(B.height)}var D=E/2;var F=A/2;if(B.xoffset){D+=this.pixelValue(B.xoffset)}if(B.yoffset){F+=this.pixelValue(B.yoffset)}var C=j.icon({iconUrl:this._iconUrl,iconSize:[E,A],iconAnchor:[D,F]});this._icons[B.width.toString()]=C;return C},_getIcon:function(A){var B=this._icons[A.toString()];if(!B){B=this._createIcon({width:A})}return B},pointToLayer:function(C,H,E,B){var D=this._symbolJson.size||this._symbolJson.width;if(!this._isDefault){if(E.sizeInfo){var G=this.getSize(C,E.sizeInfo);if(G){D=G}}if(E.colorInfo){var A=this.getColor(C,E.colorInfo);if(A){this._styles.fillColor=this.colorValue(A);this._styles.fillOpacity=this.alphaValue(A)}}}if(this._symbolJson.type==="esriPMS"){var F=j.extend({},{icon:this._getIcon(D)},B);return j.marker(H,F)}D=this.pixelValue(D);switch(this._symbolJson.style){case"esriSMSSquare":return d(H,D,j.extend({},this._styles,B));case"esriSMSDiamond":return v(H,D,j.extend({},this._styles,B));case"esriSMSCross":return w(H,D,j.extend({},this._styles,B));case"esriSMSX":return a(H,D,j.extend({},this._styles,B))}this._styles.radius=D/2;return j.circleMarker(H,j.extend({},this._styles,B))}});function l(B,A){return new r(B,A)}var s=p.extend({statics:{LINETYPES:["esriSLSDash","esriSLSDot","esriSLSDashDotDot","esriSLSDashDot","esriSLSSolid"]},initialize:function(B,A){p.prototype.initialize.call(this,B,A);this._fillStyles()},_fillStyles:function(){this._styles.lineCap="butt";this._styles.lineJoin="miter";this._styles.fill=false;this._styles.weight=0;if(!this._symbolJson){return this._styles}if(this._symbolJson.color){this._styles.color=this.colorValue(this._symbolJson.color);this._styles.opacity=this.alphaValue(this._symbolJson.color)}if(!isNaN(this._symbolJson.width)){this._styles.weight=this.pixelValue(this._symbolJson.width);var A=[];switch(this._symbolJson.style){case"esriSLSDash":A=[4,3];break;case"esriSLSDot":A=[1,3];break;case"esriSLSDashDot":A=[8,3,1,3];break;case"esriSLSDashDotDot":A=[8,3,1,3,1,3];break}if(A.length>0){for(var B=0;B<A.length;B++){A[B]*=this._styles.weight}this._styles.dashArray=A.join(",")}}},style:function(B,C){if(!this._isDefault&&C){if(C.sizeInfo){var D=this.pixelValue(this.getSize(B,C.sizeInfo));if(D){this._styles.weight=D}}if(C.colorInfo){var A=this.getColor(B,C.colorInfo);if(A){this._styles.color=this.colorValue(A);this._styles.opacity=this.alphaValue(A)}}}return this._styles}});function i(B,A){return new s(B,A)}var z=p.extend({statics:{POLYGONTYPES:["esriSFSSolid"]},initialize:function(B,A){p.prototype.initialize.call(this,B,A);if(B){this._lineStyles=i(B.outline,A).style();this._fillStyles()}},_fillStyles:function(){if(this._lineStyles){if(this._lineStyles.weight===0){this._styles.stroke=false}else{for(var A in this._lineStyles){this._styles[A]=this._lineStyles[A]}}}if(this._symbolJson){if(this._symbolJson.color&&z.POLYGONTYPES.indexOf(this._symbolJson.style>=0)){this._styles.fill=true;this._styles.fillColor=this.colorValue(this._symbolJson.color);this._styles.fillOpacity=this.alphaValue(this._symbolJson.color)}else{this._styles.fill=false;this._styles.fillOpacity=0}}},style:function(B,C){if(!this._isDefault&&C&&C.colorInfo){var A=this.getColor(B,C.colorInfo);if(A){this._styles.fillColor=this.colorValue(A);this._styles.fillOpacity=this.alphaValue(A)}}return this._styles}});function f(B,A){return new z(B,A)}var t=j.Class.extend({options:{proportionalPolygon:false,clickable:true},initialize:function(B,A){this._rendererJson=B;this._pointSymbols=false;this._symbols=[];this._visualVariables=this._parseVisualVariables(B.visualVariables);j.Util.setOptions(this,A)},_parseVisualVariables:function(C){var A={};if(C){for(var B=0;B<C.length;B++){A[C[B].type]=C[B]}}return A},_createDefaultSymbol:function(){if(this._rendererJson.defaultSymbol){this._defaultSymbol=this._newSymbol(this._rendererJson.defaultSymbol);this._defaultSymbol._isDefault=true}},_newSymbol:function(A){if(A.type==="esriSMS"||A.type==="esriPMS"){this._pointSymbols=true;return l(A,this.options)}if(A.type==="esriSLS"){return i(A,this.options)}if(A.type==="esriSFS"){return f(A,this.options)}},_getSymbol:function(){},attachStylesToLayer:function(A){if(this._pointSymbols){A.options.pointToLayer=j.Util.bind(this.pointToLayer,this)}else{A.options.style=j.Util.bind(this.style,this);A._originalStyle=A.options.style}},pointToLayer:function(B,C){var A=this._getSymbol(B);if(A&&A.pointToLayer){return A.pointToLayer(B,C,this._visualVariables,this.options)}return j.circleMarker(C,{radius:0,opacity:0})},style:function(B){var C;if(this.options.userDefinedStyle){C=this.options.userDefinedStyle(B)}var A=this._getSymbol(B);if(A){return this.mergeStyles(A.style(B,this._visualVariables),C)}else{return this.mergeStyles({opacity:0,fillOpacity:0},C)}},mergeStyles:function(C,D){var B={};var A;for(A in C){if(C.hasOwnProperty(A)){B[A]=C[A]}}if(D){for(A in D){if(D.hasOwnProperty(A)){B[A]=D[A]}}}return B}});var x=t.extend({initialize:function(B,A){t.prototype.initialize.call(this,B,A);this._createSymbol()},_createSymbol:function(){if(this._rendererJson.symbol){this._symbols.push(this._newSymbol(this._rendererJson.symbol))}},_getSymbol:function(){return this._symbols[0]}});function k(B,A){return new x(B,A)}var e=t.extend({initialize:function(B,A){t.prototype.initialize.call(this,B,A);this._field=this._rendererJson.field;if(this._rendererJson.normalizationType&&this._rendererJson.normalizationType==="esriNormalizeByField"){this._normalizationField=this._rendererJson.normalizationField}this._createSymbols()},_createSymbols:function(){var C;var A=this._rendererJson.classBreakInfos;this._symbols=[];for(var B=A.length-1;B>=0;B--){if(this.options.proportionalPolygon&&this._rendererJson.backgroundFillSymbol){C=this._newSymbol(this._rendererJson.backgroundFillSymbol)}else{C=this._newSymbol(A[B].symbol)}C.val=A[B].classMaxValue;this._symbols.push(C)}this._symbols.sort(function(E,D){return E.val>D.val?1:-1});this._createDefaultSymbol();this._maxValue=this._symbols[this._symbols.length-1].val},_getSymbol:function(C){var E=C.properties[this._field];if(this._normalizationField){var A=C.properties[this._normalizationField];if(!isNaN(A)&&A!==0){E=E/A}else{return this._defaultSymbol}}if(E>this._maxValue){return this._defaultSymbol}var D=this._symbols[0];for(var B=this._symbols.length-1;B>=0;B--){if(E>this._symbols[B].val){break}D=this._symbols[B]}return D}});function c(B,A){return new e(B,A)}var h=t.extend({initialize:function(B,A){t.prototype.initialize.call(this,B,A);this._field=this._rendererJson.field1;this._createSymbols()},_createSymbols:function(){var B;var C=this._rendererJson.uniqueValueInfos;for(var A=C.length-1;A>=0;A--){B=this._newSymbol(C[A].symbol);B.val=C[A].value;this._symbols.push(B)}this._createDefaultSymbol()},_getSymbol:function(B){var F=B.properties[this._field];if(this._rendererJson.fieldDelimiter&&this._rendererJson.field2){var D=B.properties[this._rendererJson.field2];if(D){F+=this._rendererJson.fieldDelimiter+D;var C=B.properties[this._rendererJson.field3];if(C){F+=this._rendererJson.fieldDelimiter+C}}}var E=this._defaultSymbol;for(var A=this._symbols.length-1;A>=0;A--){if(this._symbols[A].val==F){E=this._symbols[A]}}return E}});function q(B,A){return new h(B,A)}j.esri.FeatureLayer.addInitHook(function(){if(this.options.ignoreRenderer){return}var A=j.Util.bind(this.onAdd,this);var C=j.Util.bind(this.unbindPopup,this);var B=j.Util.bind(this.onRemove,this);j.Util.bind(this.createNewLayer,this);this.metadata(function(E,D){if(E){return}if(D&&D.drawingInfo){this._setRenderers(D)}if(this._alreadyAdded){this.setStyle(this._originalStyle)}},this);this.onAdd=function(D){A(D);this._addPointLayer(D);this._alreadyAdded=true};this.onRemove=function(F){B(F);if(this._pointLayer){var D=this._pointLayer.getLayers();for(var E in D){F.removeLayer(D[E])}}};this.unbindPopup=function(){C();if(this._pointLayer){var D=this._pointLayer.getLayers();for(var E in D){D[E].unbindPopup()}}};this._addPointLayer=function(D){if(this._pointLayer){this._pointLayer.addTo(D);this._pointLayer.bringToFront()}};this._createPointLayer=function(){if(!this._pointLayer){this._pointLayer=j.geoJson();this._pointLayerIds={};if(this._popup){var D=function(F,E){E.bindPopup(this._popup(F,E),this._popupOptions)};this._pointLayer.options.onEachFeature=j.Util.bind(D,this)}}};this.createNewLayer=function(E){var H=j.GeoJSON.geometryToLayer(E,this.options);if(this._hasProportionalSymbols){var F=this.getPolygonCentroid(E.geometry.coordinates);if(!(isNaN(F[0])||isNaN(F[0]))){this._createPointLayer();var G=E.id.toString();if(!this._pointLayerIds[G]){var D=this.getPointJson(E,F);this._pointLayer.addData(D);this._pointLayerIds[G]=true}this._pointLayer.bringToFront()}}return H};this.getPolygonCentroid=function(K){var N=K[0][0];if(N.length===2){N=K[0]}var G=0;var J=0;var I=0;var D=N.length;var M;var L;var H;for(var F=0,E=D-1;F<D;E=F++){M=N[F];L=N[E];G+=M[0]*L[1];G-=M[1]*L[0];H=M[0]*L[1]-L[0]*M[1];J+=(M[0]+L[0])*H;I+=(M[1]+L[1])*H}H=G*3;return[J/H,I/H]};this.getPointJson=function(D,E){return{type:"Feature",properties:D.properties,id:D.id,geometry:{type:"Point",coordinates:[E[0],E[1]]}}};this._checkForProportionalSymbols=function(D,F){this._hasProportionalSymbols=false;if(D==="esriGeometryPolygon"){if(F.backgroundFillSymbol){this._hasProportionalSymbols=true}if(F.classBreakInfos&&F.classBreakInfos.length){var E=F.classBreakInfos[0].symbol;if(E&&(E.type==="esriSMS"||E.type==="esriPMS")){this._hasProportionalSymbols=true}}}};this._setRenderers=function(F){var D;var G=F.drawingInfo.renderer;var E={url:this.options.url};if(this.options.token){E.token=this.options.token}if(this.options.pane){E.pane=this.options.pane}if(F.drawingInfo.transparency){E.layerTransparency=F.drawingInfo.transparency}if(this.options.style){E.userDefinedStyle=this.options.style}switch(G.type){case"classBreaks":this._checkForProportionalSymbols(F.geometryType,G);if(this._hasProportionalSymbols){this._createPointLayer();var H=c(G,E);H.attachStylesToLayer(this._pointLayer);E.proportionalPolygon=true}D=c(G,E);break;case"uniqueValue":D=q(G,E);break;default:D=k(G,E)}D.attachStylesToLayer(this)}});y.VERSION=g;y.Renderer=t;y.SimpleRenderer=x;y.simpleRenderer=k;y.ClassBreaksRenderer=e;y.classBreaksRenderer=c;y.UniqueValueRenderer=h;y.uniqueValueRenderer=q;y.Symbol=p;y.PointSymbol=r;y.pointSymbol=l;y.LineSymbol=s;y.lineSymbol=i;y.PolygonSymbol=z;y.polygonSymbol=f}));
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_gis/resources/js/leaflet-esri-vector-1.0.6.min.js	Thu Jul 12 17:40:07 2018 +0200
@@ -0,0 +1,1 @@
+(function(b,a){typeof exports==="object"&&typeof module!=="undefined"?a(exports,require("leaflet"),require("esri-leaflet")):typeof define==="function"&&define.amd?define(["exports","leaflet","esri-leaflet"],a):(a((b.L=b.L||{},b.L.esri=b.L.esri||{},b.L.esri.Vector=b.L.esri.Vector||{}),b.L,b.L.esri))}(this,function(c,j,i){j="default" in j?j["default"]:j;var g="1.0.6";(function(l){if(typeof c==="object"&&typeof module!=="undefined"){module.exports=l()}else{if(typeof define==="function"&&define.amd){define([],l)}else{var k;if(typeof window!=="undefined"){k=window}else{if(typeof global!=="undefined"){k=global}else{if(typeof self!=="undefined"){k=self}else{k=this}}}k.mapboxgl=l()}}})(function(){var n,l,k;return(function m(q,z,v){function u(B,t){if(!z[B]){if(!q[B]){var s=typeof require=="function"&&require;if(!t&&s){return s(B,!0)}if(p){return p(B,!0)}var A=new Error("Cannot find module '"+B+"'");throw A.code="MODULE_NOT_FOUND",A}var r=z[B]={exports:{}};q[B][0].call(r.exports,function(o){var C=q[B][1][o];return u(C?C:o)},r,r.exports,m,q,z,v)}return z[B].exports}var p=typeof require=="function"&&require;for(var w=0;w<v.length;w++){u(v[w])}return u})({1:[function(p,q,o){function r(s){s?(this.array=s.array,this.pos=s.pos):(this.array=new ArrayBuffer(this.defaultLength),this.length=this.defaultLength,this.setupViews())}q.exports=r,r.prototype={pos:0,itemSize:4,defaultLength:8192,arrayType:"ARRAY_BUFFER",get indexfunction(){return this.pos/this.itemSize},setupViews:function(){this.ubytes=new Uint8Array(this.array),this.bytes=new Int8Array(this.array),this.ushorts=new Uint16Array(this.array),this.shorts=new Int16Array(this.array)},bind:function(s){var u=s[this.arrayType];this.buffer?s.bindBuffer(u,this.buffer):(this.buffer=s.createBuffer(),s.bindBuffer(u,this.buffer),s.bufferData(u,this.array.slice(0,this.pos),s.STATIC_DRAW),this.array=null)},destroy:function(s){this.buffer&&s.deleteBuffer(this.buffer)},resize:function(){if(this.length<this.pos+this.itemSize){for(;this.length<this.pos+this.itemSize;){this.length=2*Math.round(1.5*this.length/2)}this.array=new ArrayBuffer(this.length);var s=new Uint8Array(this.array);s.set(this.ubytes),this.setupViews()}}}},{}],2:[function(t,s,v){var o=t("./line_vertex_buffer"),z=t("./line_element_buffer"),p=t("./fill_vertex_buffer"),q=t("./triangle_element_buffer"),E=t("./outline_element_buffer"),r=t("./glyph_vertex_buffer"),w=t("./triangle_element_buffer"),u=t("./icon_vertex_buffer"),A=t("./triangle_element_buffer"),D=t("./collision_box_vertex_buffer"),C=t("./circle_vertex_buffer"),B=t("./triangle_element_buffer");s.exports=function(F){return F=F||{},{glyphVertex:new r(F.glyphVertex),glyphElement:new w(F.glyphElement),iconVertex:new u(F.iconVertex),iconElement:new A(F.iconElement),circleVertex:new C(F.circleVertex),circleElement:new B(F.circleElement),fillVertex:new p(F.fillVertex),fillElement:new q(F.fillElement),outlineElement:new E(F.outlineElement),lineVertex:new o(F.lineVertex),lineElement:new z(F.lineElement),collisionBoxVertex:new D(F.collisionBoxVertex)}}},{"./circle_vertex_buffer":3,"./collision_box_vertex_buffer":4,"./fill_vertex_buffer":5,"./glyph_vertex_buffer":6,"./icon_vertex_buffer":7,"./line_element_buffer":8,"./line_vertex_buffer":9,"./outline_element_buffer":10,"./triangle_element_buffer":11}],3:[function(q,r,p){function s(u){t.call(this,u)}var o=q("../../util/util"),t=q("./buffer");r.exports=s,s.prototype=o.inherit(t,{defaultLength:32768,itemSize:4,add:function(B,v,u,z){var A=this.pos,w=A/2;this.resize(),this.shorts[w+0]=2*B+(u+1)/2,this.shorts[w+1]=2*v+(z+1)/2,this.pos+=this.itemSize},bind:function(w,v,u){t.prototype.bind.call(this,w),w.vertexAttribPointer(v.a_pos,2,w.SHORT,!1,this.itemSize,u+0)}})},{"../../util/util":106,"./buffer":1}],4:[function(q,r,p){function t(u){s.call(this,u)}var o=q("../../util/util"),s=q("./buffer");r.exports=t,t.prototype=o.inherit(s,{itemSize:12,defaultLength:32768,add:function(z,w,C,B){var A=this.pos,D=A/2,v=this.index;return this.resize(),this.shorts[D+0]=z.x,this.shorts[D+1]=z.y,this.shorts[D+2]=Math.round(w.x),this.shorts[D+3]=Math.round(w.y),this.ubytes[A+8]=Math.floor(10*C),this.ubytes[A+9]=Math.floor(10*B),this.pos+=this.itemSize,v}})},{"../../util/util":106,"./buffer":1}],5:[function(q,r,p){function t(u){s.call(this,u)}var o=q("../../util/util"),s=q("./buffer");r.exports=t,t.prototype=o.inherit(s,{itemSize:4,add:function(w,v){var u=this.pos/2;this.resize(),this.shorts[u+0]=w,this.shorts[u+1]=v,this.pos+=this.itemSize}})},{"../../util/util":106,"./buffer":1}],6:[function(q,r,p){function t(u){s.call(this,u)}var o=q("../../util/util"),s=q("./buffer");r.exports=t,t.prototype=o.inherit(s,{defaultLength:32768,itemSize:16,add:function(G,D,v,A,H,B,w,C,F){var E=this.pos,z=E/2;this.resize(),this.shorts[z+0]=G,this.shorts[z+1]=D,this.shorts[z+2]=Math.round(64*v),this.shorts[z+3]=Math.round(64*A),this.ubytes[E+8]=Math.floor(H/4),this.ubytes[E+9]=Math.floor(B/4),this.ubytes[E+10]=Math.floor(10*F),this.ubytes[E+12]=Math.floor(10*w),this.ubytes[E+13]=Math.floor(10*Math.min(C,25)),this.pos+=this.itemSize},bind:function(v,z,w){s.prototype.bind.call(this,v);var u=this.itemSize;v.vertexAttribPointer(z.a_pos,2,v.SHORT,!1,u,w+0),v.vertexAttribPointer(z.a_offset,2,v.SHORT,!1,u,w+4),v.vertexAttribPointer(z.a_data1,4,v.UNSIGNED_BYTE,!1,u,w+8),v.vertexAttribPointer(z.a_data2,2,v.UNSIGNED_BYTE,!1,u,w+12)}})},{"../../util/util":106,"./buffer":1}],7:[function(q,r,p){function s(u){t.call(this,u)}var o=q("../../util/util"),t=q("./buffer");r.exports=s,s.prototype=o.inherit(t,{defaultLength:32768,itemSize:16,add:function(G,D,A,v,H,w,B,F,C){var E=this.pos,z=E/2;this.resize(),this.shorts[z+0]=G,this.shorts[z+1]=D,this.shorts[z+2]=Math.round(64*A),this.shorts[z+3]=Math.round(64*v),this.ubytes[E+8]=H/4,this.ubytes[E+9]=w/4,this.ubytes[E+10]=Math.floor(10*(C||0)),this.ubytes[E+12]=Math.floor(10*(B||0)),this.ubytes[E+13]=Math.floor(10*Math.min(F||25,25)),this.pos+=this.itemSize},bind:function(v,z,u){t.prototype.bind.call(this,v);var w=this.itemSize;v.vertexAttribPointer(z.a_pos,2,v.SHORT,!1,w,u+0),v.vertexAttribPointer(z.a_offset,2,v.SHORT,!1,w,u+4),v.vertexAttribPointer(z.a_data1,4,v.UNSIGNED_BYTE,!1,w,u+8),v.vertexAttribPointer(z.a_data2,2,v.UNSIGNED_BYTE,!1,w,u+12)}})},{"../../util/util":106,"./buffer":1}],8:[function(q,r,p){function s(u){t.call(this,u)}var o=q("../../util/util"),t=q("./buffer");r.exports=s,s.prototype=o.inherit(t,{itemSize:6,arrayType:"ELEMENT_ARRAY_BUFFER",add:function(z,v,u){var w=this.pos/2;this.resize(),this.ushorts[w+0]=z,this.ushorts[w+1]=v,this.ushorts[w+2]=u,this.pos+=this.itemSize}})},{"../../util/util":106,"./buffer":1}],9:[function(q,r,p){function t(u){s.call(this,u)}var o=q("../../util/util"),s=q("./buffer");r.exports=t,t.extrudeScale=63,t.prototype=o.inherit(s,{itemSize:8,defaultLength:32768,add:function(C,E,v,z,F){var D=this.pos,B=D/2,A=this.index,w=t.extrudeScale;return this.resize(),this.shorts[B+0]=2*Math.floor(C.x)|v,this.shorts[B+1]=2*Math.floor(C.y)|z,this.bytes[D+4]=Math.round(w*E.x),this.bytes[D+5]=Math.round(w*E.y),this.bytes[D+6]=(F||0)/128,this.bytes[D+7]=(F||0)%128,this.pos+=this.itemSize,A}})},{"../../util/util":106,"./buffer":1}],10:[function(q,r,p){function s(u){t.call(this,u)}var o=q("../../util/util"),t=q("./buffer");r.exports=s,s.prototype=o.inherit(t,{itemSize:4,arrayType:"ELEMENT_ARRAY_BUFFER",add:function(w,v){var u=this.pos/2;this.resize(),this.ushorts[u+0]=w,this.ushorts[u+1]=v,this.pos+=this.itemSize}})},{"../../util/util":106,"./buffer":1}],11:[function(r,s,q){function p(u){t.call(this,u)}var o=r("../../util/util"),t=r("./buffer");s.exports=p,p.prototype=o.inherit(t,{itemSize:6,arrayType:"ELEMENT_ARRAY_BUFFER",add:function(z,v,u){var w=this.pos/2;this.resize(),this.ushorts[w+0]=z,this.ushorts[w+1]=v,this.ushorts[w+2]=u,this.pos+=this.itemSize}})},{"../../util/util":106,"./buffer":1}],12:[function(q,r,p){function o(t){this.buffers=t,this.elementGroups=new s(t.circleVertex,t.circleElement)}var s=q("./element_groups");r.exports=o,o.prototype.addFeatures=function(){for(var D=4096,C=0;C<this.features.length;C++){for(var A=this.features[C].loadGeometry()[0],B=0;B<A.length;B++){this.elementGroups.makeRoomFor(6);var w=A[B].x,z=A[B].y;if(!(0>w||w>=D||0>z||z>=D)){var v=this.buffers.circleVertex.index-this.elementGroups.current.vertexStartIndex;this.buffers.circleVertex.add(w,z,-1,-1),this.buffers.circleVertex.add(w,z,1,-1),this.buffers.circleVertex.add(w,z,1,1),this.buffers.circleVertex.add(w,z,-1,1),this.elementGroups.elementBuffer.add(v,v+1,v+2),this.elementGroups.elementBuffer.add(v,v+3,v+2),this.elementGroups.current.vertexLength+=4,this.elementGroups.current.elementLength+=2}}}}},{"./element_groups":14}],13:[function(r,q,t){function u(G,K,F,B,E){var H=new s("layout",G.type,G.layout,{}).values(),I={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0},J={};for(var C in H){J[C]=H[C].calculate(F,I)}"symbol"===G.type&&(H["text-size"]&&(J["text-max-size"]=H["text-size"].calculate(18,I),J["text-size"]=H["text-size"].calculate(F+1,I)),H["icon-size"]&&(J["icon-max-size"]=H["icon-size"].calculate(18,I),J["icon-size"]=H["icon-size"].calculate(F+1,I)));var M="line"===G.type?A:"fill"===G.type?v:"symbol"===G.type?w:"circle"===G.type?p:null,D=new M(K,new z[G.type](J),B,F,E);return D.id=G.id,D.type=G.type,D["source-layer"]=G["source-layer"],D.interactive=G.interactive,D.minZoom=G.minzoom,D.maxZoom=G.maxzoom,D.filter=o(G.filter),D.features=[],D}q.exports=u;var A=r("./line_bucket"),v=r("./fill_bucket"),w=r("./symbol_bucket"),p=r("./circle_bucket"),z=r("../style/layout_properties"),o=r("feature-filter"),s=r("../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":108}],14:[function(p,q,o){function r(v,u,w){this.vertexBuffer=v,this.elementBuffer=u,this.secondElementBuffer=w,this.groups=[]}function s(v,u,w){this.vertexStartIndex=v,this.elementStartIndex=u,this.secondElementStartIndex=w,this.elementLength=0,this.vertexLength=0,this.secondElementLength=0}q.exports=r,r.prototype.makeRoomFor=function(t){(!this.current||this.current.vertexLength+t>65535)&&(this.current=new s(this.vertexBuffer.index,this.elementBuffer&&this.elementBuffer.index,this.secondElementBuffer&&this.secondElementBuffer.index),this.groups.push(this.current))}},{}],15:[function(u,q,G){function s(I,J){this.x=I.x,this.y=I.y,this.z=I.z-Math.log(J)/Math.LN2,this.rtree=w(9),this.toBeInserted=[]}function C(I,J,K){return"Point"===J?p(I,K):"LineString"===J?F(I,K):"Polygon"===J?A(I,K)||F(I,K):!1}function A(I,J){return r(I,new E(J[0],J[1]))||r(I,new E(J[0],J[3]))||r(I,new E(J[2],J[1]))||r(I,new E(J[2],J[3]))?!0:F(I,J)}function F(R,O){for(var K=0;K<R.length;K++){for(var I=R[K],J=0,N=I.length-1;J<I.length;N=J++){var S=I[J],P=I[N],Q=new E(S.y,S.x),M=new E(P.y,P.x);if(v(S,P,O[0],O[2],O[1])||v(S,P,O[0],O[2],O[3])||v(Q,M,O[1],O[3],O[0])||v(Q,M,O[1],O[3],O[2])){return !0}}}return p(R,O)}function v(J,N,P,M,O){if(N.y===J.y){return N.y===O&&Math.min(J.x,N.x)<=M&&Math.max(J.x,N.x)>=P}var I=(O-J.y)/(N.y-J.y),K=J.x+I*(N.x-J.x);return K>=P&&M>=K&&1>=I&&I>=0}function p(I,K){for(var N=0;N<I.length;N++){for(var J=I[N],M=0;M<J.length;M++){if(J[M].x>=K[0]&&J[M].y>=K[1]&&J[M].x<=K[2]&&J[M].y<=K[3]){return !0}}}return !1}function t(I,K,M,J){return"Point"===K?D(I,M,J):"LineString"===K?B(I,M,J):"Polygon"===K?r(I,M)||B(I,M,J):!1}function H(I,K,N){var J=K.distSqr(N);if(0===J){return I.distSqr(K)}var M=((I.x-K.x)*(N.x-K.x)+(I.y-K.y)*(N.y-K.y))/J;return 0>M?I.distSqr(K):M>1?I.distSqr(N):I.distSqr(N.sub(K)._mult(M)._add(K))}function B(Q,N,K){for(var I=K*K,J=0;J<Q.length;J++){for(var M=Q[J],R=1;R<M.length;R++){var O=M[R-1],P=M[R];if(H(N,O,P)<I){return !0}}}return !1}function r(Q,N){for(var K,I,J,M=!1,R=0;R<Q.length;R++){K=Q[R];for(var O=0,P=K.length-1;O<K.length;P=O++){I=K[O],J=K[P],I.y>N.y!=J.y>N.y&&N.x<(J.x-I.x)*(N.y-I.y)/(J.y-I.y)+I.x&&(M=!M)}}return M}function D(J,N,P){for(var M=P*P,O=0;O<J.length;O++){for(var I=J[O],K=0;K<I.length;K++){if(I[K].distSqr(N)<=M){return !0}}}return !1}var w=u("rbush"),E=u("point-geometry"),z=u("vector-tile"),o=u("../util/util");q.exports=s,s.prototype.insert=function(I,J,K){I.layers=J,I.feature=K,this.toBeInserted.push(I)},s.prototype._load=function(){this.rtree.load(this.toBeInserted),this.toBeInserted=[]},s.prototype.query=function(X,R){this.toBeInserted.length&&this._load();var K,I,J=X.params||{},N=X.x,Y=X.y,V=[];"undefined"!=typeof N&&"undefined"!=typeof Y?(K=(J.radius||0)*(X.tileExtent||4096)/X.scale,I=[N-K,Y-K,N+K,Y+K]):I=[X.minX,X.minY,X.maxX,X.maxY];for(var W=this.rtree.search(I),M=0;M<W.length;M++){var T=W[M].feature,U=W[M].layers,Q=z.VectorTileFeature.types[T.type];if((!J.$type||Q===J.$type)&&(!K||t(T.loadGeometry(),Q,new E(N,Y),K))&&C(T.loadGeometry(),Q,I)){var O=T.toGeoJSON(this.x,this.y,this.z);J.includeGeometry||(O.geometry=null);for(var S=0;S<U.length;S++){var P=U[S];J.layerIds&&J.layerIds.indexOf(P)<0||V.push(o.extend({layer:P},O))}}}R(null,V)}},{"../util/util":106,"point-geometry":137,rbush:139,"vector-tile":144}],16:[function(p,q,o){function r(t){this.buffers=t,this.elementGroups=new s(t.fillVertex,t.fillElement,t.outlineElement)}var s=p("./element_groups");q.exports=r,r.prototype.addFeatures=function(){for(var z=this.features,v=0;v<z.length;v++){var u=z[v],w=u.loadGeometry();w&&this.addFeature(w)}},r.prototype.addFeature=function(v){for(var u=0;u<v.length;u++){this.addFill(v[u])}},r.prototype.addFill=function(C){if(!(C.length<3)){var G=C.length;this.elementGroups.makeRoomFor(G+1);for(var A,v,z,B=this.elementGroups.current,w=this.buffers.fillVertex,F=this.buffers.fillElement,H=this.buffers.outlineElement,D=w.index-B.vertexStartIndex,E=0;E<C.length;E++){v=w.index-B.vertexStartIndex,z=C[E],w.add(z.x,z.y),B.vertexLength++,E>=2&&(z.x!==C[0].x||z.y!==C[0].y)&&(F.add(D,A,v),B.elementLength++),E>=1&&(H.add(A,v),B.secondElementLength++),A=v}}}},{"./element_groups":14}],17:[function(q,r,p){function o(v,u){this.buffers=v,this.elementGroups=new s(v.lineVertex,v.lineElement),this.layoutProperties=u}var s=q("./element_groups");r.exports=o,o.prototype.addFeatures=function(){for(var z=this.features,v=0;v<z.length;v++){var w=z[v],u=w.loadGeometry();u&&this.addFeature(u)}},o.prototype.addFeature=function(w){for(var u=this.layoutProperties,v=0;v<w.length;v++){this.addLine(w[v],u["line-join"],u["line-cap"],u["line-miter-limit"],u["line-round-limit"])}},o.prototype.addLine=function(am,W,Z,ai,X){for(var ae=am.length;ae>2&&am[ae-1].equals(am[ae-2]);){ae--}if(!(am.length<2)){"bevel"===W&&(ai=1.05);var T=am[0],aj=am[ae-1],an=T.equals(aj);if(this.elementGroups.makeRoomFor(10*ae),2!==ae||!an){var aq,ag,ad,al,af,ac,N,Q=Z,ao=an?"butt":Z,w=1,ap=0,ar=!0;this.e1=this.e2=this.e3=-1,an&&(aq=am[ae-2],af=T.sub(aq)._unit()._perp());for(var J=0;ae>J;J++){if(ad=an&&J===ae-1?am[1]:am[J+1],!ad||!am[J].equals(ad)){af&&(al=af),aq&&(ag=aq),aq=am[J],ag&&(ap+=aq.dist(ag)),af=ad?ad.sub(aq)._unit()._perp():al,al=al||af;var H=al.add(af)._unit(),Y=H.x*af.x+H.y*af.y,ak=1/Y,ah=ag&&ad,O=ah?W:ad?Q:ao;if(ah&&"round"===O&&(X>ak?O="miter":2>=ak&&(O="fakeround")),"miter"===O&&ak>ai&&(O="bevel"),"bevel"===O&&(ak>2&&(O="flipbevel"),ai>ak&&(O="miter")),"miter"===O){H._mult(ak),this.addCurrentVertex(aq,w,ap,H,0,0,!1)}else{if("flipbevel"===O){if(ak>100){H=af.clone()}else{var ab=al.x*af.y-al.y*af.x>0?-1:1,aa=ak*al.add(af).mag()/al.sub(af).mag();H._perp()._mult(aa*ab)}this.addCurrentVertex(aq,w,ap,H,0,0,!1),w=-w}else{if("bevel"===O||"fakeround"===O){var A=w*(al.x*af.y-al.y*af.x)>0,z=-Math.sqrt(ak*ak-1);if(A?(N=0,ac=z):(ac=0,N=z),ar||this.addCurrentVertex(aq,w,ap,al,ac,N,!1),"fakeround"===O){for(var U,R=Math.floor(8*(0.5-(Y-0.5))),K=0;R>K;K++){U=af.mult((K+1)/(R+1))._add(al)._unit(),this.addPieSliceVertex(aq,w,ap,U,A)}this.addPieSliceVertex(aq,w,ap,H,A);for(var D=R-1;D>=0;D--){U=al.mult((D+1)/(R+1))._add(af)._unit(),this.addPieSliceVertex(aq,w,ap,U,A)}}ad&&this.addCurrentVertex(aq,w,ap,af,-ac,-N,!1)}else{"butt"===O?(ar||this.addCurrentVertex(aq,w,ap,al,0,0,!1),ad&&this.addCurrentVertex(aq,w,ap,af,0,0,!1)):"square"===O?(ar||(this.addCurrentVertex(aq,w,ap,al,1,1,!1),this.e1=this.e2=-1,w=1),ad&&this.addCurrentVertex(aq,w,ap,af,-1,-1,!1)):"round"===O&&(ar||(this.addCurrentVertex(aq,w,ap,al,0,0,!1),this.addCurrentVertex(aq,w,ap,al,1,1,!0),this.e1=this.e2=-1,w=1),ad&&(this.addCurrentVertex(aq,w,ap,af,-1,-1,!0),this.addCurrentVertex(aq,w,ap,af,0,0,!1)))}}}ar=!1}}}}},o.prototype.addCurrentVertex=function(E,I,v,B,J,z,H){var C,F=H?1:0,G=this.buffers.lineVertex,A=this.buffers.lineElement,w=this.elementGroups.current,D=this.elementGroups.current.vertexStartIndex;C=B.mult(I),J&&C._sub(B.perp()._mult(J)),this.e3=G.add(E,C,F,0,v)-D,this.e1>=0&&this.e2>=0&&(A.add(this.e1,this.e2,this.e3),w.elementLength++),this.e1=this.e2,this.e2=this.e3,C=B.mult(-I),z&&C._sub(B.perp()._mult(z)),this.e3=G.add(E,C,F,1,v)-D,this.e1>=0&&this.e2>=0&&(A.add(this.e1,this.e2,this.e3),w.elementLength++),this.e1=this.e2,this.e2=this.e3,w.vertexLength+=2},o.prototype.addPieSliceVertex=function(B,F,v,z,G){var w=this.buffers.lineVertex,E=this.buffers.lineElement,A=this.elementGroups.current,C=this.elementGroups.current.vertexStartIndex,D=G;z=z.mult(F*(G?-1:1)),this.e3=w.add(B,z,0,D,v)-C,A.vertexLength+=1,this.e1>=0&&this.e2>=0&&(E.add(this.e1,this.e2,this.e3),A.elementLength++),G?this.e2=this.e3:this.e1=this.e3}},{"./element_groups":14}],18:[function(A,q,K){function E(Q,O,R,N,P){this.buffers=Q,this.layoutProperties=O,this.overscaling=R,this.zoom=N,this.collisionDebug=P;var S=512*R,M=4096;this.tilePixelRatio=M/S,this.compareText={},this.symbolInstances=[]}function o(S,W,N,Q,X,O,U,P,M,T,R,V){this.x=S.x,this.y=S.y,this.hasText=!!N,this.hasIcon=!!Q,this.hasText&&(this.glyphQuads=O?B(S,N,U,W,X,M):[],this.textCollisionFeature=new H(W,S,N,U,P,M)),this.hasIcon&&(this.iconQuads=O?s(S,Q,T,W,X,V):[],this.iconCollisionFeature=new H(W,S,Q,T,R,V))}var t=A("./element_groups"),G=A("../symbol/anchor"),v=A("../symbol/get_anchors"),I=A("../util/token"),F=A("../symbol/quads"),u=A("../symbol/shaping"),p=A("../symbol/resolve_text"),w=A("../symbol/resolve_icons"),C=A("../symbol/mergelines"),z=u.shapeText,D=u.shapeIcon,B=F.getGlyphQuads,s=F.getIconQuads,r=A("../symbol/clip_line"),J=A("point-geometry"),H=A("../symbol/collision_feature");q.exports=E,E.prototype.needsPlacement=!0,E.prototype.addFeatures=function(ac){var Q=this.layoutProperties,U=this.features,Y=this.textFeatures,R=0.5,V=0.5;switch(Q["text-anchor"]){case"right":case"top-right":case"bottom-right":R=1;break;case"left":case"top-left":case"bottom-left":R=0}switch(Q["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":V=1;break;case"top":case"top-right":case"top-left":V=0}for(var ag="right"===Q["text-justify"]?1:"left"===Q["text-justify"]?0:0.5,X=24,S=Q["text-line-height"]*X,ae="line"!==Q["symbol-placement"]?Q["text-max-width"]*X:0,Z=Q["text-letter-spacing"]*X,P=[Q["text-offset"][0]*X,Q["text-offset"][1]*X],W=Q["text-font"].join(","),T=[],N=0;N<U.length;N++){T.push(U[N].loadGeometry())}if("line"===Q["symbol-placement"]){var M=C(U,Y,T);T=M.geometries,U=M.features,Y=M.textFeatures}for(var ad,aa,ab=0;ab<U.length;ab++){if(T[ab]){if(ad=Y[ab]?z(Y[ab],this.stacks[W],ae,S,R,V,ag,Z,P):null,Q["icon-image"]){var af=I(U[ab].properties,Q["icon-image"]),O=this.icons[af];aa=D(O,Q),O&&(void 0===this.sdfIcons?this.sdfIcons=O.sdf:this.sdfIcons!==O.sdf&&console.warn("Style sheet warning: Cannot mix SDF and non-SDF icons in one bucket"))}else{aa=null}(ad||aa)&&this.addFeature(T[ab],ad,aa)}}this.placeFeatures(ac,this.buffers,this.collisionDebug)},E.prototype.addFeature=function(al,Y,ac){var ah=this.layoutProperties,Z=24,ad=ah["text-size"]/Z,ap=this.tilePixelRatio*ad,af=this.tilePixelRatio*ah["text-max-size"]/Z,aa=this.tilePixelRatio*ah["icon-size"],an=this.tilePixelRatio*ah["symbol-spacing"],ai=ah["symbol-avoid-edges"],X=ah["text-padding"]*this.tilePixelRatio,ae=ah["icon-padding"]*this.tilePixelRatio,ab=ah["text-max-angle"]/180*Math.PI,U="map"===ah["text-rotation-alignment"]&&"line"===ah["symbol-placement"],R="map"===ah["icon-rotation-alignment"]&&"line"===ah["symbol-placement"],am=ah["text-allow-overlap"]||ah["icon-allow-overlap"]||ah["text-ignore-placement"]||ah["icon-ignore-placement"],aj="line"===ah["symbol-placement"],ak=an/2;aj&&(al=r(al,0,0,4096,4096));for(var ao=0;ao<al.length;ao++){for(var V=al[ao],T=aj?v(V,an,ab,Y,ac,Z,af,this.overscaling):[new G(V[0].x,V[0].y,0)],N=0,W=T.length;W>N;N++){var O=T[N];if(!(Y&&aj&&this.anchorIsTooClose(Y.text,ak,O))){var Q=!(O.x<0||O.x>4096||O.y<0||O.y>4096);if(!ai||Q){var ag=Q||am;this.symbolInstances.push(new o(O,V,Y,ac,ah,ag,ap,X,U,aa,ae,R))}}}}},E.prototype.anchorIsTooClose=function(P,N,Q){var M=this.compareText;if(P in M){for(var O=M[P],R=O.length-1;R>=0;R--){if(Q.dist(O[R])<N){return !0}}}else{M[P]=[]}return M[P].push(Q),!1},E.prototype.placeFeatures=function(ab,P,T){this.buffers=P;var X=this.elementGroups={text:new t(P.glyphVertex,P.glyphElement),icon:new t(P.iconVertex,P.iconElement),sdfIcons:this.sdfIcons},Q=this.layoutProperties,U=ab.maxScale;X.text["text-size"]=Q["text-size"],X.icon["icon-size"]=Q["icon-size"];var af="map"===Q["text-rotation-alignment"]&&"line"===Q["symbol-placement"],W="map"===Q["icon-rotation-alignment"]&&"line"===Q["symbol-placement"],R=Q["text-allow-overlap"]||Q["icon-allow-overlap"]||Q["text-ignore-placement"]||Q["icon-ignore-placement"];if(R){var ad=ab.angle,Y=Math.sin(ad),O=Math.cos(ad);this.symbolInstances.sort(function(ai,ah){var aj=Y*ai.x+O*ai.y,ag=Y*ah.x+O*ah.y;return ag-aj})}for(var V=0;V<this.symbolInstances.length;V++){var S=this.symbolInstances[V],N=S.hasText,M=S.hasIcon,ac=Q["text-optional"]||!N,Z=Q["icon-optional"]||!M,aa=N&&!Q["text-allow-overlap"]?ab.placeCollisionFeature(S.textCollisionFeature):ab.minScale,ae=M&&!Q["icon-allow-overlap"]?ab.placeCollisionFeature(S.iconCollisionFeature):ab.minScale;ac||Z?!Z&&aa?aa=Math.max(ae,aa):!ac&&ae&&(ae=Math.max(ae,aa)):ae=aa=Math.max(ae,aa),N&&(Q["text-ignore-placement"]||ab.insertCollisionFeature(S.textCollisionFeature,aa),U>=aa&&this.addSymbols(P.glyphVertex,P.glyphElement,X.text,S.glyphQuads,aa,Q["text-keep-upright"],af,ab.angle)),M&&(Q["icon-ignore-placement"]||ab.insertCollisionFeature(S.iconCollisionFeature,ae),U>=ae&&this.addSymbols(P.iconVertex,P.iconElement,X.icon,S.iconQuads,ae,Q["icon-keep-upright"],W,ab.angle))}T&&this.addToDebugBuffers(ab)},E.prototype.addSymbols=function(ag,U,Y,ac,V,Z,ak,ab){Y.makeRoomFor(4*ac.length);for(var W=Y.current,ai=this.zoom,ad=Math.max(Math.log(V)/Math.LN2+ai,0),T=0;T<ac.length;T++){var aa=ac[T],X=aa.angle,P=(X+ab+Math.PI)%(2*Math.PI);if(!(Z&&ak&&(P<=Math.PI/2||P>3*Math.PI/2))){var N=aa.tl,ah=aa.tr,ae=aa.bl,af=aa.br,aj=aa.tex,Q=aa.anchorPoint,O=Math.max(ai+Math.log(aa.minScale)/Math.LN2,ad),M=Math.min(ai+Math.log(aa.maxScale)/Math.LN2,25);if(!(O>=M)){O===ad&&(O=0);var R=ag.index-W.vertexStartIndex;ag.add(Q.x,Q.y,N.x,N.y,aj.x,aj.y,O,M,ad),ag.add(Q.x,Q.y,ah.x,ah.y,aj.x+aj.w,aj.y,O,M,ad),ag.add(Q.x,Q.y,ae.x,ae.y,aj.x,aj.y+aj.h,O,M,ad),ag.add(Q.x,Q.y,af.x,af.y,aj.x+aj.w,aj.y+aj.h,O,M,ad),W.vertexLength+=4,U.add(R,R+1,R+2),U.add(R+1,R+2,R+3),W.elementLength+=2}}}},E.prototype.getDependencies=function(P,N,Q){function M(R){return R||O?Q(R):void (O=!0)}var O=!1;this.getTextDependencies(P,N,M),this.getIconDependencies(P,N,M)},E.prototype.getIconDependencies=function(P,N,Q){function M(T,S){return T?Q(T):(this.icons=S,void Q())}if(this.layoutProperties["icon-image"]){var O=this.features,R=w(O,this.layoutProperties);R.length?N.send("get icons",{icons:R},M.bind(this)):Q()}else{Q()}},E.prototype.getTextDependencies=function(R,P,S){var O=this.features,Q=this.layoutProperties["text-font"],T=this.stacks=R.stacks;void 0===T[Q]&&(T[Q]={});var N=T[Q],M=p(O,this.layoutProperties,N);this.textFeatures=M.textFeatures,P.send("get glyphs",{uid:R.uid,fontstack:Q,codepoints:M.codepoints},function(W,V){if(W){return S(W)}for(var U in V){N[U]=V[U]}S()})},E.prototype.addToDebugBuffers=function(U){this.elementGroups.collisionBox=new t(this.buffers.collisionBoxVertex),this.elementGroups.collisionBox.makeRoomFor(0);for(var ab=this.buffers.collisionBoxVertex,O=-U.angle,S=U.yStretch,ac=0;ac<this.symbolInstances.length;ac++){for(var P=0;2>P;P++){var Z=this.symbolInstances[ac][0===P?"textCollisionFeature":"iconCollisionFeature"];if(Z){for(var R=Z.boxes,M=0;M<R.length;M++){var W=R[M],T=W.anchorPoint,aa=new J(W.x1,W.y1*S)._rotate(O),Q=new J(W.x2,W.y1*S)._rotate(O),N=new J(W.x1,W.y2*S)._rotate(O),Y=new J(W.x2,W.y2*S)._rotate(O),X=Math.max(0,Math.min(25,this.zoom+Math.log(W.maxScale)/Math.LN2)),V=Math.max(0,Math.min(25,this.zoom+Math.log(W.placementScale)/Math.LN2));ab.add(T,aa,X,V),ab.add(T,Q,X,V),ab.add(T,Q,X,V),ab.add(T,Y,X,V),ab.add(T,Y,X,V),ab.add(T,N,X,V),ab.add(T,N,X,V),ab.add(T,aa,X,V),this.elementGroups.collisionBox.current.vertexLength+=8}}}}}},{"../symbol/anchor":62,"../symbol/clip_line":65,"../symbol/collision_feature":67,"../symbol/get_anchors":69,"../symbol/mergelines":72,"../symbol/quads":73,"../symbol/resolve_icons":74,"../symbol/resolve_text":75,"../symbol/shaping":76,"../util/token":105,"./element_groups":14,"point-geometry":137}],19:[function(p,q,o){function r(u,s,v){this.column=u,this.row=s,this.zoom=v}q.exports=r,r.prototype={clone:function(){return new r(this.column,this.row,this.zoom)},zoomTo:function(s){return this.clone()._zoomTo(s)},sub:function(s){return this.clone()._sub(s)},_zoomTo:function(u){var s=Math.pow(2,u-this.zoom);return this.column*=s,this.row*=s,this.zoom=u,this},_sub:function(s){return s=s.zoomTo(this.zoom),this.column-=s.column,this.row-=s.row,this}}},{}],20:[function(p,q,o){function s(u,v){if(isNaN(u)||isNaN(v)){throw new Error("Invalid LngLat object: ("+u+", "+v+")")}if(this.lng=+u,this.lat=+v,this.lat>90||this.lat<-90){throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}}q.exports=s;var r=p("../util/util").wrap;s.prototype.wrap=function(){return new s(r(this.lng,-180,180),this.lat)},s.convert=function(u){return u instanceof s?u:Array.isArray(u)?new s(u[0],u[1]):u}},{"../util/util":106}],21:[function(p,q,o){function r(v,A){if(v){for(var z=A?[v,A]:v,w=0,u=z.length;u>w;w++){this.extend(z[w])}}}q.exports=r;var s=p("./lng_lat");r.prototype={extend:function(v){var A,z,w=this._sw,u=this._ne;if(v instanceof s){A=v,z=v}else{if(!(v instanceof r)){return v?this.extend(s.convert(v)||r.convert(v)):this}if(A=v._sw,z=v._ne,!A||!z){return this}}return w||u?(w.lng=Math.min(A.lng,w.lng),w.lat=Math.min(A.lat,w.lat),u.lng=Math.max(z.lng,u.lng),u.lat=Math.max(z.lat,u.lat)):(this._sw=new s(A.lng,A.lat),this._ne=new s(z.lng,z.lat)),this},getCenter:function(){return new s((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 s(this.getWest(),this.getNorth())},getSouthEast:function(){return new s(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}},r.convert=function(u){return !u||u instanceof r?u:new r(u)}},{"./lng_lat":20}],22:[function(r,q,t){function s(C,B){this.tileSize=512,this._minZoom=C||0,this._maxZoom=B||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this.zoom=0,this.center=new w(0,0),this.angle=0,this._altitude=1.5,this._pitch=0}var w=r("./lng_lat"),v=r("point-geometry"),z=r("./coordinate"),p=r("../util/util").wrap,A=r("../util/interpolate"),u=r("gl-matrix").vec4,o=r("gl-matrix").mat4;q.exports=s,s.prototype={get minZoomfunction(){return this._minZoom},set minZoomfunction(B){this._minZoom=B,this.zoom=Math.max(this.zoom,B)},get maxZoomfunction(){return this._maxZoom},set maxZoomfunction(B){this._maxZoom=B,this.zoom=Math.min(this.zoom,B)},get worldSizefunction(){return this.tileSize*this.scale},get centerPointfunction(){return this.size._div(2)},get sizefunction(){return new v(this.width,this.height)},get bearingfunction(){return -this.angle/Math.PI*180},set bearingfunction(B){this.angle=-p(B,-180,180)*Math.PI/180},get pitchfunction(){return this._pitch/Math.PI*180},set pitchfunction(B){this._pitch=Math.min(60,B)/180*Math.PI},get altitudefunction(){return this._altitude},set altitudefunction(B){this._altitude=Math.max(0.75,B)},get zoomfunction(){return this._zoom},set zoomfunction(B){B=Math.min(Math.max(B,this.minZoom),this.maxZoom),this._zoom=B,this.scale=this.zoomScale(B),this.tileZoom=Math.floor(B),this.zoomFraction=B-this.tileZoom,this._constrain()},get centerfunction(){return this._center},set centerfunction(B){this._center=B,this._constrain()},zoomScale:function(B){return Math.pow(2,B)},scaleZoom:function(B){return Math.log(B)/Math.LN2},project:function(C,B){return new v(this.lngX(C.lng,B),this.latY(C.lat,B))},unproject:function(C,B){return new w(this.xLng(C.x,B),this.yLat(C.y,B))},get xfunction(){return this.lngX(this.center.lng)},get yfunction(){return this.latY(this.center.lat)},get pointfunction(){return new v(this.x,this.y)},lngX:function(C,B){return(180+C)*(B||this.worldSize)/360},latY:function(C,B){var D=180/Math.PI*Math.log(Math.tan(Math.PI/4+C*Math.PI/360));return(180-D)*(B||this.worldSize)/360},xLng:function(C,B){return 360*C/(B||this.worldSize)-180},yLat:function(C,B){var D=180-360*C/(B||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(D*Math.PI/180))-90},panBy:function(C){var B=this.centerPoint._add(C);this.center=this.pointLocation(B)},setLocationAtPoint:function(D,C){var G=this.locationCoordinate(D),F=this.pointCoordinate(C),E=this.pointCoordinate(this.centerPoint),B=F._sub(G);this.center=this.coordinateLocation(E._sub(B))},setZoomAround:function(C,B){var D;B&&(D=this.locationPoint(B)),this.zoom=C,B&&this.setLocationAtPoint(B,D)},setBearingAround:function(C,B){var D;B&&(D=this.locationPoint(B)),this.bearing=C,B&&this.setLocationAtPoint(B,D)},locationPoint:function(B){return this.coordinatePoint(this.locationCoordinate(B))},pointLocation:function(B){return this.coordinateLocation(this.pointCoordinate(B))},locationCoordinate:function(C){var B=this.zoomScale(this.tileZoom)/this.worldSize,D=w.convert(C);return new z(this.lngX(D.lng)*B,this.latY(D.lat)*B,this.tileZoom)},coordinateLocation:function(C){var B=this.zoomScale(C.zoom);return new w(this.xLng(C.column,B),this.yLat(C.row,B))},pointCoordinate:function(P,G){void 0===G&&(G=0);var D=this.coordinatePointMatrix(this.tileZoom),C=o.invert(new Float64Array(16),D);if(!C){throw new Error("failed to invert matrix")}var K=u.transformMat4([],[P.x,P.y,0,1],C),N=u.transformMat4([],[P.x,P.y,1,1],C),B=K[3],H=N[3],Q=K[0]/B,M=N[0]/H,O=K[1]/B,F=N[1]/H,E=K[2]/B,I=N[2]/H,J=E===I?0:(G-E)/(I-E);return new z(A(Q,M,J),A(O,F,J),this.tileZoom)},coordinatePoint:function(C){var B=this.coordinatePointMatrix(C.zoom),D=u.transformMat4([],[C.column,C.row,0,1],B);return new v(D[0]/D[3],D[1]/D[3])},coordinatePointMatrix:function(C){var B=this.getProjMatrix(),D=this.worldSize/this.zoomScale(C);return o.scale(B,B,[D,D,1]),o.multiply(B,this.getPixelMatrix(),B),B},getPixelMatrix:function(){var B=o.create();return o.scale(B,B,[this.width/2,-this.height/2,1]),o.translate(B,B,[1,-1,0]),B},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var O,G,D,C,J,M,B,H,P=this.size;this.latRange&&(O=this.latY(this.latRange[1]),G=this.latY(this.latRange[0]),J=G-O<P.y?P.y/(G-O):0),this.lngRange&&(D=this.lngX(this.lngRange[0]),C=this.lngX(this.lngRange[1]),M=C-D<P.x?P.x/(C-D):0);var K=Math.max(M||0,J||0);if(K){return this.center=this.unproject(new v(M?(C+D)/2:this.x,J?(G+O)/2:this.y)),this.zoom+=this.scaleZoom(K),void (this._constraining=!1)}if(this.latRange){var N=this.y,F=P.y/2;O>N-F&&(H=O+F),N+F>G&&(H=G-F)}if(this.lngRange){var E=this.x,I=P.x/2;D>E-I&&(B=D+I),E+I>C&&(B=C-I)}(void 0!==B||void 0!==H)&&(this.center=this.unproject(new v(void 0!==B?B:this.x,void 0!==H?H:this.y))),this._constraining=!1}},getProjMatrix:function(){var C=new Float64Array(16),B=Math.atan(0.5/this.altitude),E=Math.sin(B)*this.altitude/Math.sin(Math.PI/2-this._pitch-B),D=Math.cos(Math.PI/2-this._pitch)*E+this.altitude;return o.perspective(C,2*Math.atan(this.height/2/this.altitude),this.width/this.height,0.1,D),o.translate(C,C,[0,0,-this.altitude]),o.scale(C,C,[1,-1,1/this.height]),o.rotateX(C,C,this._pitch),o.rotateZ(C,C,this.angle),o.translate(C,C,[-this.x,-this.y,0]),C}}},{"../util/interpolate":102,"../util/util":106,"./coordinate":19,"./lng_lat":20,"gl-matrix":116,"point-geometry":137}],23:[function(q,r,p){var o={" ":[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]]};r.exports=function(B,A,I,F){F=F||1;var v,z,H,J,C,G,E,w,D=[];for(v=0,z=B.length;z>v;v++){if(C=o[B[v]]){for(w=null,H=0,J=C[1].length;J>H;H+=2){-1===C[1][H]&&-1===C[1][H+1]?w=null:(G=A+C[1][H]*F,E=I-C[1][H+1]*F,w&&D.push(w.x,w.y,G,E),w={x:G,y:E})}A+=C[0]*F}}return D}},{}],24:[function(q,r,o){var t=r.exports={};t.Map=q("./ui/map"),t.Control=q("./ui/control/control"),t.Navigation=q("./ui/control/navigation"),t.Attribution=q("./ui/control/attribution"),t.Popup=q("./ui/popup"),t.GeoJSONSource=q("./source/geojson_source"),t.VideoSource=q("./source/video_source"),t.ImageSource=q("./source/image_source"),t.Style=q("./style/style"),t.LngLat=q("./geo/lng_lat"),t.LngLatBounds=q("./geo/lng_lat_bounds"),t.Point=q("point-geometry"),t.Evented=q("./util/evented"),t.util=q("./util/util"),t.supported=q("./util/browser").supported;var s=q("./util/ajax");t.util.getJSON=s.getJSON,t.util.getArrayBuffer=s.getArrayBuffer;var p=q("./util/config");t.config=p,Object.defineProperty(t,"accessToken",{get:function(){return p.ACCESS_TOKEN},set:function(u){p.ACCESS_TOKEN=u}})},{"./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(p,r,o){function s(N,J,v){var G,E=N.gl,z=J.paint["background-color"],A=J.paint["background-pattern"],C=J.paint["background-opacity"],M=A?N.spriteAtlas.getPosition(A.from,!0):null,B=A?N.spriteAtlas.getPosition(A.to,!0):null;if(M&&B){G=N.patternShader,E.switchShader(G,v),E.uniform1i(G.u_image,0),E.uniform2fv(G.u_pattern_tl_a,M.tl),E.uniform2fv(G.u_pattern_br_a,M.br),E.uniform2fv(G.u_pattern_tl_b,B.tl),E.uniform2fv(G.u_pattern_br_b,B.br),E.uniform1f(G.u_opacity,C);var I=N.transform,F=M.size,O=B.size,K=I.locationCoordinate(I.center),D=1/Math.pow(2,I.zoomFraction);E.uniform1f(G.u_mix,A.t);var H=q.create();q.scale(H,H,[1/(F[0]*A.fromScale),1/(F[1]*A.fromScale)]),q.translate(H,H,[K.column*I.tileSize%(F[0]*A.fromScale),K.row*I.tileSize%(F[1]*A.fromScale)]),q.rotate(H,H,-I.angle),q.scale(H,H,[D*I.width/2,-D*I.height/2]);var w=q.create();q.scale(w,w,[1/(O[0]*A.toScale),1/(O[1]*A.toScale)]),q.translate(w,w,[K.column*I.tileSize%(O[0]*A.toScale),K.row*I.tileSize%(O[1]*A.toScale)]),q.rotate(w,w,-I.angle),q.scale(w,w,[D*I.width/2,-D*I.height/2]),E.uniformMatrix3fv(G.u_patternmatrix_a,!1,H),E.uniformMatrix3fv(G.u_patternmatrix_b,!1,w),N.spriteAtlas.bind(E,!0)}else{G=N.fillShader,E.switchShader(G,v),E.uniform4fv(G.u_color,z)}E.disable(E.STENCIL_TEST),E.bindBuffer(E.ARRAY_BUFFER,N.backgroundBuffer),E.vertexAttribPointer(G.a_pos,N.backgroundBuffer.itemSize,E.SHORT,!1,0,0),E.drawArrays(E.TRIANGLE_STRIP,0,N.backgroundBuffer.itemCount),E.enable(E.STENCIL_TEST),E.stencilMask(0),E.stencilFunc(E.EQUAL,128,128)}var q=p("gl-matrix").mat3;r.exports=s},{"gl-matrix":116}],26:[function(r,s,p){function o(E,v,C,I){if(I.buffers){C=E.translateMatrix(C,I,v.paint["circle-translate"],v.paint["circle-translate-anchor"]);var K=I.elementGroups[v.ref||v.id];if(K){var A=E.gl;A.disable(A.STENCIL_TEST),A.switchShader(E.circleShader,C,I.exMatrix);var G=I.buffers.circleVertex,z=E.circleShader,M=I.buffers.circleElement,J=1/q.devicePixelRatio/v.paint["circle-radius"];A.uniform4fv(z.u_color,v.paint["circle-color"]),A.uniform1f(z.u_blur,Math.max(v.paint["circle-blur"],J)),A.uniform1f(z.u_size,v.paint["circle-radius"]);for(var w=0;w<K.groups.length;w++){var D=K.groups[w],F=D.vertexStartIndex*G.itemSize;G.bind(A,z,F),M.bind(A,z,F);var B=3*D.elementLength,H=D.elementStartIndex*M.itemSize;A.drawElements(A.TRIANGLES,B,A.UNSIGNED_SHORT,H)}A.enable(A.STENCIL_TEST)}}}var q=r("../util/browser.js");s.exports=o},{"../util/browser.js":95}],27:[function(p,q,o){function r(v,C,w,G){var E=G.elementGroups[C.ref||C.id].collisionBox;if(E){var B=v.gl,z=G.buffers.collisionBoxVertex,H=v.collisionBoxShader;B.enable(B.STENCIL_TEST),B.switchShader(H,w),z.bind(B,H),B.lineWidth(1);var F=12;B.vertexAttribPointer(H.a_pos,2,B.SHORT,!1,F,0),B.vertexAttribPointer(H.a_extrude,2,B.SHORT,!1,F,4),B.vertexAttribPointer(H.a_data,2,B.UNSIGNED_BYTE,!1,F,8),B.uniform1f(H.u_scale,Math.pow(2,v.transform.zoom-G.coord.z)),B.uniform1f(H.u_zoom,10*v.transform.zoom),B.uniform1f(H.u_maxzoom,10*(G.coord.z+1));var D=E.groups[0].vertexStartIndex,A=E.groups[0].vertexLength;B.drawArrays(B.LINES,D,A),B.disable(B.STENCIL_TEST)}}q.exports=r},{}],28:[function(r,s,p){function o(z,w){var v=z.gl;v.blendFunc(v.ONE,v.ONE_MINUS_SRC_ALPHA),v.switchShader(z.debugShader,w.posMatrix),v.bindBuffer(v.ARRAY_BUFFER,z.debugBuffer),v.vertexAttribPointer(z.debugShader.a_pos,z.debugBuffer.itemSize,v.SHORT,!1,0,0),v.uniform4f(z.debugShader.u_color,1,0,0,1),v.lineWidth(4),v.drawArrays(v.LINE_STRIP,0,z.debugBuffer.itemCount);var u=t(w.coord.toString(),50,200,5);v.bindBuffer(v.ARRAY_BUFFER,z.debugTextBuffer),v.bufferData(v.ARRAY_BUFFER,new Int16Array(u),v.STREAM_DRAW),v.vertexAttribPointer(z.debugShader.a_pos,z.debugTextBuffer.itemSize,v.SHORT,!1,0,0),v.lineWidth(8*q.devicePixelRatio),v.uniform4f(z.debugShader.u_color,1,1,1,1),v.drawArrays(v.LINES,0,u.length/z.debugTextBuffer.itemSize),v.lineWidth(2*q.devicePixelRatio),v.uniform4f(z.debugShader.u_color,0,0,0,1),v.drawArrays(v.LINES,0,u.length/z.debugTextBuffer.itemSize),v.blendFunc(v.ONE_MINUS_DST_ALPHA,v.ONE)}var t=r("../lib/debugtext"),q=r("../util/browser");s.exports=o},{"../lib/debugtext":23,"../util/browser":95}],29:[function(q,s,o){function t(W,G,I,Q){if(Q.buffers){var aa=Q.elementGroups[G.ref||G.id];if(aa){var P,N,M,V,H=W.gl,D=W.translateMatrix(I,Q,G.paint["fill-translate"],G.paint["fill-translate-anchor"]),Y=G.paint["fill-color"];H.stencilMask(63),H.clear(H.STENCIL_BUFFER_BIT),H.stencilFunc(H.NOTEQUAL,128,128),H.stencilOpSeparate(H.FRONT,H.INCR_WRAP,H.KEEP,H.KEEP),H.stencilOpSeparate(H.BACK,H.DECR_WRAP,H.KEEP,H.KEEP),H.colorMask(!1,!1,!1,!1),H.switchShader(W.fillShader,D),P=Q.buffers.fillVertex,P.bind(H),N=Q.buffers.fillElement,N.bind(H);for(var O,w,F=0;F<aa.groups.length;F++){M=aa.groups[F],O=M.vertexStartIndex*P.itemSize,H.vertexAttribPointer(W.fillShader.a_pos,2,H.SHORT,!1,4,O+0),V=3*M.elementLength,w=M.elementStartIndex*N.itemSize,H.drawElements(H.TRIANGLES,V,H.UNSIGNED_SHORT,w)}H.colorMask(!0,!0,!0,!0),H.stencilOp(H.KEEP,H.KEEP,H.KEEP),H.stencilMask(0);var X=G.paint["fill-outline-color"];if(G.paint["fill-antialias"]===!0&&(!G.paint["fill-pattern"]||X)){H.switchShader(W.outlineShader,D),H.lineWidth(2*p.devicePixelRatio),X?H.stencilFunc(H.EQUAL,128,128):H.stencilFunc(H.EQUAL,128,191),H.uniform2f(W.outlineShader.u_world,H.drawingBufferWidth,H.drawingBufferHeight),H.uniform4fv(W.outlineShader.u_color,X?X:Y),P=Q.buffers.fillVertex,N=Q.buffers.outlineElement,N.bind(H);for(var K=0;K<aa.groups.length;K++){M=aa.groups[K],O=M.vertexStartIndex*P.itemSize,H.vertexAttribPointer(W.outlineShader.a_pos,2,H.SHORT,!1,4,O+0),V=2*M.secondElementLength,w=M.secondElementStartIndex*N.itemSize,H.drawElements(H.LINES,V,H.UNSIGNED_SHORT,w)}}var ab,T=G.paint["fill-pattern"],C=G.paint["fill-opacity"]||1;if(T){var B=W.spriteAtlas.getPosition(T.from,!0),Z=W.spriteAtlas.getPosition(T.to,!0);if(!B||!Z){return}ab=W.patternShader,H.switchShader(ab,I),H.uniform1i(ab.u_image,0),H.uniform2fv(ab.u_pattern_tl_a,B.tl),H.uniform2fv(ab.u_pattern_br_a,B.br),H.uniform2fv(ab.u_pattern_tl_b,Z.tl),H.uniform2fv(ab.u_pattern_br_b,Z.br),H.uniform1f(ab.u_opacity,C),H.uniform1f(ab.u_mix,T.t);var J=Q.tileExtent/Q.tileSize/Math.pow(2,W.transform.tileZoom-Q.coord.z),z=r.create();r.scale(z,z,[1/(B.size[0]*J*T.fromScale),1/(B.size[1]*J*T.fromScale)]);var U=r.create();r.scale(U,U,[1/(Z.size[0]*J*T.toScale),1/(Z.size[1]*J*T.toScale)]),H.uniformMatrix3fv(ab.u_patternmatrix_a,!1,z),H.uniformMatrix3fv(ab.u_patternmatrix_b,!1,U),W.spriteAtlas.bind(H,!0)}else{ab=W.fillShader,H.switchShader(ab,I),H.uniform4fv(ab.u_color,Y)}H.stencilFunc(H.NOTEQUAL,0,63),H.bindBuffer(H.ARRAY_BUFFER,W.tileExtentBuffer),H.vertexAttribPointer(ab.a_pos,W.tileExtentBuffer.itemSize,H.SHORT,!1,0,0),H.drawArrays(H.TRIANGLE_STRIP,0,W.tileExtentBuffer.itemCount),H.stencilMask(0),H.stencilFunc(H.EQUAL,128,128)}}}var p=q("../util/browser"),r=q("gl-matrix").mat3;s.exports=t},{"../util/browser":95,"gl-matrix":116}],30:[function(q,r,o){var p=q("../util/browser"),s=q("gl-matrix").mat2;r.exports=function(ao,ay,aC,aq){if(aq.buffers){var aG=aq.elementGroups[ay.ref||ay.id];if(aG){var av=ao.gl;if(!(ay.paint["line-width"]<=0)){var au=1/p.devicePixelRatio,aB=ay.paint["line-blur"]+au,ax=ay.paint["line-width"]/2,an=-1,aw=0,ap=0;ay.paint["line-gap-width"]>0&&(an=ay.paint["line-gap-width"]/2+0.5*au,ax=ay.paint["line-width"],aw=an-au/2);var aH=aw+ax+au/2+ap,az=ay.paint["line-color"],aD=ao.transform.scale/(1<<aq.coord.z)/(aq.tileExtent/aq.tileSize),at=ao.translateMatrix(aC,aq,ay.paint["line-translate"],ay.paint["line-translate-anchor"]),am=ao.transform,aE=s.create();s.scale(aE,aE,[1,Math.cos(am._pitch)]),s.rotate(aE,aE,ao.transform.angle);var ak,aF=Math.sqrt(am.height*am.height/4*(1+am.altitude*am.altitude)),al=am.height/2*Math.tan(am._pitch),aA=(aF+al)/aF-1,K=aq.tileSize/ao.transform.tileSize,Z=ay.paint["line-dasharray"],ai=ay.paint["line-pattern"];if(Z){ak=ao.linesdfpatternShader,av.switchShader(ak,at,aq.exMatrix),av.uniform2fv(ak.u_linewidth,[aH,an]),av.uniform1f(ak.u_ratio,aD),av.uniform1f(ak.u_blur,aB),av.uniform4fv(ak.u_color,az);var ah=ao.lineAtlas.getDash(Z.from,"round"===ay.layout["line-cap"]),aj=ao.lineAtlas.getDash(Z.to,"round"===ay.layout["line-cap"]);ao.lineAtlas.bind(av);var ae=Math.pow(2,Math.floor(Math.log(ao.transform.scale)/Math.LN2)-aq.coord.z)/8*K,W=[ae/ah.width/Z.fromScale,-ah.height/2],Q=ao.lineAtlas.width/(Z.fromScale*ah.width*256*p.devicePixelRatio)/2,ab=[ae/aj.width/Z.toScale,-aj.height/2],Y=ao.lineAtlas.width/(Z.toScale*aj.width*256*p.devicePixelRatio)/2;av.uniform2fv(ak.u_patternscale_a,W),av.uniform1f(ak.u_tex_y_a,ah.y),av.uniform2fv(ak.u_patternscale_b,ab),av.uniform1f(ak.u_tex_y_b,aj.y),av.uniform1i(ak.u_image,0),av.uniform1f(ak.u_sdfgamma,Math.max(Q,Y)),av.uniform1f(ak.u_mix,Z.t),av.uniform1f(ak.u_extra,aA),av.uniformMatrix2fv(ak.u_antialiasingmatrix,!1,aE)}else{if(ai){var J=ao.spriteAtlas.getPosition(ai.from,!0),ar=ao.spriteAtlas.getPosition(ai.to,!0);if(!J||!ar){return}var af=aq.tileExtent/aq.tileSize/Math.pow(2,ao.transform.tileZoom-aq.coord.z)*K;ao.spriteAtlas.bind(av,!0),ak=ao.linepatternShader,av.switchShader(ak,at,aq.exMatrix),av.uniform2fv(ak.u_linewidth,[aH,an]),av.uniform1f(ak.u_ratio,aD),av.uniform1f(ak.u_blur,aB),av.uniform2fv(ak.u_pattern_size_a,[J.size[0]*af*ai.fromScale,ar.size[1]]),av.uniform2fv(ak.u_pattern_size_b,[ar.size[0]*af*ai.toScale,ar.size[1]]),av.uniform2fv(ak.u_pattern_tl_a,J.tl),av.uniform2fv(ak.u_pattern_br_a,J.br),av.uniform2fv(ak.u_pattern_tl_b,ar.tl),av.uniform2fv(ak.u_pattern_br_b,ar.br),av.uniform1f(ak.u_fade,ai.t),av.uniform1f(ak.u_opacity,ay.paint["line-opacity"]),av.uniform1f(ak.u_extra,aA),av.uniformMatrix2fv(ak.u_antialiasingmatrix,!1,aE)}else{ak=ao.lineShader,av.switchShader(ak,at,aq.exMatrix),av.uniform2fv(ak.u_linewidth,[aH,an]),av.uniform1f(ak.u_ratio,aD),av.uniform1f(ak.u_blur,aB),av.uniform1f(ak.u_extra,aA),av.uniformMatrix2fv(ak.u_antialiasingmatrix,!1,aE),av.uniform4fv(ak.u_color,az)}}var ad=aq.buffers.lineVertex;ad.bind(av);var aa=aq.buffers.lineElement;aa.bind(av);for(var ac=0;ac<aG.groups.length;ac++){var X=aG.groups[ac],ag=X.vertexStartIndex*ad.itemSize;av.vertexAttribPointer(ak.a_pos,2,av.SHORT,!1,8,ag+0),av.vertexAttribPointer(ak.a_data,4,av.BYTE,!1,8,ag+4);var F=3*X.elementLength,C=X.elementStartIndex*aa.itemSize;av.drawElements(av.TRIANGLES,F,av.UNSIGNED_SHORT,C)}}}}}},{"../util/browser":95,"gl-matrix":116}],31:[function(r,p,s){function q(H,z,D,F){var C=H.gl;C.disable(C.STENCIL_TEST);var A=H.rasterShader;C.switchShader(A,D),C.uniform1f(A.u_brightness_low,z.paint["raster-brightness-min"]),C.uniform1f(A.u_brightness_high,z.paint["raster-brightness-max"]),C.uniform1f(A.u_saturation_factor,o(z.paint["raster-saturation"])),C.uniform1f(A.u_contrast_factor,u(z.paint["raster-contrast"])),C.uniform3fv(A.u_spin_weights,w(z.paint["raster-hue-rotate"]));var B,G,I=F.source&&F.source._pyramid.findLoadedParent(F.coord,0,{}),E=v(F,I,z,H.transform);C.activeTexture(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,F.texture),I?(C.activeTexture(C.TEXTURE1),C.bindTexture(C.TEXTURE_2D,I.texture),B=Math.pow(2,I.coord.z-F.coord.z),G=[F.coord.x*B%1,F.coord.y*B%1]):E[1]=0,C.uniform2fv(A.u_tl_parent,G||[0,0]),C.uniform1f(A.u_scale_parent,B||1),C.uniform1f(A.u_buffer_scale,1),C.uniform1f(A.u_opacity0,E[0]),C.uniform1f(A.u_opacity1,E[1]),C.uniform1i(A.u_image0,0),C.uniform1i(A.u_image1,1),C.bindBuffer(C.ARRAY_BUFFER,F.boundsBuffer||H.tileExtentBuffer),C.vertexAttribPointer(A.a_pos,2,C.SHORT,!1,8,0),C.vertexAttribPointer(A.a_texture_pos,2,C.SHORT,!1,8,4),C.drawArrays(C.TRIANGLE_STRIP,0,4),C.enable(C.STENCIL_TEST)}function w(z){z*=Math.PI/180;var A=Math.sin(z),B=Math.cos(z);return[(2*B+1)/3,(-Math.sqrt(3)*A-B+1)/3,(Math.sqrt(3)*A-B+1)/3]}function u(z){return z>0?1/(1-z):1+z}function o(z){return z>0?1-1/(1.001-z):-z}function v(J,z,E,H){if(!J.source){return[1,0]}var C=(new Date).getTime(),A=E.paint["raster-fade-duration"],B=(C-J.timeAdded)/A,I=z?(C-z.timeAdded)/A:-1,K=J.source._pyramid.coveringZoomLevel(H),G=z?Math.abs(z.coord.z-K)>Math.abs(J.coord.z-K):!1,D=[];!z||G?(D[0]=t.clamp(B,0,1),D[1]=1-D[0]):(D[0]=t.clamp(1-I,0,1),D[1]=1-D[0]);var F=E.paint["raster-opacity"];return D[0]*=F,D[1]*=F,D}var t=r("../util/util");p.exports=q},{"../util/util":106}],32:[function(q,p,r){function v(D,B,C,z){if(z.buffers){var E=z.elementGroups[B.ref||B.id];if(E){var A=!(B.layout["text-allow-overlap"]||B.layout["icon-allow-overlap"]||B.layout["text-ignore-placement"]||B.layout["icon-ignore-placement"]),F=D.gl;A&&F.disable(F.STENCIL_TEST),E.text.groups.length&&w(D,B,C,z,E.text,"text",!0),E.icon.groups.length&&w(D,B,C,z,E.icon,"icon",E.sdfIcons),s(D,B,C,z),A&&F.enable(F.STENCIL_TEST)}}}function w(ar,ae,ag,aw,aj,an,ak){var am=ar.gl;ag=ar.translateMatrix(ag,aw,ae.paint[an+"-translate"],ae.paint[an+"-translate-anchor"]);var al,aq,ad,af=ar.transform,at="map"===ae.layout[an+"-rotation-alignment"],ao=at;ao?(al=o.create(),aq=aw.tileExtent/aw.tileSize/Math.pow(2,ar.transform.zoom-aw.coord.z),ad=1/Math.cos(af._pitch)):(al=o.clone(aw.exMatrix),aq=ar.transform.altitude,ad=1),o.scale(al,al,[aq,aq,1]);var ai=ae.paint[an+"-size"],ap=ai/u[an];o.scale(al,al,[ap,ap,1]);var F,au,aa,av,ac=Math.sqrt(af.height*af.height/4*(1+af.altitude*af.altitude)),ax=af.height/2*Math.tan(af._pitch),Y=(ac+ax)/ac-1,ab="text"===an;if(ab||ar.style.sprite.loaded()){am.activeTexture(am.TEXTURE0),F=ak?ar.sdfShader:ar.iconShader,ab?(ar.glyphAtlas.updateTexture(am),au=aw.buffers.glyphVertex,aa=aw.buffers.glyphElement,av=[ar.glyphAtlas.width/4,ar.glyphAtlas.height/4]):(ar.spriteAtlas.bind(am,at||ar.options.rotating||ar.options.zooming||1!==ap||ak||ar.transform.pitch),au=aw.buffers.iconVertex,aa=aw.buffers.iconElement,av=[ar.spriteAtlas.width/4,ar.spriteAtlas.height/4]),am.switchShader(F,ag,al),am.uniform1i(F.u_texture,0),am.uniform2fv(F.u_texsize,av),am.uniform1i(F.u_skewed,ao),am.uniform1f(F.u_extra,Y);var Z=Math.log(ai/aj[an+"-size"])/Math.LN2||0;am.uniform1f(F.u_zoom,10*(ar.transform.zoom-Z));var U=ar.frameHistory.getFadeProperties(300);am.uniform1f(F.u_fadedist,10*U.fadedist),am.uniform1f(F.u_minfadezoom,Math.floor(10*U.minfadezoom)),am.uniform1f(F.u_maxfadezoom,Math.floor(10*U.maxfadezoom)),am.uniform1f(F.u_fadezoom,10*(ar.transform.zoom+U.bump));var B,P,J,K;if(aa.bind(am),ak){var X=8,O=1.19,H=6,Q=0.105*u[an]/ai/t.devicePixelRatio;am.uniform1f(F.u_gamma,Q*ad),am.uniform4fv(F.u_color,ae.paint[an+"-color"]),am.uniform1f(F.u_buffer,0.75);for(var V=0;V<aj.groups.length;V++){B=aj.groups[V],P=B.vertexStartIndex*au.itemSize,au.bind(am,F,P),J=3*B.elementLength,K=B.elementStartIndex*aa.itemSize,am.drawElements(am.TRIANGLES,J,am.UNSIGNED_SHORT,K)}if(ae.paint[an+"-halo-width"]){am.uniform1f(F.u_gamma,(ae.paint[an+"-halo-blur"]*O/ap/X+Q)*ad),am.uniform4fv(F.u_color,ae.paint[an+"-halo-color"]),am.uniform1f(F.u_buffer,(H-ae.paint[an+"-halo-width"]/ap)/X);for(var ah=0;ah<aj.groups.length;ah++){B=aj.groups[ah],P=B.vertexStartIndex*au.itemSize,au.bind(am,F,P),J=3*B.elementLength,K=B.elementStartIndex*aa.itemSize,am.drawElements(am.TRIANGLES,J,am.UNSIGNED_SHORT,K)}}}else{am.uniform1f(F.u_opacity,ae.paint["icon-opacity"]);for(var W=0;W<aj.groups.length;W++){B=aj.groups[W],P=B.vertexStartIndex*au.itemSize,au.bind(am,F,P),J=3*B.elementLength,K=B.elementStartIndex*aa.itemSize,am.drawElements(am.TRIANGLES,J,am.UNSIGNED_SHORT,K)}}}}var t=q("../util/browser"),o=q("gl-matrix").mat4,s=q("./draw_collision_debug");p.exports=v;var u={icon:1,text:24}},{"../util/browser":95,"./draw_collision_debug":27,"gl-matrix":116}],33:[function(s,t,p){function o(C,A,w,v){function D(J,H,G,M){B.switchShader(C.dotShader,G),B.uniform1f(C.dotShader.u_size,4*r.devicePixelRatio),B.uniform1f(C.dotShader.u_blur,0.25),B.uniform4fv(C.dotShader.u_color,[0.1,0,0,0.1]),J.bind(B,C.dotShader,0);for(var E=0;E<H.length;E++){var I=H[E],F=I.vertexStartIndex,K=I.vertexLength;B.vertexAttribPointer(C.dotShader.a_pos,2,B.SHORT,!1,M,0),B.drawArrays(B.POINTS,F,K)}}var B=C.gl;if(v&&v.buffers){var u=v.elementGroups[A.ref||A.id];if(u){if(B.blendFunc(B.ONE,B.ONE_MINUS_SRC_ALPHA),"fill"===A.type){D(v.buffers.fillVertex,u.groups,w,4)}else{if("symbol"===A.type){D(v.buffers.iconVertex,u.icon.groups,w,16),D(v.buffers.glyphVertex,u.text.groups,w,16)}else{if("line"===A.type){var z=q.clone(w);q.scale(z,z,[0.5,0.5,1]),D(v.buffers.lineVertex,u.groups,z,8)}}}B.blendFunc(B.ONE_MINUS_DST_ALPHA,B.ONE)}}}var r=s("../util/browser"),q=s("gl-matrix").mat4;t.exports=o},{"../util/browser":95,"gl-matrix":116}],34:[function(q,r,p){function o(){this.frameHistory=[]}r.exports=o,o.prototype.getFadeProperties=function(G){void 0===G&&(G=300);for(var D=(new Date).getTime();this.frameHistory.length>3&&this.frameHistory[1].time+G<D;){this.frameHistory.shift()}this.frameHistory[1].time+G<D&&(this.frameHistory[0].z=this.frameHistory[1].z);var u=this.frameHistory.length;3>u&&console.warn("there should never be less than three frames in the history");var A=this.frameHistory[0].z,H=this.frameHistory[u-1],v=H.z,F=Math.min(A,v),z=Math.max(A,v),B=H.z-this.frameHistory[1].z,C=H.time-this.frameHistory[1].time,E=B/(C/G);isNaN(E)&&console.warn("fadedist should never be NaN");var w=(D-H.time)/G*E;return{fadedist:E,minfadezoom:F,maxfadezoom:z,bump:w}},o.prototype.record=function(s){var u=(new Date).getTime();this.frameHistory.length||this.frameHistory.push({time:0,z:s},{time:0,z:s}),(2===this.frameHistory.length||this.frameHistory[this.frameHistory.length-1].z!==s)&&this.frameHistory.push({time:u,z:s})}},{}],35:[function(r,s,p){var q=r("./shaders"),o=r("../util/util");p.extend=function(v){var u=v.lineWidth,w=v.getParameter(v.ALIASED_LINE_WIDTH_RANGE);return v.lineWidth=function(t){u.call(v,o.clamp(t,w[0],w[1]))},v.getShader=function(C,B){var D=B===this.FRAGMENT_SHADER?"fragment":"vertex";if(!q[C]||!q[C][D]){throw new Error("Could not find shader "+C)}var A=this.createShader(B),z=q[C][D];if("undefined"==typeof orientation&&(z=z.replace(/ highp /g," ")),this.shaderSource(A,z),this.compileShader(A),!this.getShaderParameter(A,this.COMPILE_STATUS)){throw new Error(this.getShaderInfoLog(A))}return A},v.initializeShader=function(D,B,E){var A={program:this.createProgram(),fragment:this.getShader(D,this.FRAGMENT_SHADER),vertex:this.getShader(D,this.VERTEX_SHADER),attributes:[]};if(this.attachShader(A.program,A.vertex),this.attachShader(A.program,A.fragment),this.linkProgram(A.program),this.getProgramParameter(A.program,this.LINK_STATUS)){for(var z=0;z<B.length;z++){A[B[z]]=this.getAttribLocation(A.program,B[z]),A.attributes.push(A[B[z]])}for(var C=0;C<E.length;C++){A[E[C]]=this.getUniformLocation(A.program,E[C])}}else{console.error(this.getProgramInfoLog(A.program))}return A},v.switchShader=function(D,B,E){if(B||console.trace("posMatrix does not have required argument"),this.currentShader!==D){this.useProgram(D.program);for(var A=this.currentShader?this.currentShader.attributes:[],z=D.attributes,C=0;C<A.length;C++){z.indexOf(A[C])<0&&this.disableVertexAttribArray(A[C])}for(var F=0;F<z.length;F++){A.indexOf(z[F])<0&&this.enableVertexAttribArray(z[F])}this.currentShader=D}D.posMatrix!==B&&(this.uniformMatrix4fv(D.u_matrix,!1,B),D.posMatrix=B),E&&D.exMatrix!==E&&D.u_exmatrix&&(this.uniformMatrix4fv(D.u_exmatrix,!1,E),D.exMatrix=E)},v.vertexAttrib2fv=function(z,A){v.vertexAttrib2f(z,A[0],A[1])},v.vertexAttrib3fv=function(z,A){v.vertexAttrib3f(z,A[0],A[1],A[2])},v.vertexAttrib4fv=function(z,A){v.vertexAttrib4f(z,A[0],A[1],A[2],A[3])},v}},{"../util/util":106,"./shaders":38}],36:[function(p,q,o){function r(u,s){this.width=u,this.height=s,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}q.exports=r,r.prototype.setSprite=function(s){this.sprite=s},r.prototype.getDash=function(u,s){var v=u.join(",")+s;return this.positions[v]||(this.positions[v]=this.addDash(u,s)),this.positions[v]},r.prototype.addDash=function(I,U){var Y=U?7:0,V=2*Y+1,K=128;if(this.nextRow+V>this.height){return console.warn("LineAtlas out of space"),null}for(var ab=0,M=0;M<I.length;M++){ab+=I[M]}for(var Q=this.width/ab,P=Q/2,Z=I.length%2===1,H=-Y;Y>=H;H++){for(var v=this.nextRow+Y+H,S=this.width*v,z=Z?-I[I.length-1]:0,G=I[0],W=1,O=0;O<this.width;O++){for(;O/Q>G;){z=G,G+=I[W],Z&&W===I.length-1&&(G+=I[0]),W++}var C,X=Math.abs(O-z*Q),N=Math.abs(O-G*Q),F=Math.min(X,N),ac=W%2===1;if(U){var B=Y?H/Y*(P+1):0;if(ac){var J=P-Math.abs(B);C=Math.sqrt(F*F+J*J)}else{C=P-Math.sqrt(F*F+B*B)}}else{C=(ac?1:-1)*F}this.data[3+4*(S+O)]=Math.max(0,Math.min(255,C+K))}}var aa={y:(this.nextRow+Y+0.5)/this.height,height:2*Y/this.height,width:ab};return this.nextRow+=V,this.dirty=!0,aa},r.prototype.bind=function(s){this.texture?(s.bindTexture(s.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,s.texSubImage2D(s.TEXTURE_2D,0,0,0,this.width,this.height,s.RGBA,s.UNSIGNED_BYTE,this.data))):(this.texture=s.createTexture(),s.bindTexture(s.TEXTURE_2D,this.texture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.REPEAT),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,this.width,this.height,0,s.RGBA,s.UNSIGNED_BYTE,this.data))},r.prototype.debug=function(){var v=document.createElement("canvas");document.body.appendChild(v),v.style.position="absolute",v.style.top=0,v.style.left=0,v.style.background="#ff0",v.width=this.width,v.height=this.height;for(var u=v.getContext("2d"),A=u.getImageData(0,0,this.width,this.height),z=0;z<this.data.length;z++){if(this.sdf){var w=4*z;A.data[w]=A.data[w+1]=A.data[w+2]=0,A.data[w+3]=this.data[z]}else{A.data[z]=this.data[z]}}u.putImageData(A,0,0)}},{}],37:[function(q,p,s){function t(z,A){this.gl=v.extend(z),this.transform=A,this.reusableTextures={},this.preFbos={},this.frameHistory=new r,this.setup()}var v=q("./gl_util"),u=q("../util/browser"),o=q("gl-matrix").mat4,r=q("./frame_history");p.exports=t,t.prototype.resize=function(A,B){var z=this.gl;this.width=A*u.devicePixelRatio,this.height=B*u.devicePixelRatio,z.viewport(0,0,this.width,this.height)},t.prototype.setup=function(){var z=this.gl;z.verbose=!0,z.enable(z.BLEND),z.blendFunc(z.ONE_MINUS_DST_ALPHA,z.ONE),z.enable(z.STENCIL_TEST),this.debugShader=z.initializeShader("debug",["a_pos"],["u_matrix","u_color"]),this.rasterShader=z.initializeShader("raster",["a_pos","a_texture_pos"],["u_matrix","u_brightness_low","u_brightness_high","u_saturation_factor","u_spin_weights","u_contrast_factor","u_opacity0","u_opacity1","u_image0","u_image1","u_tl_parent","u_scale_parent","u_buffer_scale"]),this.circleShader=z.initializeShader("circle",["a_pos"],["u_matrix","u_exmatrix","u_blur","u_size","u_color"]),this.lineShader=z.initializeShader("line",["a_pos","a_data"],["u_matrix","u_linewidth","u_color","u_ratio","u_blur","u_extra","u_antialiasingmatrix"]),this.linepatternShader=z.initializeShader("linepattern",["a_pos","a_data"],["u_matrix","u_linewidth","u_ratio","u_pattern_size_a","u_pattern_size_b","u_pattern_tl_a","u_pattern_br_a","u_pattern_tl_b","u_pattern_br_b","u_blur","u_fade","u_opacity","u_extra","u_antialiasingmatrix"]),this.linesdfpatternShader=z.initializeShader("linesdfpattern",["a_pos","a_data"],["u_matrix","u_linewidth","u_color","u_ratio","u_blur","u_patternscale_a","u_tex_y_a","u_patternscale_b","u_tex_y_b","u_image","u_sdfgamma","u_mix","u_extra","u_antialiasingmatrix"]),this.dotShader=z.initializeShader("dot",["a_pos"],["u_matrix","u_size","u_color","u_blur"]),this.sdfShader=z.initializeShader("sdf",["a_pos","a_offset","a_data1","a_data2"],["u_matrix","u_exmatrix","u_texture","u_texsize","u_color","u_gamma","u_buffer","u_zoom","u_fadedist","u_minfadezoom","u_maxfadezoom","u_fadezoom","u_skewed","u_extra"]),this.iconShader=z.initializeShader("icon",["a_pos","a_offset","a_data1","a_data2"],["u_matrix","u_exmatrix","u_texture","u_texsize","u_zoom","u_fadedist","u_minfadezoom","u_maxfadezoom","u_fadezoom","u_opacity","u_skewed","u_extra"]),this.outlineShader=z.initializeShader("outline",["a_pos"],["u_matrix","u_color","u_world"]),this.patternShader=z.initializeShader("pattern",["a_pos"],["u_matrix","u_pattern_tl_a","u_pattern_br_a","u_pattern_tl_b","u_pattern_br_b","u_mix","u_patternmatrix_a","u_patternmatrix_b","u_opacity","u_image"]),this.fillShader=z.initializeShader("fill",["a_pos"],["u_matrix","u_color"]),this.collisionBoxShader=z.initializeShader("collisionbox",["a_pos","a_extrude","a_data"],["u_matrix","u_scale","u_zoom","u_maxzoom"]),this.identityMatrix=o.create(),this.backgroundBuffer=z.createBuffer(),this.backgroundBuffer.itemSize=2,this.backgroundBuffer.itemCount=4,z.bindBuffer(z.ARRAY_BUFFER,this.backgroundBuffer),z.bufferData(z.ARRAY_BUFFER,new Int16Array([-1,-1,1,-1,-1,1,1,1]),z.STATIC_DRAW),this.setExtent(4096),this.debugTextBuffer=z.createBuffer(),this.debugTextBuffer.itemSize=2},t.prototype.setExtent=function(z){if(z&&z!==this.tileExtent){this.tileExtent=z;var A=this.gl;this.tileExtentBuffer=A.createBuffer(),this.tileExtentBuffer.itemSize=4,this.tileExtentBuffer.itemCount=4,A.bindBuffer(A.ARRAY_BUFFER,this.tileExtentBuffer),A.bufferData(A.ARRAY_BUFFER,new Int16Array([0,0,0,0,this.tileExtent,0,32767,0,0,this.tileExtent,0,32767,this.tileExtent,this.tileExtent,32767,32767]),A.STATIC_DRAW),this.debugBuffer=A.createBuffer(),this.debugBuffer.itemSize=2,this.debugBuffer.itemCount=5,A.bindBuffer(A.ARRAY_BUFFER,this.debugBuffer),A.bufferData(A.ARRAY_BUFFER,new Int16Array([0,0,this.tileExtent-1,0,this.tileExtent-1,this.tileExtent-1,0,this.tileExtent-1,0,0]),A.STATIC_DRAW)}},t.prototype.clearColor=function(){var z=this.gl;z.clearColor(0,0,0,0),z.clear(z.COLOR_BUFFER_BIT)},t.prototype.clearStencil=function(){var z=this.gl;z.clearStencil(0),z.stencilMask(255),z.clear(z.STENCIL_BUFFER_BIT)},t.prototype.drawClippingMask=function(z){var A=this.gl;A.switchShader(this.fillShader,z.posMatrix),A.colorMask(!1,!1,!1,!1),A.clearStencil(0),A.stencilMask(191),A.clear(A.STENCIL_BUFFER_BIT),A.stencilFunc(A.EQUAL,192,64),A.stencilMask(192),A.stencilOp(A.REPLACE,A.KEEP,A.KEEP),A.bindBuffer(A.ARRAY_BUFFER,this.tileExtentBuffer),A.vertexAttribPointer(this.fillShader.a_pos,this.tileExtentBuffer.itemSize,A.SHORT,!1,8,0),A.drawArrays(A.TRIANGLE_STRIP,0,this.tileExtentBuffer.itemCount),A.stencilFunc(A.EQUAL,128,128),A.stencilOp(A.KEEP,A.KEEP,A.REPLACE),A.stencilMask(0),A.colorMask(!0,!0,!0,!0)},t.prototype.prepareBuffers=function(){},t.prototype.bindDefaultFramebuffer=function(){var z=this.gl;z.bindFramebuffer(z.FRAMEBUFFER,null)};var w={symbol:q("./draw_symbol"),circle:q("./draw_circle"),line:q("./draw_line"),fill:q("./draw_fill"),raster:q("./draw_raster"),background:q("./draw_background"),debug:q("./draw_debug"),vertices:q("./draw_vertices")};t.prototype.render=function(B,D){this.style=B,this.options=D,this.lineAtlas=B.lineAtlas,this.spriteAtlas=B.spriteAtlas,this.spriteAtlas.setSprite(B.sprite),this.glyphAtlas=B.glyphAtlas,this.glyphAtlas.bind(this.gl),this.frameHistory.record(this.transform.zoom),this.prepareBuffers(),this.clearColor();for(var A=B._groups.length-1;A>=0;A--){var C=B._groups[A],z=B.sources[C.source];z?(this.clearStencil(),z.render(C,this)):void 0===C.source&&this.drawLayers(C,this.identityMatrix)}},t.prototype.drawTile=function(z,A){this.setExtent(z.tileExtent),this.drawClippingMask(z),this.drawLayers(A,z.posMatrix,z),this.options.debug&&w.debug(this,z)},t.prototype.drawLayers=function(B,D,A){for(var C=B.length-1;C>=0;C--){var z=B[C];z.hidden||(w[z.type](this,z,D,A),this.options.vertices&&w.vertices(this,z,D,A))}},t.prototype.drawStencilBuffer=function(){var z=this.gl;z.switchShader(this.fillShader,this.identityMatrix),z.blendFunc(z.ONE,z.ONE_MINUS_SRC_ALPHA),z.stencilMask(0),z.stencilFunc(z.EQUAL,128,128),z.bindBuffer(z.ARRAY_BUFFER,this.backgroundBuffer),z.vertexAttribPointer(this.fillShader.a_pos,this.backgroundBuffer.itemSize,z.SHORT,!1,0,0),z.uniform4fv(this.fillShader.u_color,[0,0,0,0.5]),z.drawArrays(z.TRIANGLE_STRIP,0,this.tileExtentBuffer.itemCount),z.blendFunc(z.ONE_MINUS_DST_ALPHA,z.ONE)},t.prototype.translateMatrix=function(G,C,B,z){if(!B[0]&&!B[1]){return G}if("viewport"===z){var D=Math.sin(-this.transform.angle),H=Math.cos(-this.transform.angle);B=[B[0]*H-B[1]*D,B[0]*D+B[1]*H]}var F=this.transform.scale/(1<<C.coord.z)/(C.tileExtent/C.tileSize),A=[B[0]/F,B[1]/F,0],E=new Float32Array(16);return o.translate(E,G,A),E},t.prototype.saveTexture=function(z){var A=this.reusableTextures[z.size];A?A.push(z):this.reusableTextures[z.size]=[z]},t.prototype.getTexture=function(z){var A=this.reusableTextures[z];return A&&A.length>0?A.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":116}],38:[function(q,r,p){var o=void 0;r.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=0.;if(u_minfadezoom>=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=0.;if(u_minfadezoom>=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(p,o,r){function t(z){z=z||{},this._data=z.data,void 0!==z.maxzoom&&(this.maxzoom=z.maxzoom),this.geojsonVtOptions={maxZoom:this.maxzoom},void 0!==z.buffer&&(this.geojsonVtOptions.buffer=z.buffer),void 0!==z.tolerance&&(this.geojsonVtOptions.tolerance=z.tolerance),this._pyramid=new v({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 s=p("../util/util"),w=p("../util/evented"),v=p("./tile_pyramid"),q=p("./source"),u=p("resolve-url");o.exports=t,t.prototype=s.inherit(w,{minzoom:0,maxzoom:14,_dirty:!0,setData:function(z){return this._data=z,this._dirty=!0,this.fire("change"),this.map&&this.update(this.map.transform),this},onAdd:function(z){this.map=z},loaded:function(){return this._loaded&&this._pyramid.loaded()},update:function(z){this._dirty&&this._updateData(),this._loaded&&this._pyramid.update(this.used,z)},reload:function(){this._loaded&&this._pyramid.reload()},render:q._renderTiles,featuresAt:q._vectorFeaturesAt,featuresIn:q._vectorFeaturesIn,_updateData:function(){this._dirty=!1;var z=this._data;"string"==typeof z&&(z=u(window.location.href,z)),this.workerID=this.dispatcher.send("parse geojson",{data:z,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 z=A.coord.z>this.maxzoom?Math.pow(2,A.coord.z-this.maxzoom):1,B={uid:A.uid,coord:A.coord,zoom:A.coord.z,maxZoom:this.maxzoom,tileSize:512,source:this.id,overscaling:z,angle:this.map.transform.angle,pitch:this.map.transform.pitch,collisionDebug:this.map.collisionDebug};A.workerID=this.dispatcher.send("load geojson tile",B,function(C,D){if(A.unloadVectorData(this.map.painter),!A.aborted){if(C){return void this.fire("tile.error",{tile:A})}A.loadVectorData(D),this.fire("tile.load",{tile:A})}}.bind(this),this.workerID)},_abortTile:function(z){z.aborted=!0},_addTile:function(z){this.fire("tile.add",{tile:z})},_removeTile:function(z){this.fire("tile.remove",{tile:z})},_unloadTile:function(z){z.unloadVectorData(this.map.painter),this.glyphAtlas.removeGlyphs(z.uid),this.dispatcher.send("remove tile",{uid:z.uid,source:this.id},null,z.workerID)}})},{"../util/evented":100,"../util/util":106,"./source":43,"./tile_pyramid":46,"resolve-url":140}],40:[function(r,s,p){function u(v){this.features=v,this.length=v.length}function o(v){this.type=v.type,this.rawGeometry=1===v.type?[v.geometry]:v.geometry,this.properties=v.tags,this.extent=4096}var t=r("point-geometry"),q=r("vector-tile").VectorTileFeature;s.exports=u,u.prototype.feature=function(v){return new o(this.features[v])},o.prototype.loadGeometry=function(){var A=this.rawGeometry;this.geometry=[];for(var w=0;w<A.length;w++){for(var z=A[w],B=[],v=0;v<z.length;v++){B.push(new t(z[v][0],z[v][1]))}this.geometry.push(B)}return this.geometry},o.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var D=this.geometry,F=1/0,v=-(1/0),z=1/0,E=-(1/0),w=0;w<D.length;w++){for(var B=D[w],A=0;A<B.length;A++){var C=B[A];F=Math.min(F,C.x),v=Math.max(v,C.x),z=Math.min(z,C.y),E=Math.max(E,C.y)}}return[F,z,v,E]},o.prototype.toGeoJSON=q.prototype.toGeoJSON},{"point-geometry":137,"vector-tile":144}],41:[function(q,p,r){function o(A){this.coordinates=A.coordinates,v.getImage(A.url,function(C,B){C||(this.image=B,this.image.addEventListener("load",function(){this.map._rerender()}.bind(this)),this._loaded=!0,this.map&&(this.createTile(),this.fire("change")))}.bind(this))}var s=q("../util/util"),w=q("./tile"),u=q("../geo/lng_lat"),t=q("point-geometry"),z=q("../util/evented"),v=q("../util/ajax");p.exports=o,o.prototype=s.inherit(z,{onAdd:function(A){this.map=A,this.image&&this.createTile()},createTile:function(){var F=this.map,D=this.coordinates.map(function(J){var I=u.convert(J);return F.transform.locationCoordinate(I).zoomTo(0)}),C=s.getCoordinatesCenter(D),E=4096,A=D.map(function(J){var I=J.zoomTo(C.zoom);return new t(Math.round((I.column-C.column)*E),Math.round((I.row-C.row)*E))}),H=F.painter.gl,G=32767,B=new Int16Array([A[0].x,A[0].y,0,0,A[1].x,A[1].y,G,0,A[3].x,A[3].y,0,G,A[2].x,A[2].y,G,G]);this.tile=new w,this.tile.buckets={},this.tile.boundsBuffer=H.createBuffer(),H.bindBuffer(H.ARRAY_BUFFER,this.tile.boundsBuffer),H.bufferData(H.ARRAY_BUFFER,B,H.STATIC_DRAW),this.center=C},loaded:function(){return this.image&&this.image.complete},update:function(){},reload:function(){},render:function(D,B){if(this._loaded&&this.loaded()){var A=this.center;this.tile.calculateMatrices(A.zoom,A.column,A.row,this.map.transform,B);var C=B.gl;this.tile.texture?(C.bindTexture(C.TEXTURE_2D,this.tile.texture),C.texSubImage2D(C.TEXTURE_2D,0,0,0,C.RGBA,C.UNSIGNED_BYTE,this.image)):(this.tile.texture=C.createTexture(),C.bindTexture(C.TEXTURE_2D,this.tile.texture),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_S,C.CLAMP_TO_EDGE),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_T,C.CLAMP_TO_EDGE),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_MIN_FILTER,C.LINEAR),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_MAG_FILTER,C.LINEAR),C.texImage2D(C.TEXTURE_2D,0,C.RGBA,C.RGBA,C.UNSIGNED_BYTE,this.image)),B.drawLayers(D,this.tile.posMatrix,this.tile)}},featuresAt:function(C,B,A){return A(null,[])}})},{"../geo/lng_lat":20,"../util/ajax":94,"../util/evented":100,"../util/util":106,"./tile":44,"point-geometry":137}],42:[function(p,o,r){function u(z){t.extend(this,t.pick(z,["url","tileSize"])),q._loadTileJSON.call(this,z)}var t=p("../util/util"),v=p("../util/ajax"),w=p("../util/evented"),q=p("./source"),s=p("../util/mapbox").normalizeTileURL;o.exports=u,u.prototype=t.inherit(w,{minzoom:0,maxzoom:22,roundZoom:!0,tileSize:512,_loaded:!1,onAdd:function(z){this.map=z},loaded:function(){return this._pyramid&&this._pyramid.loaded()},update:function(z){this._pyramid&&this._pyramid.update(this.used,z,this.map.style.rasterFadeDuration)},reload:function(){},render:q._renderTiles,_loadTile:function(B){function A(D,C){if(delete B.request,!B.aborted){if(D){return void this.fire("tile.error",{tile:B})}var E=this.map.painter.gl;B.texture=this.map.painter.getTexture(C.width),B.texture?(E.bindTexture(E.TEXTURE_2D,B.texture),E.texSubImage2D(E.TEXTURE_2D,0,0,0,E.RGBA,E.UNSIGNED_BYTE,C)):(B.texture=E.createTexture(),E.bindTexture(E.TEXTURE_2D,B.texture),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MIN_FILTER,E.LINEAR_MIPMAP_NEAREST),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MAG_FILTER,E.LINEAR),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,E.CLAMP_TO_EDGE),E.texImage2D(E.TEXTURE_2D,0,E.RGBA,E.RGBA,E.UNSIGNED_BYTE,C),B.texture.size=C.width),E.generateMipmap(E.TEXTURE_2D),B.timeAdded=(new Date).getTime(),this.map.animationLoop.set(this.style.rasterFadeDuration),B.source=this,B.loaded=!0,this.fire("tile.load",{tile:B})}}var z=s(B.coord.url(this.tiles),this.url);B.request=v.getImage(z,A.bind(this))},_abortTile:function(z){z.aborted=!0,z.request&&(z.request.abort(),delete z.request)},_addTile:function(z){this.fire("tile.add",{tile:z})},_removeTile:function(z){this.fire("tile.remove",{tile:z})},_unloadTile:function(z){z.texture&&this.map.painter.saveTexture(z.texture)},featuresAt:function(B,A,z){z(null,[])},featuresIn:function(B,A,z){z(null,[])}})},{"../util/ajax":94,"../util/evented":100,"../util/mapbox":103,"../util/util":106,"./source":43}],43:[function(p,o,r){var u=p("../util/util"),w=p("../util/ajax"),t=p("../util/browser"),v=p("./tile_pyramid"),q=p("./tile_coord"),s=p("../util/mapbox").normalizeSourceURL;r._loadTileJSON=function(z){var B=function(C){this._pyramid=new v({index:C,tileSize:this.tileSize,cacheSize:20,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom,reparseOverscaled:this.reparseOverscaled,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),redoPlacement:this._redoTilePlacement?this._redoTilePlacement.bind(this):void 0})}.bind(this),A=function(C,D){return C?void this.fire("error",{error:C}):(u.extend(this,u.pick(D,["tiles","minzoom","maxzoom","attribution"])),void (D.index?w.getJSON(s(D.index),function(E,F){return E?void this.fire("error",{error:E}):(B(F.index),void this.fire("load"))}.bind(this)):(B(),this.fire("load"))))}.bind(this);z.url?w.getJSON(s(z.url),A):t.frame(A.bind(this,null,z))},r._renderTiles=function(D,E){if(this._pyramid){for(var z=this._pyramid.renderedIDs(),H=0;H<z.length;H++){var A=this._pyramid.getTile(z[H]),B=q.fromID(z[H]),G=B.z,I=B.x,C=B.y,F=B.w;G=Math.min(G,this.maxzoom),(A.tileExtent>4096||A.parentId)&&(A.tileExtent=4096),I+=F*(1<<G),A.calculateMatrices(G,I,C,E.transform,E),E.drawTile(A,D)}}},r._vectorFeaturesAt=function(A,C,B){if(!this._pyramid){return B(null,[])}var z=this._pyramid.tileAt(A);return z?void this.dispatcher.send("query features",{uid:z.tile.uid,x:z.x,y:z.y,tileExtent:z.tile.tileExtent,scale:z.scale,source:this.id,params:C},B,z.tile.workerID):B(null,[])},r._vectorFeaturesIn=function(A,C,B){if(!this._pyramid){return B(null,[])}var z=this._pyramid.tilesIn(A);return z?void u.asyncAll(z,function(D,E){this.dispatcher.send("query features",{uid:D.tile.uid,source:this.id,minX:D.minX,maxX:D.maxX,minY:D.minY,maxY:D.maxY,params:C},E,D.tile.workerID)}.bind(this),function(D,E){B(D,Array.prototype.concat.apply([],E))}):B(null,[])},r.create=function(z){var B={vector:p("./vector_tile_source"),raster:p("./raster_tile_source"),geojson:p("./geojson_source"),video:p("./video_source"),image:p("./image_source")};for(var A in B){if(z instanceof B[A]){return z}}return new B[z.type](z)}},{"../util/ajax":94,"../util/browser":95,"../util/mapbox":103,"../util/util":106,"./geojson_source":39,"./image_source":41,"./raster_tile_source":42,"./tile_coord":45,"./tile_pyramid":46,"./vector_tile_source":47,"./video_source":48}],44:[function(r,q,t){function w(z,A){this.coord=z,this.uid=u.uniqueId(),this.loaded=!1,this.uses=0,this.tileSize=A}var v=r("gl-matrix"),p=v.mat2,o=v.mat4,u=r("../util/util"),s=r("../data/buffer/buffer_set");q.exports=w,w.prototype={tileExtent:4096,calculateMatrices:function(A,D,z,C){var B=Math.pow(2,A),E=C.worldSize/B;this.scale=E,this.posMatrix=new Float64Array(16),o.identity(this.posMatrix),o.translate(this.posMatrix,this.posMatrix,[D*E,z*E,0]),o.scale(this.posMatrix,this.posMatrix,[E/this.tileExtent,E/this.tileExtent,1]),o.multiply(this.posMatrix,C.getProjMatrix(),this.posMatrix),this.exMatrix=o.create(),o.ortho(this.exMatrix,0,C.width,C.height,0,0,-1),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,C.angle),this.posMatrix=new Float32Array(this.posMatrix)},positionAt:function(z,A){return z=z.zoomTo(Math.min(this.coord.z,A)),{x:(z.column-this.coord.x)*this.tileExtent,y:(z.row-this.coord.y)*this.tileExtent,scale:this.scale}},loadVectorData:function(z){this.loaded=!0,z&&(this.buffers=new s(z.buffers),this.elementGroups=z.elementGroups,this.tileExtent=z.extent)},reloadSymbolData:function(A,C){if(this.buffers){this.buffers.glyphVertex.destroy(C.gl),this.buffers.glyphElement.destroy(C.gl),this.buffers.iconVertex.destroy(C.gl),this.buffers.iconElement.destroy(C.gl),this.buffers.collisionBoxVertex.destroy(C.gl);var z=new s(A.buffers);this.buffers.glyphVertex=z.glyphVertex,this.buffers.glyphElement=z.glyphElement,this.buffers.iconVertex=z.iconVertex,this.buffers.iconElement=z.iconElement,this.buffers.collisionBoxVertex=z.collisionBoxVertex;for(var B in A.elementGroups){this.elementGroups[B]=A.elementGroups[B]}}},unloadVectorData:function(z){for(var A in this.buffers){this.buffers[A].destroy(z.gl)}this.buffers=null}}},{"../data/buffer/buffer_set":2,"../util/util":106,"gl-matrix":116}],45:[function(q,s,o){function r(w,v,B,z){isNaN(z)&&(z=0),this.z=+w,this.x=+v,this.y=+B,this.w=+z,z*=2,0>z&&(z=-1*z-1);var A=1<<this.z;this.id=32*(A*A*z+A*this.y+this.x)+this.z}function u(w,v){if(w.row>v.row){var z=w;w=v,v=z}return{x0:w.column,y0:w.row,x1:v.column,y1:v.row,dx:v.column-w.column,dy:v.row-w.row}}function t(K,B,w,v,D){var z=Math.max(w,Math.floor(B.y0)),C=Math.min(v,Math.ceil(B.y1));if(K.x0===B.x0&&K.y0===B.y0?K.x0+B.dy/K.dy*K.dx<B.x1:K.x1-B.dy/K.dy*K.dx<B.x0){var M=K;K=B,B=M}for(var E=K.dx/K.dy,I=B.dx/B.dy,A=K.dx>0,G=B.dx<0,H=z;C>H;H++){var F=E*Math.max(0,Math.min(K.dy,H+A-K.y0))+K.x0,J=I*Math.max(0,Math.min(B.dy,H+G-B.y0))+B.x0;D(Math.floor(J),Math.ceil(F),H)}}function p(F,A,w,v,C,z){var B,G=u(F,A),D=u(A,w),E=u(w,F);G.dy>D.dy&&(B=G,G=D,D=B),G.dy>E.dy&&(B=G,G=E,E=B),D.dy>E.dy&&(B=D,D=E,E=B),G.dy&&t(E,G,v,C,z),D.dy&&t(E,D,v,C,z)}s.exports=r,r.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},r.fromID=function(w){var v=w%32,C=1<<v,A=(w-v)/32,B=A%C,D=(A-B)/C%C,z=Math.floor(A/(C*C));return z%2!==0&&(z=-1*z-1),z/=2,new r(v,B,D,z)},r.prototype.url=function(w,v){return w[(this.x+this.y)%w.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",Math.min(this.z,v||this.z)).replace("{x}",this.x).replace("{y}",this.y)},r.prototype.parent=function(v){return 0===this.z?null:this.z>v?new r(this.z-1,this.x,this.y,this.w):new r(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},r.prototype.wrapped=function(){return new r(this.z,this.x,this.y,0)},r.prototype.children=function(w){if(this.z>=w){return[new r(this.z+1,this.x,this.y,this.w)]}var v=this.z+1,A=2*this.x,z=2*this.y;return[new r(v,A,z,this.w),new r(v,A+1,z,this.w),new r(v,A,z+1,this.w),new r(v,A+1,z+1,this.w)]},r.cover=function(w,v,B){function z(E,D,H){var G,F,I;if(H>=0&&A>=H){for(G=E;D>G;G++){F=(G%A+A)%A,I=new r(B,F,H,Math.floor(G/A)),C[I.id]=I}}}var A=1<<w,C={};return p(v[0],v[1],v[2],0,A,z),p(v[2],v[3],v[0],0,A,z),Object.keys(C).map(function(D){return C[D]})}},{}],46:[function(p,o,r){function u(z){this.tileSize=z.tileSize,this.minzoom=z.minzoom,this.maxzoom=z.maxzoom,this.roundZoom=z.roundZoom,this.reparseOverscaled=z.reparseOverscaled,this.index=z.index,this._load=z.load,this._abort=z.abort,this._unload=z.unload,this._add=z.add,this._remove=z.remove,this._redoPlacement=z.redoPlacement,this._tiles={},this._cache=new v(z.cacheSize,function(A){return this._unload(A)}.bind(this))}var w=p("./tile"),q=p("./tile_coord"),t=p("point-geometry"),v=p("../util/mru_cache"),s=p("../util/util");o.exports=u,u.prototype={loaded:function(){for(var z in this._tiles){if(!this._tiles[z].loaded){return !1}}return !0},orderedIDs:function(){return Object.keys(this._tiles).sort(function(z,A){return A%32-z%32}).map(function(z){return +z})},renderedIDs:function(){return this.orderedIDs().filter(function(z){return this._tiles[z].loaded&&!this._coveredTiles[z]}.bind(this))},reload:function(){this._cache.reset();for(var z in this._tiles){this._load(this._tiles[z])}},getTile:function(z){return this._tiles[z]},getZoom:function(z){return z.zoom+Math.log(z.tileSize/this.tileSize)/Math.LN2},coveringZoomLevel:function(z){return(this.roundZoom?Math.round:Math.floor)(this.getZoom(z))},coveringTiles:function(A){var C=this.coveringZoomLevel(A),z=C;if(C<this.minzoom){return[]}C>this.maxzoom&&(C=this.maxzoom);var D=A,B=D.locationCoordinate(D.center)._zoomTo(C),E=new t(B.column-0.5,B.row-0.5);return q.cover(C,[D.pointCoordinate(new t(0,0))._zoomTo(C),D.pointCoordinate(new t(D.width,0))._zoomTo(C),D.pointCoordinate(new t(D.width,D.height))._zoomTo(C),D.pointCoordinate(new t(0,D.height))._zoomTo(C)],this.reparseOverscaled?z:C).sort(function(F,G){return E.dist(F)-E.dist(G)})},findLoadedChildren:function(A,D,z){for(var F=!0,C=A.z,G=A.children(this.maxzoom),B=0;B<G.length;B++){var E=G[B].id;this._tiles[E]&&this._tiles[E].loaded?z[E]=!0:(F=!1,D>C&&this.findLoadedChildren(G[B],D,z))}return F},findLoadedParent:function(A,C,z){for(var D=A.z-1;D>=C;D--){A=A.parent(this.maxzoom);var B=this._tiles[A.id];if(B&&B.loaded){return z[A.id]=!0,B}}},update:function(E,G,M){var A,z,B,N=(this.roundZoom?Math.round:Math.floor)(this.getZoom(G)),H=s.clamp(N-10,this.minzoom,this.maxzoom),F=s.clamp(N+1,this.minzoom,this.maxzoom),J={},D=(new Date).getTime();this._coveredTiles={};var C=E?this.coveringTiles(G):[];for(A=0;A<C.length;A++){z=C[A],B=this.addTile(z),J[z.id]=!0,B.loaded||this.findLoadedChildren(z,F,J)||this.findLoadedParent(z,H,J)}for(var K in J){z=q.fromID(K),B=this._tiles[K],B&&B.timeAdded>D-(M||0)&&(this.findLoadedChildren(z,F,J)?(this._coveredTiles[K]=!0,J[K]=!0):this.findLoadedParent(z,H,J))}var I=s.keysDifference(this._tiles,J);for(A=0;A<I.length;A++){this.removeTile(+I[A])}},addTile:function(A){var C=this._tiles[A.id];if(C){return C}var z=A.wrapped();if(C=this._tiles[z.id],C||(C=this._cache.get(z.id),C&&this._redoPlacement&&this._redoPlacement(C)),!C){var D=A.z,B=D>this.maxzoom?Math.pow(2,D-this.maxzoom):1;C=new w(z,this.tileSize*B),this.index&&(C.parentId=this.indexSearch(A.id)),this._load(C)}return C.uses++,this._tiles[A.id]=C,this._add(C,A),C},removeTile:function(z){var A=this._tiles[z];A&&(A.uses--,delete this._tiles[z],this._remove(A),A.uses>0||(A.loaded?this._cache.add(A.coord.wrapped().id,A):(this._abort(A),this._unload(A))))},clearTiles:function(){for(var z in this._tiles){this.removeTile(z)}this._cache.reset()},tileAt:function(A){for(var C=this.orderedIDs(),z=0;z<C.length;z++){var D=this._tiles[C[z]],B=D.positionAt(A,this.maxzoom);if(B&&B.x>=0&&B.x<D.tileExtent&&B.y>=0&&B.y<D.tileExtent){return{tile:D,x:B.x,y:B.y,scale:B.scale}}}},tilesIn:function(A){for(var C=[],z=this.orderedIDs(),D=0;D<z.length;D++){var B=this._tiles[z[D]],E=[B.positionAt(A[0],this.maxzoom),B.positionAt(A[1],this.maxzoom)];E[0].x<B.tileExtent&&E[0].y<B.tileExtent&&E[1].x>=0&&E[1].y>=0&&C.push({tile:B,minX:E[0].x,maxX:E[1].x,minY:E[0].y,maxY:E[1].y})}return C},indexSearch:function(A){for(var D=q.fromID(A),z=[A],F=D;0!==F.z;){F=F.parent(),z.push(F.id)}for(var C,G=this.index,B=z.pop(),E=function(H){return H.id};z.length;){if(A=z.pop(),D=q.fromID(B),C=D.children(this.maxzoom).map(E).indexOf(A),G){if(0===G[C]){B=A;break}if(1===G[C]){B=A;break}B=A,G=G[C]}}return 0===z.length?null:B}}},{"../util/mru_cache":104,"../util/util":106,"./tile":44,"./tile_coord":45,"point-geometry":137}],47:[function(q,t,p){function v(w){if(o.extend(this,o.pick(w,["url","tileSize"])),512!==this.tileSize){throw new Error("vector tile sources must have a tileSize of 512")}u._loadTileJSON.call(this,w)}var o=q("../util/util"),s=q("../util/evented"),u=q("./source"),r=q("./tile_coord");t.exports=v,v.prototype=o.inherit(s,{minzoom:0,maxzoom:22,tileSize:512,reparseOverscaled:!0,_loaded:!1,onAdd:function(w){this.map=w},loaded:function(){return this._pyramid&&this._pyramid.loaded()},update:function(w){this._pyramid&&this._pyramid.update(this.used,w)},reload:function(){this._pyramid&&this._pyramid.reload()},redoPlacement:function(){if(this._pyramid){for(var A=this._pyramid.orderedIDs(),z=0;z<A.length;z++){var w=this._pyramid.getTile(A[z]);this._redoTilePlacement(w)}}},render:u._renderTiles,featuresAt:u._vectorFeaturesAt,featuresIn:u._vectorFeaturesIn,_loadTile:function(A){var z=A.coord.z>this.maxzoom?Math.pow(2,A.coord.z-this.maxzoom):1,w={url:A.coord.url(this.tiles,this.maxzoom),uid:A.uid,coord:A.coord,zoom:A.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize*z,source:this.id,overscaling:z,angle:this.map.transform.angle,pitch:this.map.transform.pitch,collisionDebug:this.map.collisionDebug,parentId:A.parentId};A.parentId&&(w.url=r.fromID(A.parentId).url(this.tiles,this.maxzoom)),A.workerID?this.dispatcher.send("reload tile",w,this._tileLoaded.bind(this,A),A.workerID):A.workerID=this.dispatcher.send("load tile",w,this._tileLoaded.bind(this,A))},_tileLoaded:function(A,z,w){if(!A.aborted){if(z){return void this.fire("tile.error",{tile:A})}A.loadVectorData(w),A.redoWhenDone&&(A.redoWhenDone=!1,this._redoTilePlacement(A)),this.fire("tile.load",{tile:A}),this.fire("tile.stats",w.bucketStats)}},_abortTile:function(w){w.aborted=!0,this.dispatcher.send("abort tile",{uid:w.uid,source:this.id},null,w.workerID)},_addTile:function(w){this.fire("tile.add",{tile:w})},_removeTile:function(w){this.fire("tile.remove",{tile:w})},_unloadTile:function(w){w.unloadVectorData(this.map.painter),this.glyphAtlas.removeGlyphs(w.uid),this.dispatcher.send("remove tile",{uid:w.uid,source:this.id},null,w.workerID)},_redoTilePlacement:function(z){function w(B,A){z.reloadSymbolData(A,this.map.painter),this.fire("tile.load",{tile:z}),z.redoingPlacement=!1,z.redoWhenDone&&(this._redoTilePlacement(z),z.redoWhenDone=!1)}return !z.loaded||z.redoingPlacement?void (z.redoWhenDone=!0):(z.redoingPlacement=!0,void this.dispatcher.send("redo placement",{uid:z.uid,source:this.id,angle:this.map.transform.angle,pitch:this.map.transform.pitch,collisionDebug:this.map.collisionDebug},w.bind(this),z.workerID))}})},{"../util/evented":100,"../util/util":106,"./source":43,"./tile_coord":45}],48:[function(p,o,r){function q(A){this.coordinates=A.coordinates,v.getVideo(A.urls,function(D,C){if(!D){this.video=C,this.video.loop=!0;var B;this.video.addEventListener("playing",function(){B=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(B)}.bind(this)),this._loaded=!0,this.map&&(this.video.play(),this.createTile(),this.fire("change"))}}.bind(this))}var s=p("../util/util"),w=p("./tile"),u=p("../geo/lng_lat"),t=p("point-geometry"),z=p("../util/evented"),v=p("../util/ajax");o.exports=q,q.prototype=s.inherit(z,{roundZoom:!0,getVideo:function(){return this.video},onAdd:function(A){this.map=A,this.video&&(this.video.play(),this.createTile())},createTile:function(){var F=this.map,D=this.coordinates.map(function(J){var I=u.convert(J);return F.transform.locationCoordinate(I).zoomTo(0)}),C=s.getCoordinatesCenter(D),E=4096,G=D.map(function(J){var I=J.zoomTo(C.zoom);return new t(Math.round((I.column-C.column)*E),Math.round((I.row-C.row)*E))}),H=F.painter.gl,A=32767,B=new Int16Array([G[0].x,G[0].y,0,0,G[1].x,G[1].y,A,0,G[3].x,G[3].y,0,A,G[2].x,G[2].y,A,A]);this.tile=new w,this.tile.buckets={},this.tile.boundsBuffer=H.createBuffer(),H.bindBuffer(H.ARRAY_BUFFER,this.tile.boundsBuffer),H.bufferData(H.ARRAY_BUFFER,B,H.STATIC_DRAW),this.center=C},loaded:function(){return this.video&&this.video.readyState>=2},update:function(){},reload:function(){},render:function(D,B){if(this._loaded&&!(this.video.readyState<2)){var A=this.center;this.tile.calculateMatrices(A.zoom,A.column,A.row,this.map.transform,B);var C=B.gl;this.tile.texture?(C.bindTexture(C.TEXTURE_2D,this.tile.texture),C.texSubImage2D(C.TEXTURE_2D,0,0,0,C.RGBA,C.UNSIGNED_BYTE,this.video)):(this.tile.texture=C.createTexture(),C.bindTexture(C.TEXTURE_2D,this.tile.texture),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_S,C.CLAMP_TO_EDGE),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_T,C.CLAMP_TO_EDGE),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_MIN_FILTER,C.LINEAR),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_MAG_FILTER,C.LINEAR),C.texImage2D(C.TEXTURE_2D,0,C.RGBA,C.RGBA,C.UNSIGNED_BYTE,this.video)),B.drawLayers(D,this.tile.posMatrix,this.tile)}},featuresAt:function(C,B,A){return A(null,[])},featuresIn:function(C,B,A){return A(null,[])}})},{"../geo/lng_lat":20,"../util/ajax":94,"../util/evented":100,"../util/util":106,"./tile":44,"point-geometry":137}],49:[function(q,o,t){function v(D){this.self=D,this.actor=new p(D,this),this.loading={},this.loaded={},this.layers=[],this.geoJSONIndexes={}}var p=q("../util/actor"),r=q("./worker_tile"),u=q("../util/util"),A=q("../util/ajax"),B=q("vector-tile"),w=q("pbf"),s=q("./tile_coord"),C=q("geojson-vt"),z=q("./geojson_wrapper");o.exports=function(D){return new v(D)},u.extend(v.prototype,{"set layers":function(D){this.layers=D},"load tile":function(H,G){function F(K,M){if(delete this.loading[I][E],K){return G(K)}if(D.data=new B.VectorTile(new w(new Uint8Array(M))),H.parentId&&D.data.layers){var J=this.getChildPosition(H.coord.id,H.parentId);D.parse(D.data,this.layers,this.actor,G,J.dz,J.xPos,J.yPos)}else{D.parse(D.data,this.layers,this.actor,G)}this.loaded[I]=this.loaded[I]||{},this.loaded[I][E]=D}var I=H.source,E=H.uid;this.loading[I]||(this.loading[I]={});var D=this.loading[I][E]=new r(H);D.xhr=A.getArrayBuffer(H.url,F.bind(this))},"reload tile":function(G,F){var E=this.loaded[G.source],H=G.uid;if(E&&E[H]){var D=E[H];D.parse(D.data,this.layers,this.actor,F)}},"abort tile":function(F){var E=this.loading[F.source],D=F.uid;E&&E[D]&&(E[D].xhr.abort(),delete E[D])},"remove tile":function(F){var E=this.loaded[F.source],D=F.uid;E&&E[D]&&delete E[D]},"redo placement":function(I,H){var F=this.loaded[I.source],J=this.loading[I.source],E=I.uid;if(F&&F[E]){var D=F[E],G=D.redoPlacement(I.angle,I.pitch,I.collisionDebug);G.result&&H(null,G.result,G.transferables)}else{J&&J[E]&&(J[E].angle=I.angle)}},"parse geojson":function(F,E){var D=function(G,H){return G?E(G):(this.geoJSONIndexes[F.source]=C(H,F.geojsonVtOptions),void E(null))}.bind(this);"string"==typeof F.data?A.getJSON(F.data,D):D(null,F.data)},"load geojson tile":function(H,G){var F=H.source,I=H.coord,E=this.geoJSONIndexes[F].getTile(I.z,I.x,I.y);if(!E){return G(null,null)}var D=new r(H);D.parse(new z(E.features),this.layers,this.actor,G),this.loaded[F]=this.loaded[F]||{},this.loaded[F][H.uid]=D},"query features":function(F,E){var D=this.loaded[F.source]&&this.loaded[F.source][F.uid];D?D.featureTree.query(F,E):E(null,[])},getChildPosition:function(I,H){var F=s.fromID(I),J=s.fromID(H),E=F.z-J.z,D=F.x&(1<<E)-1,G=F.y&(1<<E)-1;return{dz:E,xPos:D,yPos:G}}})},{"../util/actor":93,"../util/ajax":94,"../util/util":106,"./geojson_wrapper":40,"./tile_coord":45,"./worker_tile":50,"geojson-vt":111,pbf:136,"vector-tile":144}],50:[function(q,s,p){function u(w){this.coord=w.coord,this.uid=w.uid,this.zoom=w.zoom,this.maxZoom=w.maxZoom,this.tileSize=w.tileSize,this.source=w.source,this.overscaling=w.overscaling,this.angle=w.angle,this.pitch=w.pitch,this.collisionDebug=w.collisionDebug,this.stacks={}}var r=q("../data/feature_tree"),o=q("../symbol/collision_tile"),t=q("../data/buffer/buffer_set"),v=q("../data/create_bucket");s.exports=u,u.prototype.parse=function(ac,K,O,Y,N,R,U){function ag(T,ai,w,S,aj){for(var z=0;z<T.length;z++){var D=T.feature(z);D.dz=w,D.xPos=S,D.yPos=aj;for(var ah in ai){var P=ai[ah];P.filter(D)&&P.features.push(D)}}}function W(w){return function(z){w.dependenciesLoaded=!0,J(I,w,z)}}function J(S,z,P){if((!z.getDependencies||z.dependenciesLoaded)&&(!z.needsPlacement||z.previousPlaced)){if(!P){var w=Date.now();z.features.length&&z.addFeatures(aa);var D=Date.now()-w;if(z.interactive){for(var T=0;T<z.features.length;T++){var ah=z.features[T];S.featureTree.insert(ah.bbox(),z.layers,ah)}}"undefined"!=typeof self&&(self.bucketStats=self.bucketStats||{_total:0},self.bucketStats._total+=D,self.bucketStats[z.id]=(self.bucketStats[z.id]||0)+D),z.features=null}return H--,H?void (z.next&&(z.next.previousPlaced=!0,J(S,z.next))):void ab()}}function ab(){if(I.status="done",I.redoPlacementAfterDone){var D=I.redoPlacement(I.angle,I.pitch).result;V.glyphVertex=D.buffers.glyphVertex,V.iconVertex=D.buffers.iconVertex,V.collisionBoxVertex=D.buffers.collisionBoxVertex}var w=[],z={};for(ad in V){w.push(V[ad].array)}for(ad in af){z[ad]=af[ad].elementGroups}Y(null,{elementGroups:z,buffers:V,extent:A,bucketStats:"undefined"!=typeof self?self.bucketStats:null},w)}this.status="parsing",this.featureTree=new r(this.coord,this.overscaling);var ae,ad,Z,Q,I=this,V=new t,aa=new o(this.angle,this.pitch),af={},G=this.bucketsInOrder=[],F={};for(ae=0;ae<K.length;ae++){if(Z=K[ae],Z.source===this.source&&!Z.ref){var X=Z.minzoom;if(!(X&&this.zoom<X&&X<this.maxZoom)){var C=Z.maxzoom;if(!(C&&this.zoom>=C)){var B=Z.layout.visibility;if("none"!==B){if(Q=v(Z,V,this.zoom,this.overscaling,this.collisionDebug),Q.layers=[Z.id],af[Q.id]=Q,G.push(Q),ac.layers){var M=Z["source-layer"];F[M]||(F[M]={}),F[M][Q.id]=Q}else{F[Q.id]=Q}}}}}}for(ae=0;ae<K.length;ae++){Z=K[ae],Z.source===this.source&&Z.ref&&(Q=af[Z.ref],Q&&Q.layers.push(Z.id))}var A=4096;if(ac.layers){for(ad in F){Z=ac.layers[ad],Z&&(Z.extent&&(A=Z.extent),ag(Z,F[ad],N,R,U))}}else{ag(ac,F)}var E,H=G.length;for(ae=G.length-1;ae>=0;ae--){Q=G[ae],Q.needsPlacement&&(E?E.next=Q:Q.previousPlaced=!0,E=Q),Q.getDependencies&&Q.getDependencies(this,O,W(Q)),Q.needsPlacement||Q.getDependencies||J(I,Q)}},u.prototype.redoPlacement=function(E,H,w){if("done"!==this.status){return this.redoPlacementAfterDone=!0,this.angle=E,{}}for(var C=new t,I=[],z={},A=new o(E,H),F=this.bucketsInOrder,B=F.length-1;B>=0;B--){var G=F[B];"symbol"===G.type&&(G.placeFeatures(A,C,w),z[G.id]=G.elementGroups)}for(var D in C){I.push(C[D].array)}return{result:{elementGroups:z,buffers:C},transferables:I}}},{"../data/buffer/buffer_set":2,"../data/create_bucket":13,"../data/feature_tree":15,"../symbol/collision_tile":68}],51:[function(p,q,o){function r(){this.n=0,this.times=[]}q.exports=r,r.prototype.stopped=function(){return this.times=this.times.filter(function(s){return s.time>=(new Date).getTime()}),!this.times.length},r.prototype.set=function(s){return this.times.push({id:this.n,time:s+(new Date).getTime()}),this.n++},r.prototype.cancel=function(s){this.times=this.times.filter(function(t){return t.id!==s})}},{}],52:[function(p,o,r){function v(A){this.base=A,this.retina=t.devicePixelRatio>1;var z=this.retina?"@2x":"";u.getJSON(s(A,z,".json"),function(C,B){return C?void this.fire("error",{error:C}):(this.data=B,void (this.img&&this.fire("load")))}.bind(this)),u.getImage(s(A,z,".png"),function(D,C){if(D){return void this.fire("error",{error:D})}for(var F=C.getData(),E=C.data=new Uint8Array(F.length),B=0;B<F.length;B+=4){var G=F[B+3]/255;E[B+0]=F[B+0]*G,E[B+1]=F[B+1]*G,E[B+2]=F[B+2]*G,E[B+3]=F[B+3]}this.img=C,this.data&&this.fire("load")}.bind(this))}function q(){}var w=p("../util/evented"),u=p("../util/ajax"),t=p("../util/browser"),s=p("../util/mapbox").normalizeSpriteURL;o.exports=v,v.prototype=Object.create(w),v.prototype.toJSON=function(){return this.base},v.prototype.loaded=function(){return !(!this.data||!this.img)},v.prototype.resize=function(){if(t.devicePixelRatio>1!==this.retina){var z=new v(this.base);z.on("load",function(){this.img=z.img,this.data=z.data,this.retina=z.retina}.bind(this))}},q.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},v.prototype.getSpritePosition=function(A){if(!this.loaded()){return new q}var z=this.data&&this.data[A];return z&&this.img?z:new q}},{"../util/ajax":94,"../util/browser":95,"../util/evented":100,"../util/mapbox":103}],53:[function(q,r,p){var o=q("./reference");r.exports={},o.layout.forEach(function(v){var u=function(z){for(var t in z){this[t]=z[t]}},w=o[v];for(var s in w){void 0!==w[s]["default"]&&(u.prototype[s]=w[s]["default"])}r.exports[v.replace("layout_","")]=u})},{"./reference":55}],54:[function(q,r,p){var o=q("./reference"),s=q("csscolorparser").parseCSSColor;r.exports={},o.paint.forEach(function(A){var w=function(){},B=o[A];for(var z in B){var v=B[z],u=v["default"];void 0!==u&&("color"===v.type&&(u=s(u)),w.prototype[z]=u)}w.prototype.hidden=!1,r.exports[A.replace("paint_","")]=w})},{"./reference":55,csscolorparser:107}],55:[function(p,q,o){q.exports=p("mapbox-gl-style-spec/reference/latest")},{"mapbox-gl-style-spec/reference/latest":131}],56:[function(u,q,I){function o(M,J){this.animationLoop=J||new r,this.dispatcher=new D(Math.max(H.hardwareConcurrency-1,1),this),this.glyphAtlas=new B(1024,1024),this.spriteAtlas=new t(512,512),this.spriteAtlas.resize(H.devicePixelRatio),this.lineAtlas=new G(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},p.bindAll(["_forwardSourceEvent","_forwardTileEvent","_redoPlacement"],this);var K=function(R,O){if(R){return void this.fire("error",{error:R})}var Q=z(O);if(Q.length){for(var N=0;N<Q.length;N++){this.fire("error",{error:new Error(Q[N].message)})}}else{this._loaded=!0,this.stylesheet=O;var P=O.sources;for(var S in P){this.addSource(S,P[S])}O.sprite&&(this.sprite=new A(O.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(O.glyphs,this.glyphAtlas),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof M?w.getJSON(E(M),K):H.frame(K.bind(this,null,M))}var C=u("../util/evented"),v=u("./style_batch"),F=u("./style_layer"),A=u("./image_sprite"),s=u("../symbol/glyph_source"),B=u("../symbol/glyph_atlas"),t=u("../symbol/sprite_atlas"),G=u("../render/line_atlas"),p=u("../util/util"),w=u("../util/ajax"),E=u("../util/mapbox").normalizeStyleURL,H=u("../util/browser"),D=u("../util/dispatcher"),r=u("./animation_loop"),z=u("mapbox-gl-style-spec/lib/validate/latest");q.exports=o,o.prototype=p.inherit(C,{_loaded:!1,loaded:function(){if(!this._loaded){return !1}for(var J in this.sources){if(!this.sources[J].loaded()){return !1}}return this.sprite&&!this.sprite.loaded()?!1:!0},_resolve:function(){var M,J;this._layers={},this._order=[];for(var K=0;K<this.stylesheet.layers.length;K++){J=new F(this.stylesheet.layers[K]),this._layers[J.id]=J,this._order.push(J.id)}for(M in this._layers){this._layers[M].resolveLayout()}for(M in this._layers){this._layers[M].resolveReference(this._layers),this._layers[M].resolvePaint()}this._groupLayers(),this._broadcastLayers()},_groupLayers:function(){var M;this._groups=[];for(var J=0;J<this._order.length;++J){var K=this._layers[this._order[J]];M&&K.source===M.source||(M=[],M.source=K.source,this._groups.push(M)),M.push(K)}},_broadcastLayers:function(){var K=[];for(var J in this._layers){K.push(this._layers[J].json())}this.dispatcher.broadcast("set layers",K)},_cascade:function(M,J){if(this._loaded){J=J||{transition:!0};for(var K in this._layers){this._layers[K].cascade(M,J,this.stylesheet.transition||{},this.animationLoop)}this.fire("change")}},_recalculate:function(N){for(var K in this.sources){this.sources[K].used=!1}this._updateZoomHistory(N),this.rasterFadeDuration=300;for(K in this._layers){var M=this._layers[K];M.recalculate(N,this.zoomHistory)&&M.source&&(this.sources[M.source].used=!0)}var J=300;Math.floor(this.z)!==Math.floor(N)&&this.animationLoop.set(J),this.z=N,this.fire("zoom")},_updateZoomHistory:function(K){var J=this.zoomHistory;void 0===J.lastIntegerZoom&&(J.lastIntegerZoom=Math.floor(K),J.lastIntegerZoomTime=0,J.lastZoom=K),Math.floor(J.lastZoom)<Math.floor(K)?(J.lastIntegerZoom=Math.floor(K),J.lastIntegerZoomTime=Date.now()):Math.floor(J.lastZoom)>Math.floor(K)&&(J.lastIntegerZoom=Math.floor(K+1),J.lastIntegerZoomTime=Date.now()),J.lastZoom=K},batch:function(J){v(this,J)},addSource:function(K,J){return this.batch(function(M){M.addSource(K,J)}),this},removeSource:function(J){return this.batch(function(K){K.removeSource(J)}),this},getSource:function(J){return this.sources[J]},addLayer:function(K,J){return this.batch(function(M){M.addLayer(K,J)}),this},removeLayer:function(J){return this.batch(function(K){K.removeLayer(J)}),this},getLayer:function(J){return this._layers[J]},getReferentLayer:function(K){var J=this.getLayer(K);return J.ref&&(J=this.getLayer(J.ref)),J},setFilter:function(K,J){return this.batch(function(M){M.setFilter(K,J)}),this},setLayerZoomRange:function(M,J,K){return this.batch(function(N){N.setLayerZoomRange(M,J,K)}),this},getFilter:function(J){return this.getReferentLayer(J).filter},getLayoutProperty:function(K,J){return this.getReferentLayer(K).getLayoutProperty(J)},getPaintProperty:function(M,J,K){return this.getLayer(M).getPaintProperty(J,K)},featuresAt:function(O,K,N){var J=[],M=null;K.layer&&(K.layerIds=Array.isArray(K.layer)?K.layer:[K.layer]),p.asyncEach(Object.keys(this.sources),function(Q,R){var P=this.sources[Q];P.featuresAt(O,K,function(T,S){S&&(J=J.concat(S)),T&&(M=T),R()})}.bind(this),function(){return M?N(M):void N(null,J.filter(function(P){return void 0!==this._layers[P.layer]}.bind(this)).map(function(P){return P.layer=this._layers[P.layer].json(),P}.bind(this)))}.bind(this))},featuresIn:function(O,K,N){var J=[],M=null;K.layer&&(K.layer={id:K.layer}),p.asyncEach(Object.keys(this.sources),function(Q,R){var P=this.sources[Q];P.featuresIn(O,K,function(T,S){S&&(J=J.concat(S)),T&&(M=T),R()})}.bind(this),function(){return M?N(M):void N(null,J.filter(function(P){return void 0!==this._layers[P.layer]}.bind(this)).map(function(P){return P.layer=this._layers[P.layer].json(),P}.bind(this)))}.bind(this))},_remove:function(){this.dispatcher.remove()},_reloadSource:function(J){this.sources[J].reload()},_updateSources:function(K){for(var J in this.sources){this.sources[J].update(K)}},_redoPlacement:function(){for(var J in this.sources){this.sources[J].redoPlacement&&this.sources[J].redoPlacement()}},_forwardSourceEvent:function(J){this.fire("source."+J.type,p.extend({source:J.target},J))},_forwardTileEvent:function(J){this.fire(J.type,p.extend({source:J.target},J))},"get sprite json":function(M,J){var K=this.sprite;K.loaded()?J(null,{sprite:K.data,retina:K.retina}):K.on("load",function(){J(null,{sprite:K.data,retina:K.retina})})},"get icons":function(N,K){var M=this.sprite,J=this.spriteAtlas;M.loaded()?(J.setSprite(M),J.addIcons(N.icons,K)):M.on("load",function(){J.setSprite(M),J.addIcons(N.icons,K)})},"get glyphs":function(K,J){this.glyphSource.getSimpleGlyphs(K.fontstack,K.codepoints,K.uid,J)}})},{"../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":129}],57:[function(p,r,o){function t(w,u){if(!w._loaded){throw new Error("Style is not done loading")}var v=Object.create(t.prototype);v._style=w,v._groupLayers=!1,v._broadcastLayers=!1,v._reloadSources={},v._events=[],v._change=!1,u(v),v._groupLayers&&v._style._groupLayers(),v._broadcastLayers&&v._style._broadcastLayers(),Object.keys(v._reloadSources).forEach(function(z){v._style._reloadSource(z)}),v._events.forEach(function(z){v._style.fire.apply(v._style,z)}),v._change&&v._style.fire("change")}var s=p("../source/source"),q=p("./style_layer");t.prototype={addLayer:function(v,u){if(void 0!==this._style._layers[v.id]){throw new Error("There is already a layer with this ID")}return v instanceof q||(v=new q(v)),this._style._layers[v.id]=v,this._style._order.splice(u?this._style._order.indexOf(u):1/0,0,v.id),v.resolveLayout(),v.resolveReference(this._style._layers),v.resolvePaint(),this._groupLayers=!0,this._broadcastLayers=!0,v.source&&(this._reloadSources[v.source]=!0),this._events.push(["layer.add",{layer:v}]),this._change=!0,this},removeLayer:function(w){var u=this._style._layers[w];if(void 0===u){throw new Error("There is no layer with this ID")}for(var v in this._style._layers){this._style._layers[v].ref===w&&this.removeLayer(v)}return delete this._style._layers[w],this._style._order.splice(this._style._order.indexOf(w),1),this._groupLayers=!0,this._broadcastLayers=!0,this._events.push(["layer.remove",{layer:u}]),this._change=!0,this},setPaintProperty:function(z,u,w,v){return this._style.getLayer(z).setPaintProperty(u,w,v),this._change=!0,this},setLayoutProperty:function(w,u,v){return w=this._style.getReferentLayer(w),w.setLayoutProperty(u,v),this._broadcastLayers=!0,w.source&&(this._reloadSources[w.source]=!0),this._change=!0,this},setFilter:function(v,u){return v=this._style.getReferentLayer(v),v.filter=u,this._broadcastLayers=!0,v.source&&(this._reloadSources[v.source]=!0),this._change=!0,this},setLayerZoomRange:function(z,u,w){var v=this._style.getReferentLayer(z);return null!=u&&(v.minzoom=u),null!=w&&(v.maxzoom=w),this._broadcastLayers=!0,v.source&&(this._reloadSources[v.source]=!0),this._change=!0,this},addSource:function(v,u){if(!this._style._loaded){throw new Error("Style is not done loading")}if(void 0!==this._style.sources[v]){throw new Error("There is already a source with this ID")}return u=s.create(u),this._style.sources[v]=u,u.id=v,u.style=this._style,u.dispatcher=this._style.dispatcher,u.glyphAtlas=this._style.glyphAtlas,u.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).on("tile.stats",this._style._forwardTileEvent),this._events.push(["source.add",{source:u}]),this._change=!0,this},removeSource:function(v){if(void 0===this._style.sources[v]){throw new Error("There is no source with this ID")}var u=this._style.sources[v];return delete this._style.sources[v],u.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).off("tile.stats",this._style._forwardTileEvent),this._events.push(["source.remove",{source:u}]),this._change=!0,this}},r.exports=t},{"../source/source":43,"./style_layer":60}],58:[function(s,r,u){function o(B,C){this.type=B.type,this.transitionable=B.transition,null==C&&(C=B["default"]),this.json=JSON.stringify(C),"color"===this.type?this.value=z(C):this.value=C,"interpolated"===B["function"]?this.calculate=q.interpolated(this.value):(this.calculate=q["piecewise-constant"](this.value),B.transition&&(this.calculate=w(this.calculate)))}function w(B){return function(C,D,H){var E,G,J,F=C%1,M=Math.min((Date.now()-D.lastIntegerZoomTime)/H,1),I=1,K=1;return C>D.lastIntegerZoom?(E=F+(1-F)*M,I*=2,G=B(C-1),J=B(C)):(E=1-(1-M)*F,J=B(C),G=B(C+1),I/=2),{from:G,fromScale:I,to:J,toScale:K,t:E}}}function z(B){if(t[B]){return t[B]}if(Array.isArray(B)){return B}if(B.stops){return v.extend({},B,{stops:B.stops.map(function(D){return[D[0],z(D[1])]})})}if("string"==typeof B){var C=A(p(B));return t[B]=C,C}throw new Error("Invalid color "+B)}function A(B){return[B[0]/255,B[1]/255,B[2]/255,B[3]/1]}var p=s("csscolorparser").parseCSSColor,q=s("mapbox-gl-function"),v=s("../util/util");r.exports=o;var t={}},{"../util/util":106,csscolorparser:107,"mapbox-gl-function":128}],59:[function(s,t,q){function r(w){function z(A){this._values={},this._transitions={};for(var B in A){this[B]=A[B]}}return Object.keys(w).forEach(function(B){var A=w[B];Object.defineProperty(z.prototype,B,{set:function(C){this._values[B]=new v(A,C)},get:function(){return this._values[B].value}}),A.transition&&Object.defineProperty(z.prototype,B+"-transition",{set:function(C){this._transitions[B]=C},get:function(){return this._transitions[B]}})}),z.prototype.values=function(){return this._values},z.prototype.transition=function(A,B){var C=this._transitions[A]||{};return{duration:p.coalesce(C.duration,B.duration,300),delay:p.coalesce(C.delay,B.delay,0)}},z.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},z}var p=s("../util/util"),o=s("./reference"),v=s("./style_declaration"),u={paint:{},layout:{}};o.layer.type.values.forEach(function(w){u.paint[w]=r(o["paint_"+w]),u.layout[w]=r(o["layout_"+w])}),t.exports=function(w,z,A){return new u[w][z](A)}},{"../util/util":106,"./reference":55,"./style_declaration":58}],60:[function(p,o,s){function q(A){this._layer=A,this.id=A.id,this.ref=A.ref,this._resolved={},this._cascaded={},this.assign(A)}function w(K,E){var G=E+"-color",I=E+"-halo-color",B=E+"-outline-color",A=K[G],M=K[I],C=K[B],D=K[E+"-opacity"],H=A&&D*A[3],J=M&&D*M[3],F=C&&D*C[3];void 0!==H&&1>H&&(K[G]=u.premultiply([A[0],A[1],A[2],H])),void 0!==J&&1>J&&(K[I]=u.premultiply([M[0],M[1],M[2],J])),void 0!==F&&1>F&&(K[B]=u.premultiply([C[0],C[1],C[2],F]))}var u=p("../util/util"),t=p("./style_transition"),r=p("./style_declaration_set"),z=p("./layout_properties"),v=p("./paint_properties");o.exports=q,q.prototype={resolveLayout:function(){this.ref||(this.layout=new z[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(B,A){null==A?delete this.layout[B]:this.layout[B]=A},getLayoutProperty:function(A){return this.layout[A]},resolveReference:function(A){this.ref&&this.assign(A[this.ref])},resolvePaint:function(){for(var B in this._layer){var A=B.match(/^paint(?:\.(.*))?$/);A&&(this._resolved[A[1]||""]=new r("paint",this.type,this._layer[B]))}},setPaintProperty:function(C,B,D){var A=this._resolved[D||""];A||(A=this._resolved[D||""]=new r("paint",this.type,{})),A[C]=B},getPaintProperty:function(B,A){var C=this._resolved[A||""];if(C){return C[B]}},cascade:function(M,E,G,J){for(var B in this._resolved){if(""===B||M[B]){var A=this._resolved[B],N=A.values();for(var C in N){var D=N[C],I=E.transition?this._cascaded[C]:void 0;if(!I||I.declaration.json!==D.json){var K=A.transition(C,G),F=this._cascaded[C]=new t(D,I,K);F.instant()||(F.loopID=J.set(F.endTime-(new Date).getTime())),I&&J.cancel(I.loopID)}}}}if("symbol"===this.type){var H=new r("layout",this.type,this.layout);this._cascaded["text-size"]=new t(H.values()["text-size"],void 0,G),this._cascaded["icon-size"]=new t(H.values()["icon-size"],void 0,G)}},recalculate:function(C,B){var F=this.type,A=this.paint=new v[F];for(var G in this._cascaded){A[G]=this._cascaded[G].at(C,B)}if(this.hidden=this.minzoom&&C<this.minzoom||this.maxzoom&&C>=this.maxzoom||"none"===this.layout.visibility,"symbol"===F?0!==A["text-opacity"]&&this.layout["text-field"]||0!==A["icon-opacity"]&&this.layout["icon-image"]?(w(A,"text"),w(A,"icon")):this.hidden=!0:0===A[F+"-opacity"]?this.hidden=!0:w(A,F),this._cascaded["line-dasharray"]){var E=A["line-dasharray"],D=this._cascaded["line-width"]?this._cascaded["line-width"].at(Math.floor(C),1/0):A["line-width"];E.fromScale*=D,E.toScale*=D}return !this.hidden},assign:function(A){u.extend(this,u.pick(A,["type","source","source-layer","minzoom","maxzoom","filter","layout"]))},json:function(){return u.extend({},this._layer,u.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(s,t,p){function r(w,v,z){this.declaration=w,this.startTime=this.endTime=(new Date).getTime();var A=w.type;"string"!==A&&"array"!==A||!w.transitionable?this.interp=q[A]:this.interp=u,this.oldTransition=v,this.duration=z.duration||0,this.delay=z.delay||0,this.instant()||(this.endTime=this.startTime+this.duration+this.delay,this.ease=o.easeCubicInOut),v&&v.endTime<=this.startTime&&delete v.oldTransition}function u(w,v,z){return{from:w.to,fromScale:w.toScale,to:v.to,toScale:v.toScale,t:z}}var o=s("../util/util"),q=s("../util/interpolate");t.exports=r,r.prototype.instant=function(){return !this.oldTransition||!this.interp||0===this.duration&&0===this.delay},r.prototype.at=function(z,w,B){var C=this.declaration.calculate(z,w,this.duration);if(this.instant()){return C}if(B=B||Date.now(),B<this.endTime){var A=this.oldTransition.at(z,w,this.startTime),v=this.ease((B-this.startTime-this.delay)/this.duration);C=this.interp(A,C,v)}return C}},{"../util/interpolate":102,"../util/util":106}],62:[function(q,r,p){function o(u,v,w,z){this.x=u,this.y=v,this.angle=w,void 0!==z&&(this.segment=z)}var s=q("point-geometry");r.exports=o,o.prototype=Object.create(s.prototype),o.prototype.clone=function(){return new o(this.x,this.y,this.angle,this.segment)}},{"point-geometry":137}],63:[function(p,q,o){function r(t,s){this.width=t,this.height=s,this.free=[{x:0,y:0,w:t,h:s}]}q.exports=r,r.prototype.release=function(u){for(var t=0;t<this.free.length;t++){var s=this.free[t];if(s.y===u.y&&s.h===u.h&&s.x+s.w===u.x){s.w+=u.w}else{if(s.x===u.x&&s.w===u.w&&s.y+s.h===u.y){s.h+=u.h}else{if(u.y===s.y&&u.h===s.h&&u.x+u.w===s.x){s.x=u.x,s.w+=u.w}else{if(u.x!==s.x||u.w!==s.w||u.y+u.h!==s.y){continue}s.y=u.y,s.h+=u.h}}}return this.free.splice(t,1),void this.release(s)}this.free.push(u)},r.prototype.allocate=function(B,z){for(var v={x:1/0,y:1/0,w:1/0,h:1/0},u=-1,w=0;w<this.free.length;w++){var A=this.free[w];B<=A.w&&z<=A.h&&A.y<=v.y&&A.x<=v.x&&(v=A,u=w)}return 0>u?{x:-1,y:-1}:(this.free.splice(u,1),v.w<v.h?(v.w>B&&this.free.push({x:v.x+B,y:v.y,w:v.w-B,h:z}),v.h>z&&this.free.push({x:v.x,y:v.y+z,w:v.w,h:v.h-z})):(v.w>B&&this.free.push({x:v.x+B,y:v.y,w:v.w-B,h:v.h}),v.h>z&&this.free.push({x:v.x,y:v.y+z,w:B,h:v.h-z})),{x:v.x,y:v.y,w:B,h:z})}},{}],64:[function(p,q,o){function r(F,J,H,v,z){if(void 0===J.segment){return !0}for(var B=J,K=J.segment+1,E=0;E>-H/2;){if(K--,0>K){return !1}E-=F[K].dist(B),B=F[K]}E+=F[K].dist(F[K+1]),K++;for(var A=[],w=0;H/2>E;){var I=F[K-1],G=F[K],D=F[K+1];if(!D){return !1}var C=I.angleTo(G)-G.angleTo(D);for(C=(C+3*Math.PI)%(2*Math.PI)-Math.PI,A.push({distance:E,angleDelta:C}),w+=C;E-A[0].distance>v;){w-=A.shift().angleDelta}if(Math.abs(w)>z){return !1}K++,E+=G.dist(D)}return !0}q.exports=r},{}],65:[function(p,q,o){function s(G,F,A,E,J){for(var C=[],z=0;z<G.length;z++){for(var v,D=G[z],I=0;I<D.length-1;I++){var H=D[I],B=D[I+1];H.x<F&&B.x<F||(H.x<F?H=new r(F,H.y+(B.y-H.y)*((F-H.x)/(B.x-H.x))):B.x<F&&(B=new r(F,H.y+(B.y-H.y)*((F-H.x)/(B.x-H.x)))),H.y<A&&B.y<A||(H.y<A?H=new r(H.x+(B.x-H.x)*((A-H.y)/(B.y-H.y)),A):B.y<A&&(B=new r(H.x+(B.x-H.x)*((A-H.y)/(B.y-H.y)),A)),H.x>=E&&B.x>=E||(H.x>=E?H=new r(E,H.y+(B.y-H.y)*((E-H.x)/(B.x-H.x))):B.x>=E&&(B=new r(E,H.y+(B.y-H.y)*((E-H.x)/(B.x-H.x)))),H.y>=J&&B.y>=J||(H.y>=J?H=new r(H.x+(B.x-H.x)*((J-H.y)/(B.y-H.y)),J):B.y>=J&&(B=new r(H.x+(B.x-H.x)*((J-H.y)/(B.y-H.y)),J)),v&&H.equals(v[v.length-1])||(v=[H],C.push(v)),v.push(B)))))}}return C}var r=p("point-geometry");q.exports=s},{"point-geometry":137}],66:[function(q,r,o){function p(w,v,A,z,B,u){this.anchorPoint=w,this.x1=v,this.y1=A,this.x2=z,this.y2=B,this.maxScale=u,this.placementScale=0,this[0]=this[1]=this[2]=this[3]=0}r.exports=p},{}],67:[function(q,r,o){function t(w,B,H,D,v,I){var z=H.top*D-v,A=H.bottom*D+v,F=H.left*D-v,G=H.right*D+v;if(this.boxes=[],I){var C=A-z,E=G-F;if(0>=C){return}C=Math.max(10*D,C),this._addLineCollisionBoxes(w,B,E,C)}else{this.boxes.push(new p(new s(B.x,B.y),F,z,G,A,1/0))}}var p=q("./collision_box"),s=q("point-geometry");r.exports=t,t.prototype._addLineCollisionBoxes=function(H,M,B,P){var F=P/2,D=Math.floor(B/F),I=-P/2,K=this.boxes,S=M,A=M.segment+1,N=I;do{if(A--,0>A){return K}N-=H[A].dist(S),S=H[A]}while(N>-B/2);for(var w=H[A].dist(H[A+1]),Q=0;D>Q;Q++){for(var O=-B/2+Q*F;O>N+w;){if(N+=w,A++,A+1>=H.length){return K}w=H[A].dist(H[A+1])}var E=O-N,R=H[A],J=H[A+1],G=J.sub(R)._unit()._mult(E)._add(R),z=Math.max(Math.abs(O-I)-F/2,0),T=B/2/z;K.push(new p(G,-P/2,-P/2,P/2,P/2,T))}return K}},{"./collision_box":66,"point-geometry":137}],68:[function(r,s,p){function o(w,u){this.tree=q(),this.angle=w;var z=Math.sin(w),v=Math.cos(w);this.rotationMatrix=[v,-z,z,v],this.yStretch=1/Math.cos(u/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3)}var q=r("rbush");s.exports=o,o.prototype.minScale=0.25,o.prototype.maxScale=2,o.prototype.placeCollisionFeature=function(C){for(var Q=this.minScale,O=this.rotationMatrix,K=this.yStretch,G=0;G<C.boxes.length;G++){var J=C.boxes[G],E=J.anchorPoint.matMult(O),D=E.x,N=E.y;J[0]=D+J.x1,J[1]=N+J.y1*K,J[2]=D+J.x2,J[3]=N+J.y2*K;for(var H=this.tree.search(J),P=0;P<H.length;P++){var A=H[P],I=A.anchorPoint.matMult(O),z=(A.x1-J.x2)/(D-I.x),B=(A.x2-J.x1)/(D-I.x),v=(A.y1-J.y2)*K/(N-I.y),F=(A.y2-J.y1)*K/(N-I.y);(isNaN(z)||isNaN(B))&&(z=B=1),(isNaN(v)||isNaN(F))&&(v=F=1);var w=Math.min(Math.max(z,B),Math.max(v,F));if(w>A.maxScale&&(w=A.maxScale),w>J.maxScale&&(w=J.maxScale),w>Q&&w>=A.placementScale&&(Q=w),Q>=this.maxScale){return Q}}}return Q},o.prototype.insertCollisionFeature=function(w,u){for(var z=w.boxes,v=0;v<z.length;v++){z[v].placementScale=u}u<this.maxScale&&this.tree.load(z)}},{rbush:139}],69:[function(r,s,p){function v(F,w,J,H,A,z,B,D){var C=H?0.6*z*B:0,G=Math.max(H?H.right-H.left:0,A?A.right-A.left:0);if(0===F[0].x||4096===F[0].x||0===F[0].y||4096===F[0].y){var I=!0}w/4>w-G*B&&(w=G*B+w/4);var K=2*z,E=I?w/2*D%w:(G/2+K)*B*D%w;return t(F,E,w,C,J,G*B,I,!1)}function t(R,F,D,T,J,I,M,O){for(var N=0,S=F-D,C=[],E=0;E<R.length-1;E++){for(var P=R[E],H=R[E+1],z=P.dist(H),Q=H.angleTo(P);N+z>S+D;){S+=D;var B=(S-N)/z,K=q(P.x,H.x,B),G=q(P.y,H.y,B);if(K>=0&&4096>K&&G>=0&&4096>G){K=Math.round(K),G=Math.round(G);var w=new o(K,G,Q,E);(!T||u(R,w,I,T,J))&&C.push(w)}}N+=z}return O||C.length||M||(C=t(R,N/2,D,T,J,I,M,!0)),C}var q=r("../util/interpolate"),o=r("../symbol/anchor"),u=r("./check_max_angle");s.exports=v},{"../symbol/anchor":62,"../util/interpolate":102,"./check_max_angle":64}],70:[function(p,q,o){function r(v,u){this.width=v,this.height=u,this.bin=new s(v,u),this.index={},this.ids={},this.data=new Uint8Array(v*u)}var s=p("./bin_pack");q.exports=r,r.prototype={get debugfunction(){return"canvas" in this},set debugfunction(u){u&&!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")):!u&&this.canvas&&(this.canvas.parentNode.removeChild(this.canvas),delete this.ctx,delete this.canvas)}},r.prototype.getGlyphs=function(){var v,u,A,z={};for(var w in this.ids){v=w.split("#"),u=v[0],A=v[1],z[u]||(z[u]=[]),z[u].push(A)}return z},r.prototype.getRects=function(){var v,u,A,z={};for(var w in this.ids){v=w.split("#"),u=v[0],A=v[1],z[u]||(z[u]={}),z[u][A]=this.index[w]}return z},r.prototype.removeGlyphs=function(D){for(var w in this.ids){var A=this.ids[w],E=A.indexOf(D);if(E>=0&&A.splice(E,1),this.ids[w]=A,!A.length){for(var z=this.index[w],C=this.data,u=0;u<z.h;u++){for(var v=this.width*(z.y+u)+z.x,B=0;B<z.w;B++){C[v+B]=0}}this.dirty=!0,this.bin.release(z),delete this.index[w],delete this.ids[w]}}this.updateTexture(this.gl)},r.prototype.addGlyph=function(N,D,G,P){if(!G){return null}var F=D+"#"+G.id;if(this.index[F]){return this.ids[F].indexOf(N)<0&&this.ids[F].push(N),this.index[F]}if(!G.bitmap){return null}var K=G.width+2*P,v=G.height+2*P,A=1,H=K+2*A,B=v+2*A;H+=4-H%4,B+=4-B%4;var z=this.bin.allocate(H,B);if(z.x<0){return console.warn("glyph bitmap overflow"),{glyph:G,rect:null}}this.index[F]=z,this.ids[F]=[N];for(var I=this.data,w=G.bitmap,M=0;v>M;M++){for(var J=this.width*(z.y+M+A)+z.x+A,O=K*M,C=0;K>C;C++){I[J+C]=w[O+C]}}return this.dirty=!0,z},r.prototype.bind=function(u){this.gl=u,this.texture?u.bindTexture(u.TEXTURE_2D,this.texture):(this.texture=u.createTexture(),u.bindTexture(u.TEXTURE_2D,this.texture),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(u.TEXTURE_2D,0,u.ALPHA,this.width,this.height,0,u.ALPHA,u.UNSIGNED_BYTE,null))},r.prototype.updateTexture=function(w){if(this.bind(w),this.dirty){if(w.texSubImage2D(w.TEXTURE_2D,0,0,0,this.width,this.height,w.ALPHA,w.UNSIGNED_BYTE,this.data),this.ctx){for(var v=this.ctx.getImageData(0,0,this.width,this.height),B=0,A=0;B<this.data.length;B++,A+=4){v.data[A]=this.data[B],v.data[A+1]=this.data[B],v.data[A+2]=this.data[B],v.data[A+3]=255}this.ctx.putImageData(v,0,0),this.ctx.strokeStyle="red";for(var z=0;z<this.bin.free.length;z++){var u=this.bin.free[z];this.ctx.strokeRect(u.x,u.y,u.w,u.h)}}this.dirty=!1}}},{"./bin_pack":63}],71:[function(p,o,q){function u(A,B){this.url=A&&s(A),this.glyphAtlas=B,this.stacks=[],this.loading={}}function v(B,D,C){var A=1;this.advance=B.advance,this.left=B.left-C-A,this.top=B.top+C+A,this.rect=D}function r(B,D,C,A){return A=A||"abc",C.replace("{s}",A[B.length%A.length]).replace("{fontstack}",B).replace("{range}",D)}var s=p("../util/mapbox").normalizeGlyphsURL,t=p("../util/ajax").getArrayBuffer,z=p("../util/glyphs"),w=p("pbf");o.exports=u,u.prototype.getSimpleGlyphs=function(Q,J,A,F){void 0===this.stacks[Q]&&(this.stacks[Q]={});for(var E,O={},R=this.stacks[Q],G=this.glyphAtlas,C=3,D={},B=0,P=0;P<J.length;P++){var I=J[P];if(E=Math.floor(I/256),R[E]){var N=R[E].glyphs[I],M=G.addGlyph(A,Q,N,C);N&&(O[I]=new v(N,M,C))}else{void 0===D[E]&&(D[E]=[],B++),D[E].push(I)}}B||F(void 0,O);var H=function(X,S,U){if(!X){for(var T=this.stacks[Q][S]=U.stacks[0],W=0;W<D[S].length;W++){var Z=D[S][W],Y=T.glyphs[Z],V=G.addGlyph(A,Q,Y,C);Y&&(O[Z]=new v(Y,V,C))}}B--,B||F(void 0,O)}.bind(this);for(var K in D){this.loadRange(Q,K,H)}},u.prototype.loadRange=function(D,F,E){if(256*F>65535){return E("gyphs > 65535 not supported")}void 0===this.loading[D]&&(this.loading[D]={});var C=this.loading[D];if(C[F]){C[F].push(E)}else{C[F]=[E];var B=256*F+"-"+(256*F+255),A=r(D,B,this.url);t(A,function(I,J){for(var H=!I&&new z(new w(new Uint8Array(J))),G=0;G<C[F].length;G++){C[F][G](I,F,H)}delete C[F]})}}},{"../util/ajax":94,"../util/glyphs":101,"../util/mapbox":103,pbf:136}],72:[function(p,q,o){q.exports=function(P,C,H){function E(s){J.push(P[s]),R.push(H[s]),A.push(C[s]),M++}function B(v,s,T){var u=O[v];return delete O[v],O[s]=u,R[u][0].pop(),R[u][0]=R[u][0].concat(T[0]),u}function K(v,s,T){var u=S[s];return delete S[s],S[v]=u,R[u][0].shift(),R[u][0]=T[0].concat(R[u][0]),u}function G(v,s,T){var u=T?s[0][s[0].length-1]:s[0][0];return v+":"+u.x+":"+u.y}var D,S={},O={},J=[],R=[],A=[],M=0;for(D=0;D<P.length;D++){var F=H[D],Q=C[D];if(F){if(Q){var N=G(Q,F),z=G(Q,F,!0);if(N in O&&z in S&&O[N]!==S[z]){var I=K(N,z,F),w=B(N,z,R[I]);delete S[N],delete O[z],O[G(Q,R[w],!0)]=w,R[I]=null}else{N in O?B(N,z,F):z in S?K(N,z,F):(E(D),S[N]=M-1,O[z]=M-1)}}else{E(D)}}}return{features:J,textFeatures:A,geometries:R}}},{}],73:[function(s,p,t){function o(H,G,F,B,D,A,z,E,C){this.anchorPoint=H,this.tl=G,this.tr=F,this.bl=B,this.br=D,this.tex=A,this.angle=z,this.minScale=E,this.maxScale=C}function w(G,X,V,K,Q,J){var I=X.image.rect,R=1,O=X.left-R,H=O+I.w,N=X.top-R,F=N+I.h,W=new v(O,N),T=new v(H,N),B=new v(H,F),A=new v(O,F),U=Q["icon-rotate"]*Math.PI/180;if(J){var C=K[G.segment];U+=Math.atan2(G.y-C.y,G.x-C.x)}if(U){var z=Math.sin(U),E=Math.cos(U),D=[E,-z,z,E];W=W.matMult(D),T=T.matMult(D),A=A.matMult(D),B=B.matMult(D)}return[new o(new v(G.x,G.y),W,T,A,B,X.image.rect,0,r,1/0)]}function q(ab,av,aq,ah,am,ag){for(var ad=am["text-rotate"]*Math.PI/180,an=am["text-keep-upright"],aj=av.positionedGlyphs,ac=[],ai=0;ai<aj.length;ai++){var aa=aj[ai],at=aa.glyph,ao=at.rect;if(ao){var J,H=(aa.x+at.advance/2)*aq,ap=r;ag?(J=[],ap=u(J,ab,H,ah,ab.segment,!0),an&&(ap=Math.min(ap,u(J,ab,H,ah,ab.segment,!1)))):J=[{anchorPoint:new v(ab.x,ab.y),offset:0,angle:0,maxScale:1/0,minScale:r}];for(var W=aa.x+at.left,E=aa.y-at.top,Z=W+ao.w,X=E+ao.h,af=new v(W,E),Y=new v(Z,E),ar=new v(W,X),K=new v(Z,X),au=0;au<J.length;au++){var F=J[au],N=af,ak=Y,ae=ar,aw=K,al=F.angle+ad;if(al){var V=Math.sin(al),U=Math.cos(al),T=[U,-V,V,U];N=N.matMult(T),ak=ak.matMult(T),ae=ae.matMult(T),aw=aw.matMult(T)}var R=Math.max(F.minScale,ap),O=(ab.angle+ad+F.offset+2*Math.PI)%(2*Math.PI);ac.push(new o(F.anchorPoint,N,ak,ae,aw,ao,O,R,F.maxScale))}}}return ac}function u(O,K,H,B,E,A){var z=!A;0>H&&(A=!A),A&&E++;var F=new v(K.x,K.y),D=B[E],P=1/0;H=Math.abs(H);for(var C=r;;){var N=F.dist(D),J=H/N,G=Math.atan2(D.y-F.y,D.x-F.x);if(A||(G+=Math.PI),z&&(G+=Math.PI),O.push({anchorPoint:F,offset:z?Math.PI:0,minScale:J,maxScale:P,angle:(G+2*Math.PI)%(2*Math.PI)}),C>=J){break}for(F=D;F.equals(D);){if(E+=A?1:-1,D=B[E],!D){return J}}var I=D.sub(F)._unit();F=F.sub(I._mult(N)),P=J}return C}var v=s("point-geometry");p.exports={getIconQuads:w,getGlyphQuads:q};var r=0.5},{"point-geometry":137}],74:[function(q,r,o){function s(z,w){for(var A=[],v=0,B=z.length;B>v;v++){var u=p(z[v].properties,w["icon-image"]);u&&A.indexOf(u)<0&&A.push(u)}return A}var p=q("../util/token");r.exports=s},{"../util/token":105}],75:[function(q,r,o){function u(D,w,H){for(var z=[],I=[],A=0,G=D.length;G>A;A++){var E=p(D[A].properties,w["text-field"]);if(E){E=E.toString();var B=w["text-transform"];"uppercase"===B?E=E.toLocaleUpperCase():"lowercase"===B&&(E=E.toLocaleLowerCase());for(var C=0,F=E.length;F>C;C++){I.push(E.charCodeAt(C))}z[A]=E}else{z[A]=null}}return I=t(I,H),{textFeatures:z,codepoints:I}}function t(A,z){var v,B=[];A.sort(s);for(var w=0;w<A.length;w++){A[w]!==v&&(v=A[w],z[v]||B.push(A[w]))}return B}function s(w,v){return w-v}var p=q("../util/token");r.exports=u},{"../util/token":105}],76:[function(q,o,v){function u(D,C,F,E){this.codePoint=D,this.x=C,this.y=F,this.glyph=E}function t(D,C,H,F,G,E){this.positionedGlyphs=D,this.text=C,this.top=H,this.bottom=F,this.left=G,this.right=E}function A(S,H,F,M,E,I,P,T,C){for(var G=[],K=new t(G,S,C[1],C[1],C[0],C[0]),O=-17,D=C[0],R=C[1]+O,N=0;N<S.length;N++){var J=S.charCodeAt(N),Q=H[J];Q&&(G.push(new u(J,D,R,Q)),D+=Q.advance+T)}return G.length?(B(K,H,M,F,E,I,P),K):!1}function B(H,Q,N,U,M,R,X){var I=null,J=0,O=0,T=0,W=0,K=H.positionedGlyphs;if(U){for(var G=0;G<K.length;G++){var V=K[G];if(V.x-=J,V.y+=N*T,V.x>U&&null!==I){var S=K[I+1].x;W=Math.max(S,W);for(var F=I+1;G>=F;F++){K[F].y+=N,K[F].x-=S}X&&r(K,Q,O,I-1,X),O=I+1,I=null,J+=S,T++}s[V.codePoint]&&(I=G)}}var E=K[K.length-1],D=E.x+Q[E.codePoint].advance;W=Math.max(W,D);var C=(T+1)*N;r(K,Q,O,K.length-1,X),z(K,X,M,R,W,N,T),H.top+=-R*C,H.bottom=H.top+C,H.left+=-M*W,H.right=H.left+W}function r(E,D,J,H,I){for(var G=D[E[H].codePoint].advance,C=(E[H].x+G)*I,F=J;H>=F;F++){E[F].x-=C}}function z(K,G,E,I,D,H,J){for(var M=(G-E)*D,C=(-I*(J+1)+0.5)*H,F=0;F<K.length;F++){K[F].x+=M,K[F].y+=C}}function w(E,D){if(!E||!E.rect){return null}var J=D["icon-offset"][0],H=D["icon-offset"][1],I=J-E.width/2,G=I+E.width,C=H-E.height/2,F=C+E.height;return new p(E,C,F,I,G)}function p(D,C,G,E,F){this.image=D,this.top=C,this.bottom=G,this.left=E,this.right=F}o.exports={shapeText:A,shapeIcon:w};var s={32:!0}},{}],77:[function(r,s,q){function o(w,v){this.width=w,this.height=v,this.bin=new t(w,v),this.images={},this.data=!1,this.texture=0,this.filter=0,this.pixelRatio=1,this.dirty=!0}function p(K,C,F,D,J,M,v,z,A,B,w){var G,H,I=D*C+F,E=z*M+v;if(w){for(E-=M,H=-1;B>=H;H++,I=((H+B)%B+D)*C+F,E+=M){for(G=-1;A>=G;G++){J[E+G]=K[I+(G+A)%A]}}}else{for(H=0;B>H;H++,I+=C,E+=M){for(G=0;A>G;G++){J[E+G]=K[I+G]}}}}function u(w,v,A,z){this.rect=w,this.width=v,this.height=A,this.sdf=z}var t=r("./bin_pack");s.exports=o,o.prototype={get debugfunction(){return"canvas" in this},set debugfunction(v){v&&!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")):!v&&this.canvas&&(this.canvas.parentNode.removeChild(this.canvas),delete this.ctx,delete this.canvas)}},o.prototype.resize=function(J){if(this.pixelRatio===J){return !1}var C=this.pixelRatio;if(this.pixelRatio=J,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio),this.data){var E=this.data;this.data=!1,this.allocate(),this.texture=!1;for(var D=this.width*C,I=this.height*C,K=this.width*J,v=this.height*J,z=this.data,A=E,B=0;v>B;B++){for(var w=Math.floor(B*I/v)*D,F=B*K,G=0;K>G;G++){var H=Math.floor(G*D/K);z[F+G]=A[w+H]}}E=null,this.dirty=!0}return this.dirty},o.prototype.allocateImage=function(z,w){var C=2,B=z+C+(4-(z+C)%4),v=w+C+(4-(w+C)%4),A=this.bin.allocate(B,v);return 0===A.w?A:(A.originalWidth=z,A.originalHeight=w,A)},o.prototype.getImage=function(z,w){if(this.images[z]){return this.images[z]}if(!this.sprite){return null}var D=this.sprite.getSpritePosition(z);if(!D.width||!D.height){return null}var B=D.width/D.pixelRatio,v=D.height/D.pixelRatio,A=this.allocateImage(B,v);if(0===A.w){return A}var C=new u(A,B,v,D.sdf);return this.images[z]=C,this.copy(A,D,w),C},o.prototype.getPosition=function(z,w){var D=this.getImage(z,w),B=D&&D.rect;if(!B){return null}var v=w?D.width:B.w,A=w?D.height:B.h,C=1;return{size:[v,A],tl:[(B.x+C)/this.width,(B.y+C)/this.height],br:[(B.x+C+v)/this.width,(B.y+C+A)/this.height]}},o.prototype.allocate=function(){if(!this.data){var w=Math.floor(this.width*this.pixelRatio),v=Math.floor(this.height*this.pixelRatio);this.data=new Uint32Array(w*v);for(var z=0;z<this.data.length;z++){this.data[z]=0}}},o.prototype.copy=function(z,w,C){if(this.sprite.img.data){var B=new Uint32Array(this.sprite.img.data.buffer);this.allocate();var v=this.data,A=1;p(B,this.sprite.img.width,w.x,w.y,v,this.width*this.pixelRatio,(z.x+A)*this.pixelRatio,(z.y+A)*this.pixelRatio,w.width,w.height,C),this.dirty=!0}},o.prototype.setSprite=function(v){this.sprite=v},o.prototype.addIcons=function(w,v){for(var z=0;z<w.length;z++){this.getImage(w[z])}v(null,this.images)},o.prototype.bind=function(z,w){var D=!1;this.texture?z.bindTexture(z.TEXTURE_2D,this.texture):(this.texture=z.createTexture(),z.bindTexture(z.TEXTURE_2D,this.texture),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_WRAP_S,z.CLAMP_TO_EDGE),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_WRAP_T,z.CLAMP_TO_EDGE),D=!0);var B=w?z.LINEAR:z.NEAREST;if(B!==this.filter&&(z.texParameteri(z.TEXTURE_2D,z.TEXTURE_MIN_FILTER,B),z.texParameteri(z.TEXTURE_2D,z.TEXTURE_MAG_FILTER,B),this.filter=B),this.dirty&&(this.allocate(),D?z.texImage2D(z.TEXTURE_2D,0,z.RGBA,this.width*this.pixelRatio,this.height*this.pixelRatio,0,z.RGBA,z.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)):z.texSubImage2D(z.TEXTURE_2D,0,0,0,this.width*this.pixelRatio,this.height*this.pixelRatio,z.RGBA,z.UNSIGNED_BYTE,new Uint8Array(this.data.buffer)),this.dirty=!1,this.ctx)){var v=this.ctx.getImageData(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio);v.data.set(new Uint8ClampedArray(this.data.buffer)),this.ctx.putImageData(v,0,0),this.ctx.strokeStyle="red";for(var A=0;A<this.bin.free.length;A++){var C=this.bin.free[A];this.ctx.strokeRect(C.x*this.pixelRatio,C.y*this.pixelRatio,C.w*this.pixelRatio,C.h*this.pixelRatio)}}}},{"./bin_pack":63}],78:[function(p,o,r){var t=p("../util/util"),w=p("../util/interpolate"),s=p("../util/browser"),z=p("../geo/lng_lat"),q=p("../geo/lng_lat_bounds"),v=p("point-geometry"),u=o.exports=function(){};t.extend(u.prototype,{getCenter:function(){return this.transform.center},setCenter:function(A){return this.jumpTo({center:A}),this},panBy:function(B,A){return this.panTo(this.transform.center,t.extend({offset:v.convert(B).mult(-1)},A)),this},panTo:function(B,A){this.stop(),B=z.convert(B),A=t.extend({duration:500,easing:t.ease,offset:[0,0]},A);var D=this.transform,F=v.convert(A.offset).rotate(-D.angle),E=D.point,C=D.project(B).sub(F);return A.noMoveStart||this.fire("movestart"),this._ease(function(G){D.center=D.unproject(E.add(C.sub(E).mult(G))),this.fire("move")},function(){this.fire("moveend")},A),this},getZoom:function(){return this.transform.zoom},setZoom:function(A){return this.jumpTo({zoom:A}),this},zoomTo:function(B,A){this.stop(),A=t.extend({duration:500},A),A.easing=this._updateEasing(A.duration,B,A.easing);var C=this.transform,E=C.center,D=C.zoom;return A.around?E=z.convert(A.around):A.offset&&(E=C.pointLocation(C.centerPoint.add(v.convert(A.offset)))),A.animate===!1&&(A.duration=0),this.zooming||(this.zooming=!0,this.fire("movestart")),this._ease(function(F){C.setZoomAround(w(D,B,F),E),this.fire("move").fire("zoom")},function(){this.ease=null,A.duration>=200&&(this.zooming=!1,this.fire("moveend"))},A),A.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(B,A){this.stop(),A=t.extend({duration:500,easing:t.ease},A);var C=this.transform,E=this.getBearing(),D=C.center;return A.around?D=z.convert(A.around):A.offset&&(D=C.pointLocation(C.centerPoint.add(v.convert(A.offset)))),B=this._normalizeBearing(B,E),this.rotating=!0,this.fire("movestart"),this._ease(function(F){C.setBearingAround(w(E,B,F),D),this.fire("move").fire("rotate")},function(){this.rotating=!1,this.fire("moveend")},A),this},resetNorth:function(A){return this.rotateTo(0,t.extend({duration:1000},A)),this},snapToNorth:function(A){return Math.abs(this.getBearing())<this.options.bearingSnap?this.resetNorth(A):this},getPitch:function(){return this.transform.pitch},setPitch:function(A){return this.jumpTo({pitch:A}),this},fitBounds:function(H,D){D=t.extend({padding:0,offset:[0,0],maxZoom:1/0},D),H=q.convert(H);var F=v.convert(D.offset),C=this.transform,B=C.project(H.getNorthWest()),A=C.project(H.getSouthEast()),I=A.sub(B),G=(C.width-2*D.padding-2*Math.abs(F.x))/I.x,E=(C.height-2*D.padding-2*Math.abs(F.y))/I.y;return D.center=C.unproject(B.add(A).div(2)),D.zoom=Math.min(C.scaleZoom(C.scale*Math.min(G,E)),D.maxZoom),D.bearing=0,D.linear?this.easeTo(D):this.flyTo(D)},jumpTo:function(B){this.stop();var A=this.transform,C=!1,E=!1,D=!1;return"center" in B&&(A.center=z.convert(B.center)),"zoom" in B&&A.zoom!==+B.zoom&&(C=!0,A.zoom=+B.zoom),"bearing" in B&&A.bearing!==+B.bearing&&(E=!0,A.bearing=+B.bearing),"pitch" in B&&A.pitch!==+B.pitch&&(D=!0,A.pitch=+B.pitch),this.fire("movestart").fire("move"),C&&this.fire("zoom"),E&&this.fire("rotate"),D&&this.fire("pitch"),this.fire("moveend")},easeTo:function(M){this.stop(),M=t.extend({offset:[0,0],duration:500,easing:t.ease},M);var E=this.transform,H=v.convert(M.offset).rotate(-E.angle),C=E.point,B=this.getZoom(),A=this.getBearing(),N=this.getPitch(),J="zoom" in M?+M.zoom:B,F="bearing" in M?this._normalizeBearing(M.bearing,A):A,K="pitch" in M?+M.pitch:N,G=E.zoomScale(J-B),I="center" in M?E.project(z.convert(M.center)).sub(H.div(G)):C,D=z.convert(M.around);return J!==B&&(this.zooming=!0),A!==F&&(this.rotating=!0),this.zooming&&!D&&(D=E.pointLocation(E.centerPoint.add(I.sub(C).div(1-1/G)))),this.fire("movestart"),this._ease(function(O){this.zooming?E.setZoomAround(w(B,J,O),D):E.center=E.unproject(C.add(I.sub(C).mult(O))),this.rotating&&(E.bearing=w(A,F,O)),K!==N&&(E.pitch=w(N,K,O)),this.fire("move"),this.zooming&&this.fire("zoom"),this.rotating&&this.fire("rotate")},function(){this.zooming=!1,this.rotating=!1,this.fire("moveend")},M),this},flyTo:function(I){function V(M){var B=(E*E-ac*ac+(M?-1:1)*C*C*ae*ae)/(2*(M?E:ac)*C*ae);return Math.log(Math.sqrt(B*B+1)-B)}function Z(B){return(Math.exp(B)-Math.exp(-B))/2}function Q(B){return(Math.exp(B)+Math.exp(-B))/2}function P(B){return Z(B)/Q(B)}this.stop(),I=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},I);var K=this.transform,J=v.convert(I.offset),ad=this.getZoom(),W=this.getBearing(),H="center" in I?z.convert(I.center):this.getCenter(),Y="zoom" in I?+I.zoom:ad,ab="bearing" in I?this._normalizeBearing(I.bearing,W):W,R=K.zoomScale(Y-ad),X=K.point,aa=K.project(H).sub(J.div(R)),O=K.worldSize,S=I.curve,G=I.speed,ac=Math.max(K.width,K.height),E=ac/R,ae=aa.sub(X).mag(),C=S*S,D=V(0),F=function(B){return Q(D)/Q(D+S*B)},A=function(B){return ac*((Q(D)*P(D+S*B)-Z(D))/C)/ae},N=(V(1)-D)/S;if(Math.abs(ae)<0.000001){if(Math.abs(ac-E)<0.000001){return this}var U=ac>E?-1:1;N=Math.abs(Math.log(E/ac))/S,A=function(){return 0},F=function(B){return Math.exp(U*S*B)}}return I.duration=1000*N/G,this.zooming=!0,W!==ab&&(this.rotating=!0),this.fire("movestart"),this._ease(function(M){var B=M*N,T=A(B);K.zoom=ad+K.scaleZoom(1/F(B)),K.center=K.unproject(X.add(aa.sub(X).mult(T)),O),ab!==W&&(K.bearing=w(W,ab,M)),this.fire("move").fire("zoom"),ab!==W&&this.fire("rotate")},function(){this.zooming=!1,this.rotating=!1,this.fire("moveend")},I),this},isEasing:function(){return !!this._abortFn},stop:function(){return this._abortFn&&(this._abortFn(),this._finishEase()),this},_ease:function(B,A,C){this._finishFn=A,this._abortFn=s.timed(function(D){B.call(this,C.easing(D)),1===D&&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(B,A){B=t.wrap(B,-180,180);var C=Math.abs(B-A);return Math.abs(B-360-A)<C&&(B-=360),Math.abs(B+360-A)<C&&(B+=360),B},_updateEasing:function(H,D,F){var C;if(this.ease){var B=this.ease,A=(Date.now()-B.start)/B.duration,I=B.easing(A+0.01)-B.easing(A),G=0.27/Math.sqrt(I*I+0.0001)*0.01,E=Math.sqrt(0.0729-G*G);C=t.bezier(G,E,0.25,1)}else{C=F?t.bezier.apply(t,F):t.ease}return this.ease={start:(new Date).getTime(),to:Math.pow(2,D),duration:H,easing:C},C}})},{"../geo/lng_lat":20,"../geo/lng_lat_bounds":21,"../util/browser":95,"../util/interpolate":102,"../util/util":106,"point-geometry":137}],79:[function(q,r,p){function s(){}var u=q("./control"),t=q("../../util/dom"),o=q("../../util/util");r.exports=s,s.prototype=o.inherit(u,{options:{position:"bottom-right"},onAdd:function(w){var v="mapboxgl-ctrl-attrib",z=this._container=t.create("div",v,w.getContainer());return this._update(),w.on("source.load",this._update.bind(this)),w.on("source.change",this._update.bind(this)),w.on("source.remove",this._update.bind(this)),w.on("moveend",this._updateEditLink.bind(this)),z},_update:function(){var w=[];if(this._map.style){for(var v in this._map.style.sources){var z=this._map.style.sources[v];z.attribution&&w.indexOf(z.attribution)<0&&w.push(z.attribution)}}this._container.innerHTML=w.join(" | "),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var v=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+v.lng+"/"+v.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":98,"../../util/util":106,"./control":80}],80:[function(p,q,o){function r(){}q.exports=r,r.prototype={addTo:function(v){this._map=v;var u=this._container=this.onAdd(v);if(this.options&&this.options.position){var s=this.options.position,w=v._controlCorners[s];u.className+=" mapboxgl-ctrl",-1!==s.indexOf("bottom")?w.insertBefore(u,w.firstChild):w.appendChild(u)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}}},{}],81:[function(q,r,p){function u(v){o.setOptions(this,v)}var t=q("./control"),s=q("../../util/dom"),o=q("../../util/util");r.exports=u,u.prototype=o.inherit(t,{options:{position:"top-right"},onAdd:function(v){var A="mapboxgl-ctrl",w=this._container=s.create("div",A+"-group",v.getContainer());this._zoomInButton=this._createButton(A+"-icon "+A+"-zoom-in",v.zoomIn.bind(v)),this._zoomOutButton=this._createButton(A+"-icon "+A+"-zoom-out",v.zoomOut.bind(v)),this._compass=this._createButton(A+"-compass",v.resetNorth.bind(v));var z=this._compassCanvas=s.create("canvas",A+"-compass-canvas",this._compass);return z.style.cssText="width:30px; height:30px;",z.width=52,z.height=52,this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),this._compassCtx=z.getContext("2d"),v.on("rotate",this._drawNorth.bind(this)),this._drawNorth(),w},_onCompassDown:function(v){s.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._prevX=v.screenX,v.stopPropagation()},_onCompassMove:function(v){var z=v.screenX,w=2>z?-5:z>window.screen.width-2?5:(z-this._prevX)/4;this._map.setBearing(this._map.getBearing()-w),this._prevX=v.screenX,this._moved=!0,v.preventDefault()},_onCompassUp:function(){document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),s.enableDrag(),this._moved&&(this._moved=!1,s.suppressClick()),this._map.snapToNorth()},_createButton:function(v,z){var w=s.create("button",v,this._container);return w.addEventListener("click",function(){z()}),w},_drawNorth:function(){var w=20,B=8,z=26,A=this._map.transform.angle+Math.PI/2,v=this._compassCtx;this._compassCanvas.width=this._compassCanvas.width,v.translate(z,z),v.rotate(A),v.beginPath(),v.fillStyle="#000",v.lineTo(0,-B),v.lineTo(-w,0),v.lineTo(0,B),v.fill(),v.beginPath(),v.fillStyle="#bbb",v.moveTo(0,0),v.lineTo(0,B),v.lineTo(w,0),v.lineTo(0,-B),v.fill(),v.beginPath(),v.strokeStyle="#fff",v.lineWidth=4,v.moveTo(0,-B),v.lineTo(0,B),v.stroke()}})},{"../../util/dom":98,"../../util/util":106,"./control":80}],82:[function(q,r,p){function u(v){this._map=v,this._el=v.getCanvasContainer(),this._container=v.getContainer(),o.bindHandlers(this)}var t=q("../../util/dom"),s=q("../../geo/lng_lat_bounds"),o=q("../../util/util");r.exports=u,u.prototype={enable:function(){this._el.addEventListener("mousedown",this._onMouseDown,!1)},disable:function(){this._el.removeEventListener("mousedown",this._onMouseDown)},_onMouseDown:function(v){(v.shiftKey||1===v.which&&1===v.button)&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),this._startPos=t.mousePos(this._el,v),this.active=!0)},_onMouseMove:function(C){var B=this._startPos,z=t.mousePos(this._el,C);this._box||(this._box=t.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),t.disableDrag(),this._map.fire("boxzoomstart"));var A=Math.min(B.x,z.x),D=Math.max(B.x,z.x),w=Math.min(B.y,z.y),v=Math.max(B.y,z.y);t.setTransform(this._box,"translate("+A+"px,"+w+"px)"),this._box.style.width=D-A+"px",this._box.style.height=v-w+"px"},_onMouseUp:function(A){var z=this._startPos,v=t.mousePos(this._el,A),w=new s(this._map.unproject(z),this._map.unproject(v));this._finish(),this._map.fitBounds(w,{linear:!0}).fire("boxzoomend",{boxZoomBounds:w})},_onKeyDown:function(v){27===v.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,t.enableDrag())}}},{"../../geo/lng_lat_bounds":21,"../../util/dom":98,"../../util/util":106}],83:[function(q,r,o){function p(s){this._map=s,this._onDblClick=this._onDblClick.bind(this)}r.exports=p,p.prototype={enable:function(){this._map.on("dblclick",this._onDblClick)},disable:function(){this._map.off("dblclick",this._onDblClick)},_onDblClick:function(s){this._map.zoomTo(Math.round(this._map.getZoom())+1,{around:s.lngLat})}}},{}],84:[function(p,o,r){function q(A){this._map=A,this._el=A.getCanvasContainer(),s.bindHandlers(this)}var z=p("../../util/dom"),s=p("../../util/util");o.exports=q;var t=0.25,v=s.bezier(0,0,t,1),u=3000,w=4000;q.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=z.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(C){var B=this._map;if(!(B.boxZoom.active||B.dragRotate.active||C.touches&&C.touches.length>1)){this.active=!0;var E=z.mousePos(this._el,C),A=this._inertia,D=Date.now();for(A.push([D,E]);A.length>2&&D-A[0][0]>50;){A.shift()}B.stop(),B.transform.setLocationAtPoint(B.transform.pointLocation(this._pos),E),B.fire("move"),this._pos=E,C.preventDefault()}},_onUp:function(){var E=this._inertia;if(E.length<2){return void this._map.fire("moveend")}var H=E[E.length-1],C=E[0],D=H[1].sub(C[1]),B=(H[0]-C[0])/1000,I=D.mult(t/B),F=I.mag();F>u&&(F=u,I._unit()._mult(F));var A=F/(w*t),G=I.mult(-A/2);this._map.panBy(G,{duration:1000*A,easing:v,noMoveStart:!0}),this.active=!1},_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(r,s,p){function q(v){this._map=v,this._el=v.getCanvasContainer(),o.bindHandlers(this)}var u=r("../../util/dom"),t=r("point-geometry"),o=r("../../util/util");s.exports=q,q.prototype={enable:function(){this._el.addEventListener("contextmenu",this._onContextMenu,!1)},disable:function(){this._el.removeEventListener("contextmenu",this._onContextMenu)},_onContextMenu:function(v){this._map.stop(),this._startPos=this._pos=u.mousePos(this._el,v),document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("mouseup",this._onMouseUp,!1),v.preventDefault()},_onMouseMove:function(E){var B=this._startPos,w=this._pos,z=u.mousePos(this._el,E),A=this._map,F=A.transform.centerPoint,v=B.sub(F),D=v.mag();this.active=!0,A.rotating||(A.fire("movestart"),A.rotating=!0),200>D&&(F=B.add(new t(-200,0)._rotate(v.angle())));var C=w.sub(F).angleWith(z.sub(F))/Math.PI*180;A.transform.bearing=A.getBearing()-C,A.fire("move").fire("rotate"),clearTimeout(this._timeout),this._timeout=setTimeout(this._onTimeout,200),this._pos=z},_onTimeout:function(){var v=this._map;v.rotating=!1,v.snapToNorth(),v.rotating||(v._rerender(),v.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(q,s,p){function o(u){this._map=u,this._el=u.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}s.exports=o;var t=80,r=2;o.prototype={enable:function(){this._el.addEventListener("keydown",this._onKeyDown,!1)},disable:function(){this._el.removeEventListener("keydown",this._onKeyDown)},_onKeyDown:function(v){if(!(v.altKey||v.ctrlKey||v.metaKey)){var u=this._map;switch(v.keyCode){case 61:case 107:case 171:case 187:u.zoomTo(Math.round(u.getZoom())+(v.shiftKey?2:1));break;case 189:case 109:case 173:u.zoomTo(Math.round(u.getZoom())-(v.shiftKey?2:1));break;case 37:v.shiftKey?u.setBearing(u.getBearing()-r):u.panBy([-t,0]);break;case 39:v.shiftKey?u.setBearing(u.getBearing()+r):u.panBy([t,0]);break;case 38:u.panBy([0,-t]);break;case 40:u.panBy([0,t])}}}}},{}],87:[function(q,r,p){function s(u){this._map=u,this._el=u.getCanvasContainer(),o.bindHandlers(this)}var t=q("../../util/dom"),o=q("../../util/util");r.exports=s,s.prototype={enable:function(){this._el.addEventListener("touchstart",this._onStart,!1)},disable:function(){this._el.removeEventListener("touchstart",this._onStart)},_onStart:function(u){if(2===u.touches.length){var w=t.mousePos(this._el,u.touches[0]),v=t.mousePos(this._el,u.touches[1]);this._startVec=w.sub(v),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(w){if(2===w.touches.length){var B=t.mousePos(this._el,w.touches[0]),z=t.mousePos(this._el,w.touches[1]),D=B.add(z).div(2),C=B.sub(z),v=C.mag()/this._startVec.mag(),u=180*C.angleWith(this._startVec)/Math.PI,A=this._map;A.easeTo({zoom:A.transform.scaleZoom(this._startScale*v),bearing:this._startBearing+u,duration:0,around:A.unproject(D)}),w.preventDefault()}},_onEnd:function(){this._map.snapToNorth(),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd)}}},{"../../util/dom":98,"../../util/util":106}],88:[function(r,q,s){function w(A){this._map=A,this._el=A.getCanvasContainer(),u.bindHandlers(this)}var z=r("../../util/dom"),t=r("../../util/browser"),u=r("../../util/util");q.exports=w;var p="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",v=-1!==p.indexOf("firefox"),o=-1!==p.indexOf("safari")&&-1===p.indexOf("chrom");w.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(C){var B;"wheel"===C.type?(B=C.deltaY,v&&C.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(B/=t.devicePixelRatio),C.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(B*=40)):"mousewheel"===C.type&&(B=-C.wheelDeltaY,o&&(B/=3));var A=(window.performance||Date).now(),D=A-(this._time||0);this._pos=z.mousePos(this._el,C),this._time=A,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)),C.shiftKey&&B&&(B/=4),this._type&&this._zoom(-B),C.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(D){var B=this._map,A=2/(1+Math.exp(-Math.abs(D/100)));0>D&&0!==A&&(A=1/A);var E=B.ease?B.ease.to:B.transform.scale,C=B.transform.scaleZoom(E*A);B.zoomTo(C,{duration:0,around:B.unproject(this._pos)})}}},{"../../util/browser":95,"../../util/dom":98,"../../util/util":106}],89:[function(q,r,p){function s(){o.bindAll(["_onHashChange","_updateHash"],this)}r.exports=s;var o=q("../util/util");s.prototype={addTo:function(u){return this._map=u,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 u=location.hash.replace("#","").split("/");return u.length>=3?(this._map.jumpTo({center:[+u[2],+u[1]],zoom:+u[0],bearing:+(u[3]||0)}),!0):!1},_updateHash:function(){var v=this._map.getCenter(),z=this._map.getZoom(),u=this._map.getBearing(),w=Math.max(0,Math.ceil(Math.log(z)/Math.LN2)),A="#"+Math.round(100*z)/100+"/"+v.lat.toFixed(w)+"/"+v.lng.toFixed(w)+(u?"/"+Math.round(10*u)/10:"");window.history.replaceState("","",A)}}},{"../util/util":106}],90:[function(r,s,q){function t(w){this._map=w,this._el=w.getCanvasContainer();for(var v in p){w[v]=new p[v](w)}o.bindHandlers(this)}var p={scrollZoom:r("./handler/scroll_zoom"),boxZoom:r("./handler/box_zoom"),dragRotate:r("./handler/drag_rotate"),dragPan:r("./handler/drag_pan"),keyboard:r("./handler/keyboard"),doubleClickZoom:r("./handler/dblclick_zoom"),pinch:r("./handler/pinch")},u=r("../util/dom"),o=r("../util/util");s.exports=t,t.prototype={enable:function(){var w=this._map.options,v=this._el;for(var z in p){w[z]&&this._map[z].enable()}v.addEventListener("mousedown",this._onMouseDown,!1),v.addEventListener("mouseup",this._onMouseUp,!1),v.addEventListener("touchstart",this._onTouchStart,!1),v.addEventListener("click",this._onClick,!1),v.addEventListener("mousemove",this._onMouseMove,!1),v.addEventListener("dblclick",this._onDblClick,!1),v.addEventListener("contextmenu",this._onContextMenu,!1)},disable:function(){var w=this._map.options,v=this._el;for(var z in p){w[z]&&this._map[z].disable()}v.removeEventListener("mousedown",this._onMouseDown),v.removeEventListener("mouseup",this._onMouseUp),v.removeEventListener("touchstart",this._onTouchStart),v.removeEventListener("click",this._onClick),v.removeEventListener("mousemove",this._onMouseMove),v.removeEventListener("dblclick",this._onDblClick),v.removeEventListener("contextmenu",this._onContextMenu)},_onMouseDown:function(v){this._startPos=u.mousePos(this._el,v)},_onMouseUp:function(v){!this._contextMenuFired||this._map.dragRotate.active||this._map.dragPan.active||this._fireEvent("contextmenu",v),this._contextMenuFired=null},_onTouchStart:function(v){!v.touches||v.touches.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._fireEvent("dblclick",v)):this._tapped=setTimeout(this._onTimeout,300))},_onTimeout:function(){this._tapped=null},_onMouseMove:function(w){var v=this._map,A=this._el;if(!v.dragPan.active&&!v.dragRotate.active){for(var z=w.toElement||w.target;z&&z!==A;){z=z.parentNode}z===A&&this._fireEvent("mousemove",w)}},_onClick:function(w){var v=u.mousePos(this._el,w);v.equals(this._startPos)&&this._fireEvent("click",w)},_onDblClick:function(v){this._fireEvent("dblclick",v),v.preventDefault()},_onContextMenu:function(){this._contextMenuFired=!0},_fireEvent:function(w,v){var z=u.mousePos(this._el,v);this._map.fire(w,{lngLat:this._map.unproject(z),point:z,originalEvent:v})}}},{"../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(w,q,J){var B=w("../util/canvas"),p=w("../util/util"),F=w("../util/browser"),C=w("../util/evented"),E=w("../util/dom"),o=w("../style/style"),r=w("../style/animation_loop"),z=w("../render/painter"),A=w("../geo/transform"),v=w("./hash"),I=w("./interaction"),u=w("./camera"),H=w("../geo/lng_lat"),D=w("../geo/lng_lat_bounds"),G=w("point-geometry"),t=w("./control/attribution"),s=q.exports=function(K){if(K=this.options=p.inherit(this.options,K),this.animationLoop=new r,this.transform=new A(K.minZoom,K.maxZoom),K.maxBounds){var M=D.convert(K.maxBounds);this.transform.lngRange=[M.getWest(),M.getEast()],this.transform.latRange=[M.getSouth(),M.getNorth()]}p.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 I(this),K.interactive&&this.interaction.enable(),this._hash=K.hash&&(new v).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo(K),this.sources={},this.stacks={},this._classes={},this.resize(),K.classes&&this.setClasses(K.classes),K.style&&this.setStyle(K.style),K.attributionControl&&this.addControl(new t),this.on("style.error",this.onError),this.on("source.error",this.onError),this.on("tile.error",this.onError)};p.extend(s.prototype,C),p.extend(s.prototype,u.prototype),p.extend(s.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(K){return K.addTo(this),this},addClass:function(K,M){this._classes[K]||(this._classes[K]=!0,this.style&&this.style._cascade(this._classes,M))},removeClass:function(K,M){this._classes[K]&&(delete this._classes[K],this.style&&this.style._cascade(this._classes,M))},setClasses:function(M,N){this._classes={};for(var K=0;K<M.length;K++){this._classes[M[K]]=!0}this.style&&this.style._cascade(this._classes,N)},hasClass:function(K){return !!this._classes[K]},getClasses:function(){return Object.keys(this._classes)},resize:function(){var K=0,M=0;return this._container&&(K=this._container.offsetWidth||400,M=this._container.offsetHeight||300),this._canvas.resize(K,M),this.transform.width=K,this.transform.height=M,this.transform._constrain(),this.painter.resize(K,M),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){return new D(this.transform.pointLocation(new G(0,0)),this.transform.pointLocation(this.transform.size))},project:function(K){return this.transform.locationPoint(H.convert(K))},unproject:function(K){return this.transform.pointLocation(G.convert(K))},featuresAt:function(M,P,K){var O=this.unproject(M).wrap(),N=this.transform.locationCoordinate(O);return this.style.featuresAt(N,P,K),this},featuresIn:function(M,N,K){return"undefined"==typeof K&&(K=N,N=M,M=[G.convert([0,0]),G.convert([this.transform.width,this.transform.height])]),M=M.map(G.convert.bind(G)),M=[new G(Math.min(M[0].x,M[1].x),Math.min(M[0].y,M[1].y)),new G(Math.max(M[0].x,M[1].x),Math.max(M[0].y,M[1].y))].map(this.transform.pointCoordinate.bind(this.transform)),this.style.featuresIn(M,N,K),this},batch:function(K){this.style.batch(K),this.style._cascade(this._classes),this.update(!0)},setStyle:function(K){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this.update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),K?(K instanceof o?this.style=K:this.style=new o(K,this.animationLoop),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this.update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},addSource:function(K,M){return this.style.addSource(K,M),this},removeSource:function(K){return this.style.removeSource(K),this},getSource:function(K){return this.style.getSource(K)},addLayer:function(K,M){return this.style.addLayer(K,M),this.style._cascade(this._classes),this},removeLayer:function(K){return this.style.removeLayer(K),this.style._cascade(this._classes),this},setFilter:function(K,M){return this.style.setFilter(K,M),this},setLayerZoomRange:function(M,N,K){return this.style.setLayerZoomRange(M,N,K),this},getFilter:function(K){return this.style.getFilter(K)},setPaintProperty:function(M,O,K,N){return this.batch(function(P){P.setPaintProperty(M,O,K,N)}),this},getPaintProperty:function(M,N,K){return this.style.getPaintProperty(M,N,K)},setLayoutProperty:function(M,N,K){return this.batch(function(O){O.setLayoutProperty(M,N,K)}),this},getLayoutProperty:function(K,M){return this.style.getLayoutProperty(K,M)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var M=this.options.container,P=this._container="string"==typeof M?document.getElementById(M):M;P.classList.add("mapboxgl-map");var K=this._canvasContainer=E.create("div","mapboxgl-canvas-container",P);this.options.interactive&&K.classList.add("mapboxgl-interactive"),this._canvas=new B(this,K);var O=E.create("div","mapboxgl-control-container",P),N=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(Q){N[Q]=E.create("div","mapboxgl-ctrl-"+Q,O)})},_setupPainter:function(){var K=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this.options.failIfMajorPerformanceCaveat,preserveDrawingBuffer:this.options.preserveDrawingBuffer});return K?void (this.painter=new z(K,this.transform)):void console.error("Failed to initialize WebGL")},_contextLost:function(K){K.preventDefault(),this._frameId&&F.cancelFrame(this._frameId)},_contextRestored:function(){this._setupPainter(),this.resize(),this.update()},loaded:function(){return this._styleDirty||this._sourcesDirty?!1:this.style&&!this.style.loaded()?!1:!0},update:function(K){return this.style?(this._styleDirty=this._styleDirty||K,this._sourcesDirty=!0,this._rerender(),this):this},render:function(){return this.style&&this._styleDirty&&(this._styleDirty=!1,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&!this._sourcesDirtyTimeout&&(this._sourcesDirty=!1,this._sourcesDirtyTimeout=setTimeout(function(){this._sourcesDirtyTimeout=null}.bind(this),50),this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.debug,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||!this.animationLoop.stopped())&&this._rerender(),this},remove:function(){return this._hash&&this._hash.remove(),F.cancelFrame(this._frameId),clearTimeout(this._sourcesDirtyTimeout),this.setStyle(null),"undefined"!=typeof window&&window.removeEventListener("resize",this._onWindowResize,!1),this},onError:function(K){console.error(K.error)},_rerender:function(){this.style&&!this._frameId&&(this._frameId=F.frame(this.render))},_forwardStyleEvent:function(K){this.fire("style."+K.type,p.extend({style:K.target},K))},_forwardSourceEvent:function(K){this.fire(K.type,p.extend({style:K.target},K))},_forwardLayerEvent:function(K){this.fire(K.type,p.extend({style:K.target},K))},_forwardTileEvent:function(K){this.fire(K.type,p.extend({style:K.target},K))},_onStyleLoad:function(M){var N=new A,K=this.transform;K.center.lng===N.center.lng&&K.center.lat===N.center.lat&&K.zoom===N.zoom&&K.bearing===N.bearing&&K.pitch===N.pitch&&this.jumpTo(this.style.stylesheet),this.style._cascade(this._classes,{transition:!1}),this._forwardStyleEvent(M)},_onStyleChange:function(K){this.update(!0),this._forwardStyleEvent(K)},_onSourceAdd:function(K){var M=K.source;M.onAdd&&M.onAdd(this),this._forwardSourceEvent(K)},_onSourceRemove:function(K){var M=K.source;M.onRemove&&M.onRemove(this),this._forwardSourceEvent(K)},_onSourceUpdate:function(K){this.update(),this._forwardSourceEvent(K)},_onWindowResize:function(){this.stop().resize().update()}}),p.extendAll(s.prototype,{_debug:!1,get debugfunction(){return this._debug},set debugfunction(K){this._debug=K,this.update()},_collisionDebug:!1,get collisionDebugfunction(){return this._collisionDebug},set collisionDebugfunction(K){this._collisionDebug=K,this.style._redoPlacement()},_repaint:!1,get repaintfunction(){return this._repaint},set repaintfunction(K){this._repaint=K,this.update()},_vertices:!1,get verticesfunction(){return this._vertices},set verticesfunction(K){this._vertices=K,this.update()}})},{"../geo/lng_lat":20,"../geo/lng_lat_bounds":21,"../geo/transform":22,"../render/painter":37,"../style/animation_loop":51,"../style/style":56,"../util/browser":95,"../util/canvas":96,"../util/dom":98,"../util/evented":100,"../util/util":106,"./camera":78,"./control/attribution":79,"./hash":89,"./interaction":90,"point-geometry":137}],92:[function(q,s,p){function v(w){o.setOptions(this,w),o.bindAll(["_updatePosition","_onClickClose"],this)}s.exports=v;var o=q("../util/util"),r=q("../util/evented"),u=q("../util/dom"),t=q("../geo/lng_lat");v.prototype=o.inherit(r,{options:{closeButton:!0,closeOnClick:!0},addTo:function(w){return this._map=w,this._map.on("move",this._updatePosition),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._container&&this._container.parentNode.removeChild(this._container),this._map&&(this._map.off("move",this._updatePosition),this._map.off("click",this._onClickClose),delete this._map),this},getLngLat:function(){return this._lngLat},setLngLat:function(w){return this._lngLat=t.convert(w),this._update(),this},setText:function(w){return this._content=document.createTextNode(w),this._updateContent(),this},setHTML:function(z){this._content=document.createDocumentFragment();var w,A=document.createElement("body");for(A.innerHTML=z;;){if(w=A.firstChild,!w){break}this._content.appendChild(w)}return this._updateContent(),this},_update:function(){this._map&&(this._container||(this._container=u.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=u.create("div","mapboxgl-popup-tip",this._container),this._wrapper=u.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=u.create("button","mapboxgl-popup-close-button",this._wrapper),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))),this._updateContent(),this._updatePosition())},_updateContent:function(){if(this._content&&this._container){for(var w=this._wrapper;w.hasChildNodes();){w.removeChild(w.firstChild)}this.options.closeButton&&w.appendChild(this._closeButton),w.appendChild(this._content)}},_updatePosition:function(){if(this._lngLat&&this._container){var A=this._map.project(this._lngLat).round(),z=this.options.anchor;if(!z){var C=this._container.offsetWidth,D=this._container.offsetHeight;z=A.y<D?["top"]:A.y>this._map.transform.height-D?["bottom"]:[],A.x<C/2?z.push("left"):A.x>this._map.transform.width-C/2&&z.push("right"),z=0===z.length?"bottom":z.join("-"),this.options.anchor=z}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%)"},B=this._container.classList;for(var w in E){B.remove("mapboxgl-popup-anchor-"+w)}B.add("mapboxgl-popup-anchor-"+z),u.setTransform(this._container,E[z]+" 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(q,r,p){function o(s,u){this.target=s,this.parent=u,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}r.exports=o,o.prototype.receive=function(v){var z,w=v.data;if("<response>"===w.type){z=this.callbacks[w.id],delete this.callbacks[w.id],z(w.error||null,w.data)}else{if("undefined"!=typeof w.id){var u=w.id;this.parent[w.type](w.data,function(A,C,B){this.postMessage({type:"<response>",id:String(u),error:A?String(A):null,data:C},B)}.bind(this))}else{this.parent[w.type](w.data)}}},o.prototype.send=function(w,A,z,v){var u=null;z&&(this.callbacks[u=this.callbackID++]=z),this.postMessage({type:w,id:String(u),data:A},v)},o.prototype.postMessage=function(u,w){try{this.target.postMessage(u,w)}catch(v){this.target.postMessage(u)}}},{}],94:[function(p,q,o){function r(u){var s=document.createElement("a");return s.href=u,s.protocol===document.location.protocol&&s.host===document.location.host}o.getJSON=function(u,s){var v=new XMLHttpRequest;return v.open("GET",u,!0),v.setRequestHeader("Accept","application/json"),v.onerror=function(t){s(t)},v.onload=function(){if(v.status>=200&&v.status<300&&v.response){var w;try{w=JSON.parse(v.response)}catch(t){return s(t)}s(null,w)}else{s(new Error(v.statusText))}},v.send(),v},o.getArrayBuffer=function(u,s){var v=new XMLHttpRequest;return v.open("GET",u,!0),v.responseType="arraybuffer",v.onerror=function(t){s(t)},v.onload=function(){v.status>=200&&v.status<300&&v.response?s(null,v.response):s(new Error(v.statusText))},v.send(),v},o.getImage=function(u,s){return o.getArrayBuffer(u,function(v,z){v&&s(v);var t=new Image;t.onload=function(){s(null,t),(window.URL||window.webkitURL).revokeObjectURL(t.src)};var w=new Blob([new Uint8Array(z)],{type:"image/png"});return t.src=(window.URL||window.webkitURL).createObjectURL(w),t.getData=function(){var B=document.createElement("canvas"),A=B.getContext("2d");return B.width=t.width,B.height=t.height,A.drawImage(t,0,0),A.getImageData(0,0,t.width,t.height).data},t})},o.getVideo=function(v,s){var z=document.createElement("video");z.onloadstart=function(){s(null,z)};for(var u=0;u<v.length;u++){var w=document.createElement("source");r(v[u])||(z.crossOrigin="Anonymous"),w.src=v[u],z.appendChild(w)}return z.getData=function(){return z},z}},{}],95:[function(q,r,p){var o=q("./canvas"),t=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;p.frame=function(u){return t(u)};var s=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;p.cancelFrame=function(u){s(u)},p.timed=function(z,w,v){function B(C){A||(window.performance||(C=Date.now()),C>=u+w?z.call(v,1):(z.call(v,(C-u)/w),p.frame(B)))}if(!w){return z.call(v,1),null}var A=!1,u=window.performance?window.performance.now():Date.now();return p.frame(B),function(){A=!0}},p.supported=function(w){for(var v=([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 o).supportsWebGLContext(w&&w.failIfMajorPerformanceCaveat||!1)},function(){return"Worker" in window}]),u=0;u<v.length;u++){if(!v[u]()){return !1}}return !0},p.hardwareConcurrency=navigator.hardwareConcurrency||8,Object.defineProperty(p,"devicePixelRatio",{get:function(){return window.devicePixelRatio}})},{"./canvas":96}],96:[function(s,t,q){function o(u,v){this.canvas=document.createElement("canvas"),u&&v&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",u._contextLost.bind(u),!1),this.canvas.addEventListener("webglcontextrestored",u._contextRestored.bind(u),!1),this.canvas.setAttribute("tabindex",0),v.appendChild(this.canvas))}var p=s("../util");t.exports=o,o.prototype.resize=function(v,w){var u=window.devicePixelRatio||1;this.canvas.width=u*v,this.canvas.height=u*w,this.canvas.style.width=v+"px",this.canvas.style.height=w+"px"};var r={antialias:!1,alpha:!0,stencil:!0,depth:!1};o.prototype.getWebGLContext=function(u){return u=p.extend({},u,r),this.canvas.getContext("webgl",u)||this.canvas.getContext("experimental-webgl",u)},o.prototype.supportsWebGLContext=function(u){var v=p.extend({failIfMajorPerformanceCaveat:u},r);return"probablySupportsContext" in this.canvas?this.canvas.probablySupportsContext("webgl",v)||this.canvas.probablySupportsContext("experimental-webgl",v):"supportsContext" in this.canvas?this.canvas.supportsContext("webgl",v)||this.canvas.supportsContext("experimental-webgl",v):!!window.WebGLRenderingContext&&!!this.getWebGLContext(u)},o.prototype.getElement=function(){return this.canvas}},{"../util":106}],97:[function(r,s,q){function p(w,u){this.actors=[],this.currentActor=0;for(var z=0;w>z;z++){var A=new t(r("../../source/worker")),v=new o(A,u);v.name="Worker "+z,this.actors.push(v)}}var o=r("../actor"),t=r("webworkify");s.exports=p,p.prototype={broadcast:function(v,u){for(var w=0;w<this.actors.length;w++){this.actors[w].send(v,u)}},send:function(w,u,z,A,v){return("number"!=typeof A||isNaN(A))&&(A=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[A].send(w,u,z,v),A},remove:function(){for(var u=0;u<this.actors.length;u++){this.actors[u].target.terminate()}this.actors=[]}}},{"../../source/worker":49,"../actor":93,webworkify:149}],98:[function(q,p,r){function u(B){for(var A=0;A<B.length;A++){if(B[A] in t){return B[A]}}}function z(A){A.preventDefault(),A.stopPropagation(),window.removeEventListener("click",z,!0)}var v=q("point-geometry");r.create=function(C,A,B){var D=document.createElement(C);return A&&(D.className=A),B&&B.appendChild(D),D};var t=document.documentElement.style,o=u(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),s;r.disableDrag=function(){o&&(s=t[o],t[o]="none")},r.enableDrag=function(){o&&(t[o]=s)};var w=u(["transform","WebkitTransform"]);r.setTransform=function(B,A){B.style[w]=A},r.suppressClick=function(){window.addEventListener("click",z,!0),window.setTimeout(function(){window.removeEventListener("click",z,!0)},0)},r.mousePos=function(C,A){var B=C.getBoundingClientRect();return A=A.touches?A.touches[0]:A,new v(A.clientX-B.left-C.clientLeft,A.clientY-B.top-C.clientTop)}},{"point-geometry":137}],99:[function(p,q,o){q.exports={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0}},{}],100:[function(q,s,p){var o=q("./util"),r={on:function(u,v){return this._events=this._events||{},this._events[u]=this._events[u]||[],this._events[u].push(v),this},off:function(u,w){if(!u){return delete this._events,this}if(!this.listens(u)){return this}if(w){var v=this._events[u].indexOf(w);v>=0&&this._events[u].splice(v,1),this._events[u].length||delete this._events[u]}else{delete this._events[u]}return this},once:function(u,w){var v=function(t){this.off(u,v),w.call(this,t)}.bind(this);return this.on(u,v),this},fire:function(v,z){if(!this.listens(v)){return this}z=o.extend({},z),o.extend(z,{type:v,target:this});for(var w=this._events[v].slice(),u=0;u<w.length;u++){w[u].call(this,z)}return this},listens:function(u){return !(!this._events||!this._events[u])}};s.exports=r},{"./util":106}],101:[function(s,t,q){function p(v,w){this.stacks=v.readFields(r,[],w)}function r(v,A,z){if(1===v){var w=z.readMessage(o,{glyphs:{}});A.push(w)}}function o(v,A,z){if(1===v){A.name=z.readString()}else{if(2===v){A.range=z.readString()}else{if(3===v){var w=z.readMessage(u,{});A.glyphs[w.id]=w}}}}function u(v,z,w){1===v?z.id=w.readVarint():2===v?z.bitmap=w.readBytes():3===v?z.width=w.readVarint():4===v?z.height=w.readVarint():5===v?z.left=w.readSVarint():6===v?z.top=w.readSVarint():7===v&&(z.advance=w.readVarint())}t.exports=p},{}],102:[function(q,r,o){function p(s,u,v){return s*(1-v)+u*v}r.exports=p,p.number=p,p.vec2=function(s,u,v){return[p(s[0],u[0],v),p(s[1],u[1],v)]},p.color=function(s,u,v){return[p(s[0],u[0],v),p(s[1],u[1],v),p(s[2],u[2],v),p(s[3],u[3],v)]},p.array=function(s,u,v){return s.map(function(w,z){return p(w,u[z],v)})}},{}],103:[function(r,s,o){function t(v,u,w){if(w=w||q.ACCESS_TOKEN,!w&&q.REQUIRE_ACCESS_TOKEN){throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens")}if(v=v.replace(/^mapbox:\/\//,q.API_URL+u),v+=-1!==v.indexOf("?")?"&access_token=":"?access_token=",q.REQUIRE_ACCESS_TOKEN){if("s"===w[0]){throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens")}v+=w}return v}var q=r("./config"),p=r("./browser");s.exports.normalizeStyleURL=function(z,w){if(!z.match(/^mapbox:\/\/styles\//)){return z}var A=z.split("/"),u=A[3],B=A[4],v=A[5]?"/draft":"";return t("mapbox://"+u+"/"+B+v,"/styles/v1/",w)},s.exports.normalizeSourceURL=function(v,u){return v.match(/^mapbox:\/\//)?t(v+".json","/v4/",u)+"&secure":v},s.exports.normalizeGlyphsURL=function(v,u){if(!v.match(/^mapbox:\/\//)){return v}var w=v.split("/")[3];return t("mapbox://"+w+"/{fontstack}/{range}.pbf","/fonts/v1/",u)},s.exports.normalizeSpriteURL=function(B,A,C,w){if(!B.match(/^mapbox:\/\/sprites\//)){return B+A+C}var D=B.split("/"),z=D[3],u=D[4],v=D[5]?"/draft":"";return t("mapbox://"+z+"/"+u+v+"/sprite"+A+C,"/styles/v1/",w)},s.exports.normalizeTileURL=function(v,u){return u&&u.match(/^mapbox:\/\//)?v.replace(/\.((?:png|jpg)\d*)(?=$|\?)/,p.devicePixelRatio>=2?"@2x.$1":".$1"):v}},{"./browser":95,"./config":99}],104:[function(p,q,o){function r(s,u){this.max=s,this.onRemove=u,this.reset()}q.exports=r,r.prototype.reset=function(){for(var s in this.list){this.onRemove(this.list[s])}return this.list={},this.order=[],this},r.prototype.add=function(u,v){if(this.list[u]=v,this.order.push(u),this.order.length>this.max){var s=this.get(this.order[0]);s&&this.onRemove(s)}return this},r.prototype.has=function(s){return s in this.list},r.prototype.keys=function(){return this.order},r.prototype.get=function(s){if(!this.has(s)){return null}var u=this.list[s];return delete this.list[s],this.order.splice(this.order.indexOf(s),1),u}},{}],105:[function(q,r,o){function p(s,t){return t.replace(/{([^{}()\[\]<>$=:;.,^]+)}/g,function(v,u){return u in s?s[u]:""})}r.exports=p},{}],106:[function(q,r,o){var p=q("unitbezier"),s=q("../geo/coordinate");o.easeCubicInOut=function(w){if(0>=w){return 0}if(w>=1){return 1}var u=w*w,v=u*w;return 4*(0.5>w?v:3*(w-u)+v-0.75)},o.bezier=function(A,u,v,w){var z=new p(A,u,v,w);return function(B){return z.solve(B)}},o.ease=o.bezier(0.25,0.1,0.25,1),o.premultiply=function(u){return u[0]*=u[3],u[1]*=u[3],u[2]*=u[3],u},o.clamp=function(w,u,v){return Math.min(v,Math.max(u,w))},o.wrap=function(A,u,v){var w=v-u,z=((A-u)%w+w)%w+u;return z===u?v:z},o.coalesce=function(){for(var v=0;v<arguments.length;v++){var u=arguments[v];if(null!==u&&void 0!==u){return u}}},o.asyncEach=function(B,v,w){function z(){0===--A&&w()}var A=B.length;if(0===A){return w()}for(var u=0;u<B.length;u++){v(B[u],z)}},o.asyncAll=function(B,v,w){var z=B.length,A=new Array(B.length),u=null;B.forEach(function(D,C){v(D,function(F,E){F&&(u=F),A[C]=E,0===--z&&w(u,A)})})},o.keysDifference=function(z,u){var v=[];for(var w in z){w in u||v.push(w)}return v},o.extend=function(z){for(var u=1;u<arguments.length;u++){var v=arguments[u];for(var w in v){z[w]=v[w]}}return z},o.extendAll=function(w,u){for(var v in u){Object.defineProperty(w,v,Object.getOwnPropertyDescriptor(u,v))}return w},o.inherit=function(z,u){var v="function"==typeof z?z.prototype:z,w=Object.create(v);return o.extendAll(w,u),w},o.pick=function(A,u){for(var v={},w=0;w<u.length;w++){var z=u[w];z in A&&(v[z]=A[z])}return v};var t=1;o.uniqueId=function(){return t++},o.throttle=function(D,z,A){var B,C,w,v;return v=function(){B=!1,C&&(w.apply(A,C),C=!1)},w=function(){B?C=arguments:(D.apply(A,arguments),setTimeout(v,z),B=!0)}},o.debounce=function(z,u){var v,w;return function(){w=arguments,clearTimeout(v),v=setTimeout(function(){z.apply(null,w)},u)}},o.bindAll=function(v,u){v.forEach(function(w){u[w]=u[w].bind(u)})},o.bindHandlers=function(v){for(var u in v){"function"==typeof v[u]&&0===u.indexOf("_on")&&(v[u]=v[u].bind(v))}},o.setOptions=function(w,u){w.hasOwnProperty("options")||(w.options=w.options?Object.create(w.options):{});for(var v in u){w.options[v]=u[v]}return w.options},o.getCoordinatesCenter=function(z){for(var F=1/0,v=1/0,B=-(1/0),w=-(1/0),A=0;A<z.length;A++){F=Math.min(F,z[A].column),v=Math.min(v,z[A].row),B=Math.max(B,z[A].column),w=Math.max(w,z[A].row)}var E=B-F,D=w-v,C=Math.max(E,D);return new s((F+B)/2,(v+w)/2,0).zoomTo(Math.floor(-Math.log(C)/Math.LN2))}},{"../geo/coordinate":19,unitbezier:141}],107:[function(r,p,u){function q(B){return B=Math.round(B),0>B?0:B>255?255:B}function s(B){return 0>B?0:B>1?1:B}function t(B){return q("%"===B[B.length-1]?parseFloat(B)/100*255:parseInt(B))}function z(B){return s("%"===B[B.length-1]?parseFloat(B)/100:parseFloat(B))}function A(D,C,B){return 0>B?B+=1:B>1&&(B-=1),1>6*B?D+(C-D)*B*6:1>2*B?C:2>3*B?D+(C-D)*(2/3-B)*6:D}function o(H){var B=H.replace(/ /g,"").toLowerCase();if(B in w){return w[B].slice()}if("#"===B[0]){if(4===B.length){var E=parseInt(B.substr(1),16);return E>=0&&4095>=E?[(3840&E)>>4|(3840&E)>>8,240&E|(240&E)>>4,15&E|(15&E)<<4,1]:null}if(7===B.length){var E=parseInt(B.substr(1),16);return E>=0&&16777215>=E?[(16711680&E)>>16,(65280&E)>>8,255&E,1]:null}return null}var K=B.indexOf("("),N=B.indexOf(")");if(-1!==K&&N+1===B.length){var D=B.substr(0,K),O=B.substr(K+1,N-(K+1)).split(","),C=1;switch(D){case"rgba":if(4!==O.length){return null}C=z(O.pop());case"rgb":return 3!==O.length?null:[t(O[0]),t(O[1]),t(O[2]),C];case"hsla":if(4!==O.length){return null}C=z(O.pop());case"hsl":if(3!==O.length){return null}var F=(parseFloat(O[0])%360+360)%360/360,M=z(O[1]),G=z(O[2]),I=0.5>=G?G*(M+1):G+M-G*M,J=2*G-I;return[q(255*A(J,I,F+1/3)),q(255*A(J,I,F)),q(255*A(J,I,F-1/3)),C];default:return null}}return null}var w={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{u.parseCSSColor=o}catch(v){}},{}],108:[function(q,o,s){function u(z){return function(C,B,A){return"$type"===B?"t"+z+p.indexOf(A):"p["+JSON.stringify(B)+"]"+z+JSON.stringify(A)}}function t(z){var A=u(z);return function(C,D,B){return"$type"===D?A(C,D,B):"typeof(p["+JSON.stringify(D)+"]) === typeof("+JSON.stringify(B)+") && "+A(C,D,B)}}function w(z){return r[z[0]].apply(z,z)}function v(){return !0}var p=["Unknown","Point","LineString","Polygon"],r={"==":u("==="),"!=":u("!=="),">":t(">"),"<":t("<"),"<=":t("<="),">=":t(">="),"in":function(z,A){return"(function(){"+Array.prototype.slice.call(arguments,2).map(function(B){return"if ("+r["=="](z,A,B)+") return true;"}).join("")+"return false;})()"},"!in":function(){return"!("+r["in"].apply(this,arguments)+")"},any:function(){return Array.prototype.slice.call(arguments,1).map(function(z){return"("+w(z)+")"}).join("||")||"false"},all:function(){return Array.prototype.slice.call(arguments,1).map(function(z){return"("+w(z)+")"}).join("&&")||"true"},none:function(){return"!("+r.any.apply(this,arguments)+")"}};o.exports=function(z){if(!z){return v}var A="var p = f.properties || f.tags || {}, t = f.type; return "+w(z)+";";return new Function("f",A)}},{}],109:[function(q,r,p){function t(H,A,M,v,C,K,D,N){if(M/=A,v/=A,D>=M&&v>=N){return H}if(D>v||M>N){return null}for(var w=[],E=0;E<H.length;E++){var I,J,z=H[E],G=z.geometry,F=z.type;if(I=z.min[C],J=z.max[C],I>=M&&v>=J){w.push(z)}else{if(!(I>v||M>J)){var B=1===F?o(G,M,v,C):s(G,M,v,C,K,3===F);B.length&&w.push({geometry:B,type:F,tags:H[E].tags||null,min:z.min,max:z.max})}}}return w.length?w:null}function o(D,E,A,C){for(var v=[],w=0;w<D.length;w++){var z=D[w],B=z[C];B>=E&&A>=B&&v.push(z)}return v}function s(Q,I,D,F,K,C){for(var M=[],E=0;E<Q.length;E++){var G,N,R,S=0,H=0,P=null,O=Q[E],J=O.area,B=O.dist,A=O.length,z=[];for(N=0;A-1>N;N++){G=P||O[N],P=O[N+1],S=H||G[F],H=P[F],I>S?H>D?(z.push(K(G,P,I),K(G,P,D)),C||(z=u(M,z,J,B))):H>=I&&z.push(K(G,P,I)):S>D?I>H?(z.push(K(G,P,D),K(G,P,I)),C||(z=u(M,z,J,B))):D>=H&&z.push(K(G,P,D)):(z.push(G),I>H?(z.push(K(G,P,I)),C||(z=u(M,z,J,B))):H>D&&(z.push(K(G,P,D)),C||(z=u(M,z,J,B))))}G=O[A-1],S=G[F],S>=I&&D>=S&&z.push(G),R=z[z.length-1],C&&R&&(z[0][0]!==R[0]||z[0][1]!==R[1])&&z.push(z[0]),u(M,z,J,B)}return M}function u(z,A,v,w){return A.length&&(A.area=v,A.dist=w,z.push(A)),[]}r.exports=t},{}],110:[function(p,o,q){function w(E,C){var D=[];if("FeatureCollection"===E.type){for(var F=0;F<E.features.length;F++){v(D,E.features[F],C)}}else{"Feature"===E.type?v(D,E,C):v(D,{geometry:E},C)}return D}function v(H,M,C){var D,E,J,G=M.geometry,I=G.type,F=G.coordinates,K=M.properties;if("Point"===I){H.push(r(K,1,[t(F)]))}else{if("MultiPoint"===I){H.push(r(K,1,z(F)))}else{if("LineString"===I){H.push(r(K,2,[z(F,C)]))}else{if("MultiLineString"===I||"Polygon"===I){for(J=[],D=0;D<F.length;D++){J.push(z(F[D],C))}H.push(r(K,"Polygon"===I?3:2,J))}else{if("MultiPolygon"===I){for(J=[],D=0;D<F.length;D++){for(E=0;E<F[D].length;E++){J.push(z(F[D][E],C))}}H.push(r(K,3,J))}else{if("GeometryCollection"!==I){throw new Error("Input data is not a valid GeoJSON object.")}for(D=0;D<G.geometries.length;D++){v(H,{geometry:G.geometries[D],properties:K},C)}}}}}}}function r(E,C,D){var F={geometry:D,type:C,tags:E||null,min:[2,1],max:[-1,0]};return s(F),F}function z(E,C){for(var D=[],F=0;F<E.length;F++){D.push(t(E[F]))}return C&&(B(D,C),u(D)),D}function t(E){var C=Math.sin(E[1]*Math.PI/180),D=E[0]/360+0.5,F=0.5-0.25*Math.log((1+C)/(1-C))/Math.PI;return F=-1>F?-1:F>1?1:F,[D,F,0]}function u(F){for(var D,E,G=0,H=0,C=0;C<F.length-1;C++){D=E||F[C],E=F[C+1],G+=D[0]*E[1]-E[0]*D[1],H+=Math.abs(E[0]-D[0])+Math.abs(E[1]-D[1])}F.area=Math.abs(G/2),F.dist=H}function s(E){var C=E.geometry,D=E.min,F=E.max;if(1===E.type){A(D,F,C)}else{for(var G=0;G<C.length;G++){A(D,F,C[G])}}return E}function A(E,C,D){for(var F,G=0;G<D.length;G++){F=D[G],E[0]=Math.min(F[0],E[0]),C[0]=Math.max(F[0],C[0]),E[1]=Math.min(F[1],E[1]),C[1]=Math.max(F[1],C[1])}}o.exports=w;var B=p("./simplify")},{"./simplify":112}],111:[function(v,r,w){function E(G,F){return new q(G,F)}function q(H,G){G=this.options=A(Object.create(this.options),G);var F=G.debug;F&&console.time("preprocess data");var I=1<<G.maxZoom,J=B(H,G.tolerance/(I*G.extent));this.tiles={},this.tileCoords=[],F&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",G.indexMaxZoom,G.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),J=p(J,G.buffer/G.extent,D),J.length&&this.splitTile(J,0,0,0),F&&(J.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function z(H,G,F){return 32*((1<<H)*F+G)+H}function D(H,G,F){return[F,(F-H[0])*(G[1]-H[1])/(G[0]-H[0])+H[1],1]}function C(H,G,F){return[(F-H[1])*(G[0]-H[0])/(G[1]-H[1])+H[0],F,1]}function A(H,G){for(var F in G){H[F]=G[F]}return H}function o(K,H,G){var M=K.source;if(1!==M.length){return !1}var N=M[0];if(3!==N.type||N.geometry.length>1){return !1}var J=N.geometry[0].length;if(5!==J){return !1}for(var I=0;J>I;I++){var F=t.point(N.geometry[0][I],H,K.z2,K.x,K.y);if(F[0]!==-G&&F[0]!==H+G||F[1]!==-G&&F[1]!==H+G){return !1}}return !0}r.exports=E;var B=v("./convert"),t=v("./transform"),u=v("./clip"),p=v("./wrap"),s=v("./tile");q.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:100000,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},q.prototype.splitTile=function(ag,Q,ac,X,Y,U,R){for(var ab=[ag,Q,ac,X],ak=this.options,P=ak.debug,ai=null;ab.length;){X=ab.pop(),ac=ab.pop(),Q=ab.pop(),ag=ab.pop();var W=1<<Q,ah=z(Q,ac,X),aa=this.tiles[ah],af=Q===ak.maxZoom?0:ak.tolerance/(W*ak.extent);if(!aa&&(P>1&&console.time("creation"),aa=this.tiles[ah]=s(ag,W,ac,X,af,Q===ak.maxZoom),this.tileCoords.push({z:Q,x:ac,y:X}),P)){P>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Q,ac,X,aa.numFeatures,aa.numPoints,aa.numSimplified),console.timeEnd("creation"));var ad="z"+Q;this.stats[ad]=(this.stats[ad]||0)+1,this.total++}if(aa.source=ag,Y){if(Q===ak.maxZoom||Q===Y){continue}var K=1<<Y-Q;if(ac!==Math.floor(U/K)||X!==Math.floor(R/K)){continue}}else{if(Q===ak.indexMaxZoom||aa.numPoints<=ak.indexMaxPoints){continue}}if(ak.solidChildren||!o(aa,ak.extent,ak.buffer)){aa.source=null,P>1&&console.time("clipping");var ae,O,I,G,aj,J,H=0.5*ak.buffer/ak.extent,F=0.5-H,V=0.5+H,N=1+H;ae=O=I=G=null,aj=u(ag,W,ac-H,ac+V,0,D,aa.min[0],aa.max[0]),J=u(ag,W,ac+F,ac+N,0,D,aa.min[0],aa.max[0]),aj&&(ae=u(aj,W,X-H,X+V,1,C,aa.min[1],aa.max[1]),O=u(aj,W,X+F,X+N,1,C,aa.min[1],aa.max[1])),J&&(I=u(J,W,X-H,X+V,1,C,aa.min[1],aa.max[1]),G=u(J,W,X+F,X+N,1,C,aa.min[1],aa.max[1])),P>1&&console.timeEnd("clipping"),ae&&ab.push(ae,Q+1,2*ac,2*X),O&&ab.push(O,Q+1,2*ac,2*X+1),I&&ab.push(I,Q+1,2*ac+1,2*X),G&&ab.push(G,Q+1,2*ac+1,2*X+1)}else{Y&&(ai=Q)}}return ai},q.prototype.getTile=function(N,S,M){var H=this.options,I=H.extent,F=H.debug,T=1<<N;S=(S%T+T)%T;var K=z(N,S,M);if(this.tiles[K]){return t.tile(this.tiles[K],I)}F>1&&console.log("drilling down to z%d-%d-%d",N,S,M);for(var Q,R=N,P=S,G=M;!Q&&R>0;){R--,P=Math.floor(P/2),G=Math.floor(G/2),Q=this.tiles[z(R,P,G)]}if(!Q||!Q.source){return null}if(F>1&&console.log("found parent tile z%d-%d-%d",R,P,G),o(Q,I,H.buffer)){return t.tile(Q,I)}F>1&&console.time("drilling down");var O=this.splitTile(Q.source,R,P,G,N,S,M);if(F>1&&console.timeEnd("drilling down"),null!==O){var J=1<<N-O;K=z(O,Math.floor(S/J),Math.floor(M/J))}return this.tiles[K]?t.tile(this.tiles[K],I):null}},{"./clip":109,"./convert":110,"./tile":113,"./transform":114,"./wrap":115}],112:[function(q,r,o){function p(G,B){var E,w,v,H,z=B*B,D=G.length,F=0,A=D-1,C=[];for(G[F][2]=1,G[A][2]=1;A;){for(w=0,E=F+1;A>E;E++){v=s(G[E],G[F],G[A]),v>w&&(H=E,w=v)}w>z?(G[H][2]=w,C.push(F),C.push(H),F=H):(A=C.pop(),F=C.pop())}}function s(H,C,F){var w=C[0],v=C[1],I=F[0],z=F[1],E=H[0],G=H[1],A=I-w,D=z-v;if(0!==A||0!==D){var B=((E-w)*A+(G-v)*D)/(A*A+D*D);B>1?(w=I,v=z):B>0&&(w+=A*B,v+=D*B)}return A=E-w,D=G-v,A*A+D*D}r.exports=p},{}],113:[function(p,q,o){function s(C,w,F,z,B,E){for(var v={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:F,y:z,z2:w,transformed:!1,min:[2,1],max:[-1,0]},D=0;D<C.length;D++){v.numFeatures++,r(v,C[D],B,E);var G=C[D].min,A=C[D].max;G[0]<v.min[0]&&(v.min[0]=G[0]),G[1]<v.min[1]&&(v.min[1]=G[1]),A[0]>v.max[0]&&(v.max[0]=A[0]),A[1]>v.max[1]&&(v.max[1]=A[1])}return v}function r(E,z,I,A){var C,H,v,G,J=z.geometry,B=z.type,w=[],D=I*I;if(1===B){for(C=0;C<J.length;C++){w.push(J[C]),E.numPoints++,E.numSimplified++}}else{for(C=0;C<J.length;C++){if(v=J[C],A||!(2===B&&v.dist<I||3===B&&v.area<D)){var F=[];for(H=0;H<v.length;H++){G=v[H],(A||G[2]>D)&&(F.push(G),E.numSimplified++),E.numPoints++}w.push(F)}else{E.numPoints+=v.length}}}w.length&&E.features.push({geometry:w,type:B,tags:z.tags||null})}q.exports=s},{}],114:[function(p,q,o){function r(v,H){if(v.transformed){return v}var z,E,w,D=v.z2,F=v.x,I=v.y;for(z=0;z<v.features.length;z++){var C=v.features[z],G=C.geometry,A=C.type;if(1===A){for(E=0;E<G.length;E++){G[E]=s(G[E],H,D,F,I)}}else{for(E=0;E<G.length;E++){var B=G[E];for(w=0;w<B.length;w++){B[w]=s(B[w],H,D,F,I)}}}}return v.transformed=!0,v}function s(w,v,C,A,B){var z=Math.round(v*(w[0]*C-A)),u=Math.round(v*(w[1]*C-B));return[z,u]}o.tile=r,o.point=s},{}],115:[function(q,r,p){function s(A,w,B){var C=A,v=t(A,1,-1-w,w,0,B,-1,2),z=t(A,1,1-w,2+w,0,B,-1,2);return(v||z)&&(C=t(A,1,-w,1+w,0,B,-1,2),v&&(C=o(v,1).concat(C)),z&&(C=C.concat(o(z,-1)))),C}function o(B,z){for(var C=[],D=0;D<B.length;D++){var v,A=B[D],w=A.type;if(1===w){v=u(A.geometry,z)}else{v=[];for(var E=0;E<A.geometry.length;E++){v.push(u(A.geometry[E],z))}}C.push({geometry:v,type:w,tags:A.tags,min:[A.min[0]+z,A.min[1]],max:[A.max[0]+z,A.max[1]]})}return C}function u(w,v){var z=[];z.area=w.area,z.dist=w.dist;for(var A=0;A<w.length;A++){z.push([w[A][0]+v,w[A][1],w[A][2]])}return z}var t=q("./clip");r.exports=s},{"./clip":109}],116:[function(p,q,o){o.glMatrix=p("./gl-matrix/common.js"),o.mat2=p("./gl-matrix/mat2.js"),o.mat2d=p("./gl-matrix/mat2d.js"),o.mat3=p("./gl-matrix/mat3.js"),o.mat4=p("./gl-matrix/mat4.js"),o.quat=p("./gl-matrix/quat.js"),o.vec2=p("./gl-matrix/vec2.js"),o.vec3=p("./gl-matrix/vec3.js"),o.vec4=p("./gl-matrix/vec4.js")},{"./gl-matrix/common.js":117,"./gl-matrix/mat2.js":118,"./gl-matrix/mat2d.js":119,"./gl-matrix/mat3.js":120,"./gl-matrix/mat4.js":121,"./gl-matrix/quat.js":122,"./gl-matrix/vec2.js":123,"./gl-matrix/vec3.js":124,"./gl-matrix/vec4.js":125}],117:[function(q,r,o){var p={};p.EPSILON=0.000001,p.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,p.RANDOM=Math.random,p.setMatrixArrayType=function(t){GLMAT_ARRAY_TYPE=t};var s=Math.PI/180;p.toRadian=function(t){return t*s},r.exports=p},{}],118:[function(q,r,o){var p=q("./common.js"),s={};s.create=function(){var u=new p.ARRAY_TYPE(4);return u[0]=1,u[1]=0,u[2]=0,u[3]=1,u},s.clone=function(u){var v=new p.ARRAY_TYPE(4);return v[0]=u[0],v[1]=u[1],v[2]=u[2],v[3]=u[3],v},s.copy=function(u,v){return u[0]=v[0],u[1]=v[1],u[2]=v[2],u[3]=v[3],u},s.identity=function(u){return u[0]=1,u[1]=0,u[2]=0,u[3]=1,u},s.transpose=function(u,w){if(u===w){var v=w[1];u[1]=w[2],u[2]=v}else{u[0]=w[0],u[1]=w[2],u[2]=w[1],u[3]=w[3]}return u},s.invert=function(z,D){var A=D[0],v=D[1],w=D[2],C=D[3],B=A*C-w*v;return B?(B=1/B,z[0]=C*B,z[1]=-v*B,z[2]=-w*B,z[3]=A*B,z):null},s.adjoint=function(u,w){var v=w[0];return u[0]=w[3],u[1]=-w[1],u[2]=-w[2],u[3]=v,u},s.determinant=function(u){return u[0]*u[3]-u[2]*u[1]},s.multiply=function(H,z,v){var F=z[0],G=z[1],w=z[2],D=z[3],B=v[0],A=v[1],E=v[2],C=v[3];return H[0]=F*B+w*A,H[1]=G*B+D*A,H[2]=F*E+w*C,H[3]=G*E+D*C,H},s.mul=s.multiply,s.rotate=function(F,z,v){var D=z[0],E=z[1],w=z[2],C=z[3],B=Math.sin(v),A=Math.cos(v);return F[0]=D*A+w*B,F[1]=E*A+C*B,F[2]=D*-B+w*A,F[3]=E*-B+C*A,F},s.scale=function(F,z,v){var D=z[0],E=z[1],w=z[2],C=z[3],B=v[0],A=v[1];return F[0]=D*B,F[1]=E*B,F[2]=w*A,F[3]=C*A,F},s.fromRotation=function(v,z){var w=Math.sin(z),u=Math.cos(z);return v[0]=u,v[1]=w,v[2]=-w,v[3]=u,v},s.fromScaling=function(u,v){return u[0]=v[0],u[1]=0,u[2]=0,u[3]=v[1],u},s.str=function(u){return"mat2("+u[0]+", "+u[1]+", "+u[2]+", "+u[3]+")"},s.frob=function(u){return Math.sqrt(Math.pow(u[0],2)+Math.pow(u[1],2)+Math.pow(u[2],2)+Math.pow(u[3],2))},s.LDU=function(v,z,w,u){return v[2]=u[2]/u[0],w[0]=u[0],w[1]=u[1],w[3]=u[3]-v[2]*w[1],[v,z,w]},r.exports=s},{"./common.js":117}],119:[function(q,r,o){var p=q("./common.js"),s={};s.create=function(){var u=new p.ARRAY_TYPE(6);return u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u},s.clone=function(u){var v=new p.ARRAY_TYPE(6);return v[0]=u[0],v[1]=u[1],v[2]=u[2],v[3]=u[3],v[4]=u[4],v[5]=u[5],v},s.copy=function(u,v){return u[0]=v[0],u[1]=v[1],u[2]=v[2],u[3]=v[3],u[4]=v[4],u[5]=v[5],u},s.identity=function(u){return u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u},s.invert=function(F,z){var v=z[0],D=z[1],w=z[2],E=z[3],C=z[4],B=z[5],A=v*E-D*w;return A?(A=1/A,F[0]=E*A,F[1]=-D*A,F[2]=-w*A,F[3]=v*A,F[4]=(w*B-E*C)*A,F[5]=(D*C-v*B)*A,F):null},s.determinant=function(u){return u[0]*u[3]-u[1]*u[2]},s.multiply=function(N,z,v){var J=z[0],w=z[1],K=z[2],F=z[3],C=z[4],A=z[5],I=v[0],H=v[1],E=v[2],B=v[3],G=v[4],D=v[5];return N[0]=J*I+K*H,N[1]=w*I+F*H,N[2]=J*E+K*B,N[3]=w*E+F*B,N[4]=J*G+K*D+C,N[5]=w*G+F*D+A,N},s.mul=s.multiply,s.rotate=function(H,z,v){var F=z[0],w=z[1],G=z[2],C=z[3],B=z[4],A=z[5],E=Math.sin(v),D=Math.cos(v);return H[0]=F*D+G*E,H[1]=w*D+C*E,H[2]=F*-E+G*D,H[3]=w*-E+C*D,H[4]=B,H[5]=A,H},s.scale=function(H,z,v){var F=z[0],w=z[1],G=z[2],C=z[3],B=z[4],A=z[5],E=v[0],D=v[1];return H[0]=F*E,H[1]=w*E,H[2]=G*D,H[3]=C*D,H[4]=B,H[5]=A,H},s.translate=function(H,z,v){var F=z[0],w=z[1],G=z[2],C=z[3],B=z[4],A=z[5],E=v[0],D=v[1];return H[0]=F,H[1]=w,H[2]=G,H[3]=C,H[4]=F*E+G*D+B,H[5]=w*E+C*D+A,H},s.fromRotation=function(v,z){var w=Math.sin(z),u=Math.cos(z);return v[0]=u,v[1]=w,v[2]=-w,v[3]=u,v[4]=0,v[5]=0,v},s.fromScaling=function(u,v){return u[0]=v[0],u[1]=0,u[2]=0,u[3]=v[1],u[4]=0,u[5]=0,u},s.fromTranslation=function(u,v){return u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=v[0],u[5]=v[1],u},s.str=function(u){return"mat2d("+u[0]+", "+u[1]+", "+u[2]+", "+u[3]+", "+u[4]+", "+u[5]+")"},s.frob=function(u){return Math.sqrt(Math.pow(u[0],2)+Math.pow(u[1],2)+Math.pow(u[2],2)+Math.pow(u[3],2)+Math.pow(u[4],2)+Math.pow(u[5],2)+1)},r.exports=s},{"./common.js":117}],120:[function(q,s,o){var p=q("./common.js"),r={};r.create=function(){var u=new p.ARRAY_TYPE(9);return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=0,u[8]=1,u},r.fromMat4=function(u,v){return u[0]=v[0],u[1]=v[1],u[2]=v[2],u[3]=v[4],u[4]=v[5],u[5]=v[6],u[6]=v[8],u[7]=v[9],u[8]=v[10],u},r.clone=function(u){var v=new p.ARRAY_TYPE(9);return v[0]=u[0],v[1]=u[1],v[2]=u[2],v[3]=u[3],v[4]=u[4],v[5]=u[5],v[6]=u[6],v[7]=u[7],v[8]=u[8],v},r.copy=function(u,v){return u[0]=v[0],u[1]=v[1],u[2]=v[2],u[3]=v[3],u[4]=v[4],u[5]=v[5],u[6]=v[6],u[7]=v[7],u[8]=v[8],u},r.identity=function(u){return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=0,u[8]=1,u},r.transpose=function(v,A){if(v===A){var w=A[1],u=A[2],z=A[5];v[1]=A[3],v[2]=A[6],v[3]=w,v[5]=A[7],v[6]=u,v[7]=z}else{v[0]=A[0],v[1]=A[3],v[2]=A[6],v[3]=A[1],v[4]=A[4],v[5]=A[7],v[6]=A[2],v[7]=A[5],v[8]=A[8]}return v},r.invert=function(O,A){var w=A[0],J=A[1],z=A[2],N=A[3],B=A[4],G=A[5],D=A[6],I=A[7],F=A[8],C=F*B-G*I,H=-F*N+G*D,K=I*N-B*D,E=w*C+J*H+z*K;return E?(E=1/E,O[0]=C*E,O[1]=(-F*J+z*I)*E,O[2]=(G*J-z*B)*E,O[3]=H*E,O[4]=(F*w-z*D)*E,O[5]=(-G*w+z*N)*E,O[6]=K*E,O[7]=(-I*w+J*D)*E,O[8]=(B*w-J*N)*E,O):null},r.adjoint=function(H,z){var v=z[0],F=z[1],w=z[2],G=z[3],A=z[4],D=z[5],B=z[6],E=z[7],C=z[8];return H[0]=A*C-D*E,H[1]=w*E-F*C,H[2]=F*D-w*A,H[3]=D*B-G*C,H[4]=v*C-w*B,H[5]=w*G-v*D,H[6]=G*E-A*B,H[7]=F*B-v*E,H[8]=v*A-F*G,H},r.determinant=function(G){var z=G[0],v=G[1],E=G[2],w=G[3],F=G[4],A=G[5],C=G[6],B=G[7],D=G[8];return z*(D*F-A*B)+v*(-D*w+A*C)+E*(B*w-F*C)},r.multiply=function(E,J,G){var W=J[0],I=J[1],D=J[2],K=J[3],T=J[4],O=J[5],V=J[6],S=J[7],N=J[8],A=G[0],C=G[1],P=G[2],H=G[3],F=G[4],B=G[5],U=G[6],z=G[7],Q=G[8];return E[0]=A*W+C*K+P*V,E[1]=A*I+C*T+P*S,E[2]=A*D+C*O+P*N,E[3]=H*W+F*K+B*V,E[4]=H*I+F*T+B*S,E[5]=H*D+F*O+B*N,E[6]=U*W+z*K+Q*V,E[7]=U*I+z*T+Q*S,E[8]=U*D+z*O+Q*N,E},r.mul=r.multiply,r.translate=function(N,A,w){var I=A[0],z=A[1],K=A[2],B=A[3],F=A[4],D=A[5],H=A[6],E=A[7],C=A[8],G=w[0],J=w[1];return N[0]=I,N[1]=z,N[2]=K,N[3]=B,N[4]=F,N[5]=D,N[6]=G*I+J*B+H,N[7]=G*z+J*F+E,N[8]=G*K+J*D+C,N},r.rotate=function(N,A,w){var I=A[0],z=A[1],K=A[2],B=A[3],F=A[4],D=A[5],H=A[6],E=A[7],C=A[8],G=Math.sin(w),J=Math.cos(w);return N[0]=J*I+G*B,N[1]=J*z+G*F,N[2]=J*K+G*D,N[3]=J*B-G*I,N[4]=J*F-G*z,N[5]=J*D-G*K,N[6]=H,N[7]=E,N[8]=C,N},r.scale=function(v,A,w){var u=w[0],z=w[1];return v[0]=u*A[0],v[1]=u*A[1],v[2]=u*A[2],v[3]=z*A[3],v[4]=z*A[4],v[5]=z*A[5],v[6]=A[6],v[7]=A[7],v[8]=A[8],v},r.fromTranslation=function(u,v){return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=v[0],u[7]=v[1],u[8]=1,u},r.fromRotation=function(v,z){var w=Math.sin(z),u=Math.cos(z);return v[0]=u,v[1]=w,v[2]=0,v[3]=-w,v[4]=u,v[5]=0,v[6]=0,v[7]=0,v[8]=1,v},r.fromScaling=function(u,v){return u[0]=v[0],u[1]=0,u[2]=0,u[3]=0,u[4]=v[1],u[5]=0,u[6]=0,u[7]=0,u[8]=1,u},r.fromMat2d=function(u,v){return u[0]=v[0],u[1]=v[1],u[2]=0,u[3]=v[2],u[4]=v[3],u[5]=0,u[6]=v[4],u[7]=v[5],u[8]=1,u},r.fromQuat=function(D,I){var F=I[0],S=I[1],H=I[2],C=I[3],J=F+F,Q=S+S,N=H+H,R=F*J,P=S*J,K=S*Q,z=H*J,B=H*Q,O=H*N,G=C*J,E=C*Q,A=C*N;return D[0]=1-K-O,D[3]=P-A,D[6]=z+E,D[1]=P+A,D[4]=1-R-O,D[7]=B-G,D[2]=z-E,D[5]=B+G,D[8]=1-R-K,D},r.normalFromMat4=function(O,Z){var S=Z[0],ak=Z[1],X=Z[2],K=Z[3],aa=Z[4],ah=Z[5],ad=Z[6],aj=Z[7],ag=Z[8],ab=Z[9],F=Z[10],J=Z[11],ae=Z[12],W=Z[13],Q=Z[14],I=Z[15],ai=S*ah-ak*aa,C=S*ad-X*aa,af=S*aj-K*aa,H=ak*ad-X*ah,G=ak*aj-K*ah,V=X*aj-K*ad,z=ag*W-ab*ae,B=ag*Q-F*ae,ac=ag*I-J*ae,U=ab*Q-F*W,N=ab*I-J*W,D=F*I-J*Q,al=ai*D-C*N+af*U+H*ac-G*B+V*z;return al?(al=1/al,O[0]=(ah*D-ad*N+aj*U)*al,O[1]=(ad*ac-aa*D-aj*B)*al,O[2]=(aa*N-ah*ac+aj*z)*al,O[3]=(X*N-ak*D-K*U)*al,O[4]=(S*D-X*ac+K*B)*al,O[5]=(ak*ac-S*N-K*z)*al,O[6]=(W*V-Q*G+I*H)*al,O[7]=(Q*af-ae*V-I*C)*al,O[8]=(ae*G-W*af+I*ai)*al,O):null},r.str=function(u){return"mat3("+u[0]+", "+u[1]+", "+u[2]+", "+u[3]+", "+u[4]+", "+u[5]+", "+u[6]+", "+u[7]+", "+u[8]+")"},r.frob=function(u){return Math.sqrt(Math.pow(u[0],2)+Math.pow(u[1],2)+Math.pow(u[2],2)+Math.pow(u[3],2)+Math.pow(u[4],2)+Math.pow(u[5],2)+Math.pow(u[6],2)+Math.pow(u[7],2)+Math.pow(u[8],2))},s.exports=r},{"./common.js":117}],121:[function(r,s,o){var q=r("./common.js"),p={};p.create=function(){var u=new q.ARRAY_TYPE(16);return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u},p.clone=function(v){var u=new q.ARRAY_TYPE(16);return u[0]=v[0],u[1]=v[1],u[2]=v[2],u[3]=v[3],u[4]=v[4],u[5]=v[5],u[6]=v[6],u[7]=v[7],u[8]=v[8],u[9]=v[9],u[10]=v[10],u[11]=v[11],u[12]=v[12],u[13]=v[13],u[14]=v[14],u[15]=v[15],u},p.copy=function(v,u){return v[0]=u[0],v[1]=u[1],v[2]=u[2],v[3]=u[3],v[4]=u[4],v[5]=u[5],v[6]=u[6],v[7]=u[7],v[8]=u[8],v[9]=u[9],v[10]=u[10],v[11]=u[11],v[12]=u[12],v[13]=u[13],v[14]=u[14],v[15]=u[15],v},p.identity=function(u){return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u},p.transpose=function(A,v){if(A===v){var B=v[1],E=v[2],D=v[3],C=v[6],z=v[7],w=v[11];A[1]=v[4],A[2]=v[8],A[3]=v[12],A[4]=B,A[6]=v[9],A[7]=v[13],A[8]=E,A[9]=C,A[11]=v[14],A[12]=D,A[13]=z,A[14]=w}else{A[0]=v[0],A[1]=v[4],A[2]=v[8],A[3]=v[12],A[4]=v[1],A[5]=v[5],A[6]=v[9],A[7]=v[13],A[8]=v[2],A[9]=v[6],A[10]=v[10],A[11]=v[14],A[12]=v[3],A[13]=v[7],A[14]=v[11],A[15]=v[15]}return A},p.invert=function(V,an){var X=an[0],ac=an[1],ab=an[2],aj=an[3],af=an[4],Q=an[5],G=an[6],ad=an[7],ag=an[8],al=an[9],ai=an[10],W=an[11],ae=an[12],N=an[13],aa=an[14],K=an[15],ah=X*Q-ac*af,D=X*G-ab*af,C=X*ad-aj*af,J=ac*G-ab*Q,H=ac*ad-aj*Q,B=ab*ad-aj*G,ak=ag*N-al*ae,Z=ag*aa-ai*ae,U=ag*K-W*ae,F=al*aa-ai*N,am=al*K-W*N,A=ai*K-W*aa,z=ah*A-D*am+C*F+J*U-H*Z+B*ak;return z?(z=1/z,V[0]=(Q*A-G*am+ad*F)*z,V[1]=(ab*am-ac*A-aj*F)*z,V[2]=(N*B-aa*H+K*J)*z,V[3]=(ai*H-al*B-W*J)*z,V[4]=(G*U-af*A-ad*Z)*z,V[5]=(X*A-ab*U+aj*Z)*z,V[6]=(aa*C-ae*B-K*D)*z,V[7]=(ag*B-ai*C+W*D)*z,V[8]=(af*am-Q*U+ad*ak)*z,V[9]=(ac*U-X*am-aj*ak)*z,V[10]=(ae*H-N*C+K*ah)*z,V[11]=(al*C-ag*H-W*ah)*z,V[12]=(Q*Z-af*F-G*ak)*z,V[13]=(X*F-ac*Z+ab*ak)*z,V[14]=(N*D-ae*J-aa*ah)*z,V[15]=(ag*J-al*D+ai*ah)*z,V):null},p.adjoint=function(D,S){var F=S[0],I=S[1],H=S[2],Q=S[3],N=S[4],C=S[5],z=S[6],J=S[7],O=S[8],R=S[9],P=S[10],E=S[11],K=S[12],B=S[13],G=S[14],A=S[15];return D[0]=C*(P*A-E*G)-R*(z*A-J*G)+B*(z*E-J*P),D[1]=-(I*(P*A-E*G)-R*(H*A-Q*G)+B*(H*E-Q*P)),D[2]=I*(z*A-J*G)-C*(H*A-Q*G)+B*(H*J-Q*z),D[3]=-(I*(z*E-J*P)-C*(H*E-Q*P)+R*(H*J-Q*z)),D[4]=-(N*(P*A-E*G)-O*(z*A-J*G)+K*(z*E-J*P)),D[5]=F*(P*A-E*G)-O*(H*A-Q*G)+K*(H*E-Q*P),D[6]=-(F*(z*A-J*G)-N*(H*A-Q*G)+K*(H*J-Q*z)),D[7]=F*(z*E-J*P)-N*(H*E-Q*P)+O*(H*J-Q*z),D[8]=N*(R*A-E*B)-O*(C*A-J*B)+K*(C*E-J*R),D[9]=-(F*(R*A-E*B)-O*(I*A-Q*B)+K*(I*E-Q*R)),D[10]=F*(C*A-J*B)-N*(I*A-Q*B)+K*(I*J-Q*C),D[11]=-(F*(C*E-J*R)-N*(I*E-Q*R)+O*(I*J-Q*C)),D[12]=-(N*(R*G-P*B)-O*(C*G-z*B)+K*(C*P-z*R)),D[13]=F*(R*G-P*B)-O*(I*G-H*B)+K*(I*P-H*R),D[14]=-(F*(C*G-z*B)-N*(I*G-H*B)+K*(I*z-H*C)),D[15]=F*(C*P-z*R)-N*(I*P-H*R)+O*(I*z-H*C),D},p.determinant=function(Q){var aj=Q[0],U=Q[1],Y=Q[2],X=Q[3],af=Q[4],ab=Q[5],K=Q[6],D=Q[7],Z=Q[8],ac=Q[9],ah=Q[10],ae=Q[11],T=Q[12],aa=Q[13],J=Q[14],W=Q[15],H=aj*ab-U*af,ad=aj*K-Y*af,B=aj*D-X*af,A=U*K-Y*ab,G=U*D-X*ab,F=Y*D-X*K,z=Z*aa-ac*T,ag=Z*J-ah*T,V=Z*W-ae*T,N=ac*J-ah*aa,C=ac*W-ae*aa,ai=ah*W-ae*J;return H*ai-ad*C+B*N+A*V-G*ag+F*z},p.multiply=function(H,aa,K){var Q=aa[0],O=aa[1],Y=aa[2],U=aa[3],G=aa[4],B=aa[5],S=aa[6],V=aa[7],Z=aa[8],X=aa[9],J=aa[10],T=aa[11],F=aa[12],N=aa[13],E=aa[14],W=aa[15],A=K[0],z=K[1],D=K[2],C=K[3];return H[0]=A*Q+z*G+D*Z+C*F,H[1]=A*O+z*B+D*X+C*N,H[2]=A*Y+z*S+D*J+C*E,H[3]=A*U+z*V+D*T+C*W,A=K[4],z=K[5],D=K[6],C=K[7],H[4]=A*Q+z*G+D*Z+C*F,H[5]=A*O+z*B+D*X+C*N,H[6]=A*Y+z*S+D*J+C*E,H[7]=A*U+z*V+D*T+C*W,A=K[8],z=K[9],D=K[10],C=K[11],H[8]=A*Q+z*G+D*Z+C*F,H[9]=A*O+z*B+D*X+C*N,H[10]=A*Y+z*S+D*J+C*E,H[11]=A*U+z*V+D*T+C*W,A=K[12],z=K[13],D=K[14],C=K[15],H[12]=A*Q+z*G+D*Z+C*F,H[13]=A*O+z*B+D*X+C*N,H[14]=A*Y+z*S+D*J+C*E,H[15]=A*U+z*V+D*T+C*W,H},p.mul=p.multiply,p.translate=function(D,S,F){var I,H,Q,N,C,z,J,O,R,P,E,K,B=F[0],G=F[1],A=F[2];return S===D?(D[12]=S[0]*B+S[4]*G+S[8]*A+S[12],D[13]=S[1]*B+S[5]*G+S[9]*A+S[13],D[14]=S[2]*B+S[6]*G+S[10]*A+S[14],D[15]=S[3]*B+S[7]*G+S[11]*A+S[15]):(I=S[0],H=S[1],Q=S[2],N=S[3],C=S[4],z=S[5],J=S[6],O=S[7],R=S[8],P=S[9],E=S[10],K=S[11],D[0]=I,D[1]=H,D[2]=Q,D[3]=N,D[4]=C,D[5]=z,D[6]=J,D[7]=O,D[8]=R,D[9]=P,D[10]=E,D[11]=K,D[12]=I*B+C*G+R*A+S[12],D[13]=H*B+z*G+P*A+S[13],D[14]=Q*B+J*G+E*A+S[14],D[15]=N*B+O*G+K*A+S[15]),D},p.scale=function(v,u,w){var B=w[0],A=w[1],z=w[2];return v[0]=u[0]*B,v[1]=u[1]*B,v[2]=u[2]*B,v[3]=u[3]*B,v[4]=u[4]*A,v[5]=u[5]*A,v[6]=u[6]*A,v[7]=u[7]*A,v[8]=u[8]*z,v[9]=u[9]*z,v[10]=u[10]*z,v[11]=u[11]*z,v[12]=u[12],v[13]=u[13],v[14]=u[14],v[15]=u[15],v},p.rotate=function(W,ao,Z,ad){var ac,ak,ag,U,G,ae,ah,am,aj,X,af,Q,ab,N,ai,D,C,K,J,B,al,aa,V,F,an=ad[0],A=ad[1],z=ad[2],H=Math.sqrt(an*an+A*A+z*z);return Math.abs(H)<q.EPSILON?null:(H=1/H,an*=H,A*=H,z*=H,ac=Math.sin(Z),ak=Math.cos(Z),ag=1-ak,U=ao[0],G=ao[1],ae=ao[2],ah=ao[3],am=ao[4],aj=ao[5],X=ao[6],af=ao[7],Q=ao[8],ab=ao[9],N=ao[10],ai=ao[11],D=an*an*ag+ak,C=A*an*ag+z*ac,K=z*an*ag-A*ac,J=an*A*ag-z*ac,B=A*A*ag+ak,al=z*A*ag+an*ac,aa=an*z*ag+A*ac,V=A*z*ag-an*ac,F=z*z*ag+ak,W[0]=U*D+am*C+Q*K,W[1]=G*D+aj*C+ab*K,W[2]=ae*D+X*C+N*K,W[3]=ah*D+af*C+ai*K,W[4]=U*J+am*B+Q*al,W[5]=G*J+aj*B+ab*al,W[6]=ae*J+X*B+N*al,W[7]=ah*J+af*B+ai*al,W[8]=U*aa+am*V+Q*F,W[9]=G*aa+aj*V+ab*F,W[10]=ae*aa+X*V+N*F,W[11]=ah*aa+af*V+ai*F,ao!==W&&(W[12]=ao[12],W[13]=ao[13],W[14]=ao[14],W[15]=ao[15]),W)},p.rotateX=function(J,H,v){var z=Math.sin(v),w=Math.cos(v),E=H[4],B=H[5],I=H[6],F=H[7],A=H[8],C=H[9],G=H[10],D=H[11];return H!==J&&(J[0]=H[0],J[1]=H[1],J[2]=H[2],J[3]=H[3],J[12]=H[12],J[13]=H[13],J[14]=H[14],J[15]=H[15]),J[4]=E*w+A*z,J[5]=B*w+C*z,J[6]=I*w+G*z,J[7]=F*w+D*z,J[8]=A*w-E*z,J[9]=C*w-B*z,J[10]=G*w-I*z,J[11]=D*w-F*z,J},p.rotateY=function(J,H,v){var z=Math.sin(v),w=Math.cos(v),E=H[0],B=H[1],I=H[2],F=H[3],A=H[8],C=H[9],G=H[10],D=H[11];return H!==J&&(J[4]=H[4],J[5]=H[5],J[6]=H[6],J[7]=H[7],J[12]=H[12],J[13]=H[13],J[14]=H[14],J[15]=H[15]),J[0]=E*w-A*z,J[1]=B*w-C*z,J[2]=I*w-G*z,J[3]=F*w-D*z,J[8]=E*z+A*w,J[9]=B*z+C*w,J[10]=I*z+G*w,J[11]=F*z+D*w,J},p.rotateZ=function(J,H,v){var z=Math.sin(v),w=Math.cos(v),E=H[0],B=H[1],I=H[2],F=H[3],A=H[4],C=H[5],G=H[6],D=H[7];return H!==J&&(J[8]=H[8],J[9]=H[9],J[10]=H[10],J[11]=H[11],J[12]=H[12],J[13]=H[13],J[14]=H[14],J[15]=H[15]),J[0]=E*w+A*z,J[1]=B*w+C*z,J[2]=I*w+G*z,J[3]=F*w+D*z,J[4]=A*w-E*z,J[5]=C*w-B*z,J[6]=G*w-I*z,J[7]=D*w-F*z,J},p.fromTranslation=function(v,u){return v[0]=1,v[1]=0,v[2]=0,v[3]=0,v[4]=0,v[5]=1,v[6]=0,v[7]=0,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=u[0],v[13]=u[1],v[14]=u[2],v[15]=1,v},p.fromScaling=function(v,u){return v[0]=u[0],v[1]=0,v[2]=0,v[3]=0,v[4]=0,v[5]=u[1],v[6]=0,v[7]=0,v[8]=0,v[9]=0,v[10]=u[2],v[11]=0,v[12]=0,v[13]=0,v[14]=0,v[15]=1,v},p.fromRotation=function(G,E,v){var z,w,C,B=v[0],F=v[1],D=v[2],A=Math.sqrt(B*B+F*F+D*D);return Math.abs(A)<q.EPSILON?null:(A=1/A,B*=A,F*=A,D*=A,z=Math.sin(E),w=Math.cos(E),C=1-w,G[0]=B*B*C+w,G[1]=F*B*C+D*z,G[2]=D*B*C-F*z,G[3]=0,G[4]=B*F*C-D*z,G[5]=F*F*C+w,G[6]=D*F*C+B*z,G[7]=0,G[8]=B*D*C+F*z,G[9]=F*D*C-B*z,G[10]=D*D*C+w,G[11]=0,G[12]=0,G[13]=0,G[14]=0,G[15]=1,G)},p.fromXRotation=function(v,u){var w=Math.sin(u),z=Math.cos(u);return v[0]=1,v[1]=0,v[2]=0,v[3]=0,v[4]=0,v[5]=z,v[6]=w,v[7]=0,v[8]=0,v[9]=-w,v[10]=z,v[11]=0,v[12]=0,v[13]=0,v[14]=0,v[15]=1,v},p.fromYRotation=function(v,u){var w=Math.sin(u),z=Math.cos(u);return v[0]=z,v[1]=0,v[2]=-w,v[3]=0,v[4]=0,v[5]=1,v[6]=0,v[7]=0,v[8]=w,v[9]=0,v[10]=z,v[11]=0,v[12]=0,v[13]=0,v[14]=0,v[15]=1,v},p.fromZRotation=function(v,u){var w=Math.sin(u),z=Math.cos(u);return v[0]=z,v[1]=w,v[2]=0,v[3]=0,v[4]=-w,v[5]=z,v[6]=0,v[7]=0,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=0,v[13]=0,v[14]=0,v[15]=1,v},p.fromRotationTranslation=function(D,T,F){var I=T[0],H=T[1],R=T[2],N=T[3],C=I+I,z=H+H,J=R+R,O=I*C,S=I*z,Q=I*J,E=H*z,K=H*J,B=R*J,G=N*C,A=N*z,P=N*J;return D[0]=1-(E+B),D[1]=S+P,D[2]=Q-A,D[3]=0,D[4]=S-P,D[5]=1-(O+B),D[6]=K+G,D[7]=0,D[8]=Q+A,D[9]=K-G,D[10]=1-(O+E),D[11]=0,D[12]=F[0],D[13]=F[1],D[14]=F[2],D[15]=1,D},p.fromRotationTranslationScale=function(H,aa,K,Q){var O=aa[0],Y=aa[1],U=aa[2],G=aa[3],B=O+O,S=Y+Y,V=U+U,Z=O*B,X=O*S,J=O*V,T=Y*S,F=Y*V,N=U*V,E=G*B,W=G*S,A=G*V,z=Q[0],D=Q[1],C=Q[2];return H[0]=(1-(T+N))*z,H[1]=(X+A)*z,H[2]=(J-W)*z,H[3]=0,H[4]=(X-A)*D,H[5]=(1-(Z+N))*D,H[6]=(F+E)*D,H[7]=0,H[8]=(J+W)*C,H[9]=(F-E)*C,H[10]=(1-(Z+T))*C,H[11]=0,H[12]=K[0],H[13]=K[1],H[14]=K[2],H[15]=1,H},p.fromRotationTranslationScaleOrigin=function(N,ag,Q,W,V){var ad=ag[0],Z=ag[1],J=ag[2],C=ag[3],X=ad+ad,aa=Z+Z,af=J+J,ac=ad*X,O=ad*aa,Y=ad*af,H=Z*aa,U=Z*af,G=J*af,ab=C*X,B=C*aa,A=C*af,F=W[0],D=W[1],z=W[2],ae=V[0],T=V[1],K=V[2];return N[0]=(1-(H+G))*F,N[1]=(O+A)*F,N[2]=(Y-B)*F,N[3]=0,N[4]=(O-A)*D,N[5]=(1-(ac+G))*D,N[6]=(U+ab)*D,N[7]=0,N[8]=(Y+B)*z,N[9]=(U-ab)*z,N[10]=(1-(ac+H))*z,N[11]=0,N[12]=Q[0]+ae-(N[0]*ae+N[4]*T+N[8]*K),N[13]=Q[1]+T-(N[1]*ae+N[5]*T+N[9]*K),N[14]=Q[2]+K-(N[2]*ae+N[6]*T+N[10]*K),N[15]=1,N},p.fromQuat=function(D,S){var F=S[0],I=S[1],H=S[2],Q=S[3],N=F+F,C=I+I,z=H+H,J=F*N,O=I*N,R=I*C,P=H*N,E=H*C,K=H*z,B=Q*N,G=Q*C,A=Q*z;return D[0]=1-R-K,D[1]=O+A,D[2]=P-G,D[3]=0,D[4]=O-A,D[5]=1-J-K,D[6]=E+B,D[7]=0,D[8]=P+G,D[9]=E-B,D[10]=1-J-R,D[11]=0,D[12]=0,D[13]=0,D[14]=0,D[15]=1,D},p.frustum=function(G,E,v,z,w,C,B){var F=1/(v-E),D=1/(w-z),A=1/(C-B);return G[0]=2*C*F,G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=2*C*D,G[6]=0,G[7]=0,G[8]=(v+E)*F,G[9]=(w+z)*D,G[10]=(B+C)*A,G[11]=-1,G[12]=0,G[13]=0,G[14]=B*C*2*A,G[15]=0,G},p.perspective=function(w,u,z,C,B){var A=1/Math.tan(u/2),v=1/(C-B);return w[0]=A/z,w[1]=0,w[2]=0,w[3]=0,w[4]=0,w[5]=A,w[6]=0,w[7]=0,w[8]=0,w[9]=0,w[10]=(B+C)*v,w[11]=-1,w[12]=0,w[13]=0,w[14]=2*B*C*v,w[15]=0,w},p.perspectiveFromFieldOfView=function(G,E,v,z){var w=Math.tan(E.upDegrees*Math.PI/180),C=Math.tan(E.downDegrees*Math.PI/180),B=Math.tan(E.leftDegrees*Math.PI/180),F=Math.tan(E.rightDegrees*Math.PI/180),D=2/(B+F),A=2/(w+C);return G[0]=D,G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=A,G[6]=0,G[7]=0,G[8]=-((B-F)*D*0.5),G[9]=(w-C)*A*0.5,G[10]=z/(v-z),G[11]=-1,G[12]=0,G[13]=0,G[14]=z*v/(v-z),G[15]=0,G},p.ortho=function(G,E,v,z,w,C,B){var F=1/(E-v),D=1/(z-w),A=1/(C-B);return G[0]=-2*F,G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=-2*D,G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[10]=2*A,G[11]=0,G[12]=(E+v)*F,G[13]=(w+z)*D,G[14]=(B+C)*A,G[15]=1,G},p.lookAt=function(H,aa,K,Q){var O,Y,U,G,B,S,V,Z,X,J,T=aa[0],F=aa[1],N=aa[2],E=Q[0],W=Q[1],A=Q[2],z=K[0],D=K[1],C=K[2];return Math.abs(T-z)<q.EPSILON&&Math.abs(F-D)<q.EPSILON&&Math.abs(N-C)<q.EPSILON?p.identity(H):(V=T-z,Z=F-D,X=N-C,J=1/Math.sqrt(V*V+Z*Z+X*X),V*=J,Z*=J,X*=J,O=W*X-A*Z,Y=A*V-E*X,U=E*Z-W*V,J=Math.sqrt(O*O+Y*Y+U*U),J?(J=1/J,O*=J,Y*=J,U*=J):(O=0,Y=0,U=0),G=Z*U-X*Y,B=X*O-V*U,S=V*Y-Z*O,J=Math.sqrt(G*G+B*B+S*S),J?(J=1/J,G*=J,B*=J,S*=J):(G=0,B=0,S=0),H[0]=O,H[1]=G,H[2]=V,H[3]=0,H[4]=Y,H[5]=B,H[6]=Z,H[7]=0,H[8]=U,H[9]=S,H[10]=X,H[11]=0,H[12]=-(O*T+Y*F+U*N),H[13]=-(G*T+B*F+S*N),H[14]=-(V*T+Z*F+X*N),H[15]=1,H)},p.str=function(u){return"mat4("+u[0]+", "+u[1]+", "+u[2]+", "+u[3]+", "+u[4]+", "+u[5]+", "+u[6]+", "+u[7]+", "+u[8]+", "+u[9]+", "+u[10]+", "+u[11]+", "+u[12]+", "+u[13]+", "+u[14]+", "+u[15]+")"},p.frob=function(u){return Math.sqrt(Math.pow(u[0],2)+Math.pow(u[1],2)+Math.pow(u[2],2)+Math.pow(u[3],2)+Math.pow(u[4],2)+Math.pow(u[5],2)+Math.pow(u[6],2)+Math.pow(u[7],2)+Math.pow(u[8],2)+Math.pow(u[9],2)+Math.pow(u[10],2)+Math.pow(u[11],2)+Math.pow(u[12],2)+Math.pow(u[13],2)+Math.pow(u[14],2)+Math.pow(u[15],2))},s.exports=p},{"./common.js":117}],122:[function(r,u,o){var q=r("./common.js"),t=r("./mat3.js"),s=r("./vec3.js"),p=r("./vec4.js"),v={};v.create=function(){var w=new q.ARRAY_TYPE(4);return w[0]=0,w[1]=0,w[2]=0,w[3]=1,w},v.rotationTo=function(){var z=s.create(),w=s.fromValues(1,0,0),A=s.fromValues(0,1,0);return function(C,B,E){var D=s.dot(B,E);return -0.999999>D?(s.cross(z,w,B),s.length(z)<0.000001&&s.cross(z,A,B),s.normalize(z,z),v.setAxisAngle(C,z,Math.PI),C):D>0.999999?(C[0]=0,C[1]=0,C[2]=0,C[3]=1,C):(s.cross(z,B,E),C[0]=z[0],C[1]=z[1],C[2]=z[2],C[3]=1+D,v.normalize(C,C))}}(),v.setAxes=function(){var w=t.create();return function(z,C,B,A){return w[0]=B[0],w[3]=B[1],w[6]=B[2],w[1]=A[0],w[4]=A[1],w[7]=A[2],w[2]=-C[0],w[5]=-C[1],w[8]=-C[2],v.normalize(z,v.fromMat3(z,w))}}(),v.clone=p.clone,v.fromValues=p.fromValues,v.copy=p.copy,v.set=p.set,v.identity=function(w){return w[0]=0,w[1]=0,w[2]=0,w[3]=1,w},v.setAxisAngle=function(z,w,B){B=0.5*B;var A=Math.sin(B);return z[0]=A*w[0],z[1]=A*w[1],z[2]=A*w[2],z[3]=Math.cos(B),z},v.add=p.add,v.multiply=function(H,F,D){var w=F[0],G=F[1],B=F[2],E=F[3],z=D[0],A=D[1],I=D[2],C=D[3];return H[0]=w*C+E*z+G*I-B*A,H[1]=G*C+E*A+B*z-w*I,H[2]=B*C+E*I+w*A-G*z,H[3]=E*C-w*z-G*A-B*I,H},v.mul=v.multiply,v.scale=p.scale,v.rotateX=function(G,E,C){C*=0.5;var w=E[0],F=E[1],B=E[2],D=E[3],z=Math.sin(C),A=Math.cos(C);return G[0]=w*A+D*z,G[1]=F*A+B*z,G[2]=B*A-F*z,G[3]=D*A-w*z,G},v.rotateY=function(G,E,C){C*=0.5;var w=E[0],F=E[1],B=E[2],D=E[3],z=Math.sin(C),A=Math.cos(C);return G[0]=w*A-B*z,G[1]=F*A+D*z,G[2]=B*A+w*z,G[3]=D*A-F*z,G},v.rotateZ=function(G,E,C){C*=0.5;var w=E[0],F=E[1],B=E[2],D=E[3],z=Math.sin(C),A=Math.cos(C);return G[0]=w*A+F*z,G[1]=F*A-w*z,G[2]=B*A+D*z,G[3]=D*A-B*z,G},v.calculateW=function(A,w){var C=w[0],B=w[1],z=w[2];return A[0]=C,A[1]=B,A[2]=z,A[3]=Math.sqrt(Math.abs(1-C*C-B*B-z*z)),A},v.dot=p.dot,v.lerp=p.lerp,v.slerp=function(P,K,H,w){var O,B,J,z,A,Q=K[0],E=K[1],N=K[2],D=K[3],G=H[0],F=H[1],I=H[2],C=H[3];return B=Q*G+E*F+N*I+D*C,0>B&&(B=-B,G=-G,F=-F,I=-I,C=-C),1-B>0.000001?(O=Math.acos(B),J=Math.sin(O),z=Math.sin((1-w)*O)/J,A=Math.sin(w*O)/J):(z=1-w,A=w),P[0]=z*Q+A*G,P[1]=z*E+A*F,P[2]=z*N+A*I,P[3]=z*D+A*C,P},v.sqlerp=function(){var z=v.create(),w=v.create();return function(D,B,A,F,E,C){return v.slerp(z,B,E,C),v.slerp(w,A,F,C),v.slerp(D,z,w,2*C*(1-C)),D}}(),v.invert=function(A,w){var D=w[0],B=w[1],z=w[2],F=w[3],E=D*D+B*B+z*z+F*F,C=E?1/E:0;return A[0]=-D*C,A[1]=-B*C,A[2]=-z*C,A[3]=F*C,A},v.conjugate=function(z,w){return z[0]=-w[0],z[1]=-w[1],z[2]=-w[2],z[3]=w[3],z},v.length=p.length,v.len=v.length,v.squaredLength=p.squaredLength,v.sqrLen=v.squaredLength,v.normalize=p.normalize,v.fromMat3=function(A,w){var C,B=w[0]+w[4]+w[8];if(B>0){C=Math.sqrt(B+1),A[3]=0.5*C,C=0.5/C,A[0]=(w[5]-w[7])*C,A[1]=(w[6]-w[2])*C,A[2]=(w[1]-w[3])*C}else{var z=0;w[4]>w[0]&&(z=1),w[8]>w[3*z+z]&&(z=2);var E=(z+1)%3,D=(z+2)%3;C=Math.sqrt(w[3*z+z]-w[3*E+E]-w[3*D+D]+1),A[z]=0.5*C,C=0.5/C,A[3]=(w[3*E+D]-w[3*D+E])*C,A[E]=(w[3*E+z]+w[3*z+E])*C,A[D]=(w[3*D+z]+w[3*z+D])*C}return A},v.str=function(w){return"quat("+w[0]+", "+w[1]+", "+w[2]+", "+w[3]+")"},u.exports=v},{"./common.js":117,"./mat3.js":120,"./vec3.js":124,"./vec4.js":125}],123:[function(q,r,o){var p=q("./common.js"),s={};s.create=function(){var t=new p.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},s.clone=function(u){var t=new p.ARRAY_TYPE(2);return t[0]=u[0],t[1]=u[1],t},s.fromValues=function(v,u){var t=new p.ARRAY_TYPE(2);return t[0]=v,t[1]=u,t},s.copy=function(u,t){return u[0]=t[0],u[1]=t[1],u},s.set=function(v,u,t){return v[0]=u,v[1]=t,v},s.add=function(v,u,t){return v[0]=u[0]+t[0],v[1]=u[1]+t[1],v},s.subtract=function(v,u,t){return v[0]=u[0]-t[0],v[1]=u[1]-t[1],v},s.sub=s.subtract,s.multiply=function(v,u,t){return v[0]=u[0]*t[0],v[1]=u[1]*t[1],v},s.mul=s.multiply,s.divide=function(v,u,t){return v[0]=u[0]/t[0],v[1]=u[1]/t[1],v},s.div=s.divide,s.min=function(v,u,t){return v[0]=Math.min(u[0],t[0]),v[1]=Math.min(u[1],t[1]),v},s.max=function(v,u,t){return v[0]=Math.max(u[0],t[0]),v[1]=Math.max(u[1],t[1]),v},s.scale=function(v,u,t){return v[0]=u[0]*t,v[1]=u[1]*t,v},s.scaleAndAdd=function(z,w,v,u){return z[0]=w[0]+v[0]*u,z[1]=w[1]+v[1]*u,z},s.distance=function(z,w){var v=w[0]-z[0],u=w[1]-z[1];return Math.sqrt(v*v+u*u)},s.dist=s.distance,s.squaredDistance=function(z,w){var v=w[0]-z[0],u=w[1]-z[1];return v*v+u*u},s.sqrDist=s.squaredDistance,s.length=function(v){var u=v[0],t=v[1];return Math.sqrt(u*u+t*t)},s.len=s.length,s.squaredLength=function(v){var u=v[0],t=v[1];return u*u+t*t},s.sqrLen=s.squaredLength,s.negate=function(u,t){return u[0]=-t[0],u[1]=-t[1],u},s.inverse=function(u,t){return u[0]=1/t[0],u[1]=1/t[1],u},s.normalize=function(A,w){var v=w[0],u=w[1],z=v*v+u*u;return z>0&&(z=1/Math.sqrt(z),A[0]=w[0]*z,A[1]=w[1]*z),A},s.dot=function(u,t){return u[0]*t[0]+u[1]*t[1]},s.cross=function(z,w,v){var u=w[0]*v[1]-w[1]*v[0];return z[0]=z[1]=0,z[2]=u,z},s.lerp=function(C,A,z,w){var B=A[0],v=A[1];return C[0]=B+w*(z[0]-B),C[1]=v+w*(z[1]-v),C},s.random=function(v,u){u=u||1;var t=2*p.RANDOM()*Math.PI;return v[0]=Math.cos(t)*u,v[1]=Math.sin(t)*u,v},s.transformMat2=function(A,w,v){var u=w[0],z=w[1];return A[0]=v[0]*u+v[2]*z,A[1]=v[1]*u+v[3]*z,A},s.transformMat2d=function(A,w,v){var u=w[0],z=w[1];return A[0]=v[0]*u+v[2]*z+v[4],A[1]=v[1]*u+v[3]*z+v[5],A},s.transformMat3=function(A,w,v){var u=w[0],z=w[1];return A[0]=v[0]*u+v[3]*z+v[6],A[1]=v[1]*u+v[4]*z+v[7],A},s.transformMat4=function(A,w,v){var u=w[0],z=w[1];return A[0]=v[0]*u+v[4]*z+v[12],A[1]=v[1]*u+v[5]*z+v[13],A},s.forEach=function(){var t=s.create();return function(E,D,C,F,A,z){var w,B;for(D||(D=2),C||(C=0),B=F?Math.min(F*D+C,E.length):E.length,w=C;B>w;w+=D){t[0]=E[w],t[1]=E[w+1],A(t,t,z),E[w]=t[0],E[w+1]=t[1]}return E}}(),s.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},r.exports=s},{"./common.js":117}],124:[function(q,s,o){var p=q("./common.js"),r={};r.create=function(){var t=new p.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},r.clone=function(v){var u=new p.ARRAY_TYPE(3);return u[0]=v[0],u[1]=v[1],u[2]=v[2],u},r.fromValues=function(z,u,w){var v=new p.ARRAY_TYPE(3);return v[0]=z,v[1]=u,v[2]=w,v},r.copy=function(v,u){return v[0]=u[0],v[1]=u[1],v[2]=u[2],v},r.set=function(z,u,w,v){return z[0]=u,z[1]=w,z[2]=v,z},r.add=function(w,u,v){return w[0]=u[0]+v[0],w[1]=u[1]+v[1],w[2]=u[2]+v[2],w},r.subtract=function(w,u,v){return w[0]=u[0]-v[0],w[1]=u[1]-v[1],w[2]=u[2]-v[2],w},r.sub=r.subtract,r.multiply=function(w,u,v){return w[0]=u[0]*v[0],w[1]=u[1]*v[1],w[2]=u[2]*v[2],w},r.mul=r.multiply,r.divide=function(w,u,v){return w[0]=u[0]/v[0],w[1]=u[1]/v[1],w[2]=u[2]/v[2],w},r.div=r.divide,r.min=function(w,u,v){return w[0]=Math.min(u[0],v[0]),w[1]=Math.min(u[1],v[1]),w[2]=Math.min(u[2],v[2]),w},r.max=function(w,u,v){return w[0]=Math.max(u[0],v[0]),w[1]=Math.max(u[1],v[1]),w[2]=Math.max(u[2],v[2]),w},r.scale=function(w,u,v){return w[0]=u[0]*v,w[1]=u[1]*v,w[2]=u[2]*v,w},r.scaleAndAdd=function(z,u,w,v){return z[0]=u[0]+w[0]*v,z[1]=u[1]+w[1]*v,z[2]=u[2]+w[2]*v,z},r.distance=function(A,u){var w=u[0]-A[0],v=u[1]-A[1],z=u[2]-A[2];return Math.sqrt(w*w+v*v+z*z)},r.dist=r.distance,r.squaredDistance=function(A,u){var w=u[0]-A[0],v=u[1]-A[1],z=u[2]-A[2];return w*w+v*v+z*z},r.sqrDist=r.squaredDistance,r.length=function(z){var u=z[0],w=z[1],v=z[2];return Math.sqrt(u*u+w*w+v*v)},r.len=r.length,r.squaredLength=function(z){var u=z[0],w=z[1],v=z[2];return u*u+w*w+v*v},r.sqrLen=r.squaredLength,r.negate=function(v,u){return v[0]=-u[0],v[1]=-u[1],v[2]=-u[2],v},r.inverse=function(v,u){return v[0]=1/u[0],v[1]=1/u[1],v[2]=1/u[2],v},r.normalize=function(B,v){var z=v[0],w=v[1],A=v[2],u=z*z+w*w+A*A;return u>0&&(u=1/Math.sqrt(u),B[0]=v[0]*u,B[1]=v[1]*u,B[2]=v[2]*u),B},r.dot=function(v,u){return v[0]*u[0]+v[1]*u[1]+v[2]*u[2]},r.cross=function(z,G,B){var w=G[0],C=G[1],D=G[2],F=B[0],E=B[1],A=B[2];return z[0]=C*A-D*E,z[1]=D*F-w*A,z[2]=w*E-C*F,z},r.lerp=function(D,z,B,A){var C=z[0],v=z[1],w=z[2];return D[0]=C+A*(B[0]-C),D[1]=v+A*(B[1]-v),D[2]=w+A*(B[2]-w),D},r.hermite=function(A,H,C,w,D,E){var G=E*E,F=G*(2*E-3)+1,B=G*(E-2)+E,z=G*(E-1),I=G*(3-2*E);return A[0]=H[0]*F+C[0]*B+w[0]*z+D[0]*I,A[1]=H[1]*F+C[1]*B+w[1]*z+D[1]*I,A[2]=H[2]*F+C[2]*B+w[2]*z+D[2]*I,A},r.bezier=function(A,J,D,w,F,G){var I=1-G,H=I*I,B=G*G,z=H*I,K=3*G*H,C=3*B*I,E=B*G;return A[0]=J[0]*z+D[0]*K+w[0]*C+F[0]*E,A[1]=J[1]*z+D[1]*K+w[1]*C+F[1]*E,A[2]=J[2]*z+D[2]*K+w[2]*C+F[2]*E,A},r.random=function(A,u){u=u||1;var w=2*p.RANDOM()*Math.PI,v=2*p.RANDOM()-1,z=Math.sqrt(1-v*v)*u;return A[0]=Math.cos(w)*z,A[1]=Math.sin(w)*z,A[2]=v*u,A},r.transformMat4=function(D,z,B){var A=z[0],C=z[1],v=z[2],w=B[3]*A+B[7]*C+B[11]*v+B[15];return w=w||1,D[0]=(B[0]*A+B[4]*C+B[8]*v+B[12])/w,D[1]=(B[1]*A+B[5]*C+B[9]*v+B[13])/w,D[2]=(B[2]*A+B[6]*C+B[10]*v+B[14])/w,D},r.transformMat3=function(B,v,z){var w=v[0],A=v[1],u=v[2];return B[0]=w*z[0]+A*z[3]+u*z[6],B[1]=w*z[1]+A*z[4]+u*z[7],B[2]=w*z[2]+A*z[5]+u*z[8],B},r.transformQuat=function(A,K,E){var w=K[0],G=K[1],H=K[2],J=E[0],I=E[1],B=E[2],z=E[3],N=z*w+I*H-B*G,D=z*G+B*w-J*H,F=z*H+J*G-I*w,C=-J*w-I*G-B*H;return A[0]=N*z+C*-J+D*-B-F*-I,A[1]=D*z+C*-I+F*-J-N*-B,A[2]=F*z+C*-B+N*-I-D*-J,A},r.rotateX=function(B,v,z,w){var A=[],u=[];return A[0]=v[0]-z[0],A[1]=v[1]-z[1],A[2]=v[2]-z[2],u[0]=A[0],u[1]=A[1]*Math.cos(w)-A[2]*Math.sin(w),u[2]=A[1]*Math.sin(w)+A[2]*Math.cos(w),B[0]=u[0]+z[0],B[1]=u[1]+z[1],B[2]=u[2]+z[2],B},r.rotateY=function(B,v,z,w){var A=[],u=[];return A[0]=v[0]-z[0],A[1]=v[1]-z[1],A[2]=v[2]-z[2],u[0]=A[2]*Math.sin(w)+A[0]*Math.cos(w),u[1]=A[1],u[2]=A[2]*Math.cos(w)-A[0]*Math.sin(w),B[0]=u[0]+z[0],B[1]=u[1]+z[1],B[2]=u[2]+z[2],B},r.rotateZ=function(B,v,z,w){var A=[],u=[];return A[0]=v[0]-z[0],A[1]=v[1]-z[1],A[2]=v[2]-z[2],u[0]=A[0]*Math.cos(w)-A[1]*Math.sin(w),u[1]=A[0]*Math.sin(w)+A[1]*Math.cos(w),u[2]=A[2],B[0]=u[0]+z[0],B[1]=u[1]+z[1],B[2]=u[2]+z[2],B},r.forEach=function(){var t=r.create();return function(C,E,D,F,w,A){var z,B;for(E||(E=3),D||(D=0),B=F?Math.min(F*E+D,C.length):C.length,z=D;B>z;z+=E){t[0]=C[z],t[1]=C[z+1],t[2]=C[z+2],w(t,t,A),C[z]=t[0],C[z+1]=t[1],C[z+2]=t[2]}return C}}(),r.angle=function(A,u){var w=r.fromValues(A[0],A[1],A[2]),v=r.fromValues(u[0],u[1],u[2]);r.normalize(w,w),r.normalize(v,v);var z=r.dot(w,v);return z>1?0:Math.acos(z)},r.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},s.exports=r},{"./common.js":117}],125:[function(r,s,o){var q=r("./common.js"),p={};p.create=function(){var t=new q.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},p.clone=function(t){var u=new q.ARRAY_TYPE(4);return u[0]=t[0],u[1]=t[1],u[2]=t[2],u[3]=t[3],u},p.fromValues=function(w,A,u,v){var z=new q.ARRAY_TYPE(4);return z[0]=w,z[1]=A,z[2]=u,z[3]=v,z},p.copy=function(t,u){return t[0]=u[0],t[1]=u[1],t[2]=u[2],t[3]=u[3],t},p.set=function(w,A,u,v,z){return w[0]=A,w[1]=u,w[2]=v,w[3]=z,w},p.add=function(v,w,u){return v[0]=w[0]+u[0],v[1]=w[1]+u[1],v[2]=w[2]+u[2],v[3]=w[3]+u[3],v},p.subtract=function(v,w,u){return v[0]=w[0]-u[0],v[1]=w[1]-u[1],v[2]=w[2]-u[2],v[3]=w[3]-u[3],v},p.sub=p.subtract,p.multiply=function(v,w,u){return v[0]=w[0]*u[0],v[1]=w[1]*u[1],v[2]=w[2]*u[2],v[3]=w[3]*u[3],v},p.mul=p.multiply,p.divide=function(v,w,u){return v[0]=w[0]/u[0],v[1]=w[1]/u[1],v[2]=w[2]/u[2],v[3]=w[3]/u[3],v},p.div=p.divide,p.min=function(v,w,u){return v[0]=Math.min(w[0],u[0]),v[1]=Math.min(w[1],u[1]),v[2]=Math.min(w[2],u[2]),v[3]=Math.min(w[3],u[3]),v},p.max=function(v,w,u){return v[0]=Math.max(w[0],u[0]),v[1]=Math.max(w[1],u[1]),v[2]=Math.max(w[2],u[2]),v[3]=Math.max(w[3],u[3]),v},p.scale=function(v,w,u){return v[0]=w[0]*u,v[1]=w[1]*u,v[2]=w[2]*u,v[3]=w[3]*u,v},p.scaleAndAdd=function(w,z,u,v){return w[0]=z[0]+u[0]*v,w[1]=z[1]+u[1]*v,w[2]=z[2]+u[2]*v,w[3]=z[3]+u[3]*v,w},p.distance=function(A,C){var w=C[0]-A[0],z=C[1]-A[1],B=C[2]-A[2],v=C[3]-A[3];return Math.sqrt(w*w+z*z+B*B+v*v)},p.dist=p.distance,p.squaredDistance=function(A,C){var w=C[0]-A[0],z=C[1]-A[1],B=C[2]-A[2],v=C[3]-A[3];return w*w+z*z+B*B+v*v},p.sqrDist=p.squaredDistance,p.length=function(w){var A=w[0],u=w[1],v=w[2],z=w[3];return Math.sqrt(A*A+u*u+v*v+z*z)},p.len=p.length,p.squaredLength=function(w){var A=w[0],u=w[1],v=w[2],z=w[3];return A*A+u*u+v*v+z*z},p.sqrLen=p.squaredLength,p.negate=function(t,u){return t[0]=-u[0],t[1]=-u[1],t[2]=-u[2],t[3]=-u[3],t},p.inverse=function(t,u){return t[0]=1/u[0],t[1]=1/u[1],t[2]=1/u[2],t[3]=1/u[3],t},p.normalize=function(B,D){var z=D[0],A=D[1],C=D[2],w=D[3],v=z*z+A*A+C*C+w*w;return v>0&&(v=1/Math.sqrt(v),B[0]=z*v,B[1]=A*v,B[2]=C*v,B[3]=w*v),B},p.dot=function(t,u){return t[0]*u[0]+t[1]*u[1]+t[2]*u[2]+t[3]*u[3]},p.lerp=function(D,F,B,C){var E=F[0],A=F[1],w=F[2],z=F[3];return D[0]=E+C*(B[0]-E),D[1]=A+C*(B[1]-A),D[2]=w+C*(B[2]-w),D[3]=z+C*(B[3]-z),D},p.random=function(t,u){return u=u||1,t[0]=q.RANDOM(),t[1]=q.RANDOM(),t[2]=q.RANDOM(),t[3]=q.RANDOM(),p.normalize(t,t),p.scale(t,t,u),t},p.transformMat4=function(B,D,z){var A=D[0],C=D[1],w=D[2],v=D[3];return B[0]=z[0]*A+z[4]*C+z[8]*w+z[12]*v,B[1]=z[1]*A+z[5]*C+z[9]*w+z[13]*v,B[2]=z[2]*A+z[6]*C+z[10]*w+z[14]*v,B[3]=z[3]*A+z[7]*C+z[11]*w+z[15]*v,B},p.transformQuat=function(E,A,K){var w=A[0],G=A[1],J=A[2],H=K[0],I=K[1],C=K[2],z=K[3],D=z*w+I*J-C*G,N=z*G+C*w-H*J,B=z*J+H*G-I*w,F=-H*w-I*G-C*J;return E[0]=D*z+F*-H+N*-C-B*-I,E[1]=N*z+F*-I+B*-H-D*-C,E[2]=B*z+F*-C+D*-I-N*-H,E[3]=A[3],E},p.forEach=function(){var t=p.create();return function(F,C,D,E,A,w){var z,B;for(C||(C=4),D||(D=0),B=E?Math.min(E*C+D,F.length):F.length,z=D;B>z;z+=C){t[0]=F[z],t[1]=F[z+1],t[2]=F[z+2],t[3]=F[z+3],A(t,t,w),F[z]=t[0],F[z+1]=t[1],F[z+2]=t[2],F[z+3]=t[3]}return F}}(),p.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exports=p},{"./common.js":117}],126:[function(p,q,o){o.read=function(H,z,J,u,C){var G,v,I=8*C-u-1,D=(1<<I)-1,F=D>>1,B=-7,E=J?C-1:0,A=J?-1:1,K=H[z+E];for(E+=A,G=K&(1<<-B)-1,K>>=-B,B+=I;B>0;G=256*G+H[z+E],E+=A,B-=8){}for(v=G&(1<<-B)-1,G>>=-B,B+=u;B>0;v=256*v+H[z+E],E+=A,B-=8){}if(0===G){G=1-F}else{if(G===D){return v?NaN:(K?-1:1)*(1/0)}v+=Math.pow(2,u),G-=F}return(K?-1:1)*v*Math.pow(2,G-u)},o.write=function(J,A,P,v,E,I){var z,K,F,H=8*I-E-1,D=(1<<H)-1,G=D>>1,B=23===E?Math.pow(2,-24)-Math.pow(2,-77):0,Q=v?0:I-1,O=v?1:-1,C=0>A||0===A&&0>1/A?1:0;for(A=Math.abs(A),isNaN(A)||A===1/0?(K=isNaN(A)?1:0,z=D):(z=Math.floor(Math.log(A)/Math.LN2),A*(F=Math.pow(2,-z))<1&&(z--,F*=2),A+=z+G>=1?B/F:B*Math.pow(2,1-G),A*F>=2&&(z++,F/=2),z+G>=D?(K=0,z=D):z+G>=1?(K=(A*F-1)*Math.pow(2,E),z+=G):(K=A*Math.pow(2,G-1)*Math.pow(2,E),z=0));E>=8;J[P+Q]=255&K,Q+=O,K/=256,E-=8){}for(z=z<<E|K,H+=E;H>0;J[P+Q]=255&z,Q+=O,z/=256,H-=8){}J[P+Q-O]|=128*C}},{}],127:[function(p,q,o){"function"==typeof Object.create?q.exports=function(r,s){r.super_=s,r.prototype=Object.create(s.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:q.exports=function(r,s){r.super_=s;var u=function(){};u.prototype=s.prototype,r.prototype=new u,r.prototype.constructor=r}},{}],128:[function(q,r,p){function s(u){return function(){return u}}function o(v,u,w){return v*(1-w)+u*w}function t(v,u,A){for(var w=[],z=0;z<v.length;z++){w[z]=o(v[z],u[z],A)}return w}p.interpolated=function(v){if(!v.stops){return s(v)}var u=v.stops,z=v.base||1,w=Array.isArray(u[0][1])?t:o;return function(E){for(var H,A,C=0;C<u.length;C++){var B=u[C];if(B[0]<=E&&(H=B),B[0]>E){A=B;break}}if(H&&A){var D=A[0]-H[0],F=E-H[0],G=1===z?F/D:(Math.pow(z,F)-1)/(Math.pow(z,D)-1);return w(H[1],A[1],G)}return H?H[1]:A?A[1]:void 0}},p["piecewise-constant"]=function(v){if(!v.stops){return s(v)}var u=v.stops;return function(w){for(var z=0;z<u.length;z++){if(u[z][0]>w){return u[0===z?0:z-1][1]}}return u[u.length-1][1]}}},{}],129:[function(q,r,p){var o=q("../../reference/latest.min.js"),s=q("./parsed");r.exports=function(t){return s(t,o)}},{"../../reference/latest.min.js":132,"./parsed":130}],130:[function(r,s,p){function o(v){return v instanceof Number?"number":v instanceof String?"string":v instanceof Boolean?"boolean":Array.isArray(v)?"array":null===v?"null":typeof v}function q(v){return v instanceof Number||v instanceof String||v instanceof Boolean?v.valueOf():v}var u=r("csscolorparser").parseCSSColor,t=r("util").format;s.exports=function(C,z){function B(H,F){var G={message:(H?H+": ":"")+t.apply(t,Array.prototype.slice.call(arguments,2))};null!==F&&void 0!==F&&F.__line__&&(G.line=F.__line__),A.push(G)}function E(I,J,G){var H=o(J);if("string"===H&&"@"===J[0]){if(z.$version>7){return B(I,J,"constants have been deprecated as of v8")}if(!(J in v)){return B(I,J,'constant "%s" not found',J)}J=v[J],H=o(J)}if(G["function"]&&"object"===H){return E["function"](I,J,G)}if(G.type){var F=E[G.type];if(F){return F(I,J,G)}G=z[G.type]}E.object(I,J,G)}function D(F){return function(H,J,I){var G=o(J);G!==F&&B(H,J,"%s expected, %s found",F,G),"minimum" in I&&J<I.minimum&&B(H,J,"%s is less than the minimum value %s",J,I.minimum),"maximum" in I&&J>I.maximum&&B(H,J,"%s is greater than the maximum value %s",J,I.maximum)}}var v=C.constants||{},w={},A=[];return E.constants=function(G,I){if(z.$version>7){if(I){return B(G,I,"constants have been deprecated as of v8")}}else{var H=o(I);if("object"!==H){return B(G,I,"object expected, %s found",H)}for(var F in I){"@"!==F[0]&&B(G+"."+F,I[F],'constants must start with "@"')}}},E.source=function(H,I){if(!I.type){return void B(H,I,'"type" is required')}var F=q(I.type);switch(F){case"vector":case"raster":if(E.object(H,I,z.source_tile),"url" in I){for(var G in I){["type","url","tileSize"].indexOf(G)<0&&B(H+"."+G,I[G],'a source with a "url" property may not include a "%s" property',G)}}break;case"geojson":E.object(H,I,z.source_geojson);break;case"video":E.object(H,I,z.source_video);break;case"image":E.object(H,I,z.source_image);break;default:E["enum"](H+".type",I.type,{values:["vector","raster","geojson","video","image"]})}},E.layer=function(J,F){F.type||F.ref||B(J,F,'either "type" or "ref" is required');var H=q(F.type),G=q(F.ref);if(F.id&&(w[F.id]?B(J,F.id,'duplicate layer id "%s", previously used at line %d',F.id,w[F.id]):w[F.id]=F.id.__line__),"ref" in F){["type","source","source-layer","filter","layout"].forEach(function(M){M in F&&B(J,F[M],'"%s" is prohibited for ref layers',M)});var K;C.layers.forEach(function(M){M.id==G&&(K=M)}),K?K.ref?B(J,F.ref,"ref cannot reference another ref layer"):H=K.type:B(J,F.ref,'ref layer "%s" not found',G)}else{if("background"!==H){if(F.source){var I=C.sources[F.source];I?"vector"==I.type&&"raster"==H?B(J,F.source,'layer "%s" requires a raster source',F.id):"raster"==I.type&&"raster"!=H?B(J,F.source,'layer "%s" requires a vector source',F.id):"vector"!=I.type||F["source-layer"]||B(J,F,'layer "%s" must specify a "source-layer"',F.id):B(J,F.source,'source "%s" not found',F.source)}else{B(J,F,'missing required property "source"')}}}E.object(J,F,z.layer,{filter:E.filter,layout:function(N,M){var O=z["layout_"+H];return H&&O&&E(N,M,O)},paint:function(N,M){var O=z["paint_"+H];return H&&O&&E(N,M,O)}})},E.object=function(K,G,N,I){I=I||{};var P=o(G);if("object"!==P){return B(K,G,"object expected, %s found",P)}for(var O in G){var M=O.split(".")[0],J=N[M]||N["*"],H=M.match(/^(.*)-transition$/);J?(I[M]||E)((K?K+".":K)+O,G[O],J):H&&N[H[1]]&&N[H[1]].transition?E((K?K+".":K)+O,G[O],z.transition):""!==K&&1!==K.split(".").length&&B(K,G[O],'unknown property "%s"',O)}for(var F in N){N[F].required&&void 0===N[F]["default"]&&void 0===G[F]&&B(K,G,'missing required property "%s"',F)}},E.array=function(I,K,F,H){if("array"!==o(K)){return B(I,K,"array expected, %s found",o(K))}if(F.length&&K.length!==F.length){return B(I,K,"array length %d expected, length %d found",F.length,K.length)}if(F["min-length"]&&K.length<F["min-length"]){return B(I,K,"array length at least %d expected, length %d found",F["min-length"],K.length)}var J={type:F.value};C.version<7&&(J["function"]=F["function"]),"object"===o(F.value)&&(J=F.value);for(var G=0;G<K.length;G++){(H||E)(I+"["+G+"]",K[G],J)}},E.filter=function(H,I){var F;if("array"!==o(I)){return B(H,I,"array expected, %s found",o(I))}if(I.length<1){return B(H,I,"filter array must have at least 1 element")}switch(E["enum"](H+"[0]",I[0],z.filter_operator),q(I[0])){case"<":case"<=":case">":case">=":I.length>=2&&"$type"==I[1]&&B(H,I,'"$type" cannot be use with operator "%s"',I[0]);case"==":case"!=":3!=I.length&&B(H,I,'filter array for operator "%s" must have 3 elements',I[0]);case"in":case"!in":I.length>=2&&(F=o(I[1]),"string"!==F?B(H+"[1]",I[1],"string expected, %s found",F):"@"===I[1][0]&&B(H+"[1]",I[1],"filter key cannot be a constant"));for(var G=2;G<I.length;G++){F=o(I[G]),"$type"==I[1]?E["enum"](H+"["+G+"]",I[G],z.geometry_type):"string"===F&&"@"===I[G][0]?B(H+"["+G+"]",I[G],"filter value cannot be a constant"):"string"!==F&&"number"!==F&&"boolean"!==F&&B(H+"["+G+"]",I[G],"string, number, or boolean expected, %s found",F)}break;case"any":case"all":case"none":for(G=1;G<I.length;G++){E.filter(H+"["+G+"]",I[G])}}},E["function"]=function(G,H,F){E.object(G,H,z["function"],{stops:function(K,J,M){var I=-(1/0);E.array(K,J,M,function(O,N){return"array"!==o(N)?B(O,N,"array expected, %s found",o(N)):2!==N.length?B(O,N,"array length %d expected, length %d found",2,N.length):(E(O+"[0]",N[0],{type:"number"}),E(O+"[1]",N[1],F),void ("number"===o(N[0])&&("piecewise-constant"===F["function"]&&N[0]%1!==0&&B(O+"[0]",N[0],"zoom level for piecewise-constant functions must be an integer"),N[0]<=I&&B(O+"[0]",N[0],"array stops must appear in ascending order and have no duplicates"),I=N[0])))}),"array"===o(J)&&0===J.length&&B(K,J,"array must have at least one stop")}})},E["enum"]=function(G,F,H){-1===H.values.indexOf(q(F))&&B(G,F,"expected one of [%s], %s found",H.values.join(", "),F)},E.color=function(G,F){var H=o(F);return"string"!==H?B(G,F,"color expected, %s found",H):null===u(F)?B(G,F,'color expected, "%s" found',F):void 0},E.number=D("number"),E.string=D("string"),E["boolean"]=D("boolean"),E["*"]=function(){},E("",C,z.$root),z.$version>7&&C.constants&&E.constants("constants",C.constants),A.sort(function(G,F){return G.line-F.line}),A}},{csscolorparser:107,util:143}],131:[function(p,q,o){q.exports=p("./v8.json")},{"./v8.json":133}],132:[function(p,q,o){q.exports=p("./v8.min.json")},{"./v8.min.json":134}],133:[function(p,q,o){q.exports={"$version":8,"$root":{version:{required:true,type:"enum",values:[8],doc:"Stylesheet version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},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 map center in longitude and latitude.  The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level.  The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number","default":0,period:360,units:"degrees",doc:"Default bearing, in degrees.  The style bearing will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:29},pitch:{type:"number","default":0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface.  The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},sources:{required:true,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},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.",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. Valid tokens are {fontstack} and {range}.",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties.",example:{duration:300,delay:0}},layers:{required:true,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},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:true,type:"enum",values:["vector","raster"],doc:"The data type of the tile source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},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:true,type:"enum",values:["geojson"],doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number","default":14,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},buffer:{type:"number","default":64,doc:"Tile buffer size on each side (higher means fewer rendering artifacts near tile edges but slower performance)."},tolerance:{type:"number","default":3,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean","default":false,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups."},clusterRadius:{type:"number","default":400,doc:"Radius of each cluster when clustering points, relative to 4096 tile."},clusterMaxZoom:{type:"number",doc:"Max zoom to cluster points on. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."}},source_video:{type:{required:true,type:"enum",values:["video"],doc:"The data type of the video source."},urls:{required:true,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:true,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:true,type:"enum",values:["image"],doc:"The data type of the image source."},url:{required:true,type:"string",doc:"URL that points to an image"},coordinates:{required:true,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:true},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":false},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:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean","function":"piecewise-constant","default":false,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":false,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"]},"icon-ignore-placement":{type:"boolean","function":"piecewise-constant","default":false,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"]},"icon-optional":{type:"boolean","function":"piecewise-constant","default":false,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",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:true},"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:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"]},"icon-keep-upright":{type:"boolean","function":"piecewise-constant","default":false,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:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"]},"text-rotation-alignment":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"viewport",doc:"Orientation of text when map is rotated.",requires:["text-field"]},"text-field":{type:"string","function":"piecewise-constant","default":"",tokens:true,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.",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 tracking amount.",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:"Part of the text placed 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:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"]},"text-keep-upright":{type:"boolean","function":"piecewise-constant","default":true,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:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.",value:"number",units:"ems","function":"interpolated",length:2,"default":[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean","function":"piecewise-constant","default":false,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"]},"text-ignore-placement":{type:"boolean","function":"piecewise-constant","default":false,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"]},"text-optional":{type:"boolean","function":"piecewise-constant","default":false,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",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:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none"],doc:"The filter operator."},geometry_type:{type:"enum",values:["Point","LineString","Polygon"],doc:"The geometry type for the filter to select."},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"],doc:"A color operation to apply."},"function":{stops:{type:"array",required:true,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":true,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:true},"fill-color":{type:"color","default":"#000000",doc:"The color of the fill.","function":"interpolated",transition:true,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:true,requires:[{"!":"fill-pattern"},{"fill-antialias":true}]},"fill-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:true,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:true,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512)."}},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:true},"line-color":{type:"color",doc:"The color with which the line will be drawn.","default":"#000000","function":"interpolated",transition:true,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:true,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:true,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:true,units:"pixels"},"line-offset":{type:"number","default":0,doc:'The line\'s offset perpendicular to its direction. Values may be positive or negative, where positive indicates "rightwards" (if you were moving in the direction of the line) and negative indicates "leftwards."',"function":"interpolated",transition:true,units:"pixels"},"line-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:true,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:true,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string","function":"piecewise-constant",transition:true,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512)."}},paint_circle:{"circle-radius":{type:"number","default":5,minimum:0,"function":"interpolated",transition:true,units:"pixels",doc:"Circle radius."},"circle-color":{type:"color","default":"#000000",doc:"The color of the circle.","function":"interpolated",transition:true},"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:true},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.","default":1,minimum:0,maximum:1,"function":"interpolated",transition:true},"circle-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:true,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:true,requires:["icon-image"]},"icon-color":{type:"color","default":"#000000","function":"interpolated",transition:true,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:true,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:true,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:true,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:true,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",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:true,requires:["text-field"]},"text-color":{type:"color",doc:"The color with which the text will be drawn.","default":"#000000","function":"interpolated",transition:true,requires:["text-field"]},"text-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated",transition:true,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:true,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:true,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:true,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",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:true},"raster-hue-rotate":{type:"number","default":0,period:360,"function":"interpolated",transition:true,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:true},"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:true},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.","default":0,minimum:-1,maximum:1,"function":"interpolated",transition:true},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.","default":0,minimum:-1,maximum:1,"function":"interpolated",transition:true},"raster-fade-duration":{type:"number","default":300,minimum:0,"function":"interpolated",transition:true,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:true,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string","function":"piecewise-constant",transition:true,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512)."},"background-opacity":{type:"number","default":1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.","function":"interpolated",transition:true}},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(p,q,o){q.exports={"$version":8,"$root":{version:{required:true,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number","default":0,period:360,units:"degrees"},pitch:{type:"number","default":0,units:"degrees"},sources:{required:true,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:true,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:true,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number","default":0},maxzoom:{type:"number","default":22},tileSize:{type:"number","default":512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:true,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number","default":14},buffer:{type:"number","default":64},tolerance:{type:"number","default":3},cluster:{type:"boolean","default":false},clusterRadius:{type:"number","default":400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:true,type:"enum",values:["video"]},urls:{required:true,type:"array",value:"string"},coordinates:{required:true,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:true,type:"enum",values:["image"]},url:{required:true,type:"string"},coordinates:{required:true,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:true},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean","default":false},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},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"}},layout_fill:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},layout_circle:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},layout_line:{"line-cap":{type:"enum","function":"piecewise-constant",values:["butt","round","square"],"default":"butt"},"line-join":{type:"enum","function":"piecewise-constant",values:["bevel","round","miter"],"default":"miter"},"line-miter-limit":{type:"number","default":2,"function":"interpolated",requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number","default":1.05,"function":"interpolated",requires:[{"line-join":"round"}]},visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},layout_symbol:{"symbol-placement":{type:"enum","function":"piecewise-constant",values:["point","line"],"default":"point"},"symbol-spacing":{type:"number","default":250,minimum:1,"function":"interpolated",units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean","function":"piecewise-constant","default":false},"icon-allow-overlap":{type:"boolean","function":"piecewise-constant","default":false,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean","function":"piecewise-constant","default":false,requires:["icon-image"]},"icon-optional":{type:"boolean","function":"piecewise-constant","default":false,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"viewport",requires:["icon-image"]},"icon-size":{type:"number","default":1,minimum:0,"function":"interpolated",requires:["icon-image"]},"icon-image":{type:"string","function":"piecewise-constant",tokens:true},"icon-rotate":{type:"number","default":0,period:360,"function":"interpolated",units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number","default":2,minimum:0,"function":"interpolated",units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean","function":"piecewise-constant","default":false,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",requires:["icon-image"]},"text-rotation-alignment":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"viewport",requires:["text-field"]},"text-field":{type:"string","function":"piecewise-constant","default":"",tokens:true},"text-font":{type:"array",value:"string","function":"piecewise-constant","default":["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number","default":16,minimum:0,units:"pixels","function":"interpolated",requires:["text-field"]},"text-max-width":{type:"number","default":10,minimum:0,units:"em","function":"interpolated",requires:["text-field"]},"text-line-height":{type:"number","default":1.2,units:"em","function":"interpolated",requires:["text-field"]},"text-letter-spacing":{type:"number","default":0,units:"em","function":"interpolated",requires:["text-field"]},"text-justify":{type:"enum","function":"piecewise-constant",values:["left","center","right"],"default":"center",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",requires:["text-field"]},"text-max-angle":{type:"number","default":45,units:"degrees","function":"interpolated",requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number","default":0,period:360,units:"degrees","function":"interpolated",requires:["text-field"]},"text-padding":{type:"number","default":2,minimum:0,units:"pixels","function":"interpolated",requires:["text-field"]},"text-keep-upright":{type:"boolean","function":"piecewise-constant","default":true,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum","function":"piecewise-constant",values:["none","uppercase","lowercase"],"default":"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems","function":"interpolated",length:2,"default":[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean","function":"piecewise-constant","default":false,requires:["text-field"]},"text-ignore-placement":{type:"boolean","function":"piecewise-constant","default":false,requires:["text-field"]},"text-optional":{type:"boolean","function":"piecewise-constant","default":false,requires:["text-field","icon-image"]},visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},layout_raster:{visibility:{type:"enum","function":"piecewise-constant",values:["visible","none"],"default":"visible"}},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:true,value:"function_stop"},base:{type:"number","default":1,minimum:0}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean","function":"piecewise-constant","default":true},"fill-opacity":{type:"number","function":"interpolated","default":1,minimum:0,maximum:1,transition:true},"fill-color":{type:"color","default":"#000000","function":"interpolated",transition:true,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color","function":"interpolated",transition:true,requires:[{"!":"fill-pattern"},{"fill-antialias":true}]},"fill-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:true,units:"pixels"},"fill-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"map",requires:["fill-translate"]},"fill-pattern":{type:"string","function":"piecewise-constant",transition:true}},paint_line:{"line-opacity":{type:"number","function":"interpolated","default":1,minimum:0,maximum:1,transition:true},"line-color":{type:"color","default":"#000000","function":"interpolated",transition:true,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:true,units:"pixels"},"line-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"map",requires:["line-translate"]},"line-width":{type:"number","default":1,minimum:0,"function":"interpolated",transition:true,units:"pixels"},"line-gap-width":{type:"number","default":0,minimum:0,"function":"interpolated",transition:true,units:"pixels"},"line-offset":{type:"number","default":0,"function":"interpolated",transition:true,units:"pixels"},"line-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:true,units:"pixels"},"line-dasharray":{type:"array",value:"number","function":"piecewise-constant",minimum:0,transition:true,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string","function":"piecewise-constant",transition:true}},paint_circle:{"circle-radius":{type:"number","default":5,minimum:0,"function":"interpolated",transition:true,units:"pixels"},"circle-color":{type:"color","default":"#000000","function":"interpolated",transition:true},"circle-blur":{type:"number","default":0,"function":"interpolated",transition:true},"circle-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:true},"circle-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:true,units:"pixels"},"circle-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"map",requires:["circle-translate"]}},paint_symbol:{"icon-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:true,requires:["icon-image"]},"icon-color":{type:"color","default":"#000000","function":"interpolated",transition:true,requires:["icon-image"]},"icon-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated",transition:true,requires:["icon-image"]},"icon-halo-width":{type:"number","default":0,minimum:0,"function":"interpolated",transition:true,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:true,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:true,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:true,requires:["text-field"]},"text-color":{type:"color","default":"#000000","function":"interpolated",transition:true,requires:["text-field"]},"text-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated",transition:true,requires:["text-field"]},"text-halo-width":{type:"number","default":0,minimum:0,"function":"interpolated",transition:true,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number","default":0,minimum:0,"function":"interpolated",transition:true,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated",transition:true,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum","function":"piecewise-constant",values:["map","viewport"],"default":"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:true},"raster-hue-rotate":{type:"number","default":0,period:360,"function":"interpolated",transition:true,units:"degrees"},"raster-brightness-min":{type:"number","function":"interpolated","default":0,minimum:0,maximum:1,transition:true},"raster-brightness-max":{type:"number","function":"interpolated","default":1,minimum:0,maximum:1,transition:true},"raster-saturation":{type:"number","default":0,minimum:-1,maximum:1,"function":"interpolated",transition:true},"raster-contrast":{type:"number","default":0,minimum:-1,maximum:1,"function":"interpolated",transition:true},"raster-fade-duration":{type:"number","default":300,minimum:0,"function":"interpolated",transition:true,units:"milliseconds"}},paint_background:{"background-color":{type:"color","default":"#000000","function":"interpolated",transition:true,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string","function":"piecewise-constant",transition:true},"background-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated",transition:true}},transition:{duration:{type:"number","default":300,minimum:0,units:"milliseconds"},delay:{type:"number","default":0,minimum:0,units:"milliseconds"}}}},{}],135:[function(q,o,s){function r(z){var B;z&&z.length&&(B=z,z=B.length);var A=new Uint8Array(z||0);return B&&A.set(B),A.readUInt32LE=p.readUInt32LE,A.writeUInt32LE=p.writeUInt32LE,A.readInt32LE=p.readInt32LE,A.writeInt32LE=p.writeInt32LE,A.readFloatLE=p.readFloatLE,A.writeFloatLE=p.writeFloatLE,A.readDoubleLE=p.readDoubleLE,A.writeDoubleLE=p.writeDoubleLE,A.toString=p.toString,A.write=p.write,A.slice=p.slice,A.copy=p.copy,A._isBuffer=!0,A}function u(A){for(var C,B,E=A.length,z=[],D=0;E>D;D++){if(C=A.charCodeAt(D),C>55295&&57344>C){if(!B){C>56319||D+1===E?z.push(239,191,189):B=C;continue}if(56320>C){z.push(239,191,189),B=C;continue}C=B-55296<<10|C-56320|65536,B=null}else{B&&(z.push(239,191,189),B=null)}128>C?z.push(C):2048>C?z.push(C>>6|192,63&C|128):65536>C?z.push(C>>12|224,C>>6&63|128,63&C|128):z.push(C>>18|240,C>>12&63|128,C>>6&63|128,63&C|128)}return z}o.exports=r;var w=q("ieee754"),p,t,v;p={readUInt32LE:function(z){return(this[z]|this[z+1]<<8|this[z+2]<<16)+16777216*this[z+3]},writeUInt32LE:function(z,A){this[A]=z,this[A+1]=z>>>8,this[A+2]=z>>>16,this[A+3]=z>>>24},readInt32LE:function(z){return(this[z]|this[z+1]<<8|this[z+2]<<16)+(this[z+3]<<24)},readFloatLE:function(z){return w.read(this,z,!0,23,4)},readDoubleLE:function(z){return w.read(this,z,!0,52,8)},writeFloatLE:function(z,A){return w.write(this,z,A,!0,23,4)},writeDoubleLE:function(z,A){return w.write(this,z,A,!0,52,8)},toString:function(B,D,C){var F="",A="";D=D||0,C=Math.min(this.length,C||this.length);for(var E=D;C>E;E++){var z=this[E];127>=z?(F+=decodeURIComponent(A)+String.fromCharCode(z),A=""):A+="%"+z.toString(16)}return F+=decodeURIComponent(A)},write:function(z,B){for(var A=z===t?v:u(z),C=0;C<A.length;C++){this[B+C]=A[C]}},slice:function(z,A){return this.subarray(z,A)},copy:function(z,B){B=B||0;for(var A=0;A<this.length;A++){z[B+A]=this[A]}}},p.writeInt32LE=p.writeUInt32LE,r.byteLength=function(z){return t=z,v=u(z),v.length},r.isBuffer=function(z){return !(!z||!z._isBuffer)}},{ieee754:126}],136:[function(p,q,o){(function(r){function H(I){this.buf=v.isBuffer(I)?I:new v(I||0),this.pos=0,this.length=this.buf.length}function u(J,I){for(var K=0;K<J.length;K++){I.writeVarint(J[K])}}function s(J,I){for(var K=0;K<J.length;K++){I.writeSVarint(J[K])}}function A(J,I){for(var K=0;K<J.length;K++){I.writeFloat(J[K])}}function D(J,I){for(var K=0;K<J.length;K++){I.writeDouble(J[K])}}function G(J,I){for(var K=0;K<J.length;K++){I.writeBoolean(J[K])}}function E(J,I){for(var K=0;K<J.length;K++){I.writeFixed32(J[K])}}function w(J,I){for(var K=0;K<J.length;K++){I.writeSFixed32(J[K])}}function C(J,I){for(var K=0;K<J.length;K++){I.writeFixed64(J[K])}}function t(J,I){for(var K=0;K<J.length;K++){I.writeSFixed64(J[K])}}q.exports=H;var v=r.Buffer||p("./buffer");H.Varint=0,H.Fixed64=1,H.Bytes=2,H.Fixed32=5;var B=4294967296,F=1/B,z=Math.pow(2,63);H.prototype={destroy:function(){this.buf=null},readFields:function(J,I,N){for(N=N||this.length;this.pos<N;){var M=this.readVarint(),K=M>>3,O=this.pos;J(K,I,this),this.pos===O&&this.skip(M)}return I},readMessage:function(J,I){return this.readFields(J,I,this.readVarint()+this.pos)},readFixed32:function(){var I=this.buf.readUInt32LE(this.pos);return this.pos+=4,I},readSFixed32:function(){var I=this.buf.readInt32LE(this.pos);return this.pos+=4,I},readFixed64:function(){var I=this.buf.readUInt32LE(this.pos)+this.buf.readUInt32LE(this.pos+4)*B;return this.pos+=8,I},readSFixed64:function(){var I=this.buf.readUInt32LE(this.pos)+this.buf.readInt32LE(this.pos+4)*B;return this.pos+=8,I},readFloat:function(){var I=this.buf.readFloatLE(this.pos);return this.pos+=4,I},readDouble:function(){var I=this.buf.readDoubleLE(this.pos);return this.pos+=8,I},readVarint:function(){var J,I,N,M,K,P,O=this.buf;if(N=O[this.pos++],128>N){return N}if(N=127&N,M=O[this.pos++],128>M){return N|M<<7}if(M=(127&M)<<7,K=O[this.pos++],128>K){return N|M|K<<14}if(K=(127&K)<<14,P=O[this.pos++],128>P){return N|M|K|P<<21}if(J=N|M|K|(127&P)<<21,I=O[this.pos++],J+=268435456*(127&I),128>I){return J}if(I=O[this.pos++],J+=34359738368*(127&I),128>I){return J}if(I=O[this.pos++],J+=4398046511104*(127&I),128>I){return J}if(I=O[this.pos++],J+=562949953421312*(127&I),128>I){return J}if(I=O[this.pos++],J+=72057594037927940*(127&I),128>I){return J}if(I=O[this.pos++],J+=9223372036854776000*(127&I),128>I){return J}throw new Error("Expected varint not more than 10 bytes")},readVarint64:function(){var J=this.pos,I=this.readVarint();if(z>I){return I}for(var N=this.pos-2;255===this.buf[N];){N--}J>N&&(N=J),I=0;for(var M=0;N-J+1>M;M++){var K=127&~this.buf[J+M];I+=4>M?K<<7*M:K*Math.pow(2,7*M)}return -I-1},readSVarint:function(){var I=this.readVarint();return I%2===1?(I+1)/-2:I/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var J=this.readVarint()+this.pos,I=this.buf.toString("utf8",this.pos,J);return this.pos=J,I},readBytes:function(){var J=this.readVarint()+this.pos,I=this.buf.slice(this.pos,J);return this.pos=J,I},readPackedVarint:function(){for(var J=this.readVarint()+this.pos,I=[];this.pos<J;){I.push(this.readVarint())}return I},readPackedSVarint:function(){for(var J=this.readVarint()+this.pos,I=[];this.pos<J;){I.push(this.readSVarint())}return I},readPackedBoolean:function(){for(var J=this.readVarint()+this.pos,I=[];this.pos<J;){I.push(this.readBoolean())}return I},readPackedFloat:function(){for(var J=this.readVarint()+this.pos,I=[];this.pos<J;){I.push(this.readFloat())}return I},readPackedDouble:function(){for(var J=this.readVarint()+this.pos,I=[];this.pos<J;){I.push(this.readDouble())}return I},readPackedFixed32:function(){for(var J=this.readVarint()+this.pos,I=[];this.pos<J;){I.push(this.readFixed32())}return I},readPackedSFixed32:function(){for(var J=this.readVarint()+this.pos,I=[];this.pos<J;){I.push(this.readSFixed32())}return I},readPackedFixed64:function(){for(var J=this.readVarint()+this.pos,I=[];this.pos<J;){I.push(this.readFixed64())}return I},readPackedSFixed64:function(){for(var J=this.readVarint()+this.pos,I=[];this.pos<J;){I.push(this.readSFixed64())}return I},skip:function(J){var I=7&J;if(I===H.Varint){for(;this.buf[this.pos++]>127;){}}else{if(I===H.Bytes){this.pos=this.readVarint()+this.pos}else{if(I===H.Fixed32){this.pos+=4}else{if(I!==H.Fixed64){throw new Error("Unimplemented type: "+I)}this.pos+=8}}}},writeTag:function(J,I){this.writeVarint(J<<3|I)},realloc:function(J){for(var I=this.length||16;I<this.pos+J;){I*=2}if(I!==this.length){var K=new v(I);this.buf.copy(K),this.buf=K,this.length=I}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.slice(0,this.length)},writeFixed32:function(I){this.realloc(4),this.buf.writeUInt32LE(I,this.pos),this.pos+=4},writeSFixed32:function(I){this.realloc(4),this.buf.writeInt32LE(I,this.pos),this.pos+=4},writeFixed64:function(I){this.realloc(8),this.buf.writeInt32LE(-1&I,this.pos),this.buf.writeUInt32LE(Math.floor(I*F),this.pos+4),this.pos+=8},writeSFixed64:function(I){this.realloc(8),this.buf.writeInt32LE(-1&I,this.pos),this.buf.writeInt32LE(Math.floor(I*F),this.pos+4),this.pos+=8},writeVarint:function(J){if(J=+J,127>=J){this.realloc(1),this.buf[this.pos++]=J}else{if(16383>=J){this.realloc(2),this.buf[this.pos++]=J>>>0&127|128,this.buf[this.pos++]=J>>>7&127}else{if(2097151>=J){this.realloc(3),this.buf[this.pos++]=J>>>0&127|128,this.buf[this.pos++]=J>>>7&127|128,this.buf[this.pos++]=J>>>14&127}else{if(268435455>=J){this.realloc(4),this.buf[this.pos++]=J>>>0&127|128,this.buf[this.pos++]=J>>>7&127|128,this.buf[this.pos++]=J>>>14&127|128,this.buf[this.pos++]=J>>>21&127}else{for(var I=this.pos;J>=128;){this.realloc(1),this.buf[this.pos++]=255&J|128,J/=128}if(this.realloc(1),this.buf[this.pos++]=0|J,this.pos-I>10){throw new Error("Given varint doesn't fit into 10 bytes")}}}}}},writeSVarint:function(I){this.writeVarint(0>I?2*-I-1:2*I)},writeBoolean:function(I){this.writeVarint(Boolean(I))},writeString:function(J){J=String(J);var I=v.byteLength(J);this.writeVarint(I),this.realloc(I),this.buf.write(J,this.pos),this.pos+=I},writeFloat:function(I){this.realloc(4),this.buf.writeFloatLE(I,this.pos),this.pos+=4},writeDouble:function(I){this.realloc(8),this.buf.writeDoubleLE(I,this.pos),this.pos+=8},writeBytes:function(J){var I=J.length;this.writeVarint(I),this.realloc(I);for(var K=0;I>K;K++){this.buf[this.pos++]=J[K]}},writeRawMessage:function(J,I){this.pos++;var N=this.pos;J(I,this);var M=this.pos-N,K=127>=M?1:16383>=M?2:2097151>=M?3:268435455>=M?4:Math.ceil(Math.log(M)/(7*Math.LN2));if(K>1){this.realloc(K-1);for(var O=this.pos-1;O>=N;O--){this.buf[O+K-1]=this.buf[O]}}this.pos=N-1,this.writeVarint(M),this.pos+=M},writeMessage:function(J,I,K){this.writeTag(J,H.Bytes),this.writeRawMessage(I,K)},writePackedVarint:function(J,I){this.writeMessage(J,u,I)},writePackedSVarint:function(J,I){this.writeMessage(J,s,I)},writePackedBoolean:function(J,I){this.writeMessage(J,G,I)},writePackedFloat:function(J,I){this.writeMessage(J,A,I)},writePackedDouble:function(J,I){this.writeMessage(J,D,I)},writePackedFixed32:function(J,I){this.writeMessage(J,E,I)},writePackedSFixed32:function(J,I){this.writeMessage(J,w,I)},writePackedFixed64:function(J,I){this.writeMessage(J,C,I)},writePackedSFixed64:function(J,I){this.writeMessage(J,t,I)},writeBytesField:function(J,I){this.writeTag(J,H.Bytes),this.writeBytes(I)},writeFixed32Field:function(J,I){this.writeTag(J,H.Fixed32),this.writeFixed32(I)},writeSFixed32Field:function(J,I){this.writeTag(J,H.Fixed32),this.writeSFixed32(I)},writeFixed64Field:function(J,I){this.writeTag(J,H.Fixed64),this.writeFixed64(I)},writeSFixed64Field:function(J,I){this.writeTag(J,H.Fixed64),this.writeSFixed64(I)},writeVarintField:function(J,I){this.writeTag(J,H.Varint),this.writeVarint(I)},writeSVarintField:function(J,I){this.writeTag(J,H.Varint),this.writeSVarint(I)},writeStringField:function(J,I){this.writeTag(J,H.Bytes),this.writeString(I)},writeFloatField:function(J,I){this.writeTag(J,H.Fixed32),this.writeFloat(I)},writeDoubleField:function(J,I){this.writeTag(J,H.Fixed64),this.writeDouble(I)},writeBooleanField:function(J,I){this.writeVarintField(J,Boolean(I))}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./buffer":135}],137:[function(p,q,o){function r(s,u){this.x=s,this.y=u}q.exports=r,r.prototype={clone:function(){return new r(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},matMult:function(s){return this.clone()._matMult(s)},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(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(u){var v=u.x-this.x,s=u.y-this.y;return v*v+s*s},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,u){return Math.atan2(this.x*u-this.y*s,this.x*s+this.y*u)},_matMult:function(u){var v=u[0]*this.x+u[1]*this.y,s=u[2]*this.x+u[3]*this.y;return this.x=v,this.y=s,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(v){var A=Math.cos(v),u=Math.sin(v),w=A*this.x-u*this.y,z=u*this.x+A*this.y;return this.x=w,this.y=z,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},r.convert=function(s){return s instanceof r?s:Array.isArray(s)?new r(s[0],s[1]):s}},{}],138:[function(q,p,s){function w(){z=!1,u.length?t=u.concat(t):v=-1,t.length&&B()}function B(){if(!z){var C=setTimeout(w);z=!0;for(var D=t.length;D;){for(u=t,t=[];++v<D;){u&&u[v].run()}v=-1,D=t.length}u=null,z=!1,clearTimeout(C)}}function r(C,D){this.fun=C,this.array=D}function A(){}var o=p.exports={},t=[],z=!1,u,v=-1;o.nextTick=function(D){var E=new Array(arguments.length-1);if(arguments.length>1){for(var C=1;C<arguments.length;C++){E[C-1]=arguments[C]}}t.push(new r(D,E)),1!==t.length||z||setTimeout(B,0)},r.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=A,o.addListener=A,o.once=A,o.off=A,o.removeListener=A,o.removeAllListeners=A,o.emit=A,o.binding=function(C){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(C){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],139:[function(p,q,o){!function(){function M(r,s){return this instanceof M?(this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(0.4*this._maxEntries)),s&&this._initFormat(s),void this.clear()):new M(r,s)}function C(s,r){s.bbox=A(s,0,s.children.length,r)}function A(P,O,T,R){for(var S,u=F(),Q=O;T>Q;Q++){S=P.children[Q],D(u,P.leaf?R(S):S.bbox)}return u}function F(){return[1/0,1/0,-(1/0),-(1/0)]}function D(s,r){return s[0]=Math.min(s[0],r[0]),s[1]=Math.min(s[1],r[1]),s[2]=Math.max(s[2],r[2]),s[3]=Math.max(s[3],r[3]),s}function v(s,r){return s.bbox[0]-r.bbox[0]}function z(s,r){return s.bbox[1]-r.bbox[1]}function J(r){return(r[2]-r[0])*(r[3]-r[1])}function N(r){return r[2]-r[0]+(r[3]-r[1])}function B(s,r){return(Math.max(r[2],s[2])-Math.min(r[0],s[0]))*(Math.max(r[3],s[3])-Math.min(r[1],s[1]))}function K(u,s){var R=Math.max(u[0],s[0]),Q=Math.max(u[1],s[1]),O=Math.min(u[2],s[2]),P=Math.min(u[3],s[3]);return Math.max(0,O-R)*Math.max(0,P-Q)}function E(s,r){return s[0]<=r[0]&&s[1]<=r[1]&&r[2]<=s[2]&&r[3]<=s[3]}function H(s,r){return r[0]<=s[2]&&r[1]<=s[3]&&r[2]>=s[0]&&r[3]>=s[1]}function G(u,s,S,Q,O){for(var P,R=[s,S];R.length;){S=R.pop(),s=R.pop(),Q>=S-s||(P=s+Math.ceil((S-s)/Q/2)*Q,I(u,s,S,P,O),R.push(s,P,P,S))}}function I(aa,S,Q,V,T){for(var O,P,Y,ab,R,Z,U,X,W;Q>S;){for(Q-S>600&&(O=Q-S+1,P=V-S+1,Y=Math.log(O),ab=0.5*Math.exp(2*Y/3),R=0.5*Math.sqrt(Y*ab*(O-ab)/O)*(0>P-O/2?-1:1),Z=Math.max(S,Math.floor(V-P*ab/O+R)),U=Math.min(Q,Math.floor(V+(O-P)*ab/O+R)),I(aa,Z,U,V,T)),X=aa[V],P=S,W=Q,w(aa,S,V),T(aa[Q],X)>0&&w(aa,S,Q);W>P;){for(w(aa,P,W),P++,W--;T(aa[P],X)<0;){P++}for(;T(aa[W],X)>0;){W--}}0===T(aa[S],X)?w(aa,S,W):(W++,w(aa,W,Q)),V>=W&&(S=W+1),W>=V&&(Q=W-1)}}function w(s,r,O){var u=s[r];s[r]=s[O],s[O]=u}M.prototype={all:function(){return this._all(this.data,[])},search:function(U){var Q=this.data,P=[],S=this.toBBox;if(!H(U,Q.bbox)){return P}for(var R,u,O,T,V=[];Q;){for(R=0,u=Q.children.length;u>R;R++){O=Q.children[R],T=Q.leaf?S(O):O.bbox,H(U,T)&&(Q.leaf?P.push(O):E(U,T)?this._all(O,P):V.push(O))}Q=V.pop()}return P},collides:function(O){var u=this.data,T=this.toBBox;if(!H(O,u.bbox)){return !1}for(var R,P,Q,S,s=[];u;){for(R=0,P=u.children.length;P>R;R++){if(Q=u.children[R],S=u.leaf?T(Q):Q.bbox,H(O,S)){if(u.leaf||E(O,S)){return !0}s.push(Q)}}u=s.pop()}return !1},load:function(s){if(!s||!s.length){return this}if(s.length<this._minEntries){for(var r=0,P=s.length;P>r;r++){this.insert(s[r])}return this}var O=this._build(s.slice(),0,s.length-1,0);if(this.data.children.length){if(this.data.height===O.height){this._splitRoot(this.data,O)}else{if(this.data.height<O.height){var u=this.data;this.data=O,O=u}this._insert(O,this.data.height-O.height-1,!0)}}else{this.data=O}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data={children:[],height:1,bbox:F(),leaf:!0},this},remove:function(U){if(!U){return this}for(var Q,P,S,R,u=this.data,O=this.toBBox(U),T=[],V=[];u||T.length;){if(u||(u=T.pop(),P=T[T.length-1],Q=V.pop(),R=!0),u.leaf&&(S=u.children.indexOf(U),-1!==S)){return u.children.splice(S,1),T.push(u),this._condense(T),this}R||u.leaf||!E(u.bbox,O)?P?(Q++,u=P.children[Q],R=!1):u=null:(T.push(u),V.push(Q),Q=0,P=u,u=u.children[0])}return this},toBBox:function(r){return r},compareMinX:function(s,r){return s[0]-r[0]},compareMinY:function(s,r){return s[1]-r[1]},toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(s,r){for(var u=[];s;){s.leaf?r.push.apply(r,s.children):u.push.apply(u,s.children),s=u.pop()}return r},_build:function(Z,Q,U,S){var O,P=U-Q+1,X=this._maxEntries;if(X>=P){return O={children:Z.slice(Q,U+1),height:1,bbox:null,leaf:!0},C(O,this.toBBox),O}S||(S=Math.ceil(Math.log(P)/Math.log(X)),X=Math.ceil(P/Math.pow(X,S-1))),O={children:[],height:S,bbox:null,leaf:!1};var aa,R,Y,T,V=Math.ceil(P/X),W=V*Math.ceil(Math.sqrt(X));for(G(Z,Q,U,W,this.compareMinX),aa=Q;U>=aa;aa+=W){for(Y=Math.min(aa+W-1,U),G(Z,aa,Y,V,this.compareMinY),R=aa;Y>=R;R+=V){T=Math.min(R+V-1,Y),O.children.push(this._build(Z,R,T,S-1))}}return C(O,this.toBBox),O},_chooseSubtree:function(Y,R,Q,U){for(var S,O,P,Z,X,T,W,V;;){if(U.push(R),R.leaf||U.length-1===Q){break}for(W=V=1/0,S=0,O=R.children.length;O>S;S++){P=R.children[S],X=J(P.bbox),T=B(Y,P.bbox)-X,V>T?(V=T,W=W>X?X:W,Z=P):T===V&&W>X&&(W=X,Z=P)}R=Z}return R},_insert:function(O,u,S){var Q=this.toBBox,P=S?O.bbox:Q(O),R=[],s=this._chooseSubtree(P,this.data,u,R);for(s.children.push(O),D(s.bbox,P);u>=0&&R[u].children.length>this._maxEntries;){this._split(R,u),u--}this._adjustParentBBoxes(P,R,u)},_split:function(u,S){var Q=u[S],O=Q.children.length,P=this._minEntries;this._chooseSplitAxis(Q,P,O);var R=this._chooseSplitIndex(Q,P,O),s={children:Q.children.splice(R,Q.children.length-R),height:Q.height,bbox:null,leaf:!1};Q.leaf&&(s.leaf=!0),C(Q,this.toBBox),C(s,this.toBBox),S?u[S-1].children.push(s):this._splitRoot(Q,s)},_splitRoot:function(r,s){this.data={children:[r,s],height:r.height+1,bbox:null,leaf:!1},C(this.data,this.toBBox)},_chooseSplitIndex:function(W,Q,T){var R,u,O,X,P,S,V,U;for(S=V=1/0,R=Q;T-Q>=R;R++){u=A(W,0,R,this.toBBox),O=A(W,R,T,this.toBBox),X=K(u,O),P=J(u)+J(O),S>X?(S=X,U=R,V=V>P?P:V):X===S&&V>P&&(V=P,U=R)}return U},_chooseSplitAxis:function(O,u,S){var R=O.leaf?this.compareMinX:v,Q=O.leaf?this.compareMinY:z,r=this._allDistMargin(O,u,S,R),P=this._allDistMargin(O,u,S,Q);P>r&&O.children.sort(R)},_allDistMargin:function(W,Q,S,s){W.children.sort(s);var O,U,P=this.toBBox,V=A(W,0,Q,P),R=A(W,S-Q,S,P),T=N(V)+N(R);for(O=Q;S-Q>O;O++){U=W.children[O],D(V,W.leaf?P(U):U.bbox),T+=N(V)}for(O=S-Q-1;O>=Q;O--){U=W.children[O],D(R,W.leaf?P(U):U.bbox),T+=N(R)}return T},_adjustParentBBoxes:function(s,r,O){for(var u=O;u>=0;u--){D(r[u].bbox,s)}},_condense:function(r){for(var u,s=r.length-1;s>=0;s--){0===r[s].children.length?s>0?(u=r[s-1].children,u.splice(u.indexOf(r[s]),1)):this.clear():C(r[s],this.toBBox)}},_initFormat:function(s){var r=["return a"," - b",";"];this.compareMinX=new Function("a","b",r.join(s[0])),this.compareMinY=new Function("a","b",r.join(s[1])),this.toBBox=new Function("a","return [a"+s.join(", a")+"];")}},"function"==typeof n&&n.amd?n("rbush",function(){return M}):"undefined"!=typeof q?q.exports=M:"undefined"!=typeof self?self.rbush=M:window.rbush=M}()},{}],140:[function(p,q,o){void function(t,s){"function"==typeof n&&n.amd?n(s):"object"==typeof o?q.exports=s():t.resolveUrl=s()}(this,function(){function r(){var w=arguments.length;if(0===w){throw new Error("resolveUrl requires at least one argument; got none.")}var u=document.createElement("base");if(u.href=arguments[0],1===w){return u.href}var s=document.getElementsByTagName("head")[0];s.insertBefore(u,s.firstChild);for(var A,z=document.createElement("a"),v=1;w>v;v++){z.href=arguments[v],A=z.href,u.href=A}return s.removeChild(u),A}return r})},{}],141:[function(q,r,o){function p(u,s,w,v){this.cx=3*u,this.bx=3*(w-u)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(v-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=u,this.p1y=v,this.p2x=w,this.p2y=v}r.exports=p,p.prototype.sampleCurveX=function(s){return((this.ax*s+this.bx)*s+this.cx)*s},p.prototype.sampleCurveY=function(s){return((this.ay*s+this.by)*s+this.cy)*s},p.prototype.sampleCurveDerivativeX=function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},p.prototype.solveCurveX=function(z,w){"undefined"==typeof w&&(w=0.000001);var D,C,B,A,E;for(B=z,E=0;8>E;E++){if(A=this.sampleCurveX(B)-z,Math.abs(A)<w){return B}var v=this.sampleCurveDerivativeX(B);if(Math.abs(v)<0.000001){break}B-=A/v}if(D=0,C=1,B=z,D>B){return D}if(B>C){return C}for(;C>D;){if(A=this.sampleCurveX(B),Math.abs(A-z)<w){return B}z>A?D=B:C=B,B=0.5*(C-D)+D}return B},p.prototype.solve=function(u,s){return this.sampleCurveY(this.solveCurveX(u,s))}},{}],142:[function(p,q,o){q.exports=function(r){return r&&"object"==typeof r&&"function"==typeof r.copy&&"function"==typeof r.fill&&"function"==typeof r.readUInt8}},{}],143:[function(p,q,o){(function(R,T){function ab(ae,ad){var ac={seen:[],stylize:E};return arguments.length>=3&&(ac.depth=arguments[2]),arguments.length>=4&&(ac.colors=arguments[3]),G(ad)?ac.showHidden=ad:ad&&o._extend(ac,ad),t(ac.showHidden)&&(ac.showHidden=!1),t(ac.depth)&&(ac.depth=2),t(ac.colors)&&(ac.colors=!1),t(ac.customInspect)&&(ac.customInspect=!0),ac.colors&&(ac.stylize=r),z(ac,ae,ac.depth)}function r(ae,ad){var ac=ab.styles[ad];return ac?"["+ab.colors[ac][0]+"m"+ae+"["+ab.colors[ac][1]+"m":ae}function E(ad,ac){return ad}function C(ad){var ac={};return ad.forEach(function(af,ae){ac[af]=!0}),ac}function z(aj,ac,an){if(aj.customInspect&&ac&&s(ac.inspect)&&ac.inspect!==o.inspect&&(!ac.constructor||ac.constructor.prototype!==ac)){var af=ac.inspect(an,aj);return O(af)||(af=z(aj,af,an)),af}var ah=N(aj,ac);if(ah){return ah}var ae=Object.keys(ac),ao=C(ae);if(aj.showHidden&&(ae=Object.getOwnPropertyNames(ac)),W(ac)&&(ae.indexOf("message")>=0||ae.indexOf("description")>=0)){return A(ac)}if(0===ae.length){if(s(ac)){var am=ac.name?": "+ac.name:"";return aj.stylize("[Function"+am+"]","special")}if(U(ac)){return aj.stylize(RegExp.prototype.toString.call(ac),"regexp")}if(aa(ac)){return aj.stylize(Date.prototype.toString.call(ac),"date")}if(W(ac)){return A(ac)}}var al="",ak=!1,ag=["{","}"];if(M(ac)&&(ak=!0,ag=["[","]"]),s(ac)){var ad=ac.name?": "+ac.name:"";al=" [Function"+ad+"]"}if(U(ac)&&(al=" "+RegExp.prototype.toString.call(ac)),aa(ac)&&(al=" "+Date.prototype.toUTCString.call(ac)),W(ac)&&(al=" "+A(ac)),0===ae.length&&(!ak||0==ac.length)){return ag[0]+al+ag[1]}if(0>an){return U(ac)?aj.stylize(RegExp.prototype.toString.call(ac),"regexp"):aj.stylize("[Object]","special")}aj.seen.push(ac);var ai;return ai=ak?Z(aj,ac,an,ao,ae):ae.map(function(ap){return v(aj,ac,an,ao,ap,ak)}),aj.seen.pop(),X(ai,al,ag)}function N(ae,ad){if(t(ad)){return ae.stylize("undefined","undefined")}if(O(ad)){var ac="'"+JSON.stringify(ad).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ae.stylize(ac,"string")}return P(ad)?ae.stylize(""+ad,"number"):G(ad)?ae.stylize(""+ad,"boolean"):S(ad)?ae.stylize("null","null"):void 0}function A(ac){return"["+Error.prototype.toString.call(ac)+"]"}function Z(ah,ag,ae,aj,ad){for(var ai=[],af=0,ac=ag.length;ac>af;++af){K(ag,String(af))?ai.push(v(ah,ag,ae,aj,String(af),!0)):ai.push("")}return ad.forEach(function(ak){ak.match(/^\d+$/)||ai.push(v(ah,ag,ae,aj,ak,!0))}),ai}function v(ag,ac,aj,ae,af,ad){var ak,ai,ah;if(ah=Object.getOwnPropertyDescriptor(ac,af)||{value:ac[af]},ah.get?ai=ah.set?ag.stylize("[Getter/Setter]","special"):ag.stylize("[Getter]","special"):ah.set&&(ai=ag.stylize("[Setter]","special")),K(ae,af)||(ak="["+af+"]"),ai||(ag.seen.indexOf(ah.value)<0?(ai=S(aj)?z(ag,ah.value,null):z(ag,ah.value,aj-1),ai.indexOf("\n")>-1&&(ai=ad?ai.split("\n").map(function(al){return"  "+al}).join("\n").substr(2):"\n"+ai.split("\n").map(function(al){return"   "+al}).join("\n"))):ai=ag.stylize("[Circular]","special")),t(ak)){if(ad&&af.match(/^\d+$/)){return ai}ak=JSON.stringify(""+af),ak.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ak=ak.substr(1,ak.length-2),ak=ag.stylize(ak,"name")):(ak=ak.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ak=ag.stylize(ak,"string"))}return ak+": "+ai}function X(af,ae,ad){var ag=0,ac=af.reduce(function(ai,ah){return ag++,ah.indexOf("\n")>=0&&ag++,ai+ah.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ac>60?ad[0]+(""===ae?"":ae+"\n ")+" "+af.join(",\n  ")+" "+ad[1]:ad[0]+ae+" "+af.join(", ")+" "+ad[1]}function M(ac){return Array.isArray(ac)}function G(ac){return"boolean"==typeof ac}function S(ac){return null===ac}function F(ac){return null==ac}function P(ac){return"number"==typeof ac}function O(ac){return"string"==typeof ac}function w(ac){return"symbol"==typeof ac}function t(ac){return void 0===ac}function U(ac){return H(ac)&&"[object RegExp]"===B(ac)}function H(ac){return"object"==typeof ac&&null!==ac}function aa(ac){return H(ac)&&"[object Date]"===B(ac)}function W(ac){return H(ac)&&("[object Error]"===B(ac)||ac instanceof Error)}function s(ac){return"function"==typeof ac}function Y(ac){return null===ac||"boolean"==typeof ac||"number"==typeof ac||"string"==typeof ac||"symbol"==typeof ac||"undefined"==typeof ac}function B(ac){return Object.prototype.toString.call(ac)}function V(ac){return 10>ac?"0"+ac.toString(10):ac.toString(10)}function u(){var ad=new Date,ac=[V(ad.getHours()),V(ad.getMinutes()),V(ad.getSeconds())].join(":");return[ad.getDate(),D[ad.getMonth()],ac].join(" ")}function K(ad,ac){return Object.prototype.hasOwnProperty.call(ad,ac)}var Q=/%[sdj%]/g;o.format=function(ag){if(!O(ag)){for(var af=[],ad=0;ad<arguments.length;ad++){af.push(ab(arguments[ad]))}return af.join(" ")}for(var ad=1,ai=arguments,ac=ai.length,ah=String(ag).replace(Q,function(ak){if("%%"===ak){return"%"}if(ad>=ac){return ak}switch(ak){case"%s":return String(ai[ad++]);case"%d":return Number(ai[ad++]);case"%j":try{return JSON.stringify(ai[ad++])}catch(aj){return"[Circular]"}default:return ak}}),ae=ai[ad];ac>ad;ae=ai[++ad]){ah+=S(ae)||!H(ae)?" "+ae:" "+ab(ae)}return ah},o.deprecate=function(ae,ad){function ac(){if(!af){if(R.throwDeprecation){throw new Error(ad)}R.traceDeprecation?console.trace(ad):console.error(ad),af=!0}return ae.apply(this,arguments)}if(t(T.process)){return function(){return o.deprecate(ae,ad).apply(this,arguments)}}if(R.noDeprecation===!0){return ae}var af=!1;return ac};var J={},I;o.debuglog=function(ad){if(t(I)&&(I=R.env.NODE_DEBUG||""),ad=ad.toUpperCase(),!J[ad]){if(new RegExp("\\b"+ad+"\\b","i").test(I)){var ac=R.pid;J[ad]=function(){var ae=o.format.apply(o,arguments);console.error("%s %d: %s",ad,ac,ae)}}else{J[ad]=function(){}}}return J[ad]},o.inspect=ab,ab.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]},ab.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},o.isArray=M,o.isBoolean=G,o.isNull=S,o.isNullOrUndefined=F,o.isNumber=P,o.isString=O,o.isSymbol=w,o.isUndefined=t,o.isRegExp=U,o.isObject=H,o.isDate=aa,o.isError=W,o.isFunction=s,o.isPrimitive=Y,o.isBuffer=p("./support/isBuffer");var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];o.log=function(){console.log("%s - %s",u(),o.format.apply(o,arguments))},o.inherits=p("inherits"),o._extend=function(ae,ad){if(!ad||!H(ad)){return ae}for(var ac=Object.keys(ad),af=ac.length;af--;){ae[ac[af]]=ad[ac[af]]}return ae}}).call(this,p("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":142,_process:138,inherits:127}],144:[function(p,q,o){q.exports.VectorTile=p("./lib/vectortile.js"),q.exports.VectorTileFeature=p("./lib/vectortilefeature.js"),q.exports.VectorTileLayer=p("./lib/vectortilelayer.js")},{"./lib/vectortile.js":145,"./lib/vectortilefeature.js":147,"./lib/vectortilelayer.js":148}],145:[function(r,s,q){function o(v,u){this.layers=v.readFields(p,{},u)}function p(z,w,v){if(3===z){var u=new t(v,v.readVarint()+v.pos);u.length&&(w[u.name]=u)}}var t=r("./vectortilelayer");s.exports=o},{"./vectortilelayer":148}],146:[function(p,q,o){function s(v){this.feature=v,this.finalRatio=4096/v.extent*Math.pow(2,v.dz);var u=64;u/=this.finalRatio;var w=v.extent>>v.dz;u>w&&(u=w),this.dz=v.dz,this.margin=u,this.xmin=w*v.xPos-u,this.ymin=w*v.yPos-u,this.xmax=this.xmin+w+2*u,this.ymax=this.ymin+w+2*u,this.lines=[],this._prevIsIn=!1,this.type=v.type}var r=p("point-geometry");q.exports=s,s.prototype.loadGeometry=function(){var w=this.feature._pbf;w.pos=this.feature._geometry;for(var v=w.readVarint()+w.pos,A=1,z=0,C=0,B=0;w.pos<v;){if(!z){var u=w.readVarint();A=7&u,z=u>>3}if(z--,1===A||2===A){C+=w.readSVarint(),B+=w.readSVarint(),1===A?this.moveTo(C,B):this.lineTo(C,B)}else{if(7!==A){throw new Error("unknown command "+A)}this.closePolygon()}}return this.result()},s.prototype.moveTo=function(v,u){this._push_line(),this._prevIsIn=this._isIn(v,u),this._moveTo(v,u,this._prevIsIn),this._prevPt=new r(v,u),this._firstPt=new r(v,u)},s.prototype.lineTo=function(D,M){var N,E,A,F,I,G,C,z,B,v,H,w,J=this._isIn(D,M);if(J){this._prevIsIn?this._lineTo(D,M,!0):(N=this._prevPt,E=new r(D,M),A=this._intersect(E,N),this._lineTo(A.x,A.y,!0),this._lineTo(E.x,E.y,!0))}else{if(this._prevIsIn){E=this._prevPt,N=new r(D,M),A=this._intersect(E,N),this._lineTo(A.x,A.y,!0),this._lineTo(N.x,N.y,!1)}else{if(F=this._prevPt,I=new r(D,M),F.x<=this.xmin&&I.x<=this.xmin||F.x>=this.xmax&&I.x>=this.xmax||F.y<=this.ymin&&I.y<=this.ymin||F.y>=this.ymax&&I.y>=this.ymax){this._lineTo(I.x,I.y,!1)}else{if(z=[],(F.x<this.xmin&&I.x>this.xmin||F.x>this.xmin&&I.x<this.xmin)&&(G=(this.xmin-F.x)/(I.x-F.x),w=F.y+G*(I.y-F.y),w<=this.ymin?v=!1:w>=this.ymax?v=!0:(C={},C.ratio=G,C.x=this.xmin,C.y=w,z.push(C))),(F.x<this.xmax&&I.x>this.xmax||F.x>this.xmax&&I.x<this.xmax)&&(G=(this.xmax-F.x)/(I.x-F.x),w=F.y+G*(I.y-F.y),w<=this.ymin?v=!1:w>=this.ymax?v=!0:(C={},C.ratio=G,C.x=this.xmax,C.y=w,z.push(C))),(F.y<this.ymin&&I.y>this.ymin||F.y>this.ymin&&I.y<this.ymin)&&(G=(this.ymin-F.y)/(I.y-F.y),H=F.x+G*(I.x-F.x),H<=this.xmin?B=!1:H>=this.xmax?B=!0:(C={},C.ratio=G,C.x=H,C.y=this.ymin,z.push(C))),(F.y<this.ymax&&I.y>this.ymax||F.y>this.ymax&&I.y<this.ymax)&&(G=(this.ymax-F.y)/(I.y-F.y),H=F.x+G*(I.x-F.x),H<=this.xmin?B=!1:H>=this.xmax?B=!0:(C={},C.ratio=G,C.x=H,C.y=this.ymax,z.push(C))),0===z.length){B?v?this._lineTo(this.xmax,this.ymax,!0):this._lineTo(this.xmax,this.ymin,!0):v?this._lineTo(this.xmin,this.ymax,!0):this._lineTo(this.xmin,this.ymin,!0)}else{if(z.length>1&&z[0].ratio>z[1].ratio){this._lineTo(z[1].x,z[1].y,!0),this._lineTo(z[0].x,z[0].y,!0)}else{for(var K=0;K<z.length;K++){this._lineTo(z[K].x,z[K].y,!0)}}}this._lineTo(I.x,I.y,!1)}}}this._prevIsIn=J,this._prevPt=new r(D,M)},s.prototype.closePolygon=function(){var v,u;this.line.length>0&&(v=this._firstPt,u=this._prevPt,(v.x!==u.x||v.y!==u.y)&&this.lineTo(v.x,v.y))},s.prototype.result=function(){return this._push_line(),0===this.lines.length?null:this.lines},s.prototype._isIn=function(v,u){return v>=this.xmin&&v<=this.xmax&&u>=this.ymin&&u<=this.ymax},s.prototype._intersect=function(v,u){var z,w,B,A;return u.x>=this.xmin&&u.x<=this.xmax?(w=u.y<=this.ymin?this.ymin:this.ymax,z=v.x+(w-v.y)/(u.y-v.y)*(u.x-v.x)):u.y>=this.ymin&&u.y<=this.ymax?(z=u.x<=this.xmin?this.xmin:this.xmax,w=v.y+(z-v.x)/(u.x-v.x)*(u.y-v.y)):(w=u.y<=this.ymin?this.ymin:this.ymax,z=u.x<=this.xmin?this.xmin:this.xmax,B=(z-v.x)/(u.x-v.x),A=(w-v.y)/(u.y-v.y),A>B?w=v.y+B*(u.y-v.y):z=v.x+A*(u.x-v.x)),new r(z,w)},s.prototype._push_line=function(){this.line&&(1===this.type?this.line.length>0&&this.lines.push(this.line):2===this.type?this.line.length>1&&this.lines.push(this.line):3===this.type&&this.line.length>3&&this.lines.push(this.line)),this.line=[]},s.prototype._moveTo=function(v,u,w){3!==this.type?w&&(v=(v-(this.xmin+this.margin))*this.finalRatio,u=(u-(this.ymin+this.margin))*this.finalRatio,this.line.push(new r(v,u))):(w||(v<this.xmin&&(v=this.xmin),v>this.xmax&&(v=this.xmax),u<this.ymin&&(u=this.ymin),u>this.ymax&&(u=this.ymax)),v=(v-(this.xmin+this.margin))*this.finalRatio,u=(u-(this.ymin+this.margin))*this.finalRatio,this.line.push(new r(v,u)),this._is_h=!1,this._is_v=!1)},s.prototype._lineTo=function(w,v,A){var z,C;if(3!==this.type){if(A){if(w=(w-(this.xmin+this.margin))*this.finalRatio,v=(v-(this.ymin+this.margin))*this.finalRatio,this.line.length>0&&(z=this.line[this.line.length-1],z.x===w&&z.y===v)){return}this.line.push(new r(w,v))}else{this.line&&this.line.length>0&&this._push_line()}}else{if(A||(w<this.xmin&&(w=this.xmin),w>this.xmax&&(w=this.xmax),v<this.ymin&&(v=this.ymin),v>this.ymax&&(v=this.ymax)),w=(w-(this.xmin+this.margin))*this.finalRatio,v=(v-(this.ymin+this.margin))*this.finalRatio,this.line&&this.line.length>0){z=this.line[this.line.length-1];var B=z.x===w,u=z.y===v;if(B&&u){return}this._is_h&&B?(z.x=w,z.y=v,C=this.line[this.line.length-2],this._is_h=C.x===w,this._is_v=C.y===v):this._is_v&&u?(z.x=w,z.y=v,C=this.line[this.line.length-2],this._is_h=C.x===w,this._is_v=C.y===v):(this.line.push(new r(w,v)),this._is_h=B,this._is_v=u)}else{this.line.push(new r(w,v))}}}},{"point-geometry":137}],147:[function(q,r,o){function p(B,z,A,w,C){this.properties={},this.extent=A,this.type=0,this._pbf=B,this._geometry=-1,this._keys=w,this._values=C,B.readFields(v,this,z)}function v(A,w,z){1==A?w._id=z.readVarint():2==A?t(z,w):3==A?w.type=z.readVarint():4==A&&(w._geometry=z.pos)}function t(B,z){for(var A=B.readVarint()+B.pos;B.pos<A;){var w=z._keys[B.readVarint()],C=z._values[B.readVarint()];z.properties[w]=C}}var s=q("point-geometry"),u=q("./vectortileclipper");r.exports=p,p.types=["Unknown","Point","LineString","Polygon"],p.prototype.loadGeometry=function(){var F;if(this.dz){var I=new u(this);F=I.loadGeometry()}else{for(var w=0,D=this.extent;D>4096;){w+=1,D>>=1}var A=this._pbf;A.pos=this._geometry;var G,B=A.readVarint()+A.pos,J=1,z=0,E=0,H=0;for(F=[];A.pos<B;){if(!z){var C=A.readVarint();J=7&C,z=C>>3}if(z--,1===J||2===J){E+=A.readSVarint(),H+=A.readSVarint(),1===J&&(G&&F.push(G),G=[]),G.push(new s(E>>w,H>>w))}else{if(7!==J){throw new Error("unknown command "+J)}G&&G.push(G[0].clone())}}G&&F.push(G)}return F},p.prototype.bbox=function(){var E=this._pbf;E.pos=this._geometry;for(var H=E.readVarint()+E.pos,w=1,C=0,A=0,F=0,B=1/0,I=-(1/0),z=1/0,D=-(1/0);E.pos<H;){if(!C){var G=E.readVarint();w=7&G,C=G>>3}if(C--,1===w||2===w){A+=E.readSVarint(),F+=E.readSVarint(),B>A&&(B=A),A>I&&(I=A),z>F&&(z=F),F>D&&(D=F)}else{if(7!==w){throw new Error("unknown command "+w)}}}return[B,z,I,D]},p.prototype.toGeoJSON=function(F,J,w){for(var D=this.extent*Math.pow(2,w),A=this.extent*F,H=this.extent*J,B=this.loadGeometry(),K=p.types[this.type],z=0;z<B.length;z++){for(var E=B[z],I=0;I<E.length;I++){var C=E[I],G=180-360*(C.y+H)/D;E[I]=[360*(C.x+A)/D-180,360/Math.PI*Math.atan(Math.exp(G*Math.PI/180))-90]}}return"Point"===K&&1===B.length?B=B[0][0]:"Point"===K?(B=B[0],K="MultiPoint"):"LineString"===K&&1===B.length?B=B[0]:"LineString"===K&&(K="MultiLineString"),{type:"Feature",geometry:{type:K,coordinates:B},properties:this.properties}}},{"./vectortileclipper":146,"point-geometry":137}],148:[function(q,s,o){function t(w,v){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=w,this._keys=[],this._values=[],this._features=[],w.readFields(r,this,v),this.length=this._features.length}function r(z,v,w){15===z?v.version=w.readVarint():1===z?v.name=w.readString():5===z?v.extent=w.readVarint():2===z?v._features.push(w.pos):3===z?v._keys.push(w.readString()):4===z&&v._values.push(u(w))}function u(A){for(var w=null,z=A.readVarint()+A.pos;A.pos<z;){var v=A.readVarint()>>3;w=1===v?A.readString():2===v?A.readFloat():3===v?A.readDouble():4===v?A.readVarint64():5===v?A.readVarint():6===v?A.readSVarint():7===v?A.readBoolean():null}return w}var p=q("./vectortilefeature.js");s.exports=t,t.prototype.feature=function(w){if(0>w||w>=this._features.length){throw new Error("feature index out of bounds")}this._pbf.pos=this._features[w];var v=this._pbf.readVarint()+this._pbf.pos;return new p(this._pbf,v,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":147}],149:[function(r,s,p){var u=arguments[3],q=arguments[4],o=arguments[5],t=JSON.stringify;s.exports=function(v){for(var D,H=Object.keys(o),z=0,w=H.length;w>z;z++){var F=H[z],B=o[F].exports;if(B===v||B["default"]===v){D=F;break}}if(!D){D=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var I={},z=0,w=H.length;w>z;z++){var F=H[z];I[F]=F}q[D]=[Function(["require","module","exports"],"("+v+")(self)"),I]}var G=Math.floor(Math.pow(16,8)*Math.random()).toString(16),C={};C[D]=D,q[G]=[Function(["require"],"var f = require("+t(D)+");(f.default ? f.default : f)(self);"),C];var E="("+u+")({"+Object.keys(q).map(function(J){return t(J)+":["+q[J][0]+","+t(q[J][1])+"]"}).join(",")+"},{},["+t(G)+"])",A=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(A.createObjectURL(new Blob([E],{type:"text/javascript"})))}},{}]},{},[24])(24)});L.MapboxGL=L.Layer.extend({options:{updateInterval:32},initialize:function(k){L.setOptions(this,k);if(k.accessToken){mapboxgl.accessToken=k.accessToken}else{throw new Error("You should provide a Mapbox GL access token as a token option.")}var l=function(r,s,q){var p,o,n,m;m=function(){p=false;if(o){n.apply(q,o);o=false}};n=function(){if(p){o=arguments}else{r.apply(q,arguments);setTimeout(m,s);p=true}};return n};this._throttledUpdate=l(L.Util.bind(this._update,this),this.options.updateInterval)},onAdd:function(k){if(!this._glContainer){this._initContainer()}k._panes.tilePane.appendChild(this._glContainer);this._initGL();this._offset=this._map.containerPointToLayerPoint([0,0]);if(k.options.zoomAnimation){L.DomEvent.on(k._proxy,L.DomUtil.TRANSITION_END,this._transitionEnd,this)}},onRemove:function(k){if(this._map.options.zoomAnimation){L.DomEvent.off(this._map._proxy,L.DomUtil.TRANSITION_END,this._transitionEnd,this)}k.getPanes().tilePane.removeChild(this._glContainer);this._glMap.remove();this._glMap=null},getEvents:function(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd}},_initContainer:function(){var k=this._glContainer=L.DomUtil.create("div","leaflet-gl-layer");var l=this._map.getSize();k.style.width=l.x+"px";k.style.height=l.y+"px"},_initGL:function(){var k=this._map.getCenter();var l=L.extend({},this.options,{container:this._glContainer,interactive:false,center:[k.lng,k.lat],zoom:this._map.getZoom()-1,attributionControl:false});this._glMap=new mapboxgl.Map(l);this._glMap.transform.latRange=null;L.DomUtil.addClass(this._glMap._canvas.canvas,"leaflet-image-layer");L.DomUtil.addClass(this._glMap._canvas.canvas,"leaflet-zoom-animated")},_update:function(p){this._offset=this._map.containerPointToLayerPoint([0,0]);if(this._zooming){return}var m=this._map.getSize(),l=this._glContainer,q=this._glMap,n=this._map.containerPointToLayerPoint([0,0]);L.DomUtil.setPosition(l,n);var k=this._map.getCenter();var o=q.transform;o.center=mapboxgl.LngLat.convert([k.lng,k.lat]);o.zoom=this._map.getZoom()-1;if(q.transform.width!==m.x||q.transform.height!==m.y){l.style.width=m.x+"px";l.style.height=m.y+"px";q._resize()}else{q.update()}},_pinchZoom:function(k){this._glMap.jumpTo({zoom:this._map.getZoom()-1,center:this._map.getCenter()})},_animateZoom:function(k){var m=this._map.getZoomScale(k.zoom),l=this._map._latLngToNewLayerPoint(this._map.getBounds().getNorthWest(),k.zoom,k.center);L.DomUtil.setTransform(this._glMap._canvas.canvas,l.subtract(this._offset),m)},_zoomStart:function(k){this._zooming=true},_zoomEnd:function(){var l=this._map.getZoomScale(this._map.getZoom()),k=this._map._latLngToNewLayerPoint(this._map.getBounds().getNorthWest(),this._map.getZoom(),this._map.getCenter());L.DomUtil.setTransform(this._glMap._canvas.canvas,k.subtract(this._offset),l)},_transitionEnd:function(k){L.Util.requestAnimFrame(function(){var m=this._map.getZoom(),l=this._map.getCenter(),n=this._map.latLngToContainerPoint(this._map.getBounds().getNorthWest());L.DomUtil.setTransform(this._glMap._canvas.canvas,n,1);this._glMap.once("moveend",L.Util.bind(function(){this._zooming=false;this._zoomEnd()},this));this._glMap.jumpTo({center:l,zoom:m-1})},this)}});L.mapboxGL=function(k){return new L.MapboxGL(k)};function d(k,l){i.request(k,{},function(m,n){if(!m){i.request(n.sources.esri.url,{},function(o,p){if(!o){h(n,p,k);l._mapboxGL=j.mapboxGL({accessToken:"ezree",style:n});l._ready=true;l.fire("ready",{},true)}},l)}else{throw new Error("Unable to fetch vector tile style metadata")}},l)}function h(m,l,k){if(m.sources.esri.url&&m.sources.esri.url.indexOf("http")===-1){m.sources.esri.url=k.replace("/resources/styles/root.json","")}if(l.tiles&&l.tiles[0].charAt(0)!=="/"){l.tiles[0]="/"+l.tiles[0]}if(l.tileMap&&l.tileMap.charAt(0)!=="/"){l.tileMap="/"+l.tileMap}m.sources.esri={type:"vector",scheme:"xyz",tilejson:l.tilejson||"2.0.0",format:(l.tileInfo&&l.tileInfo.format)||"pbf",index:l.tileMap?m.sources.esri.url+l.tileMap:null,tiles:[m.sources.esri.url+l.tiles[0]],description:l.description,name:l.name};if(m.glyphs.indexOf("http")===-1){m.glyphs=k.replace("styles/root.json",m.glyphs.replace("../",""));m.sprite=k.replace("styles/root.json",m.sprite.replace("../",""))}}var a=j.Layer.extend({statics:{URLPREFIX:"https://www.arcgis.com/sharing/rest/content/items/",URLSUFFIX:"/resources/styles/root.json",STYLES:{DarkGray:"57436c01bc754dbb87dfb636b6484022",Gray:"1e47168d181248e491541ffd5a91c0de",Hybrid:"af6063d6906c4eb589dfe03819610660",Navigation:"e19e9330bf08490ca8353d76b5e2e658",Streets:"a60a37a27cc140ddad15f919cd5a69f2",StreetsNight:"92c551c9f07b4147846aae273e822714",StreetsRelief:"78c0a9ab4fbf4198a8b951848aab19d8",Topographic:"86d5ed4b6dc741de9dad5f0fbe09ae95",Spring:"763884983d3544c0a418a97992881fce",Newspaper:"4f4843d99c34436f82920932317893ae",MidCentury:"267f44f08a844c7abee2b62b00600540",ModernAntique:"996d9e7a3aac4514bb692ce7a990f1c1",BlackAndWhite:"3161443179244702a5e0449010013b54"}},initialize:function(l){l={key:l};if(typeof l.key==="string"&&a.STYLES[l.key]){var k=a.URLPREFIX+a.STYLES[l.key]+a.URLSUFFIX;d(k,this)}else{throw new Error('L.esri.Vector.Basemap: Invalid parameter. Use one of "DarkGray", "Gray", "Hybrid", "Navigation", "Streets", "StreetsNight", "StreetsRelief", "Topographic"')}},onAdd:function(k){this._map=k;i.Util.setEsriAttribution(k);if(k.attributionControl){i.Util._getAttributionData("https://static.arcgis.com/attribution/World_Street_Map",k);k.attributionControl.addAttribution('<span class="esri-dynamic-attribution">USGS, NOAA</span>')}if(this._ready){this._asyncAdd()}else{this.once("ready",function(){this._asyncAdd()},this)}},onRemove:function(l){l.off("moveend",i.Util._updateMapAttribution);l.removeLayer(this._mapboxGL);if(l.attributionControl){var k=document.getElementsByClassName("esri-dynamic-attribution")[0].outerHTML;l.attributionControl.removeAttribution(k)}},_asyncAdd:function(){var k=this._map;k.getContainer().style.background=this._mapboxGL.options.style.layers[0].paint["background-color"];k.on("moveend",i.Util._updateMapAttribution);this._mapboxGL.addTo(k,this)}});function f(k){return new a(k)}var b=j.Layer.extend({statics:{URLPREFIX:"https://www.arcgis.com/sharing/rest/content/items/"},initialize:function(l){l={id:l};if(typeof l.id==="string"){var m=b.URLPREFIX+l.id;var n;var k;i.request(m,{},function(o,p){if(!o){n=p.url;if(n.indexOf("basemaps.arcgis.com")===-1){this._customTileset=true;if(p.accessInformation){this._copyrightText=p.accessInformation}i.request(n,{},function(q,r){if(!q){if(r.defaultStyles.charAt(0)!=="/"){r.defaultStyles="/"+r.defaultStyles}k=n+r.defaultStyles+"/root.json";i.request(k,{},function(s,t){if(!s){h(t,r,k);this._mapboxGL=j.mapboxGL({accessToken:"ezree",style:t});this._ready=true;this.fire("ready",{},true)}},this)}},this)}else{d(m+"/resources/styles/root.json",this)}}},this)}else{throw new Error("L.esri.Vector.Layer: Invalid parameter. Use the id of an ArcGIS Online vector tile item")}},onAdd:function(k){this._map=k;i.Util.setEsriAttribution(k);if(this._ready){this._asyncAdd()}else{this.once("ready",function(){this._asyncAdd()},this)}},onRemove:function(l){l.off("moveend",i.Util._updateMapAttribution);l.removeLayer(this._mapboxGL);if(l.attributionControl){var k=document.getElementsByClassName("esri-dynamic-attribution")[0].outerHTML;l.attributionControl.removeAttribution(k)}},_asyncAdd:function(){var k=this._map;if(k.attributionControl){if(this._customTileset){if(this._copyrightText){k.attributionControl.addAttribution('<span class="esri-dynamic-attribution">'+this._copyrightText+"</span>")}}else{i.Util._getAttributionData("https://static.arcgis.com/attribution/World_Street_Map",k);k.attributionControl.addAttribution('<span class="esri-dynamic-attribution">USGS, NOAA</span>');k.on("moveend",i.Util._updateMapAttribution)}}k.getContainer().style.background=this._mapboxGL.options.style.layers[0].paint["background-color"];this._mapboxGL.addTo(k,this)}});function e(k){return new b(k)}c.VERSION=g;c.Basemap=a;c.basemap=f;c.Layer=b;c.layer=e}));
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_gis/resources/js/leaflet-google-mutant.min.js	Thu Jul 12 17:40:07 2018 +0200
@@ -0,0 +1,1 @@
+L.GridLayer.GoogleMutant=L.GridLayer.extend({includes:L.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",opacity:1,continuousWorld:false,noWrap:false,type:"roadmap",maxNativeZoom:21},initialize:function(a){L.GridLayer.prototype.initialize.call(this,a);this._ready=!!window.google&&!!window.google.maps&&!!window.google.maps.Map;this._GAPIPromise=this._ready?Promise.resolve(window.google):new Promise(function(e,d){var b=0;var c=null;c=setInterval(function(){if(b>=10){clearInterval(c);return d(new Error("window.google not found after 10 attempts"))}if(!!window.google&&!!window.google.maps&&!!window.google.maps.Map){clearInterval(c);return e(window.google)}b++},500)});this._tileCallbacks={};this._freshTiles={};this._imagesPerTile=(this.options.type==="hybrid")?2:1},onAdd:function(a){L.GridLayer.prototype.onAdd.call(this,a);this._initMutantContainer();this._GAPIPromise.then(function(){this._ready=true;this._map=a;this._initMutant();a.on("viewreset",this._reset,this);a.on("move",this._update,this);a.on("zoomend",this._handleZoomAnim,this);a.on("resize",this._resize,this);google.maps.event.addListenerOnce(this._mutant,"idle",function(){this._checkZoomLevels();this._mutantIsReady=true}.bind(this));a._controlCorners.bottomright.style.marginBottom="20px";a._controlCorners.bottomleft.style.marginBottom="20px";this._reset();this._update();if(this._subLayers){for(var b in this._subLayers){this._subLayers[b].setMap(this._mutant)}}}.bind(this))},onRemove:function(a){L.GridLayer.prototype.onRemove.call(this,a);a._container.removeChild(this._mutantContainer);this._mutantContainer=undefined;a.off("viewreset",this._reset,this);a.off("move",this._update,this);a.off("zoomend",this._handleZoomAnim,this);a.off("resize",this._resize,this);a._controlCorners.bottomright.style.marginBottom="0em";a._controlCorners.bottomleft.style.marginBottom="0em"},getAttribution:function(){return this.options.attribution},setOpacity:function(a){this.options.opacity=a;if(a<1){L.DomUtil.setOpacity(this._mutantContainer,a)}},setElementSize:function(b,a){b.style.width=a.x+"px";b.style.height=a.y+"px"},addGoogleLayer:function(b,a){if(!this._subLayers){this._subLayers={}}return this._GAPIPromise.then(function(){var d=google.maps[b];var c=new d(a);c.setMap(this._mutant);this._subLayers[b]=c;return c}.bind(this))},removeGoogleLayer:function(a){var b=this._subLayers&&this._subLayers[a];if(!b){return}b.setMap(null);delete this._subLayers[a]},_initMutantContainer:function(){if(!this._mutantContainer){this._mutantContainer=L.DomUtil.create("div","leaflet-google-mutant leaflet-top leaflet-left");this._mutantContainer.id="_MutantContainer_"+L.Util.stamp(this._mutantContainer);this._mutantContainer.style.zIndex="800";this._mutantContainer.style.pointerEvents="none";this._map.getContainer().appendChild(this._mutantContainer)}this.setOpacity(this.options.opacity);this.setElementSize(this._mutantContainer,this._map.getSize());this._attachObserver(this._mutantContainer)},_initMutant:function(){if(!this._ready||!this._mutantContainer){return}this._mutantCenter=new google.maps.LatLng(0,0);var a=new google.maps.Map(this._mutantContainer,{center:this._mutantCenter,zoom:0,tilt:0,mapTypeId:this.options.type,disableDefaultUI:true,keyboardShortcuts:false,draggable:false,disableDoubleClickZoom:true,scrollwheel:false,streetViewControl:false,styles:this.options.styles||{},backgroundColor:"transparent"});this._mutant=a;google.maps.event.addListenerOnce(a,"idle",function(){var b=this._mutantContainer.querySelectorAll("a");for(var c=0;c<b.length;c++){b[c].style.pointerEvents="auto"}}.bind(this));this.fire("spawned",{mapObject:a})},_attachObserver:function _attachObserver(b){var a=new MutationObserver(this._onMutations.bind(this));a.observe(b,{childList:true,subtree:true})},_onMutations:function _onMutations(a){for(var d=0;d<a.length;++d){var b=a[d];for(var c=0;c<b.addedNodes.length;++c){var e=b.addedNodes[c];if(e instanceof HTMLImageElement){this._onMutatedImage(e)}else{if(e instanceof HTMLElement){Array.prototype.forEach.call(e.querySelectorAll("img"),this._onMutatedImage.bind(this))}}}}},_roadRegexp:/!1i(\d+)!2i(\d+)!3i(\d+)!/,_satRegexp:/x=(\d+)&y=(\d+)&z=(\d+)/,_staticRegExp:/StaticMapService\.GetMapImage/,_onMutatedImage:function _onMutatedImage(j){var h;var e=j.src.match(this._roadRegexp);var f=0;if(e){h={z:e[1],x:e[2],y:e[3]};if(this._imagesPerTile>1){j.style.zIndex=1;f=1}}else{e=j.src.match(this._satRegexp);if(e){h={x:e[1],y:e[2],z:e[3]}}f=0}if(h){var d=this._tileCoordsToKey(h);j.style.position="absolute";var b=j.cloneNode(true);b.style.visibility="visible";j.style.visibility="hidden";var i=d+"/"+f;if(i in this._tileCallbacks&&this._tileCallbacks[i]){this._tileCallbacks[i].shift()(b);if(!this._tileCallbacks[i].length){delete this._tileCallbacks[i]}}else{if(this._tiles[d]){var g=this._tiles[d].el;var a=(f===0)?g.firstChild:g.firstChild.nextSibling;g.replaceChild(b,a)}else{if(i in this._freshTiles){this._freshTiles[i].push(b)}else{this._freshTiles[i]=[b]}}}}else{if(j.src.match(this._staticRegExp)){j.style.visibility="hidden"}}},createTile:function(f,a){var c=this._tileCoordsToKey(f);var e=L.DomUtil.create("div");e.dataset.pending=this._imagesPerTile;a=a.bind(this,null,e);for(var b=0;b<this._imagesPerTile;b++){var d=c+"/"+b;if(d in this._freshTiles){e.appendChild(this._freshTiles[d].pop());if(!this._freshTiles[d].length){delete this._freshTiles[d]}e.dataset.pending--}else{this._tileCallbacks[d]=this._tileCallbacks[d]||[];this._tileCallbacks[d].push((function(g){return function(h){g.appendChild(h);g.dataset.pending--;if(!parseInt(g.dataset.pending)){a()}}.bind(this)}.bind(this))(e))}}if(!parseInt(e.dataset.pending)){L.Util.requestAnimFrame(a)}return e},_checkZoomLevels:function(){var b=this._map.getZoom();var a=this._mutant.getZoom();if(!b||!a){return}if((a!==b)||(a>this.options.maxNativeZoom)){this._setMaxNativeZoom(a)}},_setMaxNativeZoom:function(a){if(a!=this.options.maxNativeZoom){this.options.maxNativeZoom=a;this._resetView()}},_reset:function(){this._initContainer()},_update:function(){if(this._mutant){var a=this._map.getCenter();var c=new google.maps.LatLng(a.lat,a.lng);this._mutant.setCenter(c);var e=this._map.getZoom();var b=e!==Math.round(e);var d=this._mutant.getZoom();if(!b&&(e!=d)){this._mutant.setZoom(e);if(this._mutantIsReady){this._checkZoomLevels()}}}L.GridLayer.prototype._update.call(this)},_resize:function(){var a=this._map.getSize();if(this._mutantContainer.style.width===a.x&&this._mutantContainer.style.height===a.y){return}this.setElementSize(this._mutantContainer,a);if(!this._mutant){return}google.maps.event.trigger(this._mutant,"resize")},_handleZoomAnim:function(){if(!this._mutant){return}var a=this._map.getCenter();var b=new google.maps.LatLng(a.lat,a.lng);this._mutant.setCenter(b);this._mutant.setZoom(Math.round(this._map.getZoom()))},_removeTile:function(g){if(!this._mutant){return}for(var c=0;c<this._imagesPerTile;c++){var f=g+"/"+c;if(f in this._freshTiles){delete this._freshTiles[f]}}var a=this._mutant.getZoom();var k=g.split(":")[2];if(k==a&&a==this.options.maxNativeZoom){var d=this._tiles[g].el.querySelectorAll("img");if(d.length){for(var b=0;b<this._imagesPerTile;b++){var e=g+"/"+b;var h=d[b];if(e in this._freshTiles){this._freshTiles[e].push(h)}else{this._freshTiles[e]=[h]}}}}return L.GridLayer.prototype._removeTile.call(this,g)}});L.gridLayer.googleMutant=function(a){return new L.GridLayer.GoogleMutant(a)};
\ No newline at end of file