diff --git a/folium/folium.py b/folium/folium.py index 7432c577f..db337abd7 100644 --- a/folium/folium.py +++ b/folium/folium.py @@ -90,13 +90,14 @@ def __init__(self, location=None, width='100%', height='100%', Examples -------- - >>>map = folium.Map(location=[45.523, -122.675], width=750, height=500) - >>>map = folium.Map(location=[45.523, -122.675], - tiles='Mapbox Control Room') - >>>map = folium.Map(location=(45.523, -122.675), max_zoom=20, - tiles='Cloudmade', API_key='YourKey') - >>>map = folium.Map(location=[45.523, -122.675], zoom_start=2, - tiles=('http://{s}.tiles.mapbox.com/v3/' + >>> map = folium.Map(location=[45.523, -122.675], width=750, + ... height=500) + >>> map = folium.Map(location=[45.523, -122.675], + tiles='Mapbox Control Room') + >>> map = folium.Map(location=(45.523, -122.675), max_zoom=20, + tiles='Cloudmade', API_key='YourKey') + >>> map = folium.Map(location=[45.523, -122.675], zoom_start=2, + tiles=('http://{s}.tiles.mapbox.com/v3/' 'mapbox.control-room/{z}/{x}/{y}.png'), attr='Mapbox attribution') @@ -209,8 +210,9 @@ def __init__(self, location=None, width='100%', height='100%', self.template_vars.setdefault('image_layers', []) @iter_obj('simple') - def add_tile_layer(self, tile_name=None, tile_url=None, active=False): - """Adds a simple tile layer. + def add_tile_layer(self, tile_name=None, tile_url=None, **kw): + """ + Adds a simple tile layer. Parameters ---------- @@ -218,15 +220,36 @@ def add_tile_layer(self, tile_name=None, tile_url=None, active=False): name of the tile layer tile_url: string url location of the tile layer - active: boolean - should the layer be active when added + + For the available options see: + http://leafletjs.com/reference.html#tilelayer + """ + # Same defaults. + tms = kw.pop('tms', False) + minZoom = kw.pop('minZoom', 0) + opacity = kw.pop('opacity', 1) + maxZoom = kw.pop('maxZoom', 18) + noWrap = kw.pop('noWrap', False) + zoomOffset = kw.pop('zoomOffset', 0) + zoomReverse = kw.pop('zoomReverse', False) + continuousWorld = kw.pop('continuousWorld', False) + if tile_name not in self.added_layers: tile_name = tile_name.replace(" ", "_") tile_temp = self.env.get_template('tile_layer.js') - - tile = tile_temp.render({'tile_name': tile_name, - 'tile_url': tile_url}) + tile = tile_temp.render({ + 'tile_name': tile_name, + 'tile_url': tile_url, + 'minZoom': minZoom, + 'maxZoom': maxZoom, + 'tms': str(tms).lower(), + 'continuousWorld': str(continuousWorld).lower(), + 'noWrap': str(noWrap).lower(), + 'zoomOffset': zoomOffset, + 'zoomReverse': str(zoomReverse).lower(), + 'opacity': opacity, + }) self.template_vars.setdefault('tile_layers', []).append((tile)) @@ -305,8 +328,8 @@ def simple_marker(self, location=None, popup=None, Example ------- - >>>map.simple_marker(location=[45.5, -122.3], popup='Portland, OR') - >>>map.simple_marker(location=[45.5, -122.3], popup=(vis, 'vis.json')) + >>> map.simple_marker(location=[45.5, -122.3], popup='Portland, OR') + >>> map.simple_marker(location=[45.5, -122.3], popup=(vis, 'vis.json')) """ count = self.mark_cnt['simple'] @@ -364,8 +387,8 @@ def line(self, locations, Example ------- - >>>map.line(locations=[(45.5, -122.3), (42.3, -71.0)]) - >>>map.line(locations=[(45.5, -122.3), (42.3, -71.0)], + >>> map.line(locations=[(45.5, -122.3), (42.3, -71.0)]) + >>> map.line(locations=[(45.5, -122.3), (42.3, -71.0)], line_color='red', line_opacity=1.0) """ @@ -409,7 +432,6 @@ def multiline(self, locations, line_color=None, line_opacity=None, Example ------- - # FIXME: Add another example. >>> m.multiline(locations=[[(45.5236, -122.675), (45.5236, -122.675)], [(45.5237, -122.675), (45.5237, -122.675)], [(45.5238, -122.675), (45.5238, -122.675)]]) @@ -467,9 +489,9 @@ def circle_marker(self, location=None, radius=500, popup=None, Example ------- - >>>map.circle_marker(location=[45.5, -122.3], + >>> map.circle_marker(location=[45.5, -122.3], radius=1000, popup='Portland, OR') - >>>map.circle_marker(location=[45.5, -122.3], + >>> map.circle_marker(location=[45.5, -122.3], radius=1000, popup=(bar_chart, 'bar_data.json')) """ @@ -584,7 +606,7 @@ def click_for_marker(self, popup=None): Example ------- - >>>map.click_for_marker(popup='Your Custom Text') + >>> map.click_for_marker(popup='Your Custom Text') """ latlng = '"Latitude: " + lat + "
Longitude: " + lng ' @@ -802,9 +824,9 @@ def geo_json(self, geo_path=None, geo_str=None, data_out='data.json', keyword argument will enable conversion to GeoJSON. reset: boolean, default False Remove all current geoJSON layers, start with new layer - freescale: if True use free format for the scale, where min and max values - are taken from the data. It also allow to plot allow to plot values < 0 - and float legend labels. + freescale: if True use free format for the scale, where min and max + values are taken from the data. It also allow to plot + values < 0 and float legend labels. Output ------ @@ -893,7 +915,7 @@ def json_style(style_cnt, line_color, line_weight, line_opacity, # D3 Color scale. series = data[columns[1]] - if freescale == False: + if not freescale: if threshold_scale and len(threshold_scale) > 6: raise ValueError domain = threshold_scale or utilities.split_six(series=series) @@ -918,18 +940,15 @@ def json_style(style_cnt, line_color, line_weight, line_opacity, if not freescale: legend = leg_templ.render({'lin_min': 0, - 'lin_max': int(domain[-1]*1.1), - 'tick_labels': tick_labels, - 'caption': name}) - - + 'lin_max': int(domain[-1]*1.1), + 'tick_labels': tick_labels, + 'caption': name}) else: legend = leg_templ.render({'lin_min': domain[0], 'lin_max': domain[-1], 'tick_labels': tick_labels, 'caption': name}) - self.template_vars.setdefault('map_legends', []).append(legend) # Style with color brewer colors. diff --git a/folium/templates/leaflet-dvf.markers.min.js b/folium/templates/leaflet-dvf.markers.min.js new file mode 100644 index 000000000..860d4273d --- /dev/null +++ b/folium/templates/leaflet-dvf.markers.min.js @@ -0,0 +1,6 @@ +/* + @preserve Leaflet Data Visualization Framework, a JavaScript library for creating thematic maps using Leaflet + (c) 2013, Scott Fairgrieve, HumanGeo +*/ +L.LinearFunction=L.Class.extend({initialize:function(t,e,i){this.setOptions(i),this.setRange(t,e)},_calculateParameters:function(t,e){0===this._xRange?(this._slope=0,this._b=t.y):(this._slope=(e.y-t.y)/this._xRange,this._b=t.y-this._slope*t.x)},_arrayToPoint:function(t){return{x:t[0],y:t[1]}},setOptions:function(t){L.Util.setOptions(this,t),this._preProcess=this.options.preProcess,this._postProcess=this.options.postProcess},getBounds:function(){var t=Math.min(this._minPoint.x,this._maxPoint.x),e=Math.max(this._minPoint.x,this._maxPoint.x),i=Math.min(this._minPoint.y,this._maxPoint.y),n=Math.max(this._minPoint.y,this._maxPoint.y);return[new L.Point(t,i),new L.Point(e,n)]},setRange:function(t,e){return t=t instanceof Array?this._arrayToPoint(t):t,e=e instanceof Array?this._arrayToPoint(e):e,this._minPoint=t,this._maxPoint=e,this._xRange=e.x-t.x,this._calculateParameters(t,e),this},setMin:function(t){return this.setRange(t,this._maxPoint),this},setMax:function(t){return this.setRange(this._minPoint,t),this},setPreProcess:function(t){return this._preProcess=t,this},setPostProcess:function(t){return this._postProcess=t,this},evaluate:function(t){var e;return this._preProcess&&(t=this._preProcess(t)),e=Number((this._slope*t).toFixed(6))+Number(this._b.toFixed(6)),this._postProcess&&(e=this._postProcess(e)),e},random:function(){var t=Math.random()*this._xRange+this._minPoint.x;return this.evaluate(t)},sample:function(t){t=Math.max(t,2);for(var e=t-1,i=this._xRange/e,n=this._minPoint.x,a=[];n<=this._maxPoint.x;)a.push(this.evaluate(n)),n+=i;return a},samplePoints:function(t){t=Math.max(t,2);for(var e=t-1,i=this._xRange/e,n=this._minPoint.x,a=[];n<=this._maxPoint.x;)a.push(new L.Point(n,this.evaluate(n))),n+=i;return a},getIntersectionPoint:function(t){var e=null;if(this._slope!==t._slope){var i=(this._b-t._b)/(t._slope-this._slope),n=this.evaluate(i);e=new L.Point(i,n)}return e}}),L.ColorFunction=L.LinearFunction.extend({options:{alpha:1,includeAlpha:!1},initialize:function(t,e,i){L.Util.setOptions(this,i),this._parts=[],this._dynamicPart=null,this._outputPrecision=0,this._prefix=null,this._formatOutput=function(t){return t.toFixed(this._outputPrecision)},this._mapOutput=function(t){for(var e=[],i=0;i-1&&(e=L.hslColor(e).toRGBString()),e};L.LinearFunction.prototype.initialize.call(this,t,e,{preProcess:this.options.preProcess,postProcess:n})}}),L.HSLColorFunction=L.ColorFunction.extend({initialize:function(t,e,i){L.ColorFunction.prototype.initialize.call(this,t,e,i),this._parts=["outputHue","outputSaturation","outputLuminosity"],this._prefix="hsl",this._outputPrecision=2}}),L.RGBColorFunction=L.ColorFunction.extend({initialize:function(t,e,i){L.ColorFunction.prototype.initialize.call(this,t,e,i),this._parts=["outputRed","outputBlue","outputGreen"],this._prefix="rgb",this._outputPrecision=0}}),L.RGBRedFunction=L.LinearFunction.extend({options:{outputGreen:0,outputBlue:0},initialize:function(t,e,i){L.RGBColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputRed"}}),L.RGBBlueFunction=L.LinearFunction.extend({options:{outputRed:0,outputGreen:0},initialize:function(t,e,i){L.RGBColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputBlue"}}),L.RGBGreenFunction=L.LinearFunction.extend({options:{outputRed:0,outputBlue:0},initialize:function(t,e,i){L.RGBColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputGreen"}}),L.RGBColorBlendFunction=L.LinearFunction.extend({initialize:function(t,e,i,n){i=new L.RGBColor(i),n=new L.RGBColor(n);var a=i.r(),o=n.r(),r=i.g(),s=n.g(),f=i.b(),d=n.b();this._minX=t,this._maxX=e,this._redFunction=new L.LinearFunction(new L.Point(t,a),new L.Point(e,o)),this._greenFunction=new L.LinearFunction(new L.Point(t,r),new L.Point(e,s)),this._blueFunction=new L.LinearFunction(new L.Point(t,f),new L.Point(e,d))},getBounds:function(){var t=this._redFunction.getBounds(),e=this._greenFunction.getBounds(),i=this._blueFunction.getBounds(),n=Math.min(t[0].y,e[0].y,i[0].y),a=Math.max(t[0].y,e[0].y,i[0].y);return[new L.Point(t[0].x,n),new L.Point(t[1].x,a)]},evaluate:function(t){return new L.RGBColor([this._redFunction.evaluate(t),this._greenFunction.evaluate(t),this._blueFunction.evaluate(t)]).toRGBString()}}),L.HSLHueFunction=L.HSLColorFunction.extend({options:{outputSaturation:"100%",outputLuminosity:"50%"},initialize:function(t,e,i){L.HSLColorFunction.prototype.initialize.call(this,t,e,i),this._dynamicPart="outputHue"}}),L.HSLSaturationFunction=L.LinearFunction.extend({options:{outputHue:0,outputLuminosity:"50%"},initialize:function(t,e,i){L.HSLColorFunction.prototype.initialize.call(this,t,e,i),this._formatOutput=function(t){return(100*t).toFixed(this._outputPrecision)+"%"},this._dynamicPart="outputSaturation"}}),L.HSLLuminosityFunction=L.LinearFunction.extend({options:{outputHue:0,outputSaturation:"100%"},initialize:function(t,e,i){L.HSLColorFunction.prototype.initialize.call(this,t,e,i),this._formatOutput=function(t){return(100*t).toFixed(this._outputPrecision)+"%"},this._dynamicPart="outputLuminosity"}}),L.HSLColorBlendFunction=L.LinearFunction.extend({initialize:function(t,e,i,n){i=new L.HSLColor(i),n=new L.HSLColor(n);var a=i.h(),o=n.h(),r=i.s(),s=n.s(),f=i.l(),d=n.l();this._minX=t,this._maxX=e,this._hueFunction=new L.LinearFunction(new L.Point(t,a),new L.Point(e,o)),this._saturationFunction=new L.LinearFunction(new L.Point(t,r),new L.Point(e,s)),this._luminosityFunction=new L.LinearFunction(new L.Point(t,f),new L.Point(e,d))},getBounds:function(){var t=this._hueFunction.getBounds(),e=this._saturationFunction.getBounds(),i=this._luminosityFunction.getBounds(),n=Math.min(t[0].y,e[0].y,i[0].y),a=Math.max(t[0].y,e[0].y,i[0].y);return[new L.Point(t[0].x,n),new L.Point(t[1].x,a)]},evaluate:function(t){return new L.HSLColor([this._hueFunction.evaluate(t),this._saturationFunction.evaluate(t),this._luminosityFunction.evaluate(t)]).toHSLString()}}),L.PiecewiseFunction=L.LinearFunction.extend({initialize:function(t,e){L.Util.setOptions(this,e),this._functions=t;var i,n;i=t[0].getBounds()[0],n=t[t.length-1].getBounds()[1],L.LinearFunction.prototype.initialize.call(this,i,n,{preProcess:this.options.preProcess,postProcess:this.options.postProcess})},_getFunction:function(t){for(var e,i,n,a,o=!1,r=0;r=i.x&&ti;i++)if(this[i]===t)return i;return-1}),Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=i.length;return function(a){var o,r,s;if("object"!=typeof a&&"function"!=typeof a||null===a)throw new TypeError("Object.keys called on non-object");o=[];for(r in a)t.call(a,r)&&o.push(r);if(e)for(s=0;n>s;s++)t.call(a,i[s])&&o.push(i[s]);return o}}()),L.Util.guid=function(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},L.Util.getProperty=function(t,e,i){return e in t?t[e]:i},L.Util.setFieldValue=function(t,e,i){for(var n,a=e.split("."),o=t,r=0;r-1){f=n.substring(u),n=n.substring(0,u),f=f.replace("[","").replace("]",""),a=f.split("="),o=a[0],r=a[1],l=l[n];for(var b=0;b0){var n=t[0],e=null!==e?e:2,a="M",o="L",r="Z";L.Browser.vml&&(e=0,a="m",o="l",r="xe"),i=a+n.x.toFixed(e)+","+n.y.toFixed(e);for(var s=1;ss;++s)o+=r[s]+":"+a.valueFunction(i)+";";return t.style.cssText+=o,t}},L.StylesBuilder=L.Class.extend({initialize:function(t,e){this._categories=t,this._styleFunctionMap=e,this._buildStyles()},_buildStyles:function(){for(var t,e,i,n={},a=0;ai;++i)e.push(i);return e}(n),o=new L.StylesBuilder(a,this._styleFunctionMap),r=o.getStyles();t.className&&L.DomUtil.addClass(i,t.className);for(var s in r){var f=L.DomUtil.create("i","palette-element",i),d=r[s];L.StyleConverter.applySVGStyle(f,d)}return e.innerHTML}}),L.HTMLUtils={buildTable:function(t,e,i){function n(t,e){for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return!0;return!1}e=e||"table table-condensed table-striped table-bordered";var a=L.DomUtil.create("table",e),o=L.DomUtil.create("thead","",a),r=L.DomUtil.create("tbody","",a);o.innerHTML="NameValue",i=i||[];for(var s in t)if(t.hasOwnProperty(s)&&!n(i,s)){var f=t[s];if("object"==typeof f){var d=document.createElement("div");d.appendChild(L.HTMLUtils.buildTable(f,i)),f=d.innerHTML}r.innerHTML+=""+s+""+f+""}return a}},L.AnimationUtils={animate:function(t,e,i,n){var a=n.delay||0,o=n.frames||30,r=n.duration||500,s={},f=n.easeFunction||function(t){return t},d=n.complete,c=r/o;for(var l in e)"color"!=l&&"fillColor"!=l&&i[l]?s[l]=new L.LinearFunction([0,e[l]],[o-1,i[l]]):("color"==l||"fillColor"==l)&&(s[l]=new L.RGBColorBlendFunction(0,o-1,e[l],i[l]));var u={},h=0,b=function(){for(var e in s)u[e]=s[e].evaluate(h);t.options=L.extend({},t.options,u),t.setStyle(t.options).redraw(),h++,c=f(c),o>h?setTimeout(b,c):d()};setTimeout(b,a)}},L.Color=L.Class.extend({initialize:function(t){this._rgb=[0,0,0],this._hsl=[0,1,.5],this._a=1,t&&this.parseColorDef(t)},parseColorDef:function(){},rgbToHSL:function(t,e,i){t/=255,e/=255,i/=255;var n,a,o=Math.max(t,e,i),r=Math.min(t,e,i),s=(o+r)/2;if(o==r)n=a=0;else{var f=o-r;switch(a=s>.5?f/(2-o-r):f/(o+r),o){case t:n=(e-i)/f+(i>e?6:0);break;case e:n=(i-t)/f+2;break;case i:n=(t-e)/f+4}n/=6}return[n,a,s]},hslToRGB:function(t,e,i){function n(t,e,i){return 0>i&&(i+=1),i>1&&(i-=1),1/6>i?t+6*(e-t)*i:.5>i?e:2/3>i?t+(e-t)*(2/3-i)*6:t}var a,o,r;if(0==e)a=o=r=i;else{var s=.5>i?i*(1+e):i+e-i*e,f=2*i-s;a=n(f,s,t+1/3),o=n(f,s,t),r=n(f,s,t-1/3)}return[Math.floor(255*a),Math.floor(255*o),Math.floor(255*r)]},setRGB:function(t,e,i){return this._rgb=[t,e,i],this._hsl=this.rgbToHSL(t,e,i),this},setHSL:function(t,e,i){return this._hsl=[t,e,i],this._rgb=this.hslToRGB(t,e,i),this},toHSL:function(){return this._hsl},toHSLString:function(){var t="hsl";return this._a<1&&(t+="a"),t+"("+(360*this._hsl[0]).toFixed(1)+","+(100*this._hsl[1]).toFixed(0)+"%,"+(100*this._hsl[2]).toFixed(0)+"%)"},toRGB:function(){return this._rgb},toRGBString:function(){var t;if(this._a<1)t="rgba("+this._rgb[0].toFixed(0)+","+this._rgb[1].toFixed(0)+","+this._rgb[2].toFixed(0)+","+this._a.toFixed(1)+")";else{for(var e=[this._rgb[0].toString(16),this._rgb[1].toString(16),this._rgb[2].toString(16)],i=0;it?this._runFrame(this._easeFunction(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){this._animateFrame(t),this.fire("step")},_complete:function(){L.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")}}),L.ColorBrewer={Sequential:{YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]}},Diverging:{PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},Qualitative:{Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}}},L.Palettes={huePalette:function(t,e,i,n,a){return new L.HSLHueFunction(new L.Point(t,i),new L.Point(e,n),a) +},luminosityPalette:function(t,e,i,n,a){return new L.HSLLuminosityFunction(new L.Point(t,i),new L.Point(e,n),a)},saturationPalette:function(t,e,i,n,a){return new L.HSLSaturationFunction(new L.Point(t,i),new L.Point(e,n),a)},rgbBlendPalette:function(t,e,i,n,a){return new L.RGBColorBlendFunction(t,e,i,n,a)},hslBlendPalette:function(t,e,i,n,a){return new L.HSLColorBlendFunction(t,e,i,n,a)},customColorPalette:function(t,e,i,n){return new L.CustomColorFunction(t,e,i,n)}},L.DynamicColorPalettes={rainbow:{text:"Rainbow",getPalette:function(t,e){return L.Palettes.huePalette(t,e,0,300)}},greentored:{text:"Green - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,120,0)}},yellowtored:{text:"Yellow - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,60,0)}},orangetored:{text:"Orange - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,30,0)}},redtopurple:{text:"Red - Purple",getPalette:function(t,e){return L.Palettes.huePalette(t,e,360,270)}},bluetored:{text:"Blue - Red",getPalette:function(t,e){return L.Palettes.huePalette(t,e,210,360)}},bluetored2:{text:"Blue - Red 2",getPalette:function(t,e){return L.Palettes.huePalette(t,e,180,0)}},whitetored:{text:"White - Red",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:0})}},whitetoorange:{text:"White - Orange",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:30})}},whitetoyellow:{text:"White - Yellow",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:60})}},whitetogreen:{text:"White - Green",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:120})}},whitetoltblue:{text:"White - Lt. Blue",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:180})}},whitetoblue:{text:"White - Blue",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:240})}},whitetopurple:{text:"White - Purple",getPalette:function(t,e){return L.Palettes.luminosityPalette(t,e,1,.5,{outputHue:270})}},graytored:{text:"Gray - Red",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:0})}},graytoorange:{text:"Gray - Orange",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:30})}},graytoyellow:{text:"Gray - Yellow",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:60})}},graytogreen:{text:"Gray - Green",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:120})}},graytoltblue:{text:"Gray - Lt. Blue",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:180})}},graytoblue:{text:"Gray - Blue",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:240})}},graytopurple:{text:"Gray - Purple",getPalette:function(t,e){return L.Palettes.saturationPalette(t,e,0,1,{outputHue:270})}}},L.DynamicPaletteElement=L.Class.extend({initialize:function(t,e){this._key=t,this._dynamicPalette=e},generate:function(t){var e=L.DomUtil.create("div","palette"),i=t.count,n=this._dynamicPalette.getPalette(0,i-1),a=t.width,o=!0;void 0!=t.showText&&(o=t.showText),e.setAttribute("data-palette-key",this._key),this._dynamicPalette.text&&o&&(L.DomUtil.create("div","palette-text",e).innerHTML=''+this._dynamicPalette.text);var r=a/i;t.className&&L.DomUtil.addClass(e,t.className);for(var s=0;i>s;++s){var s=L.DomUtil.create("i","palette-element");for(var f in n){var d=n[f],c=d.evaluate?d.evaluate(s):d;L.StyleConverter.setCSSProperty(s,f,c)}s.style.width=r+"px",e.appendChild(s)}return e}}),L.Path.XLINK_NS="http://www.w3.org/1999/xlink";var TextFunctions=TextFunctions||{__updatePath:L.Path.prototype._updatePath,_updatePath:function(){this.__updatePath.call(this),this.options.text&&this._createText(this.options.text)},_initText:function(){this.options.text&&this._createText(this.options.text)},getTextAnchor:function(){return this._point?this._point:void 0},setTextAnchor:function(t){this._text&&(this._text.setAttribute("x",t.x),this._text.setAttribute("y",t.y))},_createText:function(t){this._text&&this._container.removeChild(this._text),this._pathDef&&this._defs.removeChild(this._pathDef);var e=function(t,e){var i="";for(var n in e)i+=n+": "+e[n]+";";return t.setAttribute("style",i),t},i=function(t,e){for(var i in e)t.setAttribute(i,e[i]);return t};this._text=this._createElement("text");var n=document.createTextNode(t.text);if(t.path){var a=t.path,o=L.Util.guid(),r=this._createElement("path");r.setAttribute("d",this._path.getAttribute("d")),r.setAttribute("id",o),this._defs||(this._defs=this._createElement("defs"),this._container.appendChild(this._defs)),this._defs.appendChild(r),this._pathDef=r;var s=this._createElement("textPath");a.startOffset&&s.setAttribute("startOffset",a.startOffset),a.attr&&i(s,a.attr),a.style&&e(s,a.style),s.setAttributeNS(L.Path.XLINK_NS,"xlink:href","#"+o),s.appendChild(n),this._text.appendChild(s)}else{this._text.appendChild(n);var f=this.getTextAnchor();this.setTextAnchor(f)}t.className?this._text.setAttribute("class",t.className):this._text.setAttribute("class","leaflet-svg-text"),t.attr&&i(this._text,t.attr),t.style&&e(this._text,t.style),this._container.appendChild(this._text)}},PathFunctions=PathFunctions||{__updateStyle:L.Path.prototype._updateStyle,_createDefs:function(){this._defs=this._createElement("defs"),this._container.appendChild(this._defs)},_createGradient:function(t){this._defs||this._createDefs(),this._gradient&&this._defs.removeChild(this._gradient);var e=this._createElement("linearGradient"),i=L.Util.guid();this._gradientGuid=i,t=t!==!0?L.extend({},t):{};var n=t.vector||[["0%","0%"],["100%","100%"]],a={x1:n[0][0],x2:n[1][0],y1:n[0][1],y2:n[1][1]};a.id="grad"+i;var o=t.stops||[{offset:"0%",style:{color:"rgb(255, 255, 255)",opacity:1}},{offset:"60%",style:{color:this.options.fillColor||this.options.color,opacity:1}}];for(var r in a)e.setAttribute(r,a[r]);for(var s=0;s0?f[0]:"circle";r[d].fill="url(#"+e+")";var c=this._createShape(d,r[d]);this.options.clickable&&c.setAttribute("class","leaflet-clickable"),s.id=e,s.patternUnits=s.patternUnits||"objectBoundingBox";var l=this._createPattern(s),t=t.image||{width:a.x,height:a.y,x:0,y:0,url:this.options.imageCircleUrl},u=this._createImage(t);u.setAttributeNS(L.Path.XLINK_NS,"xlink:href",t.url),l.appendChild(u),this._defs.appendChild(l),this._container.insertBefore(c,this._defs),this._shape=c},_updateStyle:function(){this.__updateStyle.call(this),this.options.stroke&&(this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)),this.options.gradient?(this._createGradient(this.options.gradient),this._path.setAttribute("fill","url(#"+this._gradient.getAttribute("id")+")")):this.options.fill||this._path.setAttribute("fill","none"),this.options.dropShadow?(this._createDropShadow(),this._path.setAttribute("filter","url(#"+this._dropShadow.getAttribute("id")+")")):this._path.removeAttribute("filter"),this.options.fillPattern&&this._createFillPattern(this.options.fillPattern),this._applyCustomStyles()}},LineTextFunctions=L.extend({},TextFunctions);LineTextFunctions.__updatePath=L.Polyline.prototype._updatePath,LineTextFunctions.getCenter=function(){var t,e,i,n,a,o,r=this._latlngs,s=r.length;for(t=0,e=s-1,area=0,lat=0,lng=0;s>t;e=t++)i=r[t],n=r[e],a=i.lat*n.lng-n.lat*i.lng,lat+=(i.lat+n.lat)*a,lng+=(i.lng+n.lng)*a,area+=a/2;return o=area?new L.LatLng(lat/(6*area),lng/(6*area)):r[0],o.area=area,o},LineTextFunctions.getTextAnchor=function(){var t=this.getCenter();return this._map.latLngToLayerPoint(t)},L.Polyline.include(LineTextFunctions),L.CircleMarker.include(TextFunctions),L.Path.include(PathFunctions),L.Polygon.include(PathFunctions),L.Polyline.include(PathFunctions),L.CircleMarker.include(PathFunctions),L.CircleMarker=L.CircleMarker.extend({_applyCustomStyles:function(){(this.options.shapeImage||this.options.imageCircleUrl)&&this._createShapeImage(this.options.shapeImage)}}),L.Point.prototype.rotate=function(t,e){var i=this.distanceTo(e),n=t*L.LatLng.DEG_TO_RAD+Math.atan2(this.y-e.y,this.x-e.x);this.x=e.x+i*Math.cos(n),this.y=e.y+i*Math.sin(n)},L.MapMarker=L.Path.extend({includes:TextFunctions,initialize:function(t,e){L.Path.prototype.initialize.call(this,e),this._latlng=t},options:{fill:!0,fillOpacity:1,opacity:1,radius:15,innerRadius:5,position:{x:0,y:0},rotation:0,numberOfSides:50,color:"#000000",fillColor:"#0000FF",weight:1,gradient:!0,dropShadow:!0,clickable:!0},setLatLng:function(t){return this._latlng=t,this.redraw()},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._points=this._getPoints(),this.options.innerRadius>0&&(this._innerPoints=this._getPoints(!0).reverse())},getBounds:function(){var t=this._map,e=3*this.options.radius,i=t.project(this._latlng),n=new L.Point(i.x-this.options.radius,i.y),a=new L.Point(i.x+this.options.radius,i.y-e),o=t.unproject(n),r=t.unproject(a);return new L.LatLngBounds(o,r)},getLatLng:function(){return this._latlng},getPathString:function(){var t=this.getTextAnchor();return this._shape&&("circle"===this._shape.tagName?(this._shape.setAttribute("cx",t.x),this._shape.setAttribute("cy",t.y)):(this._shape.setAttribute("x",t.x),this._shape.setAttribute("y",t.y))),this._path.setAttribute("shape-rendering","geometricPrecision"),new L.SVGPathBuilder(this._points,this._innerPoints).build(6)},getTextAnchor:function(){return new L.Point(this._point.x,this._point.y-2*this.options.radius)},_getPoints:function(t){var e,i,n=t?360:210,a=t?n/Math.max(this.options.numberOfSides,3):n/50,o=t?n+this.options.rotation:n,r=t?this.options.rotation:-30,s=[],f=this.options.radius,d=Math.sqrt(.75),c=function(t){return t*L.LatLng.DEG_TO_RAD},l=this._point;for(t||(s.push(l),s.push(new L.Point(l.x+d*f,l.y-1.5*f)));o>r;)i=c(r),e=this._getPoint(i,f,t),s.push(e),r+=a;return t||s.push(new L.Point(l.x-d*f,l.y-1.5*f)),s},_getPoint:function(t,e,i){var n=e;return e=i?this.options.innerRadius:e,new L.Point(this._point.x+this.options.position.x+e*Math.cos(t),this._point.y-2*n+this.options.position.y-e*Math.sin(t))},_applyCustomStyles:function(){(this.options.shapeImage||this.options.imageCircleUrl)&&this._createShapeImage(this.options.shapeImage)}}),L.mapMarker=function(t,e){return new L.MapMarker(t,e)},L.RegularPolygonMarker=L.Path.extend({includes:TextFunctions,initialize:function(t,e){L.Path.prototype.initialize.call(this,e),this._latlng=t,this.options.numberOfSides=Math.max(this.options.numberOfSides,3)},options:{fill:!0,radiusX:10,radiusY:10,rotation:0,numberOfSides:3,position:{x:0,y:0},maxDegrees:360,gradient:!0,dropShadow:!1,clickable:!0},setLatLng:function(t){return this._latlng=t,this.redraw()},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._points=this._getPoints(),(this.options.innerRadius||this.options.innerRadiusX&&this.options.innerRadiusY)&&(this._innerPoints=this._getPoints(!0).reverse())},getBounds:function(){var t=this._map,e=this.options.radius||this.options.radiusX,i=this.options.radius||this.options.radiusY,n=e*Math.cos(Math.PI/4),a=i*Math.sin(Math.PI/4),o=t.project(this._latlng),r=new L.Point(o.x-n,o.y+a),s=new L.Point(o.x+n,o.y-a),f=t.unproject(r),d=t.unproject(s);return new L.LatLngBounds(f,d)},getLatLng:function(){return this._latlng},getPathString:function(){this._path.setAttribute("shape-rendering","geometricPrecision");var t=this.getTextAnchor();return this._shape&&("circle"===this._shape.tagName?(this._shape.setAttribute("cx",t.x),this._shape.setAttribute("cy",t.y)):(this._shape.setAttribute("x",t.x),this._shape.setAttribute("y",t.y))),new L.SVGPathBuilder(this._points,this._innerPoints).build(6)},_getPoints:function(t){for(var e,i,n=this.options.maxDegrees||360,a=n/Math.max(this.options.numberOfSides,3),o=n,r=0,s=[],f=t?this.options.innerRadius||this.options.innerRadiusX:this.options.radius||this.options.radiusX,d=t?this.options.innerRadius||this.options.innerRadiusY:this.options.radius||this.options.radiusY,c=function(t){return t*L.LatLng.DEG_TO_RAD};o>r;)i=c(r),e=this._getPoint(i,f,d),s.push(e),r+=a;return s},_getPoint:function(t,e,i){var n=this.options.position?this._point.add(new L.Point(this.options.position.x,this.options.position.y)):this._point,a=new L.Point(n.x+e*Math.cos(t),n.y+i*Math.sin(t));return a.rotate(this.options.rotation,n),a},_getDefaultDiameter:function(t){var e=Math.PI/this.options.numberOfSides,i=t*Math.cos(e);return 1.75*i},_applyCustomStyles:function(){(this.options.shapeImage||this.options.imageCircleUrl)&&this._createShapeImage(this.options.shapeImage)}}),L.regularPolygonMarker=function(t,e){return new L.RegularPolygonMarker(t,e)},L.StarMarker=L.RegularPolygonMarker.extend({options:{numberOfPoints:5,rotation:-15,maxDegrees:360,gradient:!0,dropShadow:!0},_getPoints:function(t){for(var e,i,n,a=this.options.maxDegrees||360,o=a/this.options.numberOfPoints,r=a,s=0,f=[],d=t?this.options.innerRadius||this.options.innerRadiusX:this.options.radius||this.options.radiusX,c=t?this.options.innerRadius||this.options.innerRadiusY:this.options.radius||this.options.radiusY,l=function(t){return t*L.LatLng.DEG_TO_RAD};r>s;)n=l(s),e=this._getPoint(n,d,c),i=this._getPoint(n+l(o)/2,d/2,c/2),f.push(e),f.push(i),s+=o;return f}}),L.starMarker=function(t,e){return new L.StarMarker(t,e)},L.TriangleMarker=L.RegularPolygonMarker.extend({options:{numberOfSides:3,rotation:30,radius:5}}),L.triangleMarker=function(t,e){return new L.TriangleMarker(t,e)},L.DiamondMarker=L.RegularPolygonMarker.extend({options:{numberOfSides:4,radiusX:5,radiusY:10}}),L.diamondMarker=function(t,e){return new L.DiamondMarker(t,e)},L.SquareMarker=L.RegularPolygonMarker.extend({options:{numberOfSides:4,rotation:45,radius:5}}),L.squareMarker=function(t,e){return new L.SquareMarker(t,e)},L.PentagonMarker=L.RegularPolygonMarker.extend({options:{numberOfSides:5,rotation:-18,radius:5}}),L.pentagonMarker=function(t,e){return new L.PentagonMarker(t,e)},L.HexagonMarker=L.RegularPolygonMarker.extend({options:{numberOfSides:6,rotation:30,radius:5}}),L.hexagonMarker=function(t,e){return new L.HexagonMarker(t,e)},L.OctagonMarker=L.RegularPolygonMarker.extend({options:{numberOfSides:8,rotation:22.5,radius:5}}),L.octagonMarker=function(t,e){return new L.OctagonMarker(t,e)},L.SVGMarker=L.Path.extend({initialize:function(t,e){L.Path.prototype.initialize.call(this,e),this._svg=e.svg,0===this._svg.indexOf("<")&&(this._data=this._svg),this._latlng=t},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng)},setLatLng:function(t){this._latlng=t,this.redraw()},getLatLng:function(){return this._latlng},getPathString:function(){var t=this,e=function(){for(var e=t._path.parentNode;"g"!==e.nodeName.toLowerCase();)e=e.parentNode;t.options.clickable&&e.setAttribute("class","leaflet-clickable");var i=t._data,n="svg"===i.nodeName.toLowerCase()?i.cloneNode(!0):i.querySelector("svg").cloneNode(!0);t.options.setStyle&&t.options.setStyle.call(t,n);var a=n.getAttribute("width"),o=n.getAttribute("height"),r=a?a.replace("px",""):"100%",s=o?o.replace("px",""):"100%";"100%"===r&&(r=t.options.size.x,s=t.options.size.y,n.setAttribute("width",r+(-1!==String(r).indexOf("%")?"":"px")),n.setAttribute("height",s+(-1!==String(s).indexOf("%")?"":"px")));var f=t.options.size||new L.Point(r,s),d=new L.Point(f.x/r,f.y/s),c=e.getElementsByTagName("svg");c.length>0&&c[0].parentNode.removeChild(c[0]),e.appendChild(n);var l=[],u=t.options.anchor||new L.Point(-f.x/2,-f.y/2),h=t._point.x+u.x,b=t._point.y+u.y;l.push("translate("+h+" "+b+")"),l.push("scale("+d.x+" "+d.y+")"),t.options.rotation&&l.push("rotate("+t.options.rotation+" "+r/2+" "+s/2+")"),e.setAttribute("transform",l.join(" "))};if(this._data)e();else{var i=new XMLHttpRequest;i.onreadystatechange=function(){4==this.readyState&&200==this.status&&(t._data=this.responseXML,e())},i.open("GET",this._svg,!0),i.send(null)}}}),L.MarkerGroup=L.FeatureGroup.extend({initialize:function(t,e){L.FeatureGroup.prototype.initialize.call(this,e),this.setLatLng(t)},setLatLng:function(t){return this._latlng=t,this.eachLayer(function(e){e.setLatLng&&e.setLatLng(t)}),this},getLatLng:function(){return this._latlng}}),L.BarMarker=L.Path.extend({initialize:function(t,e){L.Path.prototype.initialize.call(this,e),this._latlng=t},options:{fill:!0,width:2,maxHeight:10,position:{x:0,y:0},weight:1,color:"#000",opacity:1,gradient:!0,dropShadow:!1,lineCap:"square",lineJoin:"miter"},setLatLng:function(t){return this._latlng=t,this.redraw()},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._points=this._getPoints()},getBounds:function(){var t=this._map,e=t.project(this._latlng),i=this.options.width/2,n=new L.Point(e.x-i,e.y),a=new L.Point(e.x+i,e.y-this.options.maxHeight),o=t.unproject(n),r=t.unproject(a);return new L.LatLngBounds(o,r)},getLatLng:function(){return this._latlng},getPathString:function(){return this._path.setAttribute("shape-rendering","crispEdges"),new L.SVGPathBuilder(this._points).build()},_getPoints:function(){var t,e,i,n,a=[],o=this._point.x+this.options.position.x,r=this._point.y+this.options.position.y,s=this.options.width/2,f=this.options.value/this.options.maxValue*this.options.maxHeight;return t=new L.Point(o+s,r),e=new L.Point(o+s,r-f),i=new L.Point(o-s,r-f),n=new L.Point(o-s,r),a=[t,e,i,n]}}),L.barMarker=function(t,e){return new L.BarMarker(t,e)},L.ChartMarker=L.FeatureGroup.extend({initialize:function(t,e){L.Util.setOptions(this,e),this._layers={},this._latlng=t,this._loadComponents()},setLatLng:function(t){return this._latlng=t,this.redraw()},getLatLng:function(){return this._latlng},_loadComponents:function(){},_highlight:function(t){return t.weight&&(t.weight*=2),t},_unhighlight:function(t){return t.weight&&(t.weight/=2),t},_bindMouseEvents:function(t){var e=this,i=this.options.tooltipOptions;t.on("mouseover",function(t){var n,a=this.options,o=a.key,r=a.value,s=t.layerPoint,f=s.x-this._point.x,d=s.y-this._point.y,c=a.iconSize,l=f,u=d,h=5;l=0>f?c.x-f+h:-f-h,u=0>d?c.y-d+h:-d-h,n=new L.Point(l,u);var b={},p=a.displayText?a.displayText(r):r;b[o]={name:a.displayName,value:p};var g=new L.LegendIcon(b,a,{className:"leaflet-div-icon",iconSize:i?i.iconSize:c,iconAnchor:n});a.marker=new L.Marker(e._latlng,{icon:g}),a=e._highlight(a),this.initialize(e._latlng,a),this.redraw(),this.setStyle(a),e.addLayer(a.marker)}),t.on("mouseout",function(){var t=this.options;t=e._unhighlight(t),this.initialize(e._latlng,t),this.redraw(),this.setStyle(t),e.removeLayer(t.marker)})},bindPopup:function(t,e){this.eachLayer(function(i){i.bindPopup(t,e)})},openPopup:function(t){for(var e in this._layers){var i=this._layers[e];t=t||this._latlng,i.openPopup(t);break}},closePopup:function(){for(var t in this._layers){var e=this._layers[t];latlng=latlng||this._latlng,e.closePopup();break}},redraw:function(){this.clearLayers(),this._loadComponents()}}),L.BarChartMarker=L.ChartMarker.extend({initialize:function(t,e){L.Util.setOptions(this,e),L.ChartMarker.prototype.initialize.call(this,t,e)},options:{weight:1,opacity:1,color:"#000",fill:!0,position:{x:0,y:0},width:10,offset:0,iconSize:new L.Point(50,40)},_loadComponents:function(){var t,e,i,n,a,o,r,s=this.options,f=Object.keys(this.options.data),d=f.length,c=this.options.width,l=this.options.offset||0,u=this.options.data,h=this.options.chartOptions;a=-(c*d+l*(d-1))/2+c/2,o=0;for(var b in u)t=u[b],r=h[b],e=r.minValue||0,i=r.maxValue||100,s.fillColor=r.fillColor||this.options.fillColor,s.value=t,s.minValue=e,s.maxValue=i,s.position={x:a,y:o},s.width=c,s.maxHeight=r.maxHeight||10,s.key=b,s.value=t,s.displayName=r.displayName,s.opacity=this.options.opacity||1,s.fillOpacity=this.options.fillOpacity||.7,s.weight=this.options.weight||1,s.color=r.color||this.options.color,s.displayText=r.displayText,n=new L.BarMarker(this._latlng,s),this._bindMouseEvents(n),this.addLayer(n),a+=c+l}}),L.RadialBarMarker=L.Path.extend({initialize:function(t,e){L.Path.prototype.initialize.call(this,e),this._latlng=t},options:{fill:!0,radius:10,rotation:0,numberOfSides:30,position:{x:0,y:0},gradient:!0,dropShadow:!1},setLatLng:function(t){return this._latlng=t,this.redraw()},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._points=this._getPoints()},getBounds:function(){var t=this._map,e=this.options.radiusX||this.options.radius,i=this.options.radiusY||this.options.radius,n=e*Math.cos(Math.PI/4),a=i*Math.sin(Math.PI/4),o=t.project(this._latlng),r=new L.Point(o.x-n,o.y+a),s=new L.Point(o.x+n,o.y-a),f=t.unproject(r),d=t.unproject(s);return new L.LatLngBounds(f,d)},getLatLng:function(){return this._latlng},getPathString:function(){var t=this.options.endAngle-this.options.startAngle,e=t>=180?"1":"0",i=this.options.radiusX||this.options.radius,n=this.options.radiusY||this.options.radius,a="M"+this._points[0].x.toFixed(2)+","+this._points[0].y.toFixed(2)+"A"+i.toFixed(2)+","+n.toFixed(2)+" 0 "+e+",1 "+this._points[1].x.toFixed(2)+","+this._points[1].y.toFixed(2)+"L";return this._innerPoints?(a=a+this._innerPoints[0].x.toFixed(2)+","+this._innerPoints[0].y.toFixed(2),a=a+"A"+(i-this.options.barThickness).toFixed(2)+","+(n-this.options.barThickness).toFixed(2)+" 0 "+e+",0 "+this._innerPoints[1].x.toFixed(2)+","+this._innerPoints[1].y.toFixed(2)+"z"):a=a+this._point.x.toFixed(2)+","+this._point.y.toFixed(2)+"z",L.Browser.vml&&(a=Core.SVG.path(a)),this._path.setAttribute("shape-rendering","geometricPrecision"),a},_getPoints:function(){var t=this.options.endAngle-this.options.startAngle,e=this.options.endAngle+this.options.rotation,i=this.options.startAngle+this.options.rotation,n=[],a="radiusX"in this.options?this.options.radiusX:this.options.radius,o="radiusY"in this.options?this.options.radiusY:this.options.radius,r=function(t){return t*L.LatLng.DEG_TO_RAD};360===t&&(e-=.1);var s=r(i),f=r(e);return n.push(this._getPoint(s,a,o)),n.push(this._getPoint(f,a,o)),this.options.barThickness&&(this._innerPoints=[],this._innerPoints.push(this._getPoint(f,a-this.options.barThickness,o-this.options.barThickness)),this._innerPoints.push(this._getPoint(s,a-this.options.barThickness,o-this.options.barThickness))),n},_getPoint:function(t,e,i){return new L.Point(this._point.x+this.options.position.x+e*Math.cos(t),this._point.y+this.options.position.y+i*Math.sin(t))}}),L.radialBarMarker=function(t,e){return new L.RadialBarMarker(t,e)},L.PieChartMarker=L.ChartMarker.extend({initialize:function(t,e){L.Util.setOptions(this,e),L.ChartMarker.prototype.initialize.call(this,t,e)},options:{weight:1,opacity:1,color:"#000",fill:!0,radius:10,rotation:0,numberOfSides:50,mouseOverExaggeration:1.2,maxDegrees:360,iconSize:new L.Point(50,40)},_highlight:function(t){var e=t.radiusX,i=t.radiusY,n=t.barThickness;return t.oldBarThickness=n,t.oldRadiusX=e,t.oldRadiusY=i,t.radiusX*=t.mouseOverExaggeration,t.radiusY*=t.mouseOverExaggeration,t.barThickness=t.radiusX-e+n,t},_unhighlight:function(t){return t.radiusX=t.oldRadiusX,t.radiusY=t.oldRadiusY,t.barThickness=t.oldBarThickness,t},_loadComponents:function(){var t,e,i,n,a=0,o=0,r=0,s=this.options.maxDegrees||360,f=this.options.rotation,d=this.options,c=this.options.data,l=this.options.chartOptions,u=function(t,e){var i=0;return t[e]&&(i=parseFloat(t[e])),i};for(n in c)t=u(c,n),a+=t;if(a>0)for(n in c)t=parseFloat(c[n]),i=l[n],r=t/a,o=r*s,d.startAngle=f,d.endAngle=f+o,d.fillColor=i.fillColor,d.color=i.color||"#000",d.radiusX=this.options.radiusX||this.options.radius,d.radiusY=this.options.radiusY||this.options.radius,d.rotation=0,d.key=n,d.value=t,d.displayName=i.displayName,d.displayText=i.displayText,e=new L.RadialBarMarker(this._latlng,d),this._bindMouseEvents(e),f=d.endAngle,this.addLayer(e)}}),L.pieChartMarker=function(t,e){return new L.PieChartMarker(t,e)},L.CoxcombChartMarker=L.PieChartMarker.extend({statics:{SIZE_MODE_RADIUS:"radius",SIZE_MODE_AREA:"area"}}),L.CoxcombChartMarker=L.CoxcombChartMarker.extend({initialize:function(t,e){L.Util.setOptions(this,e),L.PieChartMarker.prototype.initialize.call(this,t,e)},options:{weight:1,opacity:1,color:"#000",fill:!0,radius:10,rotation:0,numberOfSides:50,mouseOverExaggeration:1.2,maxDegrees:360,iconSize:new L.Point(50,40),sizeMode:L.CoxcombChartMarker.SIZE_MODE_AREA},_loadComponents:function(){var t,e,i,n,a,o=0,r=this.options.maxDegrees||360,s=this.options.rotation,f=this.options,d="radiusX"in this.options?this.options.radiusX:this.options.radius,c="radiusY"in this.options?this.options.radiusY:this.options.radius,l=Object.keys(this.options.data),u=l.length,h=this.options.data,b=this.options.chartOptions;o=r/u;for(var p in h){t=parseFloat(h[p]),a=b[p];var e=a.minValue||0,i=a.maxValue;if(this.options.sizeMode===L.CoxcombChartMarker.SIZE_MODE_RADIUS){var g=new L.LinearFunction(new L.Point(e,0),new L.Point(i,d)),_=new L.LinearFunction(new L.Point(e,0),new L.Point(i,c));f.radiusX=g.evaluate(t),f.radiusY=_.evaluate(t)}else{var y=Math.max(d,c),m=Math.PI*Math.pow(y,2)/u,P=new L.LinearFunction(new L.Point(e,0),new L.Point(i,m),{postProcess:function(t){return Math.sqrt(u*t/Math.PI)}});f.radiusX=P.evaluate(t),f.radiusY=f.radiusX}f.startAngle=s,f.endAngle=s+o,f.fillColor=a.fillColor,f.color=a.color||"#000",f.rotation=0,f.key=p,f.value=t,f.displayName=a.displayName,f.displayText=a.displayText,n=new L.RadialBarMarker(this._latlng,f),this._bindMouseEvents(n),s=f.endAngle,this.addLayer(n)}}}),L.coxcombChartMarker=function(t,e){return new L.CoxcombChartMarker(t,e)},L.RadialBarChartMarker=L.ChartMarker.extend({initialize:function(t,e){L.Util.setOptions(this,e),L.ChartMarker.prototype.initialize.call(this,t,e)},options:{weight:1,opacity:1,color:"#000",fill:!0,radius:10,rotation:0,numberOfSides:30,offset:2,barThickness:5,maxDegrees:360,iconSize:new L.Point(50,40)},_loadComponents:function(){var t,e,i,n,a,o=this.options.rotation,r=this.options.maxDegrees||360,s=this.options,f=this.options.radiusX||this.options.radius,d=this.options.radiusY||this.options.radius,c=this.options.data,l=this.options.chartOptions,u=this.options.barThickness||4,h=this.options.offset||2;for(var b in c){t=parseFloat(c[b]),a=l[b],e=a.minValue||0,i=a.maxValue||100;var p=new L.LinearFunction(new L.Point(e,0),new L.Point(i,r));o=p.evaluate(t),s.startAngle=this.options.rotation,s.endAngle=this.options.rotation+o,s.fillColor=a.fillColor,s.radiusX=f,s.radiusY=d,s.barThickness=u,s.rotation=0,s.key=b,s.value=t,s.displayName=a.displayName,s.displayText=a.displayText,s.weight=this.options.weight||1,n=new L.RadialBarMarker(this._latlng,s),this._bindMouseEvents(n),this.addLayer(n),f+=u+h,d+=u+h}}}),L.radialBarChartMarker=function(t,e){return new L.RadialBarChartMarker(t,e)},L.StackedRegularPolygonMarker=L.ChartMarker.extend({options:{iconSize:new L.Point(50,40)},initialize:function(t,e){L.Util.setOptions(this,e),L.ChartMarker.prototype.initialize.call(this,t,e)},_loadComponents:function(){var t,e,i,n,a=0,o=0,r=this.options,s=this.options.data,f=this.options.chartOptions;for(n in s){t=parseFloat(s[n]),i=f[n],minValue=i.minValue||0,maxValue=i.maxValue||100,minRadius=i.minRadius||0,maxRadius=i.maxRadius||10,r.fillColor=i.fillColor||this.options.fillColor,r.value=t,r.minValue=minValue,r.maxValue=maxValue;var d=new L.LinearFunction(new L.Point(minValue,minRadius),new L.Point(maxValue,maxRadius)),c=d.evaluate(t);r.radiusX=a+c,r.radiusY=o+c,r.innerRadiusX=a,r.innerRadiusY=o,r.key=n,r.displayName=i.displayName,r.opacity=this.options.opacity||1,r.fillOpacity=this.options.fillOpacity||.7,r.weight=this.options.weight||1,r.color=i.color||this.options.color,r.displayText=i.displayText,e=new L.RegularPolygonMarker(this._latlng,r),this._bindMouseEvents(e),a=r.radiusX,o=r.radiusY,this.addLayer(e)}}}),L.RadialMeterMarker=L.ChartMarker.extend({initialize:function(t,e){L.Util.setOptions(this,e),L.ChartMarker.prototype.initialize.call(this,t,e)},options:{weight:1,opacity:1,color:"#000",fill:!0,radius:10,rotation:180,numberOfSides:30,offset:2,barThickness:5,maxDegrees:180,iconSize:new L.Point(50,40),backgroundStyle:{fill:!0,fillColor:"#707070",fillOpacity:.2,opacity:.8,color:"#505050"}},_loadComponents:function(){var t,e,i,n,a,o,r=this.options.rotation,s=this.options.maxDegrees||360,f=this.options,d=this.options.radiusX||this.options.radius,c=this.options.radiusY||this.options.radius,l=this.options.data,u=this.options.chartOptions,h=this.options.barThickness||4,b=r,p=this.options.numSegments||10,g=s/p;for(var _ in l){t=parseFloat(l[_]),a=u[_],o=this.options.displayOptions?this.options.displayOptions[_]:{},e=a.minValue||0,i=a.maxValue||100;for(var y=i-e,m=s/y*(t-e),P=r+m,x=r+s,v=new L.LinearFunction(new L.Point(r,e),new L.Point(x,i));P>b;){f.startAngle=b;var w=Math.min(g,P-b);f.endAngle=b+w,f.fillColor=a.fillColor,f.radiusX=d,f.radiusY=c,f.barThickness=h,f.rotation=0,f.key=_,f.value=t,f.displayName=a.displayName,f.displayText=a.displayText;var C=v.evaluate(b+w);for(var S in o)f[S]=o[S].evaluate?o[S].evaluate(C):o[S];n=new L.RadialBarMarker(this._latlng,f),this._bindMouseEvents(n),this.addLayer(n),b+=w}if(this.options.backgroundStyle&&x>b){var w=x-b;f.endAngle=b+w,f.radiusX=d,f.radiusY=c,f.barThickness=h,f.rotation=0,f.key=_,f.value=t,f.displayName=a.displayName,f.displayText=a.displayText,f.fillColor=null,f.fill=!1,f.gradient=!1;for(var M in this.options.backgroundStyle)f[M]=this.options.backgroundStyle[M];var C=v.evaluate(b+w);n=new L.RadialBarMarker(this._latlng,f),this.addLayer(n)}}}}); \ No newline at end of file diff --git a/folium/templates/tile_layer.js b/folium/templates/tile_layer.js index 91774fd36..3e700a4da 100644 --- a/folium/templates/tile_layer.js +++ b/folium/templates/tile_layer.js @@ -1 +1,10 @@ -var {{ tile_name }} = L.tileLayer('{{ tile_url }}'); \ No newline at end of file +var {{ tile_name }} = L.tileLayer('{{ tile_url }}',{ + 'minZoom': {{minZoom}}, + 'maxZoom': {{maxZoom}}, + 'tms': {{tms}}, + 'continuousWorld': {{continuousWorld}}, + 'noWrap': {{noWrap}}, + 'zoomOffset': {{zoomOffset}}, + 'zoomReverse': {{zoomReverse}}, + 'opacity': {{opacity}} + }); \ No newline at end of file diff --git a/tests/folium_tests.py b/tests/folium_tests.py index 123aa3e91..acfd975d7 100644 --- a/tests/folium_tests.py +++ b/tests/folium_tests.py @@ -138,6 +138,41 @@ def test_wms_layer(self): 'wms_transparent': 'true'}) assert map.template_vars['wms_layers'][0] == wms + def test_add_tile_layer(self): + """Test add_layer URLs.""" + + map = folium.Map(location=[44, -73], zoom_start=3) + tile_name = "Temperature" + tile_url = 'http://gis.srh.noaa.gov/arcgis/services/NDFDTemps/' + tile_url += 'MapServer/WMSServer' + minZoom = 1 + maxZoom = 5 + tms = True + continuousWorld = False + noWrap = True + zoomOffset = 1 + zoomReverse = True + opacity = 2 + map.add_tile_layer(tile_name=tile_name, tile_url=tile_url, active=True, + minZoom=minZoom, maxZoom=maxZoom, tms=tms, + continuousWorld=continuousWorld, noWrap=noWrap, + zoomOffset=zoomOffset, zoomReverse=zoomReverse, + opacity=opacity, attribution='Leaflet') + tile_temp = self.env.get_template('tile_layer.js') + tile = tile_temp.render({ + 'tile_name': tile_name, + 'tile_url': tile_url, + 'minZoom': minZoom, + 'maxZoom': maxZoom, + 'tms': str(tms).lower(), + 'continuousWorld': str(continuousWorld).lower(), + 'noWrap': str(noWrap).lower(), + 'zoomOffset': zoomOffset, + 'zoomReverse': str(zoomReverse).lower(), + 'opacity': opacity, + }) + assert map.template_vars['tile_layers'][0] == tile + def test_simple_marker(self): """Test simple marker addition."""