From efd56c88c0b51ac6df9bfef6fbc387d779e46a62 Mon Sep 17 00:00:00 2001 From: Scott Fairgrieve Date: Wed, 14 May 2014 14:48:31 -0400 Subject: [PATCH] Added convenience methods for setting basic marker options (issue #7). Moved all of the documentation from the README to the wiki --- README.md | 768 +------------------------------- dist/leaflet-dvf.js | 48 ++ dist/leaflet-dvf.markers.js | 48 ++ dist/leaflet-dvf.markers.min.js | 4 +- dist/leaflet-dvf.min.js | 7 +- examples/html/sparklines.html | 5 +- src/leaflet.dvf.datalayer.js | 6 +- src/leaflet.dvf.markers.js | 59 +++ src/leaflet.dvf.palettes.js | 5 +- src/leaflet.dvf.utils.js | 3 + 10 files changed, 180 insertions(+), 773 deletions(-) diff --git a/README.md b/README.md index 136b7da..d55f4df 100644 --- a/README.md +++ b/README.md @@ -2,773 +2,13 @@ ## Overview -The Leaflet DVF is an extension to [CloudMade][]'s [Leaflet][] JavaScript mapping library. -The primary goal of the framework is to simplify data visualization and thematic mapping. +The Leaflet DVF is an extension to the [Leaflet][] JavaScript mapping library. +The primary goal of the framework is to simplify data visualization and thematic mapping using Leaflet - making it easier to turn raw data into compelling maps. ![Overview](http://humangeo.github.com/leaflet-dvf/images/overview.png "Overview") ![Election Mapping](http://humangeo.github.com/leaflet-dvf/images/electionmapping.png "Election Mapping") ![Country Data](http://humangeo.github.com/leaflet-dvf/images/countrydata.png "Country Data") -It includes: +## Getting Started -New marker types (see the markers example below): - -* MapMarker - create an SVG-based map marker similar to Leaflet's image-based marker, but fully customizable via L.Path style properties -* RegularPolygonMarker - create N-sided shapes like triangles, squares, hexagons, etc. -* StarMarker - create stars with N points -* ChartMarkers - useful for displaying multiple data properties at each location: - * BarChartMarker - * PieChartMarker - * RadialBarChartMarker - * CoxcombChartMarker - * RadialMeterMarker - * StackedRegularPolygonMarker - a variation on the bar chart - * SparklineMarker - graph-based markers for illustrating time series and other x, y data in a geospatial context (Coming soon) - -Functions for easily mapping data properties to Leaflet style values: - -* LinearFunction -* Color functions: - * HSLHueFunction - vary the output hue based on a data property - * HSLSaturationFunction - vary the output saturation based on a data property - * HSLLuminosityFunction - vary the output lightness/luminosity based on a data property - * Various RGB functions - * Built-in support for [Colorbrewer](http://colorbrewer2.org) color scales -* PiecewiseFunction - use multiple LinearFunction classes in sequence (e.g. vary a color from white to yellow, yellow to red) -* CustomColorFunction - specify the specific color scale to use. Use L.ColorBrewer to specify Colorbrewer scales. - -New layer types that simplify reading and visualizing any JSON-based data structure: - -* DataLayer -* ChartDataLayer and corresponding DataLayer instances for various chart types -* ChoroplethDataLayer -* Others - -GeoJSON polygons for countries and US states to support Choropleth mapping. Countries are generated from: https://github.com/johan/world.geo.json. -Just include these JavaScript files if you plan to build a country or US state choropleth. -Polygons are indexed via a state or country code and lookups are created to map various state/country code formats to the default index format. - -Automatic legend generation and a simple legend control. -To generate a legend, just call getLegend on any DataLayer, or use the provided legend control and the legend will be displayed automatically. - -Support for gradient fills and drop shadows, text on Path-based items (e.g. markers, polylines, polygons, etc.), and more. - -Callouts for annotating map data. Use the L.Callout class to add individual callouts to your map. See the [Markers](http://humangeo.github.com/leaflet-dvf/examples/html/markers.html) example for an illustration of callouts. - -*NOTE: The dist folder includes a minified version of the full framework as well as a minified version of the code required to use the new markers* -*Use leaflet-dvf.markers.min.js if you want to use the new markers without the rest of the framework* - -## Pre-requisites - -Required: -* [Leaflet](http://leafletjs.com/) - -Optional - required for particular classes to work: -* [Underscore JS](http://underscorejs.org/) -* [Moment JS](http://momentjs.com/) -* [geohash.js](https://github.com/davetroy/geohash-js) -* [JavaScript Topology Suite (JSTS)](https://github.com/bjornharrtell/jsts) -* [Core Framework SVG Utilities](https://code.google.com/p/core-framework/source/browse/trunk/plugins/svg.js) *Required for full functionality in archaic browsers (see note below)* -* [TopoJSON](https://github.com/mbostock/topojson) *Recommended/required for US county lookups* - -Using the framework in IE8 and below: - -**Special thanks to Keith Chew of [e3solutions](http://www.e3solutions.net) for testing and getting things working in IE8 and below. This is still an on-going effort, so additional bug fixes may be forthcoming. The examples provided here may need some tweaking to work in IE8 and below** - -As you may or may not be aware, IE8 and below do not support SVG. Leaflet and most SVG frameworks mitigate this problem by using Vector Markup Language (VML) instead of SVG when rendering custom shapes and paths. -With the latest version of the framework, most of the components will work without requiring any extra dependencies. However, L.RadialBarChartMarker and L.PieChartMarker will require including the [Core Framework SVG Utilities](https://code.google.com/p/core-framework/source/browse/trunk/plugins/svg.js). These utilities can convert more complex SVG shapes into corresponding VML shapes. - -## Build - -Install [UglifyJS](https://github.com/mishoo/UglifyJS) and run build.sh in the build folder OR concatenate the source files in the following order: - -Full: -* src/copyright.js -* src/leaflet.dvf.linearfunctions.js -* src/leaflet.dvf.utils.js -* src/leaflet.dvf.palettes.js -* src/leaflet.dvf.regularpolygon.js -* src/leaflet.dvf.markers.js -* src/leaflet.dvf.chartmarkers.js -* src/leaflet.dvf.datalayer.js -* src/leaflet.dvf.lines.js -* src/leaflet.dvf.controls.js - -Markers only: -* src/copyright.js -* src/leaflet.dvf.linearfunctions.js -* src/leaflet.dvf.utils.js -* src/leaflet.dvf.palettes.js -* src/leaflet.dvf.markers.js -* src/leaflet.dvf.chartmarkers.js - -## Examples - -*NOTE: Most of these examples have multiple layers; use the layers control to see all of the layers* - -New Marker Types: -* [Markers](http://humangeo.github.com/leaflet-dvf/examples/html/markers.html) - -Proportional Symbol: -* [USGS Earthquakes](http://humangeo.github.com/leaflet-dvf/examples/html/earthquakes.html) -* [Meetup Finder](http://humangeo.github.com/leaflet-dvf/examples/html/meetups.html) *Zoom to an area of interest, put in a Meetup topic, and click the search button* -* [Weather](http://humangeo.github.com/leaflet-dvf/examples/html/weather.html) -* [Sochi Medal Count](http://humangeo.github.com/leaflet-dvf/examples/html/sochistats.html) - -Choropleth Mapping: -* [Color Functions](http://humangeo.github.com/leaflet-dvf/examples/html/colors.html) -* [Geohashes](http://humangeo.github.com/leaflet-dvf/examples/html/geohashes.html) - -Mix: -* [WorldBank and UN Data](http://humangeo.github.com/leaflet-dvf/examples/html/incomelevels.html) -* [Election 2012 Polling](http://humangeo.github.com/leaflet-dvf/examples/html/election2012.html) *Illustrates sizing pie charts by a data value* -* [2008 vs 2012 Election Results](http://humangeo.github.com/leaflet-dvf/examples/html/election2012results.html) -* [2008 Election Results](http://humangeo.github.com/leaflet-dvf/examples/html/uselectiondata.html) -* [Netherlands Population by ZIP 2](http://humangeo.github.com/leaflet-dvf/examples/html/nlzip.html) **Thanks to Steven De Schrijver of [Conundra](http://www.conundra.eu) for providing the example use case** - -Images: -* [Panoramio Browser](http://humangeo.github.com/leaflet-dvf/examples/html/panoramio.html) *NOTE: This is a work in progress but is mostly complete* - -Lines: -* [Napoleon's March](http://humangeo.github.com/leaflet-dvf/examples/html/minard.html) *Yet another variation of Charle's Minard's famous visualization that illustrates the use of the FlowLine class* -* [US Airports and Flight Data](http://humangeo.github.com/leaflet-dvf/examples/html/airports.html) *Illustrates using the L.Graph class for visualizing flights between airports* - -In Progress: -* [Sparklines](http://humangeo.github.com/leaflet-dvf/examples/html/sparklines.html) *NOTE: This is a work in progress. The code is incomplete and can be found in src/leaflet.dvf.experimental.js* -* [Run Map](http://humangeo.github.com/leaflet-dvf/examples/html/runmap.html) *NOTE: This is a work in progress. Illustrates using a WeightedPolyline to show variations in GPS data* -* [US County Statistics](http://humangeo.github.com/leaflet-dvf/examples/html/countystats.html) - -Tutorials coming soon to [HumanGeo](http://www.thehumangeo.com/)'s [blog](http://blog.thehumangeo.com) - -# Documentation - -> A work in progress ... - -## Basic Enhancements (New) - -> Two new optional properties have been added to the basic L.Path properties to enable for a gradient fill and drop shadow. For now, these properties are boolean values, but in the future, support might be added for fine-grained control over the appearance of gradients/drop shadows. - -#### Usage -```javascript -var layer = new (, { - // L.Path style options - ... - gradient: true, - dropShadow: true -}); - -var layer = new (, { - gradient: { - vector: [['0%', '50%'], ['100%', '50%']], - stops: [{ - offset: '0%', - style: { - color: '#ffffff', - opacity: 1 - } - }, { - offset: '50%', - style: { - color: '#ff0000', - opacity: 1 - } - }] - } -}); - -``` - -#### Options -Option | Type | Default | Description ---- | --- | --- | --- -gradient | Boolean OR Object | differs depending on the layer class (most new marker types use a gradient by default) | Specifying a value of true will fill the path with a gradient from white to the specified fillColor (top left - bottom right) -dropShadow | Boolean | false | Specifying a value of true will add a dropShadow to the path - -#### gradient Property Options -Option | Type | Default | Description ---- | --- | --- | --- -vector | Array | [['0%', '0%'], ['100%', '100%']] | an array consisting of a start and end point that defines the direction of the gradient. Each start and end point is an array of x and y values. Where x and y values can be percentage strings (e.g. '100%') or numbers defining an absolute position -stops | Array | | an array of stop objects defining the colors to be used in the gradient. Each stop object has offset and style properties. See below. - -#### stop Options -Option | Type | Default | Description ---- | --- | --- | --- -offset | String OR Number | | The position along the gradient at which to apply the given color/opacity -style | Object | { opacity: 1, color: } | an object with color and opacity properties defining the color and opacity to be used in the given stop. If you omit the color, the Path's fillColor or color will be used automatically. - -> You can also add text to any Path based item by passing in the a text option as part of the normal style options - -#### Usage -```javascript -var layer = new (, { - // L.Path style options - ... - text: { - text: , - attr: {}, - style: {, - attr: {}, - style: {} - } - } -}); -``` - -#### Text Options -Option | Type | Default | Description ---- | --- | --- | --- -text | String | null | The text to display -attr | Object| null | A set of key/value pairs that will be added as attributes to the created SVG text element (see the SVG spec for specifics) -style | Object | null | A set of key/value pairs that will be added to the style attribute for the created SVG text element (see the SVG spec for specific styles) -path | Object | null | This will cause the specified text to be displayed along the path (see options below) - -#### Path Options -Option | Type | Default | Description ---- | --- | --- | --- -startOffset | String | null | Percentage or absolute position along the path where text should start -attr | Object| null | A set of key/value pairs that will be added as attributes to the created SVG textPath element (see the SVG spec for specifics) -style | Object | null | A set of key/value pairs that will be added to the style attribute for the created SVG textPath element (see the SVG spec for specific styles) - -## Markers - -> The framework adds several new marker types geared towards dynamic data visualization. See the [Markers](http://humangeo.github.com/leaflet-dvf/examples/html/markers.html) example for an illustration of each of these markers. - -### L.MapMarker - -> Creates an SVG-based map marker, similar to the default Leaflet image-based marker but fully customizable using the basic L.Path properties - -Map Marker - -#### Usage -`L.MapMarker( LatLng, options?);` - -```javascript -var marker = new L.MapMarker(new L.LatLng(0, 0), { - radius: 10, - // L.Path style options - ... -}); - -map.addLayer(marker); -``` - -#### Options -Option | Type | Default | Description ---- | --- | --- | --- -numberOfSides | Number | 3 | If an inner radius is specified, then the marker will have a hole in center. This property determines the shape of the hole. -rotation | Number | 0 | If an inner radius is specified, this controls the rotation of the hole in the center. -radius OR radiusX, radiusY | Number | 10 | The radius of the circular part of the marker, also adjusts the height of the marker -innerRadius OR innerRadiusX, innerRadiusY | Number | null | The inner radius of the marker hole in pixels. -imageCircleUrl | String | null | The URL of an image to display on the marker. This will be displayed in the main circular area of the marker. - -### L.RegularPolygonMarker - -> Creates an N-sided marker - -Regular Polygons - -#### Usage -`L.RegularPolygonMarker( LatLng, options?);` - -```javascript -var marker = new L.RegularPolygonMarker(new L.LatLng(0, 0), { - numberOfSides: 3, - rotation: 60.0, - radius: 10, - // L.Path style options - ... -}); - -map.addLayer(marker); -``` - -#### Options -Option | Type | Default | Description ---- | --- | --- | --- -numberOfSides | Number | 3 | The number of sides the marker should have -rotation | Number | 0.0 | The angle in degrees that the marker should be rotated -radius OR radiusX, radiusY | Number | 10 | The radius of the marker in pixels -innerRadius OR innerRadiusX, innerRadiusY | Number | null | The inner radius of the marker in pixels. Specifying an innerRadius will produce a regular polygon with a hole in the middle. -imageCircleUrl | String | null | The URL of an image to display on the marker. This will be displayed in the main circular area of the marker. - -### L.StarMarker - -Star Marker - -> Creates a star-shaped marker with N-points - -#### Usage -`L.StarMarker( LatLng, options?);` - -#### Options (in addition to the L.RegularPolygonMarker options defined above) -Option | Type | Default | Description ---- | --- | --- | --- -numberOfPoints | Number | 5 | The number of points the star should have - -### ChartMarkers - -Bar Chart MarkerRadial Bar Chart MarkerPie Chart MarkerCoxcomb Chart MarkerStacked Regular Polygon MarkerRadial Meter Marker - -> Display dynamic charts (bar chart, radial bar chart, pie chart, coxcomb chart, etc.) as markers - -#### Usage -`L.BarChartMarker( LatLng, options?);` -`L.RadialBarChartMarker( LatLng, options?);` -`L.PieChartMarker( LatLng, options?);` -`L.CoxcombChartMarker( LatLng, options?);` -`L.StackedRegularPolygonMarker( LatLng, options?);` -`L.RadialMeterMarker( LatLng, options?);` - -```javascript -var options = { - data: { - 'dataPoint1': Math.random() * 20, - 'dataPoint2': Math.random() * 20, - 'dataPoint3': Math.random() * 20, - 'dataPoint4': Math.random() * 20 - }, - chartOptions: { - 'dataPoint1': { - fillColor: '#FEE5D9', - minValue: 0, - maxValue: 20, - maxHeight: 20, - displayText: function (value) { - return value.toFixed(2); - } - }, - 'dataPoint2': { - fillColor: '#FCAE91', - minValue: 0, - maxValue: 20, - maxHeight: 20, - displayText: function (value) { - return value.toFixed(2); - } - }, - 'dataPoint3': { - fillColor: '#FB6A4A', - minValue: 0, - maxValue: 20, - maxHeight: 20, - displayText: function (value) { - return value.toFixed(2); - } - }, - 'dataPoint4': { - fillColor: '#CB181D', - minValue: 0, - maxValue: 20, - maxHeight: 20, - displayText: function (value) { - return value.toFixed(2); - } - } - }, - weight: 1, - color: '#000000', - ... // Other L.Path style options -} - -var barChartMarker = new L.BarChartMarker(new L.LatLng(0, 0), options); -``` - -#### Options (in addition to the *L.Path* style options) - -Option | Type | Default | Description ---- | --- | --- | --- -data | Object | null | A set of key/value pairs that provides a data value for each property displayed by the marker -chartOptions | Object | null | A set of key/value pairs that defines the options associated with each data property displayed by the marker. -backgroundStyle (L.RadialMeterMarker) | Object | L.Path object with a semi-transparent gray fill and stroke | An object of L.Path style options that will be used to style the background area of the chart. Set this to null or false to prevent a background from being displayed. - -### L.Callout - -> Used for annotating markers, lines, and polygons. Callouts include a line and associated icon (L.Icon or L.DivIcon). - -#### Usage -`L.Callout( latlng, options?);` - -```javascript -var callout = new L.Callout(new L.LatLng(0.0, 0.0), { - arrow: true, - numberOfSides: 3, - radius: 8, - icon: new L.DivIcon(...), - direction: L.CalloutLine.DIRECTION.NE, - lineStyle: L.CalloutLine.LINESTYLE.ARC, - size: new L.Point(50, 50), - weight: 2, - fillOpacity: 1.0, - color: '#FFFFFF', - fillColor: '#FFFFFF' -}); - -map.addLayer(callout); -``` - -#### Options (in addition to L.Path style options) -Option | Type | Default | Description ---- | --- | --- | --- -arrow | Boolean | true | true/false - whether or not an arrow should be added to the end of the callout line -numberOfSides | Number | 3 | The number of sides the arrow at the end of the callout line will have. -radius | Number | 6 | The radius of the arrow that will be displayed at the end of the callout line -icon | Object| null | An L.Icon or L.DivIcon object that will be displayed at the end of the callout line -direction | String | 'ne' | The quadrant in which the callout will be placed: 'ne', 'se', 'sw', 'nw'. Use L.CalloutLine.DIRECTION properties (NE, SE, SW, NW) to specify this -lineStyle | String | 'angle' | The style of the associated callout line: 'arc', 'angle', 'straight'. Use L.CalloutLine.LINESTYLE properties (ARC, ANGLE, STRAIGHT) to specify this. 'arc' displays a curved line, 'angle' displays an angled line, and 'straight' displays a straight line from the annotation point to the associated icon. -size | Object | L.Point(60, 30) | The bounds of the callout line - -Include L.Path options to style the callout line associated with the callout object (e.g. color, fillColor, weight, etc.) - -## Lines - -### L.ArcedPolyline - -> Draws an arced polyline. Rather than drawing a straight line from latlng1 to latlng2, this class draws an arced line from latlng1 to latlng2. The height of the arc is proportional to the distance between latlng1 and latlng2 and defined by a customizable L.LinearFunction instance. This is useful for illustrating spatial relationships, flight paths, etc. - -#### Usage -`L.ArcedPolyline( latlngs, options?);` - -```javascript -var arcedPolyline = new L.ArcedPolyline([...], { - distanceToHeight: new L.LinearFunction([0, 0], [4000, 400]), - color: '#FF00000', - weight: 4 -}); - -map.addLayer(arcedPolyline); -``` - -#### Options (in addition to L.Path style options) -Option | Type | Default | Description ---- | --- | --- | --- -distanceToHeight | L.LinearFunction | new L.LinearFunction([0, 5], [1000, 200]) | An L.LinearFunction instance that maps the distance between two points to an arc height in pixels - -## Utility Functions - -> Classes for mapping data properties to Leaflet style values - -### L.LinearFunction - -> Used to map a data property from one scale to another - -#### Usage -`L.LinearFunction( minPoint, maxPoint, options?);` - -```javascript -// Map a data property that ranges from 0 to 100 to a value between 5 and 20 (e.g. marker radius) -var linearFunction = new L.LinearFunction(new L.Point(0, 5), new L.Point(100, 20)); - -// OR - In addition to L.Point objects, you can also use arrays -var linearFunction = new L.LinearFunction([0, 5], [100, 20]); - -console.log(linearFunction.evaluate(10)); // prints 6.5 -``` - -#### Options -Option | Type | Default | Description ---- | --- | --- | --- -preProcess | Function | null | A function for pre-processing an input value -postProcess | Function | null | A function for post-processing an output value - -#### Key Methods -Method | Usage | Description ---- | --- | --- -evaluate | `linearFunction.evaluate();` | Interpolates an output value based on the passed in input value - -### Color Functions - -> Used to map a data property to a color. The framework includes tools for mapping color using Hue, Saturation, and Lightness/Luminosity (HSL) or Red, Green, Blue (RGB) color. See the [Colors](http://humangeo.github.com/leaflet-dvf/examples/html/colors.html) example. - -#### Usage - -> Change the output hue dynamically based on the input data property -> *Useful for producing colors along a rainbow scale (or subset)* -`L.HSLHueFunction( minPoint, maxPoint, options?);` - -> Change the output saturation dynamically based on the input data property -> *Useful for varying between a color and gray* -`L.HSLSaturationFunction( minPoint, maxPoint, options?);` - -> Change the output luminosity dynamically based on the input data property -> *Useful for varying between a color and white* -`L.HSLLuminosityFunction( minPoint, maxPoint, options?);` - -> Change the output red value dynamically based on the input data property -`L.RGBRedFunction( minPoint, maxPoint, options?);` - -> Change the output blue value dynamically based on the input data property -`L.RGBBlueFunction( minPoint, maxPoint, options?);` - -> Change the output green value dynamically based on the input data property -`L.RGBGreenFunction( minPoint, maxPoint, options?);` - -> Vary the output color dynamically between two RGB colors -`L.RGBColorBlendFunction( minX, > maxX, minColor, maxColor);` - -> Vary the output color dynamically using the colors specified in the colors array. Use with L.ColorBrewer color scales -`L.CustomColorFunction( minX, > maxX, colors, options?);` - -```javascript -// Map a data property that ranges from 0 to 100 to a color between green (hue of 120) and red (hue of 0) -var colorFunction = new L.HSLHueFunction(new L.Point(0, 120), new L.Point(100, 20)); - -colorFunction.evaluate(10); // prints 'hsl(110.00, 100%, 50%)' -``` - -#### Options - -##### HSL Options -Option | Type | Default | Description ---- | --- | --- | --- -outputHue | Number | 0 | The desired output hue *NOTE: use with L.HSLSaturationFunction and L.HSLLuminosityFunction* -outputSaturation | String | '100%' | The desired output saturation *NOTE: use with L.HSLHueFunction and L.HSLLuminosityFunction* -outputLuminosity | String | '50%' | The desired width of the legend element *NOTE: use with L.HSLHueFunction and L.HSLSaturationFunction* - -##### RGB Options -Option | Type | Default | Description ---- | --- | --- | --- -outputRed | Number (0..255) | null | The desired output red value *NOTE: use with L.RGBGreenFunction and L.RGBBlueFunction* -outputGreen | Number | (0..255) | The desired output green value *NOTE: use with L.RGBRedFunction and L.RGBBlueFunction* -outputBlue | Number | (0..255) | The desired output blue value *NOTE: use with L.RGBRedFunction and L.RGBGreenFunction* - -### L.PiecewiseFunction - -> Used to combine L.LinearFunction instances for cases where one instance won't suffice - -#### Usage -`L.PiecewiseFunction( functions, options?);` - -```javascript -// Map a data property that ranges from 0 to 100 to a color that ranges from white to yellow, yellow to red -// To vary a color between white and that color, use an HSLLuminosityFunction. In this case we'll vary -// the color from white to yellow until the value reaches 50 -var whiteToYellow = new L.HSLLuminosityFunction(new L.Point(0, 1), new L.Point(50, 0.5), { - outputHue: 60 -}); - -// We'll then vary the color from yellow to red from 50 to 100 -var yellowToRed = new L.HSLHueFunction(new L.Point(50, 60), new L.Point(100, 0)); - -// Create a new PiecewiseFunction and use this as you would any other LinearFunction -var colorFunction = new L.PiecewiseFunction([whiteToYellow, yellowToRed]); - -... -``` - -## DataLayer Classes - -> Support loading and displaying data from any JSON-based object/collection - -### L.DataLayer - -> Display data values using L.RegularPolygonMarker instances. To override the default marker behavior, use the getMarker option or inherit from DataLayer and override _getMarker. In thematic mapping, this class displays data using proportional symbols. -> -> *NOTE: If the location features are lines/polygons (e.g. GeoJSON), this class will use the centroid of each line/polygon to place each marker. When dealing with line/polygon features, you must include a reference to the [JavaScript Topology Suite (JSTS) JS files](https://github.com/bjornharrtell/jsts/tree/master/lib). These files are used to calculate centroids. If these files are not included, the DataLayer class will fallback to using the center of the bounds of the layer's geometry.* - -#### Usage -`L.DataLayer( data, options?);` - -#### Options -Option | Type | Default | Description ---- | --- | --- | --- -recordsField | String | 'features' | A pointer to the field in the input data that contains the records to be visualized. Use null when the data being passed in is the set of records to be visualized. Use dot notation to specify child properties (e.g. data.election.resultsByState), see note below. -locationMode | String | 'latlng' OR L.LocationModes.LATLNG | The mode used to determine a location for each record. Use a string or the *L.LocationModes* constant values -latitudeField | String | 'coordinates.1' | The property of each record that contains the latitude *NOTE: Use with 'latlng' locationMode* -longitudeField | String | 'coordinates.0' | The property of each record that contains the longitude *NOTE: Use with 'latlng' locationMode* -codeField | String | null | The property of each record that contains the code used to lookup a location *NOTE: Use with 'state', 'country', or 'lookup' locationMode values* -geohashField | String | null | The property of each record that contains the geohash used to determine a location *NOTE: Use with 'geohash' locationMode values* -layerOptions | Object | null | Default style - An object containing Leaflet L.Path style properties that will be used as the default style for DataLayer markers/polygons. These properties will be overridden by the displayOptions. -displayOptions | Object | null | Dynamic styles - An object containing pointers to one or property values of each record with associated L.Path style properties and LinearFunction objects -tooltipOptions | Object | null | Options used to configure the tooltips that are displayed on mouseover (iconSize and iconAnchor) -onEachRecord | Function | null | A function that performs additional operations (e.g. binding a popup) on a created layer based on the record associated with that layer (similar to the L.GeoJSON onEachFeature method). Note that the parameter ordering is: layer, record. This is slightly different from the L.GeoJSON onEachFeature method, where the ordering is: featureData, layer. -includeLayer OR filter | Function | null | A function for determining whether or not the layer for a given record should be added to the map. -getLocation | Function | null | A function for getting a custom location from a record (e.g. looking up an address) *NOTE: Use with 'custom' locationMode value* -locationLookup | Object (GeoJSON FeatureCollection) | null | A GeoJSON FeatureCollection that will be used to lookup the location associated with a given record. This is useful when you have some data that maps to political/statistical boundaries other than US states or countries. *NOTE: Use with 'lookup locationMode* -locationIndexField | String | null | A string identifying the field that will be used to index GeoJSON Feature objects when the locationMode is L.LocationModes.LOOKUP. If you don't specify this field, the DataLayer will use the codeField value as the property to use when indexing GeoJSON Features -includeBoundary | Boolean | null | true/false - whether or not the boundary polygon should be displayed when displaying proportional symbols. This is useful for identifying the boundary associated with each symbol. -boundaryStyle | Object | null | Path style options used for specifying how the boundary associated with the point will be displayed -getMarker | Function | null | A function for overriding the default marker that gets placed at each location. The function takes a latlng and options as parameters. - -#### Referencing Data Properties - -Use dot notation to reference items in the passed in data object. This applies to all field options (e.g. recordsField) as well as displayOptions. - -Given an object like: - -```javascript -{ - data: { - values: [ - { - property1: 1, - property2: 'akdfljlkfds', - property3: 234, - location: [-1.234324, 13.123213], - additional: { - property1: 2, - property2: 56 - } - }, - ... - { - property1: 34, - property2: 'werewrwer', - property3: 56, - location: [5.435444, 8.999345], - additional: { - property1: 88, - property2: 3 - } - } - ] - } -} -``` - -You might specify the following options: - -```javascript -{ - recordsField: 'data.values', - locationMode: L.LocationModes.LATLNG, - latitudeField: 'location.1' // Points to the second item in the location array - longitudeField: 'location.0' // Points to the first item in the location array, - displayOptions: { - 'additional.property1': { - ... // See displayOptions below - } - } -} -``` - -#### displayOptions - -> The *displayOptions* option is used to define how data properties are dynamically mapped to display styles. It's a JavaScript object of key/value pairs that follows the pattern: - -```javascript -{ - : { - displayName: , - displayText: , - // Leaflet L.Path style properties with static values or L.LinearFunction instances - // or just functions for dynamic mapping - color: , - fillColor: , - ... - }, - : { - displayName: ..., - displayText: ..., - ... - }, - ... - : { - displayName: ..., - displayText: ..., - ... - } -} -``` - -### ChartDataLayers - -> Display data values using ChartMarker instances (inherits from L.DataLayer) - -#### Usage -`L.BarChartDataLayer( data, options?);` -`L.RadialBarChartDataLayer( data, options?);` -`L.PieChartDataLayer( data, options?);` -`L.CoxcombChartDataLayer( data, options?);` -`L.StackedRegularPolygonDataLayer( data, options?);` - -#### Options -Option | Type | Default | Description ---- | --- | --- | --- - -> NOTE: You can use the displayOptions option to size ChartMarker instances dynamically by some property of each record. See the DataLayer options above for more information about displayOptions. - -### L.ChoroplethDataLayer - -> Display data values using dynamically styled points, lines, and polygons (inherits from L.DataLayer) - -Choropleth Data Layer -Choropleth Data Layer - -#### Usage -`L.ChoroplethDataLayer( data, options?);` - -#### Options -Option | Type | Default | Description ---- | --- | --- | --- - -### L.MarkerDataLayer - -> Display data values using markers based on L.Icon or L.DivIcon icons (inherits from L.DataLayer) - -#### Usage -`L.MarkerDataLayer( data, options?);` - -#### Options -Option | Type | Default | Description ---- | --- | --- | --- - -### L.PanoramioLayer - -> Display Panoramio images on the map. Shows the top 50 most popular images for the current map view. -> NOTE: Requires [Moment.js](http://momentjs.com) -> Check out [Panoramio Browser](http://humangeo.github.com/leaflet-dvf/examples/html/panoramio.html) for an example of using this layer. -Panoramio Layer - -#### Usage -`L.PanoramioLayer( options?);` - -#### Options (in addition to the *L.DataLayer* style options) -Option | Type | Default | Description ---- | --- | --- | --- -photoSet | String | public | The Panoramio API photo set to use for retrieving images. Can be one of 'public' - the most popular photos, 'full' - all photos, or a specific author id -updateInterval | Number | 300000 | The number of milliseconds to wait before updating the current view -size | String | square | The marker image size ("square" or "mini_square") -refreshEvents | String | moveend | The Leaflet events that will trigger a refresh of photos (separate with spaces) -onEachPhoto | Function | null | A function that will be called for each photo in the collection of retrieved photos. This is similar to the onEachRecord function of a DataLayer. - -## Legends - -> Useful for visually informing users about the dynamic styles associated with your L.DataLayer instances - -### L.Control.Legend - -> Add this control to your map to automatically display a dynamic legend for any L.DataLayer based instance that you add to your map - -```javascript -var legendControl = new L.Control.Legend(); - -legendControl.addTo(map); -``` - -### L.DataLayer - *getLegend()* - -> Call *getLegend* on any L.DataLayer instance to get an HTML element that can be added to your page - -#### Usage - -`layer.getLegend( options?);` - -```javascript -var layer = new L.DataLayer(data, {...}); - -layer.getLegend(); // Returns HTML -``` - -#### Options - -Option | Type | Default | Description ---- | --- | --- | --- -className | String | null | A class name that will be added to the legend element, useful for adding custom CSS styles -numSegments | Number | 10 | The number of segments/bars to include in the legend element -width | Number | 100 | The desired width of the legend element -gradient | Boolean | true | Whether or not to display numeric legend segments with a gradient between color values - -[CloudMade]: http://www.cloudmade.com -[Leaflet]: http://leafletjs.com +Check out the [examples](https://github.com/humangeo/leaflet-dvf/wiki/Examples) or read the [docs](https://github.com/humangeo/leaflet-dvf/wiki). \ No newline at end of file diff --git a/dist/leaflet-dvf.js b/dist/leaflet-dvf.js index 5fd38af..591582c 100644 --- a/dist/leaflet-dvf.js +++ b/dist/leaflet-dvf.js @@ -2281,6 +2281,22 @@ L.MapMarker = L.Path.extend({ getLatLng: function() { return this._latlng; }, + setRadius: function(radius) { + this.options.radius = radius; + return this.redraw(); + }, + setInnerRadius: function(innerRadius) { + this.options.innerRadius = innerRadius; + return this.redraw(); + }, + setRotation: function(rotation) { + this.options.rotation = rotation; + return this.redraw(); + }, + setNumberOfSides: function(numberOfSides) { + this.options.numberOfSides = numberOfSides; + return this.redraw(); + }, getPathString: function() { var anchorPoint = this.getTextAnchor(); if (this._shape) { @@ -2382,6 +2398,34 @@ L.RegularPolygonMarker = L.Path.extend({ var map = this._map, radiusX = this.options.radius || this.options.radiusX, radiusY = this.options.radius || this.options.radiusY, deltaX = radiusX * Math.cos(Math.PI / 4), deltaY = radiusY * Math.sin(Math.PI / 4), point = map.project(this._latlng), swPoint = new L.Point(point.x - deltaX, point.y + deltaY), nePoint = new L.Point(point.x + deltaX, point.y - deltaY), sw = map.unproject(swPoint), ne = map.unproject(nePoint); return new L.LatLngBounds(sw, ne); }, + setRadius: function(radius) { + this.options.radius = radius; + return this.redraw(); + }, + setRadiusXY: function(radiusX, radiusY) { + this.options.radius = null; + this.options.radiusX = radiusX; + this.options.radiusY = radiusY; + return this.redraw(); + }, + setInnerRadius: function(innerRadius) { + this.options.innerRadius = innerRadius; + return this.redraw(); + }, + setInnerRadiusXY: function(innerRadiusX, innerRadiusY) { + this.options.innerRadius = null; + this.options.innerRadiusX = innerRadiusX; + this.options.innerRadiusY = innerRadiusY; + return this.redraw(); + }, + setRotation: function(rotation) { + this.options.rotation = rotation; + return this.redraw(); + }, + setNumberOfSides: function(numberOfSides) { + this.options.numberOfSides = numberOfSides; + return this.redraw(); + }, getLatLng: function() { return this._latlng; }, @@ -2452,6 +2496,10 @@ L.StarMarker = L.RegularPolygonMarker.extend({ gradient: true, dropShadow: true }, + setNumberOfPoints: function(numberOfPoints) { + this.options.numberOfPoints = numberOfPoints; + return this.redraw(); + }, _getPoints: function(inner) { var maxDegrees = this.options.maxDegrees || 360; var angleSize = maxDegrees / this.options.numberOfPoints; diff --git a/dist/leaflet-dvf.markers.js b/dist/leaflet-dvf.markers.js index 53fee66..9039669 100644 --- a/dist/leaflet-dvf.markers.js +++ b/dist/leaflet-dvf.markers.js @@ -2219,6 +2219,22 @@ L.MapMarker = L.Path.extend({ getLatLng: function() { return this._latlng; }, + setRadius: function(radius) { + this.options.radius = radius; + return this.redraw(); + }, + setInnerRadius: function(innerRadius) { + this.options.innerRadius = innerRadius; + return this.redraw(); + }, + setRotation: function(rotation) { + this.options.rotation = rotation; + return this.redraw(); + }, + setNumberOfSides: function(numberOfSides) { + this.options.numberOfSides = numberOfSides; + return this.redraw(); + }, getPathString: function() { var anchorPoint = this.getTextAnchor(); if (this._shape) { @@ -2320,6 +2336,34 @@ L.RegularPolygonMarker = L.Path.extend({ var map = this._map, radiusX = this.options.radius || this.options.radiusX, radiusY = this.options.radius || this.options.radiusY, deltaX = radiusX * Math.cos(Math.PI / 4), deltaY = radiusY * Math.sin(Math.PI / 4), point = map.project(this._latlng), swPoint = new L.Point(point.x - deltaX, point.y + deltaY), nePoint = new L.Point(point.x + deltaX, point.y - deltaY), sw = map.unproject(swPoint), ne = map.unproject(nePoint); return new L.LatLngBounds(sw, ne); }, + setRadius: function(radius) { + this.options.radius = radius; + return this.redraw(); + }, + setRadiusXY: function(radiusX, radiusY) { + this.options.radius = null; + this.options.radiusX = radiusX; + this.options.radiusY = radiusY; + return this.redraw(); + }, + setInnerRadius: function(innerRadius) { + this.options.innerRadius = innerRadius; + return this.redraw(); + }, + setInnerRadiusXY: function(innerRadiusX, innerRadiusY) { + this.options.innerRadius = null; + this.options.innerRadiusX = innerRadiusX; + this.options.innerRadiusY = innerRadiusY; + return this.redraw(); + }, + setRotation: function(rotation) { + this.options.rotation = rotation; + return this.redraw(); + }, + setNumberOfSides: function(numberOfSides) { + this.options.numberOfSides = numberOfSides; + return this.redraw(); + }, getLatLng: function() { return this._latlng; }, @@ -2390,6 +2434,10 @@ L.StarMarker = L.RegularPolygonMarker.extend({ gradient: true, dropShadow: true }, + setNumberOfPoints: function(numberOfPoints) { + this.options.numberOfPoints = numberOfPoints; + return this.redraw(); + }, _getPoints: function(inner) { var maxDegrees = this.options.maxDegrees || 360; var angleSize = maxDegrees / this.options.numberOfPoints; diff --git a/dist/leaflet-dvf.markers.min.js b/dist/leaflet-dvf.markers.min.js index b0b8418..d3f8c78 100644 --- a/dist/leaflet-dvf.markers.min.js +++ b/dist/leaflet-dvf.markers.min.js @@ -3,5 +3,5 @@ (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=[];this._maxPoint.x>=n;)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=[];this._maxPoint.x>=n;)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;this._parts.length>i;++i){var n=this._parts[i];e.push(t[n])}return this.options.includeAlpha&&e.push(this.options.alpha),e},this._getColorString=function(t){t=this._formatOutput(t),this.options[this._dynamicPart]=t;var e=this._mapOutput(this.options);return this._writeColor(this._prefix,e)},this._writeColor=function(t,e){return this.options.includeAlpha&&(t+="a"),t+"("+e.join(",")+")"};var n=function(t){i&&i.postProcess&&(t=i.postProcess.call(this,t));var e=this._getColorString(t);return L.Browser.ie&&e.indexOf("hsl")>-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;this._functions.length>r;++r)if(a=this._functions[r],e=a.getBounds(),i=e[0],n=e[1],t>=i.x&&n.x>t){o=!0;break}return o?a:this._functions[this._functions.length-1]},evaluate:function(t){var e,i=null;return this._preProcess&&(t=this._preProcess(t)),e=this._getFunction(t),e&&(i=e.evaluate(t),this._postProcess&&(i=this._postProcess(i))),i}}),L.CustomColorFunction=L.PiecewiseFunction.extend({options:{interpolate:!0},initialize:function(t,e,i,n){var a,o=e-t,r=o/(i.length-1),s=[];L.Util.setOptions(this,n);for(var f=0;i.length>f;++f){var d=Math.min(f+1,i.length-1);a=this.options.interpolate?new L.RGBColorBlendFunction(t+r*f,t+r*d,i[f],i[d]):new L.RGBColorBlendFunction(t+r*f,t+r*d,i[f],i[f]),s.push(a)}L.PiecewiseFunction.prototype.initialize.call(this,s)}}),L.CategoryFunction=L.Class.extend({initialize:function(t,e){L.Util.setOptions(this,e),this._categoryKeys=Object.keys(t),this._categoryMap=t,this._preProcess=this.options.preProcess,this._postProcess=this.options.postProcess},evaluate:function(t){var e;return this._preProcess&&(t=this._preProcess(t)),e=this._categoryMap[t],this._postProcess&&(e=this._postProcess(e)),e},getCategories:function(){return this._categoryKeys}}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){for(var i=e||0,n=this.length;n>i;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;a.length-1>r;++r)n=a[r],o[n]=o[n]||{},o=o[n];o[a[a.length-1]]=i},L.Util.getFieldValue=function(t,e){var i=null;if(e){for(var n,a,o,r,s,f,d,c=e.split("."),l=t,u=-1,h=0;c.length>h;++h)if(n=c[h],u=n.indexOf("["),u>-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;l.length>b;++b)s=l[b],d=s[o],d&&d===r&&(l=s)}else{if(!l||!l.hasOwnProperty(n)){l=null;break}l=l[n]}i=l}else i=t;return i},L.Util.getNumericRange=function(t,e){var i=Number.MAX_VALUE,n=Number.MIN_VALUE;for(var a in t)if(t.hasOwnProperty(a)){var o=t[a],r=L.Util.getFieldValue(o,e);i=Math.min(i,r),n=Math.max(n,r)}return[i,n]},L.CategoryLegend=L.Class.extend({initialize:function(t){L.Util.setOptions(this,t)},generate:function(t){t=t||{};var e=document.createElement("div"),i=L.DomUtil.create("div","legend",e),n=t.className,a=this.options;n&&L.DomUtil.addClass(i,n),t.title&&(L.DomUtil.create("div","legend-title",i).innerHTML=t.title);for(var o in a){categoryOptions=a[o];var r=categoryOptions.displayName||o,s=L.DomUtil.create("div","data-layer-legend",i),f=L.DomUtil.create("div","legend-box",s);L.DomUtil.create("div","key",s).innerHTML=r,L.StyleConverter.applySVGStyle(f,categoryOptions)}return e.innerHTML}}),L.LegendIcon=L.DivIcon.extend({initialize:function(t,e,i){var n,a=document.createElement("div"),o=L.DomUtil.create("div","legend",a),r=L.DomUtil.create("div","title",o),s=L.DomUtil.create("div","legend-box",o),f=L.DomUtil.create("div","legend-values",o),d=e.title||e.name;d&&(r.innerHTML=d);for(var c in t)n=t[c],L.DomUtil.create("div","key",f).innerHTML=n.name||c,L.DomUtil.create("div","value",f).innerHTML=n.value;L.StyleConverter.applySVGStyle(s,e),s.style.height="5px",i.html=a.innerHTML,i.className=i.className||"legend-icon",L.DivIcon.prototype.initialize.call(this,i)}}),L.legendIcon=function(t,e,i){return new L.LegendIcon(t,e,i)},L.GeometryUtils={getName:function(t){var e=null;if(t&&t.features)for(var i=0;t.features.length>i;++i){var n=t.features[i];if(n.properties&&n.properties.name){e=n.properties.name;break}}return e},getGeoJSONLocation:function(t,e,i,n){var a=new L.GeoJSON(t,{pointToLayer:function(t,a){var o={location:a,text:i?L.Util.getFieldValue(e,i):[a.lat.toFixed(3),a.lng.toFixed(3)].join(", "),center:a};return n(o,e)}}),o=null;try{o=L.GeometryUtils.loadCentroid(t)}catch(r){console.log("Error loading centroid for "+JSON.stringify(t))}return{location:a,text:i?L.Util.getFieldValue(e,i):null,center:o}},mergeProperties:function(t,e,i){var n,a,o=e.features,r=L.GeometryUtils.indexFeatureCollection(o,i),s={type:"FeatureCollection",features:[]};for(var f in t)if(t.hasOwnProperty(f)&&(n=t[f],a=n[i])){var d=r[a];for(var c in n)d.properties[c]=n[c];s.features.push(d)}return s},indexFeatureCollection:function(t,e){for(var i,n,a,o=t.features,r={},s=0;o.length>s;++s)if(i=o[s],n=i.properties,a=n[e],a in r){var f=r[a];"GeometryCollection"!==f.geometry.type?r[a]={type:"Feature",geometry:{type:"GeometryCollection",geometries:[i.geometry,f.geometry]}}:f.geometry.geometries.push(i.geometry)}else r[a]=i;return r},arrayToMap:function(t,e,i){for(var n,a,o,r={},s=0;t.length>s;++s)n=t[s],a=n[e],o=i?n[i]:n,r[a]=o;return r},arrayToMaps:function(t,e){for(var i,n,a,o,r,s,f,d=[],c=0;e.length>c;++c)d.push({});for(var l=0;t.length>l;++l){n=t[l];for(var u=0;e.length>u;++u)i=d[u],r=e[u],s=r.from,f=r.to,a=n[s],o=f?n[f]:n,i[a]=o}return d},loadCentroid:function(t){var e,i,n,a=null;if(t.geometry&&"Point"===t.geometry.type)a=new L.LatLng(t.geometry.coordinates[1],t.geometry.coordinates[0]);else if("undefined"!=typeof jsts){var o=new jsts.io.GeoJSONParser,r=o.read(t);if(r.getCentroid)e=r.getCentroid(),i=e.coordinate.x,n=e.coordinate.y;else if(r.features){for(var s=0,f=0,d=0;r.features.length>d;++d)e=r.features[d].geometry.getCentroid(),s+=e.coordinate.x,f+=e.coordinate.y;i=s/r.features.length,n=f/r.features.length}else e=r.geometry.getCentroid(),i=e.coordinate.x,n=e.coordinate.y;a=new L.LatLng(n,i)}return a},loadCentroids:function(t){var e,i={};for(var n in t)e=t[n],i[n]=L.GeometryUtils.loadCentroid(e);return i}},L.SVGPathBuilder=L.Class.extend({initialize:function(t,e,i){this._points=t||[],this._innerPoints=e||[],L.Util.setOptions(this,i)},options:{closePath:!0},_getPathString:function(t,e){var i="";if(t.length>0){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;t.length>s;s++)n=t[s],i+=o+n.x.toFixed(e)+","+n.y.toFixed(e);this.options.closePath&&(i+=r)}return i},addPoint:function(t,e){e?this._innerPoints.push(t):this._points.push(t)},build:function(t){t=t||this.options.digits;var e=this._getPathString(this._points,t);return this._innerPoints&&(e+=this._getPathString(this._innerPoints,t)),e}}),L.StyleConverter={keyMap:{fillColor:{property:["background-color"],valueFunction:function(t){return t}},color:{property:["color","border-top-color","border-right-color","border-bottom-color","border-left-color"],valueFunction:function(t){return t}},weight:{property:["border-width"],valueFunction:function(t){return Math.ceil(t)+"px"}},stroke:{property:["border-style"],valueFunction:function(t){return t===!0?"solid":"none"}},dashArray:{property:["border-style"],valueFunction:function(t){var e="solid";return t&&(e="dashed"),e}},barThickness:{property:["height"],valueFunction:function(t){return t+"px"}},radius:{property:["height"],valueFunction:function(t){return 2*t+"px"}},fillOpacity:{property:["opacity"],valueFunction:function(t){return t}}},applySVGStyle:function(t,e,i){var n=L.StyleConverter.keyMap;i&&(n=L.Util.extend(n,i)),t.style.borderStyle="solid";for(var a in e)L.StyleConverter.setCSSProperty(t,a,e[a],n);return t},setCSSProperty:function(t,e,i,n){var n=n||L.StyleConverter.keyMap,a=n[e],o="";if(a)for(var r=a.property,s=0,f=r.length;f>s;++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;this._categories.length>a;++a){t=this._categories[a],n[t]={};for(var o in this._styleFunctionMap)e=this._styleFunctionMap[o],i=e.evaluate?e.evaluate(a):"function"==typeof e?e(a):e,n[t][o]=i}this._styleMap=n},getStyles:function(){return this._styleMap}}),L.PaletteBuilder=L.Class.extend({initialize:function(t){this._styleFunctionMap=t},generate:function(t){t=t||{};var e=document.createElement("div"),i=L.DomUtil.create("div","palette",e),n=t.count||10,a=function(t){for(var e=[],i=0;t>i;++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+6*(e-t)*(2/3-i):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 1>this._a&&(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(1>this._a)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;e.length>i;++i)1===e[i].length&&(e[i]="0"+e[i]);t="#"+e.join("")}return t},r:function(t){return arguments.length?this.setRGB(t,this._rgb[1],this._rgb[2]):this._rgb[0]},g:function(t){return arguments.length?this.setRGB(this._rgb[0],t,this._rgb[2]):this._rgb[1]},b:function(t){return arguments.length?this.setRGB(this._rgb[0],this._rgb[1],t):this._rgb[2]},h:function(t){return arguments.length?this.setHSL(t,this._hsl[1],this._hsl[2]):this._hsl[0]},s:function(t){return arguments.length?this.setHSL(this._hsl[0],t,this._hsl[2]):this._hsl[1]},l:function(t){return arguments.length?this.setHSL(this._hsl[0],this._hsl[1],t):this._hsl[2]},a:function(t){return arguments.length?(this._a=t,this):this._a}}),L.RGBColor=L.Color.extend({initialize:function(t){L.Color.prototype.initialize.call(this,t)},parseColorDef:function(t){var e,i,n,a,o=t instanceof Array,r=0===t.indexOf("#"),s=[];o?(e=Math.floor(t[0]),i=Math.floor(t[1]),n=Math.floor(t[2]),a=4===t.length?t[3]:1):r?(t=t.replace("#",""),e=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16),a=8===t.length?parseInt(t.substring(6,8),16):1):(s=t.replace("rgb","").replace("a","").replace(/\s+/g,"").replace("(","").replace(")","").split(","),e=parseInt(s[0]),i=parseInt(s[1]),n=parseInt(s[2]),a=4===s.length?parseInt(s[3]):1),this.setRGB(e,i,n),this._a=a}}),L.rgbColor=function(t){return new L.RGBColor(t)},L.HSLColor=L.Color.extend({initialize:function(t){L.Color.prototype.initialize.call(this,t)},parseColorDef:function(t){var e,i,n,a,o=t instanceof Array;if(o)e=t[0],i=t[1],n=t[2],a=4===t.length?t[3]:1;else{var r=t.replace("hsl","").replace("a","").replace("(","").replace(/\s+/g,"").replace(/%/g,"").replace(")","").split(",");e=Number(r[0])/360,i=Number(r[1])/100,n=Number(r[2])/100,a=4===r.length?parseInt(r[3]):1}this.setHSL(e,i,n),this._a=a}}),L.hslColor=function(t){return new L.HSLColor(t)},L.Animation=L.Class.extend({initialize:function(t,e){this._easeFunction=t,this._animateFrame=e},run:function(t,e){this.stop(),this._el=t,this._inProgress=!0,this._duration=e.duration||.25,this._animationOptions=e,this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=L.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?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;o.length>s;++s){var f=o[s],d=this._createElement("stop");f.style=f.style||{};for(var r in f){var c=f[r];if("style"===r){var l="";c.color=c.color||this.options.fillColor||this.options.color,c.opacity=c.opacity===void 0?1:c.opacity;for(var u in c)l+="stop-"+u+":"+c[u]+";";c=l}d.setAttribute(r,c)}e.appendChild(d)}this._gradient=e,this._defs.appendChild(e)},_createDropShadow:function(t){this._defs||this._createDefs(),this._dropShadow&&this._defs.removeChild(this._dropShadow);var e=L.Util.guid(),i=this._createElement("filter"),n=this._createElement("feOffset"),a=this._createElement("feGaussianBlur"),o=this._createElement("feBlend");t=t||{width:"200%",height:"200%"},t.id="filter"+e;for(var r in t)i.setAttribute(r,t[r]);var s={result:"offOut","in":"SourceAlpha",dx:"2",dy:"2"},f={result:"blurOut","in":"offOut",stdDeviation:"2"},d={"in":"SourceGraphic",in2:"blurOut",mode:"lighten"};for(var r in s)n.setAttribute(r,s[r]);for(var r in f)a.setAttribute(r,f[r]);for(var r in d)o.setAttribute(r,d[r]);i.appendChild(n),i.appendChild(a),i.appendChild(o),this._dropShadow=i,this._defs.appendChild(i)},_createCustomElement:function(t,e){var i=this._createElement(t);for(var n in e)e.hasOwnProperty(n)&&i.setAttribute(n,e[n]);return i},_createImage:function(t){var e=this._createElement("image");return e.setAttribute("width",t.width),e.setAttribute("height",t.height),e.setAttribute("x",t.x||0),e.setAttribute("y",t.y||0),e.setAttributeNS(L.Path.XLINK_NS,"xlink:href",t.url),e},_createPattern:function(t){var e=this._createCustomElement("pattern",t);return e},_createShape:function(t,e){var i=this._createCustomElement(t,e);return i},_applyCustomStyles:function(){},_createFillPattern:function(t){var e=L.Util.guid(),i=t.pattern;i.id=e,i.patternUnits=i.patternUnits||"objectBoundingBox";var n=this._createPattern(i),a=this._createImage(t.image);a.setAttributeNS(L.Path.XLINK_NS,"xlink:href",t.url),n.appendChild(a),this._defs||this._createDefs(),this._defs.appendChild(n),this._path.setAttribute("fill","url(#"+e+")")},_getDefaultDiameter:function(t){return 1.75*t},_createShapeImage:function(t){t=t||{};var e=L.Util.guid(),i=this.options.radius||Math.max(this.options.radiusX,this.options.radiusY),n=this._getDefaultDiameter(i),a=t.imageSize||new L.Point(n,n),o=t.radius||n/2,r=t.shape||{circle:{r:o,cx:0,cy:0}},s=t.pattern||{width:a.x,height:a.y,x:0,y:0},f=Object.keys(r),d=f.length>0?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();if(this._shape)if("circle"===this._shape.tagName||"ellipse"===this._shape.tagName)this._shape.setAttribute("cx",t.x),this._shape.setAttribute("cy",t.y);else{var e=this._shape.getAttribute("width"),i=this._shape.getAttribute("height");this._shape.setAttribute("x",t.x-Number(e)/2),this._shape.setAttribute("y",t.y-Number(i)/2)}return 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(){var t=this.getTextAnchor();if(this._shape)if("circle"===this._shape.tagName||"ellipse"===this._shape.tagName)this._shape.setAttribute("cx",t.x),this._shape.setAttribute("cy",t.y);else{var e=this._shape.getAttribute("width"),i=this._shape.getAttribute("height");this._shape.setAttribute("x",t.x-Number(e)/2),this._shape.setAttribute("y",t.y-Number(i)/2)}return this._path.setAttribute("shape-rendering","geometricPrecision"),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!==(r+"").indexOf("%")?"":"px")),n.setAttribute("height",s+(-1!==(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 M in o)f[M]=o[M].evaluate?o[M].evaluate(C):o[M];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 S in this.options.backgroundStyle)f[S]=this.options.backgroundStyle[S];var C=v.evaluate(b+w); -n=new L.RadialBarMarker(this._latlng,f),this.addLayer(n)}}}}); \ No newline at end of file +},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;o.length>s;++s){var f=o[s],d=this._createElement("stop");f.style=f.style||{};for(var r in f){var c=f[r];if("style"===r){var l="";c.color=c.color||this.options.fillColor||this.options.color,c.opacity=c.opacity===void 0?1:c.opacity;for(var u in c)l+="stop-"+u+":"+c[u]+";";c=l}d.setAttribute(r,c)}e.appendChild(d)}this._gradient=e,this._defs.appendChild(e)},_createDropShadow:function(t){this._defs||this._createDefs(),this._dropShadow&&this._defs.removeChild(this._dropShadow);var e=L.Util.guid(),i=this._createElement("filter"),n=this._createElement("feOffset"),a=this._createElement("feGaussianBlur"),o=this._createElement("feBlend");t=t||{width:"200%",height:"200%"},t.id="filter"+e;for(var r in t)i.setAttribute(r,t[r]);var s={result:"offOut","in":"SourceAlpha",dx:"2",dy:"2"},f={result:"blurOut","in":"offOut",stdDeviation:"2"},d={"in":"SourceGraphic",in2:"blurOut",mode:"lighten"};for(var r in s)n.setAttribute(r,s[r]);for(var r in f)a.setAttribute(r,f[r]);for(var r in d)o.setAttribute(r,d[r]);i.appendChild(n),i.appendChild(a),i.appendChild(o),this._dropShadow=i,this._defs.appendChild(i)},_createCustomElement:function(t,e){var i=this._createElement(t);for(var n in e)e.hasOwnProperty(n)&&i.setAttribute(n,e[n]);return i},_createImage:function(t){var e=this._createElement("image");return e.setAttribute("width",t.width),e.setAttribute("height",t.height),e.setAttribute("x",t.x||0),e.setAttribute("y",t.y||0),e.setAttributeNS(L.Path.XLINK_NS,"xlink:href",t.url),e},_createPattern:function(t){var e=this._createCustomElement("pattern",t);return e},_createShape:function(t,e){var i=this._createCustomElement(t,e);return i},_applyCustomStyles:function(){},_createFillPattern:function(t){var e=L.Util.guid(),i=t.pattern;i.id=e,i.patternUnits=i.patternUnits||"objectBoundingBox";var n=this._createPattern(i),a=this._createImage(t.image);a.setAttributeNS(L.Path.XLINK_NS,"xlink:href",t.url),n.appendChild(a),this._defs||this._createDefs(),this._defs.appendChild(n),this._path.setAttribute("fill","url(#"+e+")")},_getDefaultDiameter:function(t){return 1.75*t},_createShapeImage:function(t){t=t||{};var e=L.Util.guid(),i=this.options.radius||Math.max(this.options.radiusX,this.options.radiusY),n=this._getDefaultDiameter(i),a=t.imageSize||new L.Point(n,n),o=t.radius||n/2,r=t.shape||{circle:{r:o,cx:0,cy:0}},s=t.pattern||{width:a.x,height:a.y,x:0,y:0},f=Object.keys(r),d=f.length>0?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},setRadius:function(t){return this.options.radius=t,this.redraw()},setInnerRadius:function(t){return this.options.innerRadius=t,this.redraw()},setRotation:function(t){return this.options.rotation=t,this.redraw()},setNumberOfSides:function(t){return this.options.numberOfSides=t,this.redraw()},getPathString:function(){var t=this.getTextAnchor();if(this._shape)if("circle"===this._shape.tagName||"ellipse"===this._shape.tagName)this._shape.setAttribute("cx",t.x),this._shape.setAttribute("cy",t.y);else{var e=this._shape.getAttribute("width"),i=this._shape.getAttribute("height");this._shape.setAttribute("x",t.x-Number(e)/2),this._shape.setAttribute("y",t.y-Number(i)/2)}return 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)},setRadius:function(t){return this.options.radius=t,this.redraw()},setRadiusXY:function(t,e){return this.options.radius=null,this.options.radiusX=t,this.options.radiusY=e,this.redraw()},setInnerRadius:function(t){return this.options.innerRadius=t,this.redraw()},setInnerRadiusXY:function(t,e){return this.options.innerRadius=null,this.options.innerRadiusX=t,this.options.innerRadiusY=e,this.redraw()},setRotation:function(t){return this.options.rotation=t,this.redraw()},setNumberOfSides:function(t){return this.options.numberOfSides=t,this.redraw()},getLatLng:function(){return this._latlng},getPathString:function(){var t=this.getTextAnchor();if(this._shape)if("circle"===this._shape.tagName||"ellipse"===this._shape.tagName)this._shape.setAttribute("cx",t.x),this._shape.setAttribute("cy",t.y);else{var e=this._shape.getAttribute("width"),i=this._shape.getAttribute("height");this._shape.setAttribute("x",t.x-Number(e)/2),this._shape.setAttribute("y",t.y-Number(i)/2)}return this._path.setAttribute("shape-rendering","geometricPrecision"),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},setNumberOfPoints:function(t){return this.options.numberOfPoints=t,this.redraw()},_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!==(r+"").indexOf("%")?"":"px")),n.setAttribute("height",s+(-1!==(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/dist/leaflet-dvf.min.js b/dist/leaflet-dvf.min.js index 71da423..73f7220 100644 --- a/dist/leaflet-dvf.min.js +++ b/dist/leaflet-dvf.min.js @@ -2,6 +2,7 @@ @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=[];this._maxPoint.x>=n;)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=[];this._maxPoint.x>=n;)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;this._parts.length>i;++i){var n=this._parts[i];e.push(t[n])}return this.options.includeAlpha&&e.push(this.options.alpha),e},this._getColorString=function(t){t=this._formatOutput(t),this.options[this._dynamicPart]=t;var e=this._mapOutput(this.options);return this._writeColor(this._prefix,e)},this._writeColor=function(t,e){return this.options.includeAlpha&&(t+="a"),t+"("+e.join(",")+")"};var n=function(t){i&&i.postProcess&&(t=i.postProcess.call(this,t));var e=this._getColorString(t);return L.Browser.ie&&e.indexOf("hsl")>-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(),l=i.b(),c=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,l),new L.Point(e,c))},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(),l=i.l(),c=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,l),new L.Point(e,c))},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;this._functions.length>r;++r)if(a=this._functions[r],e=a.getBounds(),i=e[0],n=e[1],t>=i.x&&n.x>t){o=!0;break}return o?a:this._functions[this._functions.length-1]},evaluate:function(t){var e,i=null;return this._preProcess&&(t=this._preProcess(t)),e=this._getFunction(t),e&&(i=e.evaluate(t),this._postProcess&&(i=this._postProcess(i))),i}}),L.CustomColorFunction=L.PiecewiseFunction.extend({options:{interpolate:!0},initialize:function(t,e,i,n){var a,o=e-t,r=o/(i.length-1),s=[];L.Util.setOptions(this,n);for(var l=0;i.length>l;++l){var c=Math.min(l+1,i.length-1);a=this.options.interpolate?new L.RGBColorBlendFunction(t+r*l,t+r*c,i[l],i[c]):new L.RGBColorBlendFunction(t+r*l,t+r*c,i[l],i[l]),s.push(a)}L.PiecewiseFunction.prototype.initialize.call(this,s)}}),L.CategoryFunction=L.Class.extend({initialize:function(t,e){L.Util.setOptions(this,e),this._categoryKeys=Object.keys(t),this._categoryMap=t,this._preProcess=this.options.preProcess,this._postProcess=this.options.postProcess},evaluate:function(t){var e;return this._preProcess&&(t=this._preProcess(t)),e=this._categoryMap[t],this._postProcess&&(e=this._postProcess(e)),e},getCategories:function(){return this._categoryKeys}}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){for(var i=e||0,n=this.length;n>i;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;a.length-1>r;++r)n=a[r],o[n]=o[n]||{},o=o[n];o[a[a.length-1]]=i},L.Util.getFieldValue=function(t,e){var i=null;if(e){for(var n,a,o,r,s,l,c,d=e.split("."),f=t,h=-1,u=0;d.length>u;++u)if(n=d[u],h=n.indexOf("["),h>-1){l=n.substring(h),n=n.substring(0,h),l=l.replace("[","").replace("]",""),a=l.split("="),o=a[0],r=a[1],f=f[n];for(var p=0;f.length>p;++p)s=f[p],c=s[o],c&&c===r&&(f=s)}else{if(!f||!f.hasOwnProperty(n)){f=null;break}f=f[n]}i=f}else i=t;return i},L.Util.getNumericRange=function(t,e){var i=Number.MAX_VALUE,n=Number.MIN_VALUE;for(var a in t)if(t.hasOwnProperty(a)){var o=t[a],r=L.Util.getFieldValue(o,e);i=Math.min(i,r),n=Math.max(n,r)}return[i,n]},L.CategoryLegend=L.Class.extend({initialize:function(t){L.Util.setOptions(this,t)},generate:function(t){t=t||{};var e=document.createElement("div"),i=L.DomUtil.create("div","legend",e),n=t.className,a=this.options;n&&L.DomUtil.addClass(i,n),t.title&&(L.DomUtil.create("div","legend-title",i).innerHTML=t.title);for(var o in a){categoryOptions=a[o];var r=categoryOptions.displayName||o,s=L.DomUtil.create("div","data-layer-legend",i),l=L.DomUtil.create("div","legend-box",s);L.DomUtil.create("div","key",s).innerHTML=r,L.StyleConverter.applySVGStyle(l,categoryOptions)}return e.innerHTML}}),L.LegendIcon=L.DivIcon.extend({initialize:function(t,e,i){var n,a=document.createElement("div"),o=L.DomUtil.create("div","legend",a),r=L.DomUtil.create("div","title",o),s=L.DomUtil.create("div","legend-box",o),l=L.DomUtil.create("div","legend-values",o),c=e.title||e.name;c&&(r.innerHTML=c);for(var d in t)n=t[d],L.DomUtil.create("div","key",l).innerHTML=n.name||d,L.DomUtil.create("div","value",l).innerHTML=n.value;L.StyleConverter.applySVGStyle(s,e),s.style.height="5px",i.html=a.innerHTML,i.className=i.className||"legend-icon",L.DivIcon.prototype.initialize.call(this,i)}}),L.legendIcon=function(t,e,i){return new L.LegendIcon(t,e,i)},L.GeometryUtils={getName:function(t){var e=null;if(t&&t.features)for(var i=0;t.features.length>i;++i){var n=t.features[i];if(n.properties&&n.properties.name){e=n.properties.name;break}}return e},getGeoJSONLocation:function(t,e,i,n){var a=new L.GeoJSON(t,{pointToLayer:function(t,a){var o={location:a,text:i?L.Util.getFieldValue(e,i):[a.lat.toFixed(3),a.lng.toFixed(3)].join(", "),center:a};return n(o,e)}}),o=null;try{o=L.GeometryUtils.loadCentroid(t)}catch(r){console.log("Error loading centroid for "+JSON.stringify(t))}return{location:a,text:i?L.Util.getFieldValue(e,i):null,center:o}},mergeProperties:function(t,e,i){var n,a,o=e.features,r=L.GeometryUtils.indexFeatureCollection(o,i),s={type:"FeatureCollection",features:[]};for(var l in t)if(t.hasOwnProperty(l)&&(n=t[l],a=n[i])){var c=r[a];for(var d in n)c.properties[d]=n[d];s.features.push(c)}return s},indexFeatureCollection:function(t,e){for(var i,n,a,o=t.features,r={},s=0;o.length>s;++s)if(i=o[s],n=i.properties,a=n[e],a in r){var l=r[a];"GeometryCollection"!==l.geometry.type?r[a]={type:"Feature",geometry:{type:"GeometryCollection",geometries:[i.geometry,l.geometry]}}:l.geometry.geometries.push(i.geometry)}else r[a]=i;return r},arrayToMap:function(t,e,i){for(var n,a,o,r={},s=0;t.length>s;++s)n=t[s],a=n[e],o=i?n[i]:n,r[a]=o;return r},arrayToMaps:function(t,e){for(var i,n,a,o,r,s,l,c=[],d=0;e.length>d;++d)c.push({});for(var f=0;t.length>f;++f){n=t[f];for(var h=0;e.length>h;++h)i=c[h],r=e[h],s=r.from,l=r.to,a=n[s],o=l?n[l]:n,i[a]=o}return c},loadCentroid:function(t){var e,i,n,a=null;if(t.geometry&&"Point"===t.geometry.type)a=new L.LatLng(t.geometry.coordinates[1],t.geometry.coordinates[0]);else if("undefined"!=typeof jsts){var o=new jsts.io.GeoJSONParser,r=o.read(t);if(r.getCentroid)e=r.getCentroid(),i=e.coordinate.x,n=e.coordinate.y;else if(r.features){for(var s=0,l=0,c=0;r.features.length>c;++c)e=r.features[c].geometry.getCentroid(),s+=e.coordinate.x,l+=e.coordinate.y;i=s/r.features.length,n=l/r.features.length}else e=r.geometry.getCentroid(),i=e.coordinate.x,n=e.coordinate.y;a=new L.LatLng(n,i)}return a},loadCentroids:function(t){var e,i={};for(var n in t)e=t[n],i[n]=L.GeometryUtils.loadCentroid(e);return i}},L.SVGPathBuilder=L.Class.extend({initialize:function(t,e,i){this._points=t||[],this._innerPoints=e||[],L.Util.setOptions(this,i)},options:{closePath:!0},_getPathString:function(t,e){var i="";if(t.length>0){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;t.length>s;s++)n=t[s],i+=o+n.x.toFixed(e)+","+n.y.toFixed(e);this.options.closePath&&(i+=r)}return i},addPoint:function(t,e){e?this._innerPoints.push(t):this._points.push(t)},build:function(t){t=t||this.options.digits;var e=this._getPathString(this._points,t);return this._innerPoints&&(e+=this._getPathString(this._innerPoints,t)),e}}),L.StyleConverter={keyMap:{fillColor:{property:["background-color"],valueFunction:function(t){return t}},color:{property:["color","border-top-color","border-right-color","border-bottom-color","border-left-color"],valueFunction:function(t){return t}},weight:{property:["border-width"],valueFunction:function(t){return Math.ceil(t)+"px"}},stroke:{property:["border-style"],valueFunction:function(t){return t===!0?"solid":"none"}},dashArray:{property:["border-style"],valueFunction:function(t){var e="solid";return t&&(e="dashed"),e}},barThickness:{property:["height"],valueFunction:function(t){return t+"px"}},radius:{property:["height"],valueFunction:function(t){return 2*t+"px"}},fillOpacity:{property:["opacity"],valueFunction:function(t){return t}}},applySVGStyle:function(t,e,i){var n=L.StyleConverter.keyMap;i&&(n=L.Util.extend(n,i)),t.style.borderStyle="solid";for(var a in e)L.StyleConverter.setCSSProperty(t,a,e[a],n);return t},setCSSProperty:function(t,e,i,n){var n=n||L.StyleConverter.keyMap,a=n[e],o="";if(a)for(var r=a.property,s=0,l=r.length;l>s;++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;this._categories.length>a;++a){t=this._categories[a],n[t]={};for(var o in this._styleFunctionMap)e=this._styleFunctionMap[o],i=e.evaluate?e.evaluate(a):"function"==typeof e?e(a):e,n[t][o]=i}this._styleMap=n},getStyles:function(){return this._styleMap}}),L.PaletteBuilder=L.Class.extend({initialize:function(t){this._styleFunctionMap=t},generate:function(t){t=t||{};var e=document.createElement("div"),i=L.DomUtil.create("div","palette",e),n=t.count||10,a=function(t){for(var e=[],i=0;t>i;++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 l=L.DomUtil.create("i","palette-element",i),c=r[s];L.StyleConverter.applySVGStyle(l,c)}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 l=t[s];if("object"==typeof l){var c=document.createElement("div");c.appendChild(L.HTMLUtils.buildTable(l,i)),l=c.innerHTML}r.innerHTML+=""+s+""+l+""}return a}},L.AnimationUtils={animate:function(t,e,i,n){var a=n.delay||0,o=n.frames||30,r=n.duration||500,s={},l=n.easeFunction||function(t){return t},c=n.complete,d=r/o;for(var f in e)"color"!=f&&"fillColor"!=f&&i[f]?s[f]=new L.LinearFunction([0,e[f]],[o-1,i[f]]):("color"==f||"fillColor"==f)&&(s[f]=new L.RGBColorBlendFunction(0,o-1,e[f],i[f]));var h={},u=0,p=function(){for(var e in s)h[e]=s[e].evaluate(u);t.options=L.extend({},t.options,h),t.setStyle(t.options).redraw(),u++,d=l(d),o>u?setTimeout(p,d):c()};setTimeout(p,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 l=o-r;switch(a=s>.5?l/(2-o-r):l/(o+r),o){case t:n=(e-i)/l+(i>e?6:0);break;case e:n=(i-t)/l+2;break;case i:n=(t-e)/l+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+6*(e-t)*(2/3-i):t}var a,o,r;if(0==e)a=o=r=i;else{var s=.5>i?i*(1+e):i+e-i*e,l=2*i-s;a=n(l,s,t+1/3),o=n(l,s,t),r=n(l,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 1>this._a&&(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(1>this._a)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;e.length>i;++i)1===e[i].length&&(e[i]="0"+e[i]);t="#"+e.join("")}return t},r:function(t){return arguments.length?this.setRGB(t,this._rgb[1],this._rgb[2]):this._rgb[0]},g:function(t){return arguments.length?this.setRGB(this._rgb[0],t,this._rgb[2]):this._rgb[1]},b:function(t){return arguments.length?this.setRGB(this._rgb[0],this._rgb[1],t):this._rgb[2]},h:function(t){return arguments.length?this.setHSL(t,this._hsl[1],this._hsl[2]):this._hsl[0]},s:function(t){return arguments.length?this.setHSL(this._hsl[0],t,this._hsl[2]):this._hsl[1]},l:function(t){return arguments.length?this.setHSL(this._hsl[0],this._hsl[1],t):this._hsl[2]},a:function(t){return arguments.length?(this._a=t,this):this._a}}),L.RGBColor=L.Color.extend({initialize:function(t){L.Color.prototype.initialize.call(this,t)},parseColorDef:function(t){var e,i,n,a,o=t instanceof Array,r=0===t.indexOf("#"),s=[];o?(e=Math.floor(t[0]),i=Math.floor(t[1]),n=Math.floor(t[2]),a=4===t.length?t[3]:1):r?(t=t.replace("#",""),e=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16),a=8===t.length?parseInt(t.substring(6,8),16):1):(s=t.replace("rgb","").replace("a","").replace(/\s+/g,"").replace("(","").replace(")","").split(","),e=parseInt(s[0]),i=parseInt(s[1]),n=parseInt(s[2]),a=4===s.length?parseInt(s[3]):1),this.setRGB(e,i,n),this._a=a}}),L.rgbColor=function(t){return new L.RGBColor(t)},L.HSLColor=L.Color.extend({initialize:function(t){L.Color.prototype.initialize.call(this,t)},parseColorDef:function(t){var e,i,n,a,o=t instanceof Array;if(o)e=t[0],i=t[1],n=t[2],a=4===t.length?t[3]:1;else{var r=t.replace("hsl","").replace("a","").replace("(","").replace(/\s+/g,"").replace(/%/g,"").replace(")","").split(",");e=Number(r[0])/360,i=Number(r[1])/100,n=Number(r[2])/100,a=4===r.length?parseInt(r[3]):1}this.setHSL(e,i,n),this._a=a}}),L.hslColor=function(t){return new L.HSLColor(t)},L.Animation=L.Class.extend({initialize:function(t,e){this._easeFunction=t,this._animateFrame=e},run:function(t,e){this.stop(),this._el=t,this._inProgress=!0,this._duration=e.duration||.25,this._animationOptions=e,this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=L.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?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 l in n){var c=n[l],d=c.evaluate?c.evaluate(s):c;L.StyleConverter.setCSSProperty(s,l,d)}s.style.width=r+"px",e.appendChild(s)}return e}}),L.RegularPolygon=L.Polygon.extend({statics:{R:6378.137,M_PER_KM:1e3},initialize:function(t,e){this._centerLatLng=t,L.Util.setOptions(this,e),L.Polygon.prototype.initialize.call(this,this._getLatLngs(),e)},options:{fill:!0,radius:1e3,numberOfSides:4,rotation:0,maxDegrees:360},getLatLng:function(){return this._centerLatLng},setRadius:function(t){this.options.radius=t,this._latlngs=this._getLatLngs(),this.redraw()},_getLatLngs:function(){for(var t,e=this.options.maxDegrees||360,i=e/Math.max(this.options.numberOfSides,3),n=e+this.options.rotation,a=this.options.rotation,o=[];n>a;)t=this._getPoint(a),o.push(t),a+=i;return o},_getPoint:function(t){var e=function(t){return t*L.LatLng.DEG_TO_RAD},i=function(t){return t*L.LatLng.RAD_TO_DEG},n=e(t),a=this.options.radius/L.RegularPolygon.M_PER_KM/L.RegularPolygon.R,o=e(this._centerLatLng.lat),r=e(this._centerLatLng.lng),s=Math.asin(Math.sin(o)*Math.cos(a)+Math.cos(o)*Math.sin(a)*Math.cos(n)),l=r+Math.atan2(Math.sin(n)*Math.sin(a)*Math.cos(o),Math.cos(a)-Math.sin(o)*Math.sin(s));return s=i(s),l=i(l),new L.LatLng(s,l)}}),L.regularPolygon=function(t,e){return new L.RegularPolygon(t,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 l=this.getTextAnchor();this.setTextAnchor(l)}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;o.length>s;++s){var l=o[s],c=this._createElement("stop");l.style=l.style||{};for(var r in l){var d=l[r];if("style"===r){var f="";d.color=d.color||this.options.fillColor||this.options.color,d.opacity=d.opacity===void 0?1:d.opacity;for(var h in d)f+="stop-"+h+":"+d[h]+";";d=f}c.setAttribute(r,d)}e.appendChild(c)}this._gradient=e,this._defs.appendChild(e)},_createDropShadow:function(t){this._defs||this._createDefs(),this._dropShadow&&this._defs.removeChild(this._dropShadow);var e=L.Util.guid(),i=this._createElement("filter"),n=this._createElement("feOffset"),a=this._createElement("feGaussianBlur"),o=this._createElement("feBlend");t=t||{width:"200%",height:"200%"},t.id="filter"+e;for(var r in t)i.setAttribute(r,t[r]);var s={result:"offOut","in":"SourceAlpha",dx:"2",dy:"2"},l={result:"blurOut","in":"offOut",stdDeviation:"2"},c={"in":"SourceGraphic",in2:"blurOut",mode:"lighten"};for(var r in s)n.setAttribute(r,s[r]);for(var r in l)a.setAttribute(r,l[r]);for(var r in c)o.setAttribute(r,c[r]);i.appendChild(n),i.appendChild(a),i.appendChild(o),this._dropShadow=i,this._defs.appendChild(i)},_createCustomElement:function(t,e){var i=this._createElement(t);for(var n in e)e.hasOwnProperty(n)&&i.setAttribute(n,e[n]);return i},_createImage:function(t){var e=this._createElement("image");return e.setAttribute("width",t.width),e.setAttribute("height",t.height),e.setAttribute("x",t.x||0),e.setAttribute("y",t.y||0),e.setAttributeNS(L.Path.XLINK_NS,"xlink:href",t.url),e},_createPattern:function(t){var e=this._createCustomElement("pattern",t);return e},_createShape:function(t,e){var i=this._createCustomElement(t,e);return i},_applyCustomStyles:function(){},_createFillPattern:function(t){var e=L.Util.guid(),i=t.pattern;i.id=e,i.patternUnits=i.patternUnits||"objectBoundingBox";var n=this._createPattern(i),a=this._createImage(t.image);a.setAttributeNS(L.Path.XLINK_NS,"xlink:href",t.url),n.appendChild(a),this._defs||this._createDefs(),this._defs.appendChild(n),this._path.setAttribute("fill","url(#"+e+")")},_getDefaultDiameter:function(t){return 1.75*t},_createShapeImage:function(t){t=t||{};var e=L.Util.guid(),i=this.options.radius||Math.max(this.options.radiusX,this.options.radiusY),n=this._getDefaultDiameter(i),a=t.imageSize||new L.Point(n,n),o=t.radius||n/2,r=t.shape||{circle:{r:o,cx:0,cy:0}},s=t.pattern||{width:a.x,height:a.y,x:0,y:0},l=Object.keys(r),c=l.length>0?l[0]:"circle";r[c].fill="url(#"+e+")";var d=this._createShape(c,r[c]);this.options.clickable&&d.setAttribute("class","leaflet-clickable"),s.id=e,s.patternUnits=s.patternUnits||"objectBoundingBox";var f=this._createPattern(s),t=t.image||{width:a.x,height:a.y,x:0,y:0,url:this.options.imageCircleUrl},h=this._createImage(t);h.setAttributeNS(L.Path.XLINK_NS,"xlink:href",t.url),f.appendChild(h),this._defs.appendChild(f),this._container.insertBefore(d,this._defs),this._shape=d},_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();if(this._shape)if("circle"===this._shape.tagName||"ellipse"===this._shape.tagName)this._shape.setAttribute("cx",t.x),this._shape.setAttribute("cy",t.y);else{var e=this._shape.getAttribute("width"),i=this._shape.getAttribute("height");this._shape.setAttribute("x",t.x-Number(e)/2),this._shape.setAttribute("y",t.y-Number(i)/2)}return 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=[],l=this.options.radius,c=Math.sqrt(.75),d=function(t){return t*L.LatLng.DEG_TO_RAD},f=this._point;for(t||(s.push(f),s.push(new L.Point(f.x+c*l,f.y-1.5*l)));o>r;)i=d(r),e=this._getPoint(i,l,t),s.push(e),r+=a;return t||s.push(new L.Point(f.x-c*l,f.y-1.5*l)),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),l=t.unproject(r),c=t.unproject(s);return new L.LatLngBounds(l,c)},getLatLng:function(){return this._latlng},getPathString:function(){var t=this.getTextAnchor();if(this._shape)if("circle"===this._shape.tagName||"ellipse"===this._shape.tagName)this._shape.setAttribute("cx",t.x),this._shape.setAttribute("cy",t.y);else{var e=this._shape.getAttribute("width"),i=this._shape.getAttribute("height");this._shape.setAttribute("x",t.x-Number(e)/2),this._shape.setAttribute("y",t.y-Number(i)/2)}return this._path.setAttribute("shape-rendering","geometricPrecision"),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=[],l=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,d=function(t){return t*L.LatLng.DEG_TO_RAD};o>r;)i=d(r),e=this._getPoint(i,l,c),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,l=[],c=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,f=function(t){return t*L.LatLng.DEG_TO_RAD};r>s;)n=f(s),e=this._getPoint(n,c,d),i=this._getPoint(n+f(o)/2,c/2,d/2),l.push(e),l.push(i),s+=o;return l}}),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!==(r+"").indexOf("%")?"":"px")),n.setAttribute("height",s+(-1!==(s+"").indexOf("%")?"":"px")));var l=t.options.size||new L.Point(r,s),c=new L.Point(l.x/r,l.y/s),d=e.getElementsByTagName("svg");d.length>0&&d[0].parentNode.removeChild(d[0]),e.appendChild(n);var f=[],h=t.options.anchor||new L.Point(-l.x/2,-l.y/2),u=t._point.x+h.x,p=t._point.y+h.y;f.push("translate("+u+" "+p+")"),f.push("scale("+c.x+" "+c.y+")"),t.options.rotation&&f.push("rotate("+t.options.rotation+" "+r/2+" "+s/2+")"),e.setAttribute("transform",f.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,l=this.options.value/this.options.maxValue*this.options.maxHeight;return t=new L.Point(o+s,r),e=new L.Point(o+s,r-l),i=new L.Point(o-s,r-l),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,l=s.x-this._point.x,c=s.y-this._point.y,d=a.iconSize,f=l,h=c,u=5;f=0>l?d.x-l+u:-l-u,h=0>c?d.y-c+u:-c-u,n=new L.Point(f,h);var p={},b=a.displayText?a.displayText(r):r;p[o]={name:a.displayName,value:b};var g=new L.LegendIcon(p,a,{className:"leaflet-div-icon",iconSize:i?i.iconSize:d,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,l=Object.keys(this.options.data),c=l.length,d=this.options.width,f=this.options.offset||0,h=this.options.data,u=this.options.chartOptions;a=-(d*c+f*(c-1))/2+d/2,o=0;for(var p in h)t=h[p],r=u[p],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=d,s.maxHeight=r.maxHeight||10,s.key=p,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+=d+f}}),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),l=t.unproject(r),c=t.unproject(s);return new L.LatLngBounds(l,c)},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),l=r(e);return n.push(this._getPoint(s,a,o)),n.push(this._getPoint(l,a,o)),this.options.barThickness&&(this._innerPoints=[],this._innerPoints.push(this._getPoint(l,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,l=this.options.rotation,c=this.options,d=this.options.data,f=this.options.chartOptions,h=function(t,e){var i=0;return t[e]&&(i=parseFloat(t[e])),i};for(n in d)t=h(d,n),a+=t;if(a>0)for(n in d)t=parseFloat(d[n]),i=f[n],r=t/a,o=r*s,c.startAngle=l,c.endAngle=l+o,c.fillColor=i.fillColor,c.color=i.color||"#000",c.radiusX=this.options.radiusX||this.options.radius,c.radiusY=this.options.radiusY||this.options.radius,c.rotation=0,c.key=n,c.value=t,c.displayName=i.displayName,c.displayText=i.displayText,e=new L.RadialBarMarker(this._latlng,c),this._bindMouseEvents(e),l=c.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,l=this.options,c="radiusX"in this.options?this.options.radiusX:this.options.radius,d="radiusY"in this.options?this.options.radiusY:this.options.radius,f=Object.keys(this.options.data),h=f.length,u=this.options.data,p=this.options.chartOptions;o=r/h;for(var b in u){t=parseFloat(u[b]),a=p[b];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,c)),y=new L.LinearFunction(new L.Point(e,0),new L.Point(i,d));l.radiusX=g.evaluate(t),l.radiusY=y.evaluate(t)}else{var _=Math.max(c,d),m=Math.PI*Math.pow(_,2)/h,v=new L.LinearFunction(new L.Point(e,0),new L.Point(i,m),{postProcess:function(t){return Math.sqrt(h*t/Math.PI)}});l.radiusX=v.evaluate(t),l.radiusY=l.radiusX}l.startAngle=s,l.endAngle=s+o,l.fillColor=a.fillColor,l.color=a.color||"#000",l.rotation=0,l.key=b,l.value=t,l.displayName=a.displayName,l.displayText=a.displayText,n=new L.RadialBarMarker(this._latlng,l),this._bindMouseEvents(n),s=l.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,l=this.options.radiusX||this.options.radius,c=this.options.radiusY||this.options.radius,d=this.options.data,f=this.options.chartOptions,h=this.options.barThickness||4,u=this.options.offset||2;for(var p in d){t=parseFloat(d[p]),a=f[p],e=a.minValue||0,i=a.maxValue||100;var b=new L.LinearFunction(new L.Point(e,0),new L.Point(i,r));o=b.evaluate(t),s.startAngle=this.options.rotation,s.endAngle=this.options.rotation+o,s.fillColor=a.fillColor,s.radiusX=l,s.radiusY=c,s.barThickness=h,s.rotation=0,s.key=p,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),l+=h+u,c+=h+u}}}),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,l=this.options.chartOptions;for(n in s){t=parseFloat(s[n]),i=l[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 c=new L.LinearFunction(new L.Point(minValue,minRadius),new L.Point(maxValue,maxRadius)),d=c.evaluate(t);r.radiusX=a+d,r.radiusY=o+d,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,l=this.options,c=this.options.radiusX||this.options.radius,d=this.options.radiusY||this.options.radius,f=this.options.data,h=this.options.chartOptions,u=this.options.barThickness||4,p=r,b=this.options.numSegments||10,g=s/b; -for(var y in f){t=parseFloat(f[y]),a=h[y],o=this.options.displayOptions?this.options.displayOptions[y]:{},e=a.minValue||0,i=a.maxValue||100;for(var _=i-e,m=s/_*(t-e),v=r+m,P=r+s,x=new L.LinearFunction(new L.Point(r,e),new L.Point(P,i));v>p;){l.startAngle=p;var w=Math.min(g,v-p);l.endAngle=p+w,l.fillColor=a.fillColor,l.radiusX=c,l.radiusY=d,l.barThickness=u,l.rotation=0,l.key=y,l.value=t,l.displayName=a.displayName,l.displayText=a.displayText;var C=x.evaluate(p+w);for(var F in o)l[F]=o[F].evaluate?o[F].evaluate(C):o[F];n=new L.RadialBarMarker(this._latlng,l),this._bindMouseEvents(n),this.addLayer(n),p+=w}if(this.options.backgroundStyle&&P>p){var w=P-p;l.endAngle=p+w,l.radiusX=c,l.radiusY=d,l.barThickness=u,l.rotation=0,l.key=y,l.value=t,l.displayName=a.displayName,l.displayText=a.displayText,l.fillColor=null,l.fill=!1,l.gradient=!1;for(var S in this.options.backgroundStyle)l[S]=this.options.backgroundStyle[S];var C=x.evaluate(p+w);n=new L.RadialBarMarker(this._latlng,l),this.addLayer(n)}}}}),L.LocationModes={LATLNG:function(t,e){var i=function(e,i){var n=L.Util.getFieldValue(t,e),a=L.Util.getFieldValue(t,i),o=null;if(n&&a){var r=new L.LatLng(n,a);o={location:r,text:[r.lat.toFixed(3),r.lng.toFixed(3)].join(", "),center:r}}return o},n=i(this.options.latitudeField,this.options.longitudeField);if(!n&&this.options.fallbackLocationFields)for(var a,e=0;!n&&this.options.fallbackLocationFields.length>e;)a=this.options.fallbackLocationFields[e],n=i(a.latitudeField,a.longitudeField),e++;return n},GEOHASH:function(t,e){var i,n=this.options.geohashField?L.Util.getFieldValue(t,this.options.geohashField):e,a=decodeGeoHash(n);return a.latitude[2]&&a.longitude[2]&&(i=new L.LatLngBounds(new L.LatLng(a.latitude[0],a.longitude[0]),new L.LatLng(a.latitude[1],a.longitude[1]))),{location:i,text:n,center:i.getCenter()}},GWCOUNTRY:function(t,e){var i,n,a=this.options.codeField?L.Util.getFieldValue(t,this.options.codeField):e,o=L.gwNoLookup||{},r=L.countries||{},s=L.countryCentroids||{},l=a.toUpperCase();a=l;var c=l in o;c&&(a=o[l]||a),a?(i=r[a],n=s[a]):console.log("Code not found: "+l);var d=new L.GeoJSON(i);return{location:d,text:L.GeometryUtils.getName(i)||a,center:n}},COUNTRY:function(t,e){var i,n,a=this.options.codeField?L.Util.getFieldValue(t,this.options.codeField):e,o=L.codeLookup||{},r=L.alpha2Lookup||{},s=L.fips2Lookup||{},l=L.countries||{},c=L.countryCentroids||{},d=a.toUpperCase();a=d,2===a.length?a=r[d]||s[d]:3===a.length&&(a=o[d]||a),a?(i=l[a],n=c[a]):console.log("Code not found: "+d);var f=new L.GeoJSON(i);return{location:f,text:L.GeometryUtils.getName(i)||a,center:n}},STATE:function(t,e){var i,n,a=this.options.codeField?L.Util.getFieldValue(t,this.options.codeField):e,o=L.states||{},r=L.stateCentroids||{},s=a.toUpperCase();a=s,i=o[a],n=r[a];var l=new L.GeoJSON(i);return{location:l,text:L.GeometryUtils.getName(i)||a,center:n}},GEOJSON:function(t){var e=this.options.geoJSONField,i=e?L.Util.getFieldValue(t,e):t,n=null;if(i){var a=this,o=function(t,e){return a.recordToLayer(t,e)};n=L.GeometryUtils.getGeoJSONLocation(i,t,this.options.locationTextField,o)}return n},LOOKUP:function(t,e){var i=this.options.codeField?L.Util.getFieldValue(t,this.options.codeField):e;this._lookupIndex=this._lookupIndex||L.GeometryUtils.indexFeatureCollection(this.options.locationLookup,this.options.locationIndexField||this.options.codeField);var n=this._lookupIndex[i],a=null;if(n||0!==i.indexOf("0")||(n=this._lookupIndex[i.substring(1)]),n){var o=this,r=function(t,e){return o.recordToLayer(t,e)};a=L.GeometryUtils.getGeoJSONLocation(n,t,this.options.locationTextField,r)}return a},CUSTOM:function(t){var e,i=this.options.codeField,n=L.Util.getFieldValue(t,i),a={};if(a[n]=t,this.options.getLocation){var o=this,r=function(t,e){o.locationToLayer(e,a[t])};e=this.options.getLocation(a,i,[n],r)}return e}},L.DataLayer=L.LayerGroup.extend({includes:L.Mixin.Events,initialize:function(t,e){L.Util.setOptions(this,e),L.LayerGroup.prototype.initialize.call(this,e),t=t||{},this._includeFunction=this.options.filter||this.options.includeLayer,this._markerFunction=this.options.getMarker||this._getMarker,this._boundaryLayer=new L.LayerGroup,this.addLayer(this._boundaryLayer),this.addData(t)},_zoomFunction:function(){var t=this._map,e=this,i=t.getZoom();if(this.options.maxZoom&&i>this.options.maxZoom)this.hiddenLayers=[],this.eachLayer(function(i){e.hiddenLayers.push(i),t.removeLayer(i)});else if(this.hiddenLayers){for(;this.hiddenLayers.length>0;){var n=this.hiddenLayers.pop();t.addLayer(n),this.options.backgroundLayer&&n.bringToBack&&n.bringToBack()}this.hiddenLayers=null}},onAdd:function(t){L.LayerGroup.prototype.onAdd.call(this,t),t.on("zoomend",this._zoomFunction,this)},onRemove:function(t){L.LayerGroup.prototype.onRemove.call(this,t),t.off("zoomend",this._zoomFunction,this)},bringToBack:function(){this.invoke("bringToBack"),this._boundaryLayer&&this._boundaryLayer.invoke("bringToBack")},bringToFront:function(){this._boundaryLayer&&this._boundaryLayer.invoke("bringToFront"),this.invoke("bringToFront")},getBounds:function(){var t;return this.eachLayer(function(e){e.getBounds&&(t?t.extend(e.getBounds()):t=e.getBounds())}),t},options:{recordsField:"features",locationMode:L.LocationModes.LATLNG,latitudeField:"geometry.coordinates.1",longitudeField:"geometry.coordinates.0",displayField:null,displayOptions:null,layerOptions:{numberOfSides:4,radius:10,weight:1,color:"#000"},showLegendTooltips:!0,tooltipOptions:{iconSize:new L.Point(60,50),iconAnchor:new L.Point(-5,50),mouseOverExaggeration:2},setHighlight:function(t){return t.weight=t.weight||1,t.fillOpacity=t.fillOpacity||.5,t.weight*=2,t.fillOpacity/=1.5,t},unsetHighlight:function(t){return t.weight=t.weight||1,t.fillOpacity=t.fillOpacity||.25,t.weight/=2,t.fillOpacity*=1.5,t}},_getLocation:function(t,e){return this.options.locationMode.call(this,t,e)},_processLocation:function(t){var e=t.center;return e},_addBoundary:function(t,e,i){var n=t.location;if(this.options.includeBoundary){if(n instanceof L.LatLngBounds&&(n=new L.Rectangle(n)),n.setStyle){var a;this.options.boundaryStyle instanceof Function&&(a=this.options.boundaryStyle.call(this,i,n)),a=a||this.options.boundaryStyle||L.extend({},e,{fillOpacity:.2,clickable:!1}),n.setStyle(a)}this._boundaryLayer.addLayer(n)}},_getLayer:function(t,e,i){return this._addBoundary(t,e,i),t=this._processLocation(t),t?this._markerFunction.call(this,t,e,i):void 0},_getMarker:function(t,e){var i;return t&&(i=e.numberOfSides>=30&&!(e.innerRadius||e.innerRadiusX&&e.innerRadiusY)?new L.CircleMarker(t,e):new L.RegularPolygonMarker(t,e)),i},_preProcessRecords:function(t){return t},_shouldLoadRecord:function(t){return this._includeFunction?this._includeFunction.call(this,t):!0},_loadRecords:function(t){var e;t=this._preProcessRecords(t);for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];n=this.options.deriveProperties?this.options.deriveProperties(n):n;var a=this._shouldLoadRecord(n);a&&(e=this._getLocation(n,i),this.locationToLayer(e,n))}},_preloadLocations:function(t){var e=this.options.codeField,i=[],n={};for(var a in t)if(t.hasOwnProperty(a)){var o=t[a],r=L.Util.getFieldValue(o,e);n[r]=o,i.push(r)}if(this.options.getLocation){var s=this,l=function(t,e){s.locationToLayer(e,n[t])};this.options.getLocation(n,e,i,l)}},setDisplayOptions:function(t){return this.options.displayOptions=t,this.reloadData(),this},setDisplayOption:function(t,e){if(this.options.displayOptions=this.options.displayOptions||{},t in this.options.displayOptions){var i=this.options.displayOptions[t];this.options.displayOptions[t]=L.extend({},i,e)}else this.options.displayOptions[t]=e;return this.reloadData(),this},setFilter:function(t){return this.options.filter=t,this.reloadData(),this},setData:function(t){this._data=t,this.reloadData()},reloadData:function(){return this.clearLayers(),this._data&&this.addData(this._data),this.fire("legendChanged",this),this},addData:function(t){var e=null!==this.options.recordsField&&this.options.recordsField.length>0?L.Util.getFieldValue(t,this.options.recordsField):t;this.options.locationMode===L.LocationModes.CUSTOM&&this.options.preload?this._preloadLocations(e):this._loadRecords(e),this._data=t},locationToLayer:function(t,e){var i;i=this.recordToLayer(t,e),i&&this.addLayer(i)},_bindMouseEvents:function(t,e,i){var n=this,a=this.options,o=a.setHighlight,r=a.unsetHighlight,s=a.tooltipOptions,l=function(t){var e=t.target,a=this.options||e.options,r=new L.LegendIcon(i,a,{className:s.className||"leaflet-div-icon",iconSize:s.iconSize,iconAnchor:s.iconAnchor}),l=t.latlng||t.target._latlng,c=new L.Marker(l,{icon:r});n.addLayer(c),n.tooltip&&(n.removeLayer(n.tooltip),n.tooltip=null),n.tooltip=c,o&&(a=o(a)),e.setStyle&&e.setStyle(a)},c=function(t){n.tooltip&&n.tooltip.setLatLng(t.latlng)},d=function(t){n.tooltip&&(n.removeLayer(n.tooltip),n.tooltip=null);var e=t.target,i=this.options||e.options;r&&(i=r(i)),e.setStyle&&e.setStyle(i)},f=function(t){t.on({mouseover:l,mouseout:d,mousemove:c})},h=function(t){t.eachLayer?t.eachLayer(function(t){h(t)}):f(t)};h(t)},_getDynamicOptions:function(t){var e=L.Util.extend({},this.options.layerOptions),i=this.options.displayOptions,n={};if(i)for(var a in i){var o,r=i[a],s=L.Util.getFieldValue(t,a),l=r.displayText?r.displayText(s):s;if(n[a]={name:r.displayName,value:l},r.styles)e=L.Util.extend(e,r.styles[s]),r.styles[s]=e;else for(var c in r)o=r[c],e[c]=o.evaluate?o.evaluate(s):o.call?o.call(this,s):o}return{layerOptions:e,legendDetails:n}},recordToLayer:function(t,e){var i,n=L.Util.extend({},this.options.layerOptions),a={},o=!0;if(this._includeFunction&&(o=this._includeFunction.call(this,e)),o){var r=this._getDynamicOptions(e);n=r.layerOptions,a=r.legendDetails,t&&n&&(n.title=t.text,i=this._getLayer(t,n,e),i&&(this.options.showLegendTooltips&&this._bindMouseEvents(i,n,a),this.options.onEachRecord&&this.options.onEachRecord.call(this,i,e,t,this)))}return i},getLegend:function(t){return this.options.getLegend?this.options.getLegend.call(this,t):this._getLegend(t)},_getLegendElement:function(t){var e,i,n=document.createElement("i"),a=t.displayProperties,o=t.layerOptions,r=t.ignoreProperties,s=t.displayTextFunction,l=t.index,c=t.numSegments,d=t.segmentWidth,f=t.minValue,h=t.maxValue;L.StyleConverter.applySVGStyle(n,o);for(var u in a)if(-1===r.indexOf(u)&&(valueFunction=a[u],valueFunction&&(valueFunction.getBounds||a.minValue&&a.maxValue))){var p=valueFunction.getBounds?valueFunction.getBounds():null,b=p?p[0].x:a.minValue,g=p?p[1].x:a.maxValue,y=new L.LinearFunction(new L.Point(0,b),new L.Point(c,g));e=b,i=g,s&&(e=s(b),i=s(g)),0===l&&(f.innerHTML=e,h.innerHTML=i);var _=(g-b)/c,m=y.evaluate(l),v=y.evaluate(l+1),P=valueFunction.evaluate?valueFunction.evaluate(m):valueFunction(m),x=valueFunction.evaluate?valueFunction.evaluate(v):valueFunction(v);L.StyleConverter.setCSSProperty(n,u,P),"fillColor"===u&&(n.style.cssText+=t.gradient?"background-image:linear-gradient(left , "+P+" 0%, "+x+" 100%);"+"background-image:-ms-linear-gradient(left , "+P+" 0%, "+x+" 100%);"+"background-image:-moz-linear-gradient(left , "+P+" 0%, "+x+" 100%);"+"background-image:-webkit-linear-gradient(left , "+P+" 0%, "+x+" 100%);":"background-color:"+x+";"),"color"===u&&(n.style.cssText+="border-top-color:"+P+";"+"border-bottom-color:"+x+";"+"border-left-color:"+P+";"+"border-right-color:"+x+";"),"weight"===u&&(n.style.cssText+="border-top-width:"+P+";"+"border-bottom-width:"+x+";"+"border-left-width:"+P+";"+"border-right-width:"+x+";");var w=_*l+b,C=w+_;s&&valueFunction&&(w=s(w),C=s(C)),n.setAttribute("title",w+" - "+C)}return n.style.width=d+"px",n},_getLegend:function(t){t=t||this.options.legendOptions||{};var e,i=t.className,n=document.createElement("div"),a=L.DomUtil.create("div","legend",n),o=t.numSegments||10,r=t.width||100,s=this.options.layerOptions||{},l=s.weight||0,c=r/o-2*l,d=this.options.displayOptions||{};i&&L.DomUtil.addClass(a,i),t.title&&(L.DomUtil.create("legend","",a).innerHTML=t.title);var f=function(t){return t};for(var h in d){var u=d[h],p=u.displayName||h;e=u.displayText;var b=e?e:f,g=u.styles;if(L.DomUtil.create("div","legend-title",a).innerHTML=p,g)a.innerHTML+=new L.CategoryLegend(g).generate();else{for(var y=L.DomUtil.create("div","data-layer-legend"),_=L.DomUtil.create("div","min-value",y),m=L.DomUtil.create("div","scale-bars",y),v=L.DomUtil.create("div","max-value",y),P=["displayName","displayText","minValue","maxValue"],x=0;o>x;++x){var w={displayProperties:u,layerOptions:s,ignoreProperties:P,displayTextFunction:b,index:x,numSegments:o,segmentWidth:c,minValue:_,maxValue:v,gradient:t.gradient},C=this._getLegendElement(w);m.appendChild(C)}a.appendChild(y)}}return n.innerHTML}}),L.dataLayer=function(t,e){return new L.DataLayer(t,e)},L.MapMarkerDataLayer=L.DataLayer.extend({_getMarker:function(t,e){return new L.MapMarker(t,e)}}),L.mapMarkerDataLayer=function(t,e){return new L.MapMarkerDataLayer(t,e)},L.MarkerDataLayer=L.DataLayer.extend({initialize:function(t,e){this._markerMap={},L.DataLayer.prototype.initialize.call(this,t,e)},options:{recordsField:"features",locationMode:L.LocationModes.LATLNG,latitudeField:"latitude",longitudeField:"longitude",layerOptions:{icon:null},showLegendTooltips:!1},_getMarker:function(t,e,i){return this.options.setIcon&&(e.icon=this.options.setIcon.call(this,i,e)),new L.Marker(t,e)},_getLegendElement:function(){},_getLegend:function(){return"No legend available"}}),L.markerDataLayer=function(t,e){return new L.MarkerDataLayer(t,e)},L.PanoramioLayer=L.MarkerDataLayer.extend({statics:{UPLOAD_DATE_FORMAT:"DD MMM YYYY",SIZE_BY_DATE:"date",SIZE_BY_POPULARITY:"popularity",SIZE_BY_NONE:"none",SIZES:{square:[60,60],mini_square:[32,32]},NUM_PHOTOS:50}}),L.PanoramioLayer=L.PanoramioLayer.extend({initialize:function(t){L.MarkerDataLayer.prototype.initialize.call(this,{},t),this._from=0,this._to=L.PanoramioLayer.NUM_PHOTOS,this._calls=[]},options:{recordsField:"photos",latitudeField:"latitude",longitudeField:"longitude",locationMode:L.LocationModes.LATLNG,showLegendTooltips:!1,sizeBy:L.PanoramioLayer.SIZE_BY_DATE,layerOptions:{opacity:1},onEachRecord:function(t,e){var i=e.photo_file_url,n=e.photo_title,a=this,o=e.width,r=e.height,s=2e4;t.on("click",function(l){var c=document.createElement("div"),d=L.DomUtil.create("div","",c),f=L.DomUtil.create("img","photo",d);f.setAttribute("onload","this.style.opacity=1;"),f.setAttribute("src",i),f.style.width=o+"px";var h=L.DomUtil.create("div","photo-info",d);h.style.width=o-20+"px",h.innerHTML=""+n+""+''+''+"";var u=L.DomUtil.create("a","author-link",d);u.setAttribute("target","_blank"),u.setAttribute("href",e.owner_url),u.innerHTML="by "+e.owner_name;var p=new L.DivIcon({className:"photo-details",html:c.innerHTML,iconAnchor:[o/2,r/2]}),b=new L.Marker(l.target._latlng,{icon:p,zIndexOffset:s});b.on("click",function(t){a.removeLayer(t.target)}),t.viewedImage=b,a.viewedImage=b,a.addLayer(b)}),this.options.onEachPhoto&&this.options.onEachPhoto.call(this,t,e)},setIcon:function(t){var e=L.Util.getFieldValue(t,"photo_title"),i=null;this._sizeFunction&&(i=this._sizeFunction.evaluate(t.index));var n=i?new L.Point(i,i):L.PanoramioLayer.SIZES[this.options.size],a=t.photo_file_url.replace("/medium/","/"+this.options.size+"/"),o=new L.DivIcon({iconSize:n,className:"",html:''});return o},updateInterval:3e5,size:"square",attributionText:'Photos provided by . Photos provided by are under the copyright of their owners',refreshEvents:"moveend",photoSet:"public"},includes:L.Mixin.Events,onAdd:function(t){L.DataLayer.prototype.onAdd.call(this,t),t.attributionControl&&t.attributionControl.addAttribution(this.options.attributionText);var e=this,i=function(){e._from=0,e._to=L.PanoramioLayer.NUM_PHOTOS,e.fire("requestingPhotos"),e._call&&clearTimeout(e._call);var t=function(){e.requestPhotos()};e._call=setTimeout(t,1e3)};this.requestPhotos(),this._interval=setInterval(i,this.options.updateInterval),this._resetFunction=i,t.on(this.options.refreshEvents,i)},onRemove:function(t){L.DataLayer.prototype.onRemove.call(this,t),t.attributionControl&&t.attributionControl.removeAttribution(this.options.attributionText),this._interval&&(clearInterval(this._interval),this._interval=null),t.off(this.options.refreshEvents,this._resetFunction)},calculateSizeByDate:function(t){for(var e=t.photos,i=[],n=0;e.length>n;++n){var a=e[n],o=moment(a.upload_date,L.PanoramioLayer.UPLOAD_DATE_FORMAT);i.push(o),e[n].index=o}i.sort(function(t,e){return t-e});var r=L.PanoramioLayer.SIZES[this.options.size][0];return this._sizeFunction=new L.LinearFunction([i[0],r/2],[i[i.length-1],r]),t},calculateSizeByPopularity:function(t){for(var e=t.photos,i=0;e.length>i;++i)e[i].index=i;var n=L.PanoramioLayer.SIZES[this.options.size][0];return this._sizeFunction=new L.LinearFunction([0,n/2],[e.length,n]),t},next:function(){this._from=this._to,this._to=this._from+L.PanoramioLayer.NUM_PHOTOS,this.requestPhotos()},previous:function(){this._to=this._from,this._from=this._from-L.PanoramioLayer.NUM_PHOTOS,this.requestPhotos()},requestJsonp:function(t,e,i){var n=this,a="function"+(new Date).getTime(),o=[];e.callback="window.LeafletDvfJsonpCallbacks."+a;for(property in e)e.hasOwnProperty(property)&&o.push(property+"="+encodeURIComponent(e[property]));return t+=(t.indexOf("?")>0?"&":"?")+o.join("&"),window.LeafletDvfJsonpCallbacks===void 0&&(window.LeafletDvfJsonpCallbacks={}),window.LeafletDvfJsonpCallbacks[a]=function(t){i.call(n,t),delete window.LeafletDvfJsonpCallbacks[a]},this.jsonpScript&&(document.head.removeChild(this.jsonpScript),this.jsonpScript=null),this.jsonpScript=document.createElement("script"),this.jsonpScript.setAttribute("type","text/javascript"),this.jsonpScript.setAttribute("async","true"),this.jsonpScript.setAttribute("src",t),document.head.appendChild(this.jsonpScript),{abort:function(){a in window.LeafletDvfJsonpCallbacks&&(window.LeafletDvfJsonpCallbacks[a]=function(){delete window.LeafletDvfJsonpCallbacks[a]})}}},requestPhotos:function(){for(var t=this,e=this._map.getBounds(),i=e.getSouthWest(),n=e.getNorthEast();t._calls.length>0;)t._calls.pop().abort();var a=this.requestJsonp("http://www.panoramio.com/map/get_panoramas.php",{set:this.options.photoSet,from:t._from,to:t._to,minx:i.lng,miny:i.lat,maxx:n.lng,maxy:n.lat,size:"medium",mapfilter:"true"},function(e){t._count=e.count,moment&&t.options.sizeBy===L.PanoramioLayer.SIZE_BY_DATE?e=t.calculateSizeByDate(e):t.options.sizeBy===L.PanoramioLayer.SIZE_BY_POPULARITY&&(e=t.calculateSizeByPopularity(e)),t.fire("photosAvailable",e),t.clearLayers(),t.addData(e)});t._calls.push(a)}}),L.panoramioLayer=function(t){return new L.PanoramioLayer(t)},L.GeohashDataLayer=L.DataLayer.extend({initialize:function(t,e){L.DataLayer.prototype.initialize.call(this,t,e)},options:{recordsField:"features",locationMode:L.LocationModes.GEOHASH,geohashField:"geohash",displayField:null,displayOptions:null,layerOptions:{weight:1,color:"#000"}},_getLayer:function(t,e){return new L.Rectangle(t.location,e)}}),L.geohashDataLayer=function(t,e){return new L.GeohashDataLayer(t,e)},L.ChoroplethDataLayer=L.DataLayer.extend({initialize:function(t,e){L.DataLayer.prototype.initialize.call(this,t,e)},options:{recordsField:"features",locationMode:L.LocationModes.COUNTRY,codeField:"ISO",displayField:null,displayOptions:null,layerOptions:{weight:1,color:"#000"},maxZoom:16,backgroundLayer:!0},_getLayer:function(t,e,i){return t.location instanceof L.LatLng&&(t.location=this._markerFunction.call(this,t.location,e,i)),t.location.setStyle&&(e.gradient=t.location instanceof L.Polyline?!1:e.gradient,t.location.setStyle(e)),t.location}}),L.choroplethDataLayer=function(t,e){return new L.ChoroplethDataLayer(t,e)},L.ChartDataLayer=L.DataLayer.extend({options:{showLegendTooltips:!1},initialize:function(t,e){L.DataLayer.prototype.initialize.call(this,t,e)},_getLayer:function(t,e,i){this._addBoundary(t,e,i),t=this._processLocation(t);var n=this.options.chartOptions,a=this.options.tooltipOptions,o={};o=e,o.data={},o.chartOptions=n;for(var r in this.options.chartOptions)o.data[r]=L.Util.getFieldValue(i,r);for(var r in a)o[r]=a[r];var s;return t&&(s=this._getMarker(t,o)),s},_getMarker:function(){},_getLegend:function(t){L.DataLayer.prototype._getLegend.call(this,t);var e=new L.CategoryLegend(this.options.chartOptions);return t=t||this.options.legendOptions,e.generate(t)}}),L.BarChartDataLayer=L.ChartDataLayer.extend({initialize:function(t,e){L.ChartDataLayer.prototype.initialize.call(this,t,e)},_getMarker:function(t,e){return new L.BarChartMarker(t,e)}}),L.barChartDataLayer=function(t,e){return new L.BarChartDataLayer(t,e)},L.RadialBarChartDataLayer=L.ChartDataLayer.extend({initialize:function(t,e){L.ChartDataLayer.prototype.initialize.call(this,t,e)},_getMarker:function(t,e){return new L.RadialBarChartMarker(t,e)}}),L.radialBarChartDataLayer=function(t,e){return new L.RadialBarChartDataLayer(t,e)},L.PieChartDataLayer=L.ChartDataLayer.extend({initialize:function(t,e){L.ChartDataLayer.prototype.initialize.call(this,t,e)},_getMarker:function(t,e){return new L.PieChartMarker(t,e)}}),L.pieChartDataLayer=function(t,e){return new L.PieChartDataLayer(t,e)},L.CoxcombChartDataLayer=L.ChartDataLayer.extend({initialize:function(t,e){L.ChartDataLayer.prototype.initialize.call(this,t,e)},_getMarker:function(t,e){return new L.CoxcombChartMarker(t,e)}}),L.coxcombChartDataLayer=function(t,e){return new L.CoxcombChartDataLayer(t,e)},L.StackedRegularPolygonDataLayer=L.ChartDataLayer.extend({initialize:function(t,e){L.ChartDataLayer.prototype.initialize.call(this,t,e)},_getMarker:function(t,e){return new L.StackedRegularPolygonMarker(t,e)}}),L.stackedRegularPolygonDataLayer=function(t,e){return new L.StackedRegularPolygonDataLayer(t,e)},L.RadialMeterMarkerDataLayer=L.DataLayer.extend({options:{showLegendTooltips:!1},initialize:function(t,e){L.DataLayer.prototype.initialize.call(this,t,e)},_getLayer:function(t,e,i){this._addBoundary(t,e),t=this._processLocation(t);var n=this.options.chartOptions,a=this.options.tooltipOptions,o=this.options.displayOptions,r={};r=e,r.data={},r.chartOptions=n,r.displayOptions=o;for(var s in this.options.chartOptions)r.data[s]=L.Util.getFieldValue(i,s);for(var s in a)r[s]=a[s];var l;return t&&(l=this._getMarker(t,r)),l},_getMarker:function(t,e){return new L.RadialMeterMarker(t,e)}}),L.radialMeterMarkerDataLayer=function(t,e){return new L.RadialMeterMarkerDataLayer(t,e)},L.CalloutLine=L.Path.extend({statics:{LINESTYLE:{ARC:"arc",ANGLE:"angle",STRAIGHT:"straight"},DIRECTION:{NE:"ne",NW:"nw",SE:"se",SW:"sw"}}}),L.CalloutLine=L.CalloutLine.extend({initialize:function(t,e){L.Util.setOptions(this,e),L.Path.prototype.initialize.call(this,e),this._latlng=t},options:{size:new L.Point(60,30),position:new L.Point(0,0),color:"#FFFFFF",opacity:1,weight:2,fillColor:"#000000",fill:!1,gradient:!1,dropShadow:!1,direction:L.CalloutLine.DIRECTION.NE,lineStyle:L.CalloutLine.LINESTYLE.ANGLE,lineCap:"butt",lineJoin:"miter",arrow:!1},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._points=this._getPoints()},getEndPoint:function(){return this.projectLatlngs(),this._points[this._points.length-1]},_getPathAngle:function(){return new L.SVGPathBuilder(this._points,[],{closePath:!1}).build(6)},_getPathArc:function(){var t=(this.options.direction||L.CalloutLine.DIRECTION.NE).toLowerCase(),e=t[0],i="n"===e?-1:1,n=this._points[0],a=this._points[this._points.length-1],o=["M",n.x,",",n.y," Q",n.x,",",n.y+i*this.options.size.y," ",a.x,",",a.y];return o.join(" ")},_getPoints:function(){var t=this._point.x+this.options.position.x,e=this._point.y+this.options.position.y,i=this.options.size.x,n=this.options.size.y,a=(this.options.direction||L.CalloutLine.DIRECTION.NE).toLowerCase(),o=[],r=a[1],s=a[0],l="w"===r?-1:1,c="n"===s?-1:1;o.push(new L.Point(t,e));var d=e+c*n,f=i/2,h=Math.atan(n/f);if(this.options.lineStyle===L.CalloutLine.LINESTYLE.ARC?h=Math.atan(Math.pow(n,2)/f):this.options.lineStyle===L.CalloutLine.LINESTYLE.STRAIGHT&&(h=Math.atan(n/i)),this._angle=h,this.options.lineStyle!==L.CalloutLine.LINESTYLE.STRAIGHT){var u=new L.Point(t+l*f,d);o.push(u)}var p=new L.Point(t+l*i,d);return o.push(p),o},getBounds:function(){var t=this._map,e=t.project(this._latlng),i=new L.Point(e.x+this.options.position.x,e.y+this.options.position.y),n=new L.Point(i.x+this.options.size.x,i.y-this.options.size.y),a=t.unproject(i),o=t.unproject(n);return new L.LatLngBounds(a,o)},setLatLng:function(t){this._latlng=t,this.redraw()},getLatLng:function(){return this._latlng},getPathString:function(){this._path.setAttribute("shape-rendering","geometricPrecision");var t=this.options.lineStyle||L.CalloutLine.LINESTYLE.ANGLE,e="";return e+=t===L.CalloutLine.LINESTYLE.ANGLE||t===L.CalloutLine.LINESTYLE.STRAIGHT?this._getPathAngle():this._getPathArc()}}),L.calloutLine=function(t,e){return new L.CalloutLine(t,e)},L.Callout=L.LayerGroup.extend({options:{color:"#FFFFFF",fillColor:"#FFFFFF"},initialize:function(t,e){L.Util.setOptions(this,e),L.LayerGroup.prototype.initialize.call(this,e),this._latlng=t},onAdd:function(t){L.LayerGroup.prototype.onAdd.call(this,t),this.addLayers()},addArrow:function(t,e,i){if(this.options.arrow){var t=L.LatLng.RAD_TO_DEG*t,n=this.options.numberOfSides||3,a=this.options.radius||6,o=180/n,r={se:o+t,sw:180+o-t,nw:180+o+t,ne:o-t},s=r[e],l=new L.RegularPolygonMarker(this._latlng,{position:i,numberOfSides:n,rotation:s,fillColor:this.options.fillColor,color:this.options.color,gradient:this.options.gradient,weight:this.options.weight,opacity:this.options.opacity,fillOpacity:this.options.fillOpacity,radius:a,lineCap:"butt",lineJoin:"miter"});this.addLayer(l)}},addLine:function(){var t={};for(var e in this.options)"icon"!==e&&(t[e]=this.options[e]);var i=new L.CalloutLine(this._latlng,t);return this.addLayer(i),i},addIcon:function(t,e){var i=this.options.size,n=this.options.icon,a=n.options.iconSize,o=t[0],r=t[1],s="w"===r?a.x+i.x-e.x:-1*(i.x+e.x),l="n"===o?a.y/2+i.y-e.y:-1*(-a.y/2+i.y+e.y);n.options.iconAnchor=new L.Point(s,l);var c=new L.Marker(this._latlng,{icon:n});this.addLayer(c)},addLayers:function(){var t,e=(this.options.direction||"ne").toLowerCase(),i=this.options.position||new L.Point(0,0);t=this.addLine(),this.addIcon(e,i),this.addArrow(t._angle,e,i)}}),L.callout=function(t,e){return new L.Callout(t,e)},L.FlowLine=L.DataLayer.extend({statics:{LINE_FUNCTION:function(t,e,i){return new L.Polyline([t,e],i)},LINE_FUNCTION_INTERPOLATED:function(t,e,i){var n=this._map.latlngToLayerPoint(t),a=this._map.latlngToLayerPoint(e),o=new L.LinearFunction(n,a),r=Math.ceil(n.distanceTo(a)/i.interpolationOptions.segmentLength);o.samplePoints(r)}}}),L.FlowLine=L.FlowLine.extend({initialize:function(t,e){L.Util.setOptions(this,e),L.DataLayer.prototype.initialize.call(this,t,e)},options:{getLine:L.FlowLine.LINE_FUNCTION},onEachSegment:function(t,e,i){var n={};if(this.options.timeField){var a=L.Util.getFieldValue(t,this.options.timeField),o=L.Util.getFieldValue(e,this.options.timeField),r=this.options.timeFormat,s=r?moment(a,r):moment(a),l=r?moment(o,r):moment(o),c=l.valueOf()-s.valueOf();n.time=c}for(var d in this.options.displayOptions){var f=L.Util.getFieldValue(t,d),h=L.Util.getFieldValue(e,d),u=h-f,p=100*(u/f);n[d]={from:f,to:h,change:u,percentChange:p},n.time&&(n[d].changeOverTime=u/n.time)}var b,g=i.getLatLngs(),y=g[0].distanceTo(g[1]);n.time&&(b=y/(1e3*n.time)),this.options.onEachSegment&&this.options.onEachSegment.call(this,t,e,i,n,y,b)},_loadRecords:function(t){var e,i=this.options.layerOptions,n=[];for(var a in t)if(t.hasOwnProperty(a)){var o=t[a];if(e=this._getLocation(o,a)){var r,s=this._getLayer(e,i,o),l=!0;if(this.options.includeLayer&&(l=this.options.includeLayer(o)),this._lastRecord&&l){var i=this._getDynamicOptions(this._lastRecord);r=this.options.getLine.call(this,this._lastMarker.getLatLng(),s.getLatLng(),i.layerOptions),this.addLayer(r),this.onEachSegment(this._lastRecord,o,r)}l&&(this._lastRecord=o,this._lastMarker=s)}}for(;n.length>0;)this.addLayer(n.pop())}}),L.flowLine=function(t,e){return new L.FlowLine(t,e)},L.ArcedFlowLine=L.FlowLine.extend({options:{getLine:function(t,e,i){return new L.ArcedPolyline([t,e],i)}},initialize:function(t,e){L.FlowLine.prototype.initialize.call(this,t,e)}}),L.arcedFlowLine=function(t,e){return new L.ArcedFlowLine(t,e)},L.ArcedPolyline=L.Path.extend({includes:TextFunctions,initialize:function(t,e){L.Path.prototype.initialize.call(this,e),this._latlngs=t},options:{distanceToHeight:new L.LinearFunction([0,5],[1e3,200]),color:"#FFFFFF",opacity:1,weight:1,fillColor:"#000000",fill:!1,gradient:!1,dropShadow:!1,optimizeSpeed:!1},projectLatlngs:function(){this._points=[];for(var t=0;this._latlngs.length>t;++t)this._points.push(this._map.latLngToLayerPoint(this._latlngs[t]))},getBounds:function(){for(var t=new L.LatLngBounds,e=0;this._latlngs.length>e;++e)t.extend(this._latlngs[e]);return t},setLatLngs:function(t){this._latlngs=t,this.redraw()},getLatLngs:function(){return this._latlngs},drawSegment:function(t,e){var i=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),n=this.options.distanceToHeight.evaluate(i),a=["M",t.x,",",t.y," C",t.x,",",t.y-n," ",e.x,",",e.y-n," ",e.x,",",e.y];return a.join(" ")},getPathString:function(){this.options.optimizeSpeed&&this._path.setAttribute("shape-rendering","optimizeSpeed");for(var t=[],e=0;this._points.length-1>e;++e)t.push(this.drawSegment(this._points[e],this._points[e+1]));return t.join("")}}),L.arcedPolyline=function(t,e){return new L.ArcedPolyline(t,e)},L.Control.Legend=L.Control.extend({options:{position:"bottomright",autoAdd:!0},onAdd:function(t){var e="leaflet-control-legend",i=L.DomUtil.create("div",e),n=this;return this.options.autoAdd&&(t.on("layeradd",function(t){var e=t.layer;n.addLayer(e)}),t.on("layerremove",function(t){var e=t.layer;n.removeLayer(e)})),this.toggleSize=L.bind(this.toggleSize,this),L.DomEvent.addListener(i,"mouseover",this.toggleSize).addListener(i,"mouseout",this.toggleSize).addListener(i,"click",L.DomEvent.stopPropagation).addListener(i,"click",L.DomEvent.preventDefault),i},clear:function(){this._container.innerHTML=""},toggleSize:function(){L.DomUtil.hasClass(this._container,"larger")?L.DomUtil.removeClass(this._container,"larger"):L.DomUtil.addClass(this._container,"larger")},redrawLayer:function(t){this.removeLayer(t),this.addLayer(t)},addLayer:function(t){var e=L.Util.stamp(t),i=this;t.getLegend&&(this.addLegend(e,t.getLegend()),t.on("legendChanged",function(){i.redrawLayer(t)}))},removeLayer:function(t){var e=L.Util.stamp(t);if(t.getLegend){var i=document.getElementById(e);i.parentNode.removeChild(i),t.off("legendChanged")}},addLegend:function(t,e){var i=this._container,n=document.getElementById(t);n||(n=L.DomUtil.create("div","",i),n.id=t),n.innerHTML=e}}),L.control.legend=function(t){return new L.Control.Legend(t)}; \ No newline at end of file +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=[];this._maxPoint.x>=n;)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=[];this._maxPoint.x>=n;)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;this._parts.length>i;++i){var n=this._parts[i];e.push(t[n])}return this.options.includeAlpha&&e.push(this.options.alpha),e},this._getColorString=function(t){t=this._formatOutput(t),this.options[this._dynamicPart]=t;var e=this._mapOutput(this.options);return this._writeColor(this._prefix,e)},this._writeColor=function(t,e){return this.options.includeAlpha&&(t+="a"),t+"("+e.join(",")+")"};var n=function(t){i&&i.postProcess&&(t=i.postProcess.call(this,t));var e=this._getColorString(t);return L.Browser.ie&&e.indexOf("hsl")>-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(),l=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,l),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(),l=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,l),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;this._functions.length>r;++r)if(a=this._functions[r],e=a.getBounds(),i=e[0],n=e[1],t>=i.x&&n.x>t){o=!0;break}return o?a:this._functions[this._functions.length-1]},evaluate:function(t){var e,i=null;return this._preProcess&&(t=this._preProcess(t)),e=this._getFunction(t),e&&(i=e.evaluate(t),this._postProcess&&(i=this._postProcess(i))),i}}),L.CustomColorFunction=L.PiecewiseFunction.extend({options:{interpolate:!0},initialize:function(t,e,i,n){var a,o=e-t,r=o/(i.length-1),s=[];L.Util.setOptions(this,n);for(var l=0;i.length>l;++l){var d=Math.min(l+1,i.length-1);a=this.options.interpolate?new L.RGBColorBlendFunction(t+r*l,t+r*d,i[l],i[d]):new L.RGBColorBlendFunction(t+r*l,t+r*d,i[l],i[l]),s.push(a)}L.PiecewiseFunction.prototype.initialize.call(this,s)}}),L.CategoryFunction=L.Class.extend({initialize:function(t,e){L.Util.setOptions(this,e),this._categoryKeys=Object.keys(t),this._categoryMap=t,this._preProcess=this.options.preProcess,this._postProcess=this.options.postProcess},evaluate:function(t){var e;return this._preProcess&&(t=this._preProcess(t)),e=this._categoryMap[t],this._postProcess&&(e=this._postProcess(e)),e},getCategories:function(){return this._categoryKeys}}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){for(var i=e||0,n=this.length;n>i;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;a.length-1>r;++r)n=a[r],o[n]=o[n]||{},o=o[n];o[a[a.length-1]]=i},L.Util.getFieldValue=function(t,e){var i=null;if(e){for(var n,a,o,r,s,l,d,c=e.split("."),f=t,u=-1,h=0;c.length>h;++h)if(n=c[h],u=n.indexOf("["),u>-1){l=n.substring(u),n=n.substring(0,u),l=l.replace("[","").replace("]",""),a=l.split("="),o=a[0],r=a[1],f=f[n];for(var p=0;f.length>p;++p)s=f[p],d=s[o],d&&d===r&&(f=s)}else{if(!f||!f.hasOwnProperty(n)){f=null;break}f=f[n]}i=f}else i=t;return i},L.Util.getNumericRange=function(t,e){var i=Number.MAX_VALUE,n=Number.MIN_VALUE;for(var a in t)if(t.hasOwnProperty(a)){var o=t[a],r=L.Util.getFieldValue(o,e);i=Math.min(i,r),n=Math.max(n,r)}return[i,n]},L.CategoryLegend=L.Class.extend({initialize:function(t){L.Util.setOptions(this,t)},generate:function(t){t=t||{};var e=document.createElement("div"),i=L.DomUtil.create("div","legend",e),n=t.className,a=this.options;n&&L.DomUtil.addClass(i,n),t.title&&(L.DomUtil.create("div","legend-title",i).innerHTML=t.title);for(var o in a){categoryOptions=a[o];var r=categoryOptions.displayName||o,s=L.DomUtil.create("div","data-layer-legend",i),l=L.DomUtil.create("div","legend-box",s);L.DomUtil.create("div","key",s).innerHTML=r,L.StyleConverter.applySVGStyle(l,categoryOptions)}return e.innerHTML}}),L.LegendIcon=L.DivIcon.extend({initialize:function(t,e,i){var n,a=document.createElement("div"),o=L.DomUtil.create("div","legend",a),r=L.DomUtil.create("div","title",o),s=L.DomUtil.create("div","legend-box",o),l=L.DomUtil.create("div","legend-values",o),d=e.title||e.name;d&&(r.innerHTML=d);for(var c in t)n=t[c],L.DomUtil.create("div","key",l).innerHTML=n.name||c,L.DomUtil.create("div","value",l).innerHTML=n.value;L.StyleConverter.applySVGStyle(s,e),s.style.height="5px",i.html=a.innerHTML,i.className=i.className||"legend-icon",L.DivIcon.prototype.initialize.call(this,i)}}),L.legendIcon=function(t,e,i){return new L.LegendIcon(t,e,i)},L.GeometryUtils={getName:function(t){var e=null;if(t&&t.features)for(var i=0;t.features.length>i;++i){var n=t.features[i];if(n.properties&&n.properties.name){e=n.properties.name;break}}return e},getGeoJSONLocation:function(t,e,i,n){var a=new L.GeoJSON(t,{pointToLayer:function(t,a){var o={location:a,text:i?L.Util.getFieldValue(e,i):[a.lat.toFixed(3),a.lng.toFixed(3)].join(", "),center:a};return n(o,e)}}),o=null;try{o=L.GeometryUtils.loadCentroid(t)}catch(r){console.log("Error loading centroid for "+JSON.stringify(t))}return{location:a,text:i?L.Util.getFieldValue(e,i):null,center:o}},mergeProperties:function(t,e,i){var n,a,o=e.features,r=L.GeometryUtils.indexFeatureCollection(o,i),s={type:"FeatureCollection",features:[]};for(var l in t)if(t.hasOwnProperty(l)&&(n=t[l],a=n[i])){var d=r[a];for(var c in n)d.properties[c]=n[c];s.features.push(d)}return s},indexFeatureCollection:function(t,e){for(var i,n,a,o=t.features,r={},s=0;o.length>s;++s)if(i=o[s],n=i.properties,a=n[e],a in r){var l=r[a];"GeometryCollection"!==l.geometry.type?r[a]={type:"Feature",geometry:{type:"GeometryCollection",geometries:[i.geometry,l.geometry]}}:l.geometry.geometries.push(i.geometry)}else r[a]=i;return r},arrayToMap:function(t,e,i){for(var n,a,o,r={},s=0;t.length>s;++s)n=t[s],a=n[e],o=i?n[i]:n,r[a]=o;return r},arrayToMaps:function(t,e){for(var i,n,a,o,r,s,l,d=[],c=0;e.length>c;++c)d.push({});for(var f=0;t.length>f;++f){n=t[f];for(var u=0;e.length>u;++u)i=d[u],r=e[u],s=r.from,l=r.to,a=n[s],o=l?n[l]:n,i[a]=o}return d},loadCentroid:function(t){var e,i,n,a=null;if(t.geometry&&"Point"===t.geometry.type)a=new L.LatLng(t.geometry.coordinates[1],t.geometry.coordinates[0]);else if("undefined"!=typeof jsts){var o=new jsts.io.GeoJSONParser,r=o.read(t);if(r.getCentroid)e=r.getCentroid(),i=e.coordinate.x,n=e.coordinate.y;else if(r.features){for(var s=0,l=0,d=0;r.features.length>d;++d)e=r.features[d].geometry.getCentroid(),s+=e.coordinate.x,l+=e.coordinate.y;i=s/r.features.length,n=l/r.features.length}else e=r.geometry.getCentroid(),i=e.coordinate.x,n=e.coordinate.y;a=new L.LatLng(n,i)}return a},loadCentroids:function(t){var e,i={};for(var n in t)e=t[n],i[n]=L.GeometryUtils.loadCentroid(e);return i}},L.SVGPathBuilder=L.Class.extend({initialize:function(t,e,i){this._points=t||[],this._innerPoints=e||[],L.Util.setOptions(this,i)},options:{closePath:!0},_getPathString:function(t,e){var i="";if(t.length>0){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;t.length>s;s++)n=t[s],i+=o+n.x.toFixed(e)+","+n.y.toFixed(e);this.options.closePath&&(i+=r)}return i},addPoint:function(t,e){e?this._innerPoints.push(t):this._points.push(t)},build:function(t){t=t||this.options.digits;var e=this._getPathString(this._points,t);return this._innerPoints&&(e+=this._getPathString(this._innerPoints,t)),e}}),L.StyleConverter={keyMap:{fillColor:{property:["background-color"],valueFunction:function(t){return t}},color:{property:["color","border-top-color","border-right-color","border-bottom-color","border-left-color"],valueFunction:function(t){return t}},weight:{property:["border-width"],valueFunction:function(t){return Math.ceil(t)+"px"}},stroke:{property:["border-style"],valueFunction:function(t){return t===!0?"solid":"none"}},dashArray:{property:["border-style"],valueFunction:function(t){var e="solid";return t&&(e="dashed"),e}},barThickness:{property:["height"],valueFunction:function(t){return t+"px"}},radius:{property:["height"],valueFunction:function(t){return 2*t+"px"}},fillOpacity:{property:["opacity"],valueFunction:function(t){return t}}},applySVGStyle:function(t,e,i){var n=L.StyleConverter.keyMap;i&&(n=L.Util.extend(n,i)),t.style.borderStyle="solid";for(var a in e)L.StyleConverter.setCSSProperty(t,a,e[a],n);return t},setCSSProperty:function(t,e,i,n){var n=n||L.StyleConverter.keyMap,a=n[e],o="";if(a)for(var r=a.property,s=0,l=r.length;l>s;++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;this._categories.length>a;++a){t=this._categories[a],n[t]={};for(var o in this._styleFunctionMap)e=this._styleFunctionMap[o],i=e.evaluate?e.evaluate(a):"function"==typeof e?e(a):e,n[t][o]=i}this._styleMap=n},getStyles:function(){return this._styleMap}}),L.PaletteBuilder=L.Class.extend({initialize:function(t){this._styleFunctionMap=t},generate:function(t){t=t||{};var e=document.createElement("div"),i=L.DomUtil.create("div","palette",e),n=t.count||10,a=function(t){for(var e=[],i=0;t>i;++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 l=L.DomUtil.create("i","palette-element",i),d=r[s];L.StyleConverter.applySVGStyle(l,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 l=t[s];if("object"==typeof l){var d=document.createElement("div");d.appendChild(L.HTMLUtils.buildTable(l,i)),l=d.innerHTML}r.innerHTML+=""+s+""+l+""}return a}},L.AnimationUtils={animate:function(t,e,i,n){var a=n.delay||0,o=n.frames||30,r=n.duration||500,s={},l=n.easeFunction||function(t){return t},d=n.complete,c=r/o;for(var f in e)"color"!=f&&"fillColor"!=f&&i[f]?s[f]=new L.LinearFunction([0,e[f]],[o-1,i[f]]):("color"==f||"fillColor"==f)&&(s[f]=new L.RGBColorBlendFunction(0,o-1,e[f],i[f]));var u={},h=0,p=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=l(c),o>h?setTimeout(p,c):d()};setTimeout(p,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 l=o-r;switch(a=s>.5?l/(2-o-r):l/(o+r),o){case t:n=(e-i)/l+(i>e?6:0);break;case e:n=(i-t)/l+2;break;case i:n=(t-e)/l+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+6*(e-t)*(2/3-i):t}var a,o,r;if(0==e)a=o=r=i;else{var s=.5>i?i*(1+e):i+e-i*e,l=2*i-s;a=n(l,s,t+1/3),o=n(l,s,t),r=n(l,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 1>this._a&&(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(1>this._a)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;e.length>i;++i)1===e[i].length&&(e[i]="0"+e[i]);t="#"+e.join("")}return t},r:function(t){return arguments.length?this.setRGB(t,this._rgb[1],this._rgb[2]):this._rgb[0]},g:function(t){return arguments.length?this.setRGB(this._rgb[0],t,this._rgb[2]):this._rgb[1]},b:function(t){return arguments.length?this.setRGB(this._rgb[0],this._rgb[1],t):this._rgb[2]},h:function(t){return arguments.length?this.setHSL(t,this._hsl[1],this._hsl[2]):this._hsl[0]},s:function(t){return arguments.length?this.setHSL(this._hsl[0],t,this._hsl[2]):this._hsl[1]},l:function(t){return arguments.length?this.setHSL(this._hsl[0],this._hsl[1],t):this._hsl[2]},a:function(t){return arguments.length?(this._a=t,this):this._a}}),L.RGBColor=L.Color.extend({initialize:function(t){L.Color.prototype.initialize.call(this,t)},parseColorDef:function(t){var e,i,n,a,o=t instanceof Array,r=0===t.indexOf("#"),s=[];o?(e=Math.floor(t[0]),i=Math.floor(t[1]),n=Math.floor(t[2]),a=4===t.length?t[3]:1):r?(t=t.replace("#",""),e=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16),a=8===t.length?parseInt(t.substring(6,8),16):1):(s=t.replace("rgb","").replace("a","").replace(/\s+/g,"").replace("(","").replace(")","").split(","),e=parseInt(s[0]),i=parseInt(s[1]),n=parseInt(s[2]),a=4===s.length?parseInt(s[3]):1),this.setRGB(e,i,n),this._a=a}}),L.rgbColor=function(t){return new L.RGBColor(t)},L.HSLColor=L.Color.extend({initialize:function(t){L.Color.prototype.initialize.call(this,t)},parseColorDef:function(t){var e,i,n,a,o=t instanceof Array;if(o)e=t[0],i=t[1],n=t[2],a=4===t.length?t[3]:1;else{var r=t.replace("hsl","").replace("a","").replace("(","").replace(/\s+/g,"").replace(/%/g,"").replace(")","").split(",");e=Number(r[0])/360,i=Number(r[1])/100,n=Number(r[2])/100,a=4===r.length?parseInt(r[3]):1}this.setHSL(e,i,n),this._a=a}}),L.hslColor=function(t){return new L.HSLColor(t)},L.Animation=L.Class.extend({initialize:function(t,e){this._easeFunction=t,this._animateFrame=e},run:function(t,e){this.stop(),this._el=t,this._inProgress=!0,this._duration=e.duration||.25,this._animationOptions=e,this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=L.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?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 l in n){var d=n[l],c=d.evaluate?d.evaluate(s):d;L.StyleConverter.setCSSProperty(s,l,c)}s.style.width=r+"px",e.appendChild(s)}return e}}),L.RegularPolygon=L.Polygon.extend({statics:{R:6378.137,M_PER_KM:1e3},initialize:function(t,e){this._centerLatLng=t,L.Util.setOptions(this,e),L.Polygon.prototype.initialize.call(this,this._getLatLngs(),e)},options:{fill:!0,radius:1e3,numberOfSides:4,rotation:0,maxDegrees:360},getLatLng:function(){return this._centerLatLng},setRadius:function(t){this.options.radius=t,this._latlngs=this._getLatLngs(),this.redraw()},_getLatLngs:function(){for(var t,e=this.options.maxDegrees||360,i=e/Math.max(this.options.numberOfSides,3),n=e+this.options.rotation,a=this.options.rotation,o=[];n>a;)t=this._getPoint(a),o.push(t),a+=i;return o},_getPoint:function(t){var e=function(t){return t*L.LatLng.DEG_TO_RAD},i=function(t){return t*L.LatLng.RAD_TO_DEG},n=e(t),a=this.options.radius/L.RegularPolygon.M_PER_KM/L.RegularPolygon.R,o=e(this._centerLatLng.lat),r=e(this._centerLatLng.lng),s=Math.asin(Math.sin(o)*Math.cos(a)+Math.cos(o)*Math.sin(a)*Math.cos(n)),l=r+Math.atan2(Math.sin(n)*Math.sin(a)*Math.cos(o),Math.cos(a)-Math.sin(o)*Math.sin(s));return s=i(s),l=i(l),new L.LatLng(s,l)}}),L.regularPolygon=function(t,e){return new L.RegularPolygon(t,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 l=this.getTextAnchor();this.setTextAnchor(l)}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;o.length>s;++s){var l=o[s],d=this._createElement("stop");l.style=l.style||{};for(var r in l){var c=l[r];if("style"===r){var f="";c.color=c.color||this.options.fillColor||this.options.color,c.opacity=c.opacity===void 0?1:c.opacity;for(var u in c)f+="stop-"+u+":"+c[u]+";";c=f}d.setAttribute(r,c)}e.appendChild(d)}this._gradient=e,this._defs.appendChild(e)},_createDropShadow:function(t){this._defs||this._createDefs(),this._dropShadow&&this._defs.removeChild(this._dropShadow);var e=L.Util.guid(),i=this._createElement("filter"),n=this._createElement("feOffset"),a=this._createElement("feGaussianBlur"),o=this._createElement("feBlend");t=t||{width:"200%",height:"200%"},t.id="filter"+e;for(var r in t)i.setAttribute(r,t[r]);var s={result:"offOut","in":"SourceAlpha",dx:"2",dy:"2"},l={result:"blurOut","in":"offOut",stdDeviation:"2"},d={"in":"SourceGraphic",in2:"blurOut",mode:"lighten"};for(var r in s)n.setAttribute(r,s[r]);for(var r in l)a.setAttribute(r,l[r]);for(var r in d)o.setAttribute(r,d[r]);i.appendChild(n),i.appendChild(a),i.appendChild(o),this._dropShadow=i,this._defs.appendChild(i)},_createCustomElement:function(t,e){var i=this._createElement(t);for(var n in e)e.hasOwnProperty(n)&&i.setAttribute(n,e[n]);return i},_createImage:function(t){var e=this._createElement("image");return e.setAttribute("width",t.width),e.setAttribute("height",t.height),e.setAttribute("x",t.x||0),e.setAttribute("y",t.y||0),e.setAttributeNS(L.Path.XLINK_NS,"xlink:href",t.url),e},_createPattern:function(t){var e=this._createCustomElement("pattern",t);return e},_createShape:function(t,e){var i=this._createCustomElement(t,e);return i},_applyCustomStyles:function(){},_createFillPattern:function(t){var e=L.Util.guid(),i=t.pattern;i.id=e,i.patternUnits=i.patternUnits||"objectBoundingBox";var n=this._createPattern(i),a=this._createImage(t.image);a.setAttributeNS(L.Path.XLINK_NS,"xlink:href",t.url),n.appendChild(a),this._defs||this._createDefs(),this._defs.appendChild(n),this._path.setAttribute("fill","url(#"+e+")")},_getDefaultDiameter:function(t){return 1.75*t},_createShapeImage:function(t){t=t||{};var e=L.Util.guid(),i=this.options.radius||Math.max(this.options.radiusX,this.options.radiusY),n=this._getDefaultDiameter(i),a=t.imageSize||new L.Point(n,n),o=t.radius||n/2,r=t.shape||{circle:{r:o,cx:0,cy:0}},s=t.pattern||{width:a.x,height:a.y,x:0,y:0},l=Object.keys(r),d=l.length>0?l[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 f=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),f.appendChild(u),this._defs.appendChild(f),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},setRadius:function(t){return this.options.radius=t,this.redraw()},setInnerRadius:function(t){return this.options.innerRadius=t,this.redraw()},setRotation:function(t){return this.options.rotation=t,this.redraw()},setNumberOfSides:function(t){return this.options.numberOfSides=t,this.redraw()},getPathString:function(){var t=this.getTextAnchor();if(this._shape)if("circle"===this._shape.tagName||"ellipse"===this._shape.tagName)this._shape.setAttribute("cx",t.x),this._shape.setAttribute("cy",t.y);else{var e=this._shape.getAttribute("width"),i=this._shape.getAttribute("height");this._shape.setAttribute("x",t.x-Number(e)/2),this._shape.setAttribute("y",t.y-Number(i)/2)}return 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=[],l=this.options.radius,d=Math.sqrt(.75),c=function(t){return t*L.LatLng.DEG_TO_RAD},f=this._point;for(t||(s.push(f),s.push(new L.Point(f.x+d*l,f.y-1.5*l)));o>r;)i=c(r),e=this._getPoint(i,l,t),s.push(e),r+=a;return t||s.push(new L.Point(f.x-d*l,f.y-1.5*l)),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),l=t.unproject(r),d=t.unproject(s);return new L.LatLngBounds(l,d)},setRadius:function(t){return this.options.radius=t,this.redraw()},setRadiusXY:function(t,e){return this.options.radius=null,this.options.radiusX=t,this.options.radiusY=e,this.redraw()},setInnerRadius:function(t){return this.options.innerRadius=t,this.redraw()},setInnerRadiusXY:function(t,e){return this.options.innerRadius=null,this.options.innerRadiusX=t,this.options.innerRadiusY=e,this.redraw()},setRotation:function(t){return this.options.rotation=t,this.redraw()},setNumberOfSides:function(t){return this.options.numberOfSides=t,this.redraw()},getLatLng:function(){return this._latlng},getPathString:function(){var t=this.getTextAnchor();if(this._shape)if("circle"===this._shape.tagName||"ellipse"===this._shape.tagName)this._shape.setAttribute("cx",t.x),this._shape.setAttribute("cy",t.y);else{var e=this._shape.getAttribute("width"),i=this._shape.getAttribute("height");this._shape.setAttribute("x",t.x-Number(e)/2),this._shape.setAttribute("y",t.y-Number(i)/2)}return this._path.setAttribute("shape-rendering","geometricPrecision"),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=[],l=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,l,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},setNumberOfPoints:function(t){return this.options.numberOfPoints=t,this.redraw()},_getPoints:function(t){for(var e,i,n,a=this.options.maxDegrees||360,o=a/this.options.numberOfPoints,r=a,s=0,l=[],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,f=function(t){return t*L.LatLng.DEG_TO_RAD};r>s;)n=f(s),e=this._getPoint(n,d,c),i=this._getPoint(n+f(o)/2,d/2,c/2),l.push(e),l.push(i),s+=o;return l}}),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!==(r+"").indexOf("%")?"":"px")),n.setAttribute("height",s+(-1!==(s+"").indexOf("%")?"":"px")));var l=t.options.size||new L.Point(r,s),d=new L.Point(l.x/r,l.y/s),c=e.getElementsByTagName("svg");c.length>0&&c[0].parentNode.removeChild(c[0]),e.appendChild(n);var f=[],u=t.options.anchor||new L.Point(-l.x/2,-l.y/2),h=t._point.x+u.x,p=t._point.y+u.y;f.push("translate("+h+" "+p+")"),f.push("scale("+d.x+" "+d.y+")"),t.options.rotation&&f.push("rotate("+t.options.rotation+" "+r/2+" "+s/2+")"),e.setAttribute("transform",f.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,l=this.options.value/this.options.maxValue*this.options.maxHeight;return t=new L.Point(o+s,r),e=new L.Point(o+s,r-l),i=new L.Point(o-s,r-l),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,l=s.x-this._point.x,d=s.y-this._point.y,c=a.iconSize,f=l,u=d,h=5;f=0>l?c.x-l+h:-l-h,u=0>d?c.y-d+h:-d-h,n=new L.Point(f,u);var p={},b=a.displayText?a.displayText(r):r;p[o]={name:a.displayName,value:b};var g=new L.LegendIcon(p,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,l=Object.keys(this.options.data),d=l.length,c=this.options.width,f=this.options.offset||0,u=this.options.data,h=this.options.chartOptions;a=-(c*d+f*(d-1))/2+c/2,o=0;for(var p in u)t=u[p],r=h[p],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=p,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+f}}),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),l=t.unproject(r),d=t.unproject(s);return new L.LatLngBounds(l,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),l=r(e);return n.push(this._getPoint(s,a,o)),n.push(this._getPoint(l,a,o)),this.options.barThickness&&(this._innerPoints=[],this._innerPoints.push(this._getPoint(l,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,l=this.options.rotation,d=this.options,c=this.options.data,f=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=f[n],r=t/a,o=r*s,d.startAngle=l,d.endAngle=l+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),l=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,l=this.options,d="radiusX"in this.options?this.options.radiusX:this.options.radius,c="radiusY"in this.options?this.options.radiusY:this.options.radius,f=Object.keys(this.options.data),u=f.length,h=this.options.data,p=this.options.chartOptions;o=r/u;for(var b in h){t=parseFloat(h[b]),a=p[b];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)),y=new L.LinearFunction(new L.Point(e,0),new L.Point(i,c));l.radiusX=g.evaluate(t),l.radiusY=y.evaluate(t)}else{var _=Math.max(d,c),m=Math.PI*Math.pow(_,2)/u,v=new L.LinearFunction(new L.Point(e,0),new L.Point(i,m),{postProcess:function(t){return Math.sqrt(u*t/Math.PI)}});l.radiusX=v.evaluate(t),l.radiusY=l.radiusX}l.startAngle=s,l.endAngle=s+o,l.fillColor=a.fillColor,l.color=a.color||"#000",l.rotation=0,l.key=b,l.value=t,l.displayName=a.displayName,l.displayText=a.displayText,n=new L.RadialBarMarker(this._latlng,l),this._bindMouseEvents(n),s=l.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,l=this.options.radiusX||this.options.radius,d=this.options.radiusY||this.options.radius,c=this.options.data,f=this.options.chartOptions,u=this.options.barThickness||4,h=this.options.offset||2;for(var p in c){t=parseFloat(c[p]),a=f[p],e=a.minValue||0,i=a.maxValue||100;var b=new L.LinearFunction(new L.Point(e,0),new L.Point(i,r));o=b.evaluate(t),s.startAngle=this.options.rotation,s.endAngle=this.options.rotation+o,s.fillColor=a.fillColor,s.radiusX=l,s.radiusY=d,s.barThickness=u,s.rotation=0,s.key=p,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),l+=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,l=this.options.chartOptions;for(n in s){t=parseFloat(s[n]),i=l[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,l=this.options,d=this.options.radiusX||this.options.radius,c=this.options.radiusY||this.options.radius,f=this.options.data,u=this.options.chartOptions,h=this.options.barThickness||4,p=r,b=this.options.numSegments||10,g=s/b;for(var y in f){t=parseFloat(f[y]),a=u[y],o=this.options.displayOptions?this.options.displayOptions[y]:{},e=a.minValue||0,i=a.maxValue||100;for(var _=i-e,m=s/_*(t-e),v=r+m,P=r+s,x=new L.LinearFunction(new L.Point(r,e),new L.Point(P,i));v>p;){l.startAngle=p;var w=Math.min(g,v-p);l.endAngle=p+w,l.fillColor=a.fillColor,l.radiusX=d,l.radiusY=c,l.barThickness=h,l.rotation=0,l.key=y,l.value=t,l.displayName=a.displayName,l.displayText=a.displayText;var C=x.evaluate(p+w);for(var F in o)l[F]=o[F].evaluate?o[F].evaluate(C):o[F];n=new L.RadialBarMarker(this._latlng,l),this._bindMouseEvents(n),this.addLayer(n),p+=w}if(this.options.backgroundStyle&&P>p){var w=P-p;l.endAngle=p+w,l.radiusX=d,l.radiusY=c,l.barThickness=h,l.rotation=0,l.key=y,l.value=t,l.displayName=a.displayName,l.displayText=a.displayText,l.fillColor=null,l.fill=!1,l.gradient=!1;for(var S in this.options.backgroundStyle)l[S]=this.options.backgroundStyle[S];var C=x.evaluate(p+w);n=new L.RadialBarMarker(this._latlng,l),this.addLayer(n)}}}}),L.LocationModes={LATLNG:function(t,e){var i=function(e,i){var n=L.Util.getFieldValue(t,e),a=L.Util.getFieldValue(t,i),o=null;if(n&&a){var r=new L.LatLng(n,a);o={location:r,text:[r.lat.toFixed(3),r.lng.toFixed(3)].join(", "),center:r}}return o},n=i(this.options.latitudeField,this.options.longitudeField);if(!n&&this.options.fallbackLocationFields)for(var a,e=0;!n&&this.options.fallbackLocationFields.length>e;)a=this.options.fallbackLocationFields[e],n=i(a.latitudeField,a.longitudeField),e++;return n},GEOHASH:function(t,e){var i,n=this.options.geohashField?L.Util.getFieldValue(t,this.options.geohashField):e,a=decodeGeoHash(n);return a.latitude[2]&&a.longitude[2]&&(i=new L.LatLngBounds(new L.LatLng(a.latitude[0],a.longitude[0]),new L.LatLng(a.latitude[1],a.longitude[1]))),{location:i,text:n,center:i.getCenter()}},GWCOUNTRY:function(t,e){var i,n,a=this.options.codeField?L.Util.getFieldValue(t,this.options.codeField):e,o=L.gwNoLookup||{},r=L.countries||{},s=L.countryCentroids||{},l=a.toUpperCase();a=l;var d=l in o;d&&(a=o[l]||a),a?(i=r[a],n=s[a]):console.log("Code not found: "+l);var c=new L.GeoJSON(i);return{location:c,text:L.GeometryUtils.getName(i)||a,center:n}},COUNTRY:function(t,e){var i,n,a=this.options.codeField?L.Util.getFieldValue(t,this.options.codeField):e,o=L.codeLookup||{},r=L.alpha2Lookup||{},s=L.fips2Lookup||{},l=L.countries||{},d=L.countryCentroids||{},c=a.toUpperCase();a=c,2===a.length?a=r[c]||s[c]:3===a.length&&(a=o[c]||a),a?(i=l[a],n=d[a]):console.log("Code not found: "+c);var f=new L.GeoJSON(i);return{location:f,text:L.GeometryUtils.getName(i)||a,center:n}},STATE:function(t,e){var i,n,a=this.options.codeField?L.Util.getFieldValue(t,this.options.codeField):e,o=L.states||{},r=L.stateCentroids||{},s=a.toUpperCase();a=s,i=o[a],n=r[a];var l=new L.GeoJSON(i);return{location:l,text:L.GeometryUtils.getName(i)||a,center:n}},GEOJSON:function(t){var e=this.options.geoJSONField,i=e?L.Util.getFieldValue(t,e):t,n=null;if(i){var a=this,o=function(t,e){return a.recordToLayer(t,e)};n=L.GeometryUtils.getGeoJSONLocation(i,t,this.options.locationTextField,o)}return n},LOOKUP:function(t,e){var i=this.options.codeField?L.Util.getFieldValue(t,this.options.codeField):e;this._lookupIndex=this._lookupIndex||L.GeometryUtils.indexFeatureCollection(this.options.locationLookup,this.options.locationIndexField||this.options.codeField);var n=this._lookupIndex[i],a=null;if(n||0!==i.indexOf("0")||(n=this._lookupIndex[i.substring(1)]),n){var o=this,r=function(t,e){return o.recordToLayer(t,e)};a=L.GeometryUtils.getGeoJSONLocation(n,t,this.options.locationTextField,r)}return a},CUSTOM:function(t){var e,i=this.options.codeField,n=L.Util.getFieldValue(t,i),a={};if(a[n]=t,this.options.getLocation){var o=this,r=function(t,e){o.locationToLayer(e,a[t])};e=this.options.getLocation(a,i,[n],r)}return e}},L.DataLayer=L.LayerGroup.extend({includes:L.Mixin.Events,initialize:function(t,e){L.Util.setOptions(this,e),L.LayerGroup.prototype.initialize.call(this,e),t=t||{},this._includeFunction=this.options.filter||this.options.includeLayer,this._markerFunction=this.options.getMarker||this._getMarker,this._boundaryLayer=new L.LayerGroup,this.addLayer(this._boundaryLayer),this.addData(t)},_zoomFunction:function(){var t=this._map,e=this,i=t.getZoom();if(this.options.maxZoom&&i>this.options.maxZoom)this.hiddenLayers=[],this.eachLayer(function(i){e.hiddenLayers.push(i),t.removeLayer(i)});else if(this.hiddenLayers){for(;this.hiddenLayers.length>0;){var n=this.hiddenLayers.pop();t.addLayer(n),this.options.backgroundLayer&&n.bringToBack&&n.bringToBack()}this.hiddenLayers=null}},onAdd:function(t){L.LayerGroup.prototype.onAdd.call(this,t),t.on("zoomend",this._zoomFunction,this)},onRemove:function(t){L.LayerGroup.prototype.onRemove.call(this,t),t.off("zoomend",this._zoomFunction,this)},bringToBack:function(){this.invoke("bringToBack"),this._boundaryLayer&&this._boundaryLayer.invoke("bringToBack")},bringToFront:function(){this._boundaryLayer&&this._boundaryLayer.invoke("bringToFront"),this.invoke("bringToFront")},getBounds:function(){var t;return this.eachLayer(function(e){e.getBounds&&(t?t.extend(e.getBounds()):t=e.getBounds())}),t},options:{recordsField:"features",locationMode:L.LocationModes.LATLNG,latitudeField:"geometry.coordinates.1",longitudeField:"geometry.coordinates.0",displayField:null,displayOptions:null,layerOptions:{numberOfSides:4,radius:10,weight:1,color:"#000"},showLegendTooltips:!0,tooltipOptions:{iconSize:new L.Point(60,50),iconAnchor:new L.Point(-5,50),mouseOverExaggeration:2},setHighlight:function(t){return t.weight=t.weight||1,t.fillOpacity=t.fillOpacity||.5,t.weight*=2,t.fillOpacity/=1.5,t},unsetHighlight:function(t){return t.weight=t.weight||1,t.fillOpacity=t.fillOpacity||.25,t.weight/=2,t.fillOpacity*=1.5,t}},_getLocation:function(t,e){return this.options.locationMode.call(this,t,e)},_processLocation:function(t){var e=t.center;return e},_addBoundary:function(t,e,i){var n=t.location;if(this.options.includeBoundary){if(n instanceof L.LatLngBounds&&(n=new L.Rectangle(n)),n.setStyle){var a;this.options.boundaryStyle instanceof Function&&(a=this.options.boundaryStyle.call(this,i,n)),a=a||this.options.boundaryStyle||L.extend({},e,{fillOpacity:.2,clickable:!1}),n.setStyle(a)}this._boundaryLayer.addLayer(n)}},_getLayer:function(t,e,i){return this._addBoundary(t,e,i),t=this._processLocation(t),t?this._markerFunction.call(this,t,e,i):void 0},_getMarker:function(t,e){var i;return t&&(i=e.numberOfSides>=30&&!(e.innerRadius||e.innerRadiusX&&e.innerRadiusY)?new L.CircleMarker(t,e):new L.RegularPolygonMarker(t,e)),i},_preProcessRecords:function(t){return t},_shouldLoadRecord:function(t){return this._includeFunction?this._includeFunction.call(this,t):!0},_loadRecords:function(t){var e;t=this._preProcessRecords(t);for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];n=this.options.deriveProperties?this.options.deriveProperties(n):n;var a=this._shouldLoadRecord(n);a&&(e=this._getLocation(n,i),this.locationToLayer(e,n))}},_preloadLocations:function(t){var e=this.options.codeField,i=[],n={};for(var a in t)if(t.hasOwnProperty(a)){var o=t[a],r=L.Util.getFieldValue(o,e);n[r]=o,i.push(r)}if(this.options.getLocation){var s=this,l=function(t,e){s.locationToLayer(e,n[t])};this.options.getLocation(n,e,i,l)}},setDisplayOptions:function(t){return this.options.displayOptions=t,this.reloadData(),this},setDisplayOption:function(t,e){if(this.options.displayOptions=this.options.displayOptions||{},t in this.options.displayOptions){var i=this.options.displayOptions[t];this.options.displayOptions[t]=L.extend({},i,e)}else this.options.displayOptions[t]=e;return this.reloadData(),this},setFilter:function(t){return this.options.filter=t,this.reloadData(),this},setData:function(t){this._data=t,this.reloadData()},reloadData:function(){return this.clearLayers(),this._data&&this.addData(this._data),this.fire("legendChanged",this),this},addData:function(t){var e=null!==this.options.recordsField&&this.options.recordsField.length>0?L.Util.getFieldValue(t,this.options.recordsField):t;this.options.locationMode===L.LocationModes.CUSTOM&&this.options.preload?this._preloadLocations(e):this._loadRecords(e),this._data=t},locationToLayer:function(t,e){var i;i=this.recordToLayer(t,e),i&&this.addLayer(i)},_bindMouseEvents:function(t,e,i){var n=this,a=this.options,o=a.setHighlight,r=a.unsetHighlight,s=a.tooltipOptions,l=function(t){var e=t.target,a=this.options||e.options,r=new L.LegendIcon(i,a,{className:s.className||"leaflet-div-icon",iconSize:s.iconSize,iconAnchor:s.iconAnchor}),l=t.latlng||t.target._latlng,d=new L.Marker(l,{icon:r});n.addLayer(d),n.tooltip&&(n.removeLayer(n.tooltip),n.tooltip=null),n.tooltip=d,o&&(a=o(a)),e.setStyle&&e.setStyle(a)},d=function(t){n.tooltip&&n.tooltip.setLatLng(t.latlng)},c=function(t){n.tooltip&&(n.removeLayer(n.tooltip),n.tooltip=null);var e=t.target,i=this.options||e.options;r&&(i=r(i)),e.setStyle&&e.setStyle(i)},f=function(t){t.on({mouseover:l,mouseout:c,mousemove:d})},u=function(t){t.eachLayer?t.eachLayer(function(t){u(t)}):f(t)};u(t)},_getDynamicOptions:function(t){var e=L.Util.extend({},this.options.layerOptions),i=this.options.displayOptions,n={};if(i)for(var a in i){var o,r=i[a],s=L.Util.getFieldValue(t,a),l=r.displayText?r.displayText(s):s;if(n[a]={name:r.displayName,value:l},r.styles)e=L.Util.extend(e,r.styles[s]),r.styles[s]=e;else for(var d in r)o=r[d],e[d]=o.evaluate?o.evaluate(s):o.call?o.call(this,s):o}return{layerOptions:e,legendDetails:n}},recordToLayer:function(t,e){var i,n=L.Util.extend({},this.options.layerOptions),a={},o=!0;if(this._includeFunction&&(o=this._includeFunction.call(this,e)),o){var r=this._getDynamicOptions(e);n=r.layerOptions,a=r.legendDetails,t&&n&&(n.title=t.text,i=this._getLayer(t,n,e),i&&(this.options.showLegendTooltips&&this._bindMouseEvents(i,n,a),this.options.onEachRecord&&this.options.onEachRecord.call(this,i,e,t,this)))}return i},getLegend:function(t){return this.options.getLegend?this.options.getLegend.call(this,t):this._getLegend(t)},_getLegendElement:function(t){var e,i,n=document.createElement("i"),a=t.displayProperties,o=t.layerOptions,r=t.ignoreProperties,s=t.displayTextFunction,l=t.index,d=t.numSegments,c=t.segmentWidth,f=t.minValue,u=t.maxValue;L.StyleConverter.applySVGStyle(n,o);for(var h in a)if(-1===r.indexOf(h)&&(valueFunction=a[h],valueFunction&&(valueFunction.getBounds||a.minValue&&a.maxValue))){var p=valueFunction.getBounds?valueFunction.getBounds():null,b=p?p[0].x:a.minValue,g=p?p[1].x:a.maxValue,y=new L.LinearFunction(new L.Point(0,b),new L.Point(d,g));e=b,i=g,s&&(e=s(b),i=s(g)),0===l&&(f.innerHTML=e,u.innerHTML=i);var _=(g-b)/d,m=y.evaluate(l),v=y.evaluate(l+1),P=valueFunction.evaluate?valueFunction.evaluate(m):valueFunction(m),x=valueFunction.evaluate?valueFunction.evaluate(v):valueFunction(v);L.StyleConverter.setCSSProperty(n,h,P),"fillColor"===h&&(n.style.cssText+=t.gradient?"background-image:linear-gradient(left , "+P+" 0%, "+x+" 100%);"+"background-image:-ms-linear-gradient(left , "+P+" 0%, "+x+" 100%);"+"background-image:-moz-linear-gradient(left , "+P+" 0%, "+x+" 100%);"+"background-image:-webkit-linear-gradient(left , "+P+" 0%, "+x+" 100%);":"background-color:"+x+";"),"color"===h&&(n.style.cssText+="border-top-color:"+P+";"+"border-bottom-color:"+x+";"+"border-left-color:"+P+";"+"border-right-color:"+x+";"),"weight"===h&&(n.style.cssText+="border-top-width:"+P+";"+"border-bottom-width:"+x+";"+"border-left-width:"+P+";"+"border-right-width:"+x+";");var w=_*l+b,C=w+_;s&&valueFunction&&(w=s(w),C=s(C)),n.setAttribute("title",w+" - "+C)}return n.style.width=c+"px",n},_getLegend:function(t){t=t||this.options.legendOptions||{};var e,i=t.className,n=document.createElement("div"),a=L.DomUtil.create("div","legend",n),o=t.numSegments||10,r=t.width||100,s=this.options.layerOptions||{},l=s.weight||0,d=r/o-2*l,c=this.options.displayOptions||{};i&&L.DomUtil.addClass(a,i),t.title&&(L.DomUtil.create("legend","",a).innerHTML=t.title);var f=function(t){return t};for(var u in c){var h=c[u],p=h.displayName||u;e=h.displayText;var b=e?e:f,g=h.styles;if(L.DomUtil.create("div","legend-title",a).innerHTML=p,g)a.innerHTML+=new L.CategoryLegend(g).generate();else{for(var y=L.DomUtil.create("div","data-layer-legend"),_=L.DomUtil.create("div","min-value",y),m=L.DomUtil.create("div","scale-bars",y),v=L.DomUtil.create("div","max-value",y),P=["displayName","displayText","minValue","maxValue"],x=0;o>x;++x){var w={displayProperties:h,layerOptions:s,ignoreProperties:P,displayTextFunction:b,index:x,numSegments:o,segmentWidth:d,minValue:_,maxValue:v,gradient:t.gradient},C=this._getLegendElement(w);m.appendChild(C)}a.appendChild(y)}}return n.innerHTML}}),L.dataLayer=function(t,e){return new L.DataLayer(t,e)},L.MapMarkerDataLayer=L.DataLayer.extend({_getMarker:function(t,e){return new L.MapMarker(t,e)}}),L.mapMarkerDataLayer=function(t,e){return new L.MapMarkerDataLayer(t,e)},L.MarkerDataLayer=L.DataLayer.extend({initialize:function(t,e){this._markerMap={},L.DataLayer.prototype.initialize.call(this,t,e)},options:{recordsField:"features",locationMode:L.LocationModes.LATLNG,latitudeField:"latitude",longitudeField:"longitude",layerOptions:{icon:null},showLegendTooltips:!1},_getMarker:function(t,e,i){return this.options.setIcon&&(e.icon=this.options.setIcon.call(this,i,e)),new L.Marker(t,e)},_getLegendElement:function(){},_getLegend:function(){return"No legend available"}}),L.markerDataLayer=function(t,e){return new L.MarkerDataLayer(t,e)},L.PanoramioLayer=L.MarkerDataLayer.extend({statics:{UPLOAD_DATE_FORMAT:"DD MMM YYYY",SIZE_BY_DATE:"date",SIZE_BY_POPULARITY:"popularity",SIZE_BY_NONE:"none",SIZES:{square:[60,60],mini_square:[32,32]},NUM_PHOTOS:50}}),L.PanoramioLayer=L.PanoramioLayer.extend({initialize:function(t){L.MarkerDataLayer.prototype.initialize.call(this,{},t),this._from=0,this._to=L.PanoramioLayer.NUM_PHOTOS,this._calls=[]},options:{recordsField:"photos",latitudeField:"latitude",longitudeField:"longitude",locationMode:L.LocationModes.LATLNG,showLegendTooltips:!1,sizeBy:L.PanoramioLayer.SIZE_BY_DATE,layerOptions:{opacity:1},onEachRecord:function(t,e){var i=e.photo_file_url,n=e.photo_title,a=this,o=e.width,r=e.height,s=2e4;t.on("click",function(l){var d=document.createElement("div"),c=L.DomUtil.create("div","",d),f=L.DomUtil.create("img","photo",c);f.setAttribute("onload","this.style.opacity=1;"),f.setAttribute("src",i),f.style.width=o+"px";var u=L.DomUtil.create("div","photo-info",c);u.style.width=o-20+"px",u.innerHTML=""+n+""+''+''+"";var h=L.DomUtil.create("a","author-link",c);h.setAttribute("target","_blank"),h.setAttribute("href",e.owner_url),h.innerHTML="by "+e.owner_name;var p=new L.DivIcon({className:"photo-details",html:d.innerHTML,iconAnchor:[o/2,r/2]}),b=new L.Marker(l.target._latlng,{icon:p,zIndexOffset:s});b.on("click",function(t){a.removeLayer(t.target)}),t.viewedImage=b,a.viewedImage=b,a.addLayer(b)}),this.options.onEachPhoto&&this.options.onEachPhoto.call(this,t,e)},setIcon:function(t){var e=L.Util.getFieldValue(t,"photo_title"),i=null;this._sizeFunction&&(i=this._sizeFunction.evaluate(t.index));var n=i?new L.Point(i,i):L.PanoramioLayer.SIZES[this.options.size],a=t.photo_file_url.replace("/medium/","/"+this.options.size+"/"),o=new L.DivIcon({iconSize:n,className:"",html:''});return o},updateInterval:3e5,size:"square",attributionText:'Photos provided by . Photos provided by are under the copyright of their owners',refreshEvents:"moveend",photoSet:"public"},includes:L.Mixin.Events,onAdd:function(t){L.DataLayer.prototype.onAdd.call(this,t),t.attributionControl&&t.attributionControl.addAttribution(this.options.attributionText);var e=this,i=function(){e._from=0,e._to=L.PanoramioLayer.NUM_PHOTOS,e.fire("requestingPhotos"),e._call&&clearTimeout(e._call);var t=function(){e.requestPhotos()};e._call=setTimeout(t,1e3)};this.requestPhotos(),this._interval=setInterval(i,this.options.updateInterval),this._resetFunction=i,t.on(this.options.refreshEvents,i)},onRemove:function(t){L.DataLayer.prototype.onRemove.call(this,t),t.attributionControl&&t.attributionControl.removeAttribution(this.options.attributionText),this._interval&&(clearInterval(this._interval),this._interval=null),t.off(this.options.refreshEvents,this._resetFunction)},calculateSizeByDate:function(t){for(var e=t.photos,i=[],n=0;e.length>n;++n){var a=e[n],o=moment(a.upload_date,L.PanoramioLayer.UPLOAD_DATE_FORMAT);i.push(o),e[n].index=o}i.sort(function(t,e){return t-e});var r=L.PanoramioLayer.SIZES[this.options.size][0];return this._sizeFunction=new L.LinearFunction([i[0],r/2],[i[i.length-1],r]),t},calculateSizeByPopularity:function(t){for(var e=t.photos,i=0;e.length>i;++i)e[i].index=i;var n=L.PanoramioLayer.SIZES[this.options.size][0];return this._sizeFunction=new L.LinearFunction([0,n/2],[e.length,n]),t},next:function(){this._from=this._to,this._to=this._from+L.PanoramioLayer.NUM_PHOTOS,this.requestPhotos()},previous:function(){this._to=this._from,this._from=this._from-L.PanoramioLayer.NUM_PHOTOS,this.requestPhotos()},requestJsonp:function(t,e,i){var n=this,a="function"+(new Date).getTime(),o=[];e.callback="window.LeafletDvfJsonpCallbacks."+a;for(property in e)e.hasOwnProperty(property)&&o.push(property+"="+encodeURIComponent(e[property]));return t+=(t.indexOf("?")>0?"&":"?")+o.join("&"),window.LeafletDvfJsonpCallbacks===void 0&&(window.LeafletDvfJsonpCallbacks={}),window.LeafletDvfJsonpCallbacks[a]=function(t){i.call(n,t),delete window.LeafletDvfJsonpCallbacks[a]},this.jsonpScript&&(document.head.removeChild(this.jsonpScript),this.jsonpScript=null),this.jsonpScript=document.createElement("script"),this.jsonpScript.setAttribute("type","text/javascript"),this.jsonpScript.setAttribute("async","true"),this.jsonpScript.setAttribute("src",t),document.head.appendChild(this.jsonpScript),{abort:function(){a in window.LeafletDvfJsonpCallbacks&&(window.LeafletDvfJsonpCallbacks[a]=function(){delete window.LeafletDvfJsonpCallbacks[a]})}}},requestPhotos:function(){for(var t=this,e=this._map.getBounds(),i=e.getSouthWest(),n=e.getNorthEast();t._calls.length>0;)t._calls.pop().abort();var a=this.requestJsonp("http://www.panoramio.com/map/get_panoramas.php",{set:this.options.photoSet,from:t._from,to:t._to,minx:i.lng,miny:i.lat,maxx:n.lng,maxy:n.lat,size:"medium",mapfilter:"true"},function(e){t._count=e.count,moment&&t.options.sizeBy===L.PanoramioLayer.SIZE_BY_DATE?e=t.calculateSizeByDate(e):t.options.sizeBy===L.PanoramioLayer.SIZE_BY_POPULARITY&&(e=t.calculateSizeByPopularity(e)),t.fire("photosAvailable",e),t.clearLayers(),t.addData(e)});t._calls.push(a)}}),L.panoramioLayer=function(t){return new L.PanoramioLayer(t)},L.GeohashDataLayer=L.DataLayer.extend({initialize:function(t,e){L.DataLayer.prototype.initialize.call(this,t,e)},options:{recordsField:"features",locationMode:L.LocationModes.GEOHASH,geohashField:"geohash",displayField:null,displayOptions:null,layerOptions:{weight:1,color:"#000"}},_getLayer:function(t,e){return new L.Rectangle(t.location,e)}}),L.geohashDataLayer=function(t,e){return new L.GeohashDataLayer(t,e)},L.ChoroplethDataLayer=L.DataLayer.extend({initialize:function(t,e){L.DataLayer.prototype.initialize.call(this,t,e)},options:{recordsField:"features",locationMode:L.LocationModes.COUNTRY,codeField:"ISO",displayField:null,displayOptions:null,layerOptions:{weight:1,color:"#000"},maxZoom:16,backgroundLayer:!0},_getLayer:function(t,e,i){return t.location instanceof L.LatLng&&(t.location=this._markerFunction.call(this,t.location,e,i)),t.location.setStyle&&(e.gradient=t.location instanceof L.Polyline?!1:e.gradient,t.location.setStyle(e)),t.location}}),L.choroplethDataLayer=function(t,e){return new L.ChoroplethDataLayer(t,e)},L.ChartDataLayer=L.DataLayer.extend({options:{showLegendTooltips:!1},initialize:function(t,e){L.DataLayer.prototype.initialize.call(this,t,e)},_getLayer:function(t,e,i){this._addBoundary(t,e,i),t=this._processLocation(t);var n=this.options.chartOptions,a=this.options.tooltipOptions,o={};o=e,o.data={},o.chartOptions=n;for(var r in this.options.chartOptions)o.data[r]=L.Util.getFieldValue(i,r);for(var r in a)o[r]=a[r];var s;return t&&(s=this._getMarker(t,o)),s},_getMarker:function(){},_getLegend:function(t){L.DataLayer.prototype._getLegend.call(this,t);var e=new L.CategoryLegend(this.options.chartOptions);return t=t||this.options.legendOptions,e.generate(t)}}),L.BarChartDataLayer=L.ChartDataLayer.extend({initialize:function(t,e){L.ChartDataLayer.prototype.initialize.call(this,t,e)},_getMarker:function(t,e){return new L.BarChartMarker(t,e)}}),L.barChartDataLayer=function(t,e){return new L.BarChartDataLayer(t,e)},L.RadialBarChartDataLayer=L.ChartDataLayer.extend({initialize:function(t,e){L.ChartDataLayer.prototype.initialize.call(this,t,e)},_getMarker:function(t,e){return new L.RadialBarChartMarker(t,e)}}),L.radialBarChartDataLayer=function(t,e){return new L.RadialBarChartDataLayer(t,e)},L.PieChartDataLayer=L.ChartDataLayer.extend({initialize:function(t,e){L.ChartDataLayer.prototype.initialize.call(this,t,e)},_getMarker:function(t,e){return new L.PieChartMarker(t,e)}}),L.pieChartDataLayer=function(t,e){return new L.PieChartDataLayer(t,e)},L.CoxcombChartDataLayer=L.ChartDataLayer.extend({initialize:function(t,e){L.ChartDataLayer.prototype.initialize.call(this,t,e)},_getMarker:function(t,e){return new L.CoxcombChartMarker(t,e)}}),L.coxcombChartDataLayer=function(t,e){return new L.CoxcombChartDataLayer(t,e)},L.StackedRegularPolygonDataLayer=L.ChartDataLayer.extend({initialize:function(t,e){L.ChartDataLayer.prototype.initialize.call(this,t,e)},_getMarker:function(t,e){return new L.StackedRegularPolygonMarker(t,e)}}),L.stackedRegularPolygonDataLayer=function(t,e){return new L.StackedRegularPolygonDataLayer(t,e)},L.RadialMeterMarkerDataLayer=L.DataLayer.extend({options:{showLegendTooltips:!1},initialize:function(t,e){L.DataLayer.prototype.initialize.call(this,t,e)},_getLayer:function(t,e,i){this._addBoundary(t,e),t=this._processLocation(t);var n=this.options.chartOptions,a=this.options.tooltipOptions,o=this.options.displayOptions,r={};r=e,r.data={},r.chartOptions=n,r.displayOptions=o;for(var s in this.options.chartOptions)r.data[s]=L.Util.getFieldValue(i,s);for(var s in a)r[s]=a[s];var l;return t&&(l=this._getMarker(t,r)),l},_getMarker:function(t,e){return new L.RadialMeterMarker(t,e)}}),L.radialMeterMarkerDataLayer=function(t,e){return new L.RadialMeterMarkerDataLayer(t,e)},L.CalloutLine=L.Path.extend({statics:{LINESTYLE:{ARC:"arc",ANGLE:"angle",STRAIGHT:"straight"},DIRECTION:{NE:"ne",NW:"nw",SE:"se",SW:"sw"}}}),L.CalloutLine=L.CalloutLine.extend({initialize:function(t,e){L.Util.setOptions(this,e),L.Path.prototype.initialize.call(this,e),this._latlng=t},options:{size:new L.Point(60,30),position:new L.Point(0,0),color:"#FFFFFF",opacity:1,weight:2,fillColor:"#000000",fill:!1,gradient:!1,dropShadow:!1,direction:L.CalloutLine.DIRECTION.NE,lineStyle:L.CalloutLine.LINESTYLE.ANGLE,lineCap:"butt",lineJoin:"miter",arrow:!1},projectLatlngs:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._points=this._getPoints()},getEndPoint:function(){return this.projectLatlngs(),this._points[this._points.length-1]},_getPathAngle:function(){return new L.SVGPathBuilder(this._points,[],{closePath:!1}).build(6)},_getPathArc:function(){var t=(this.options.direction||L.CalloutLine.DIRECTION.NE).toLowerCase(),e=t[0],i="n"===e?-1:1,n=this._points[0],a=this._points[this._points.length-1],o=["M",n.x,",",n.y," Q",n.x,",",n.y+i*this.options.size.y," ",a.x,",",a.y];return o.join(" ")},_getPoints:function(){var t=this._point.x+this.options.position.x,e=this._point.y+this.options.position.y,i=this.options.size.x,n=this.options.size.y,a=(this.options.direction||L.CalloutLine.DIRECTION.NE).toLowerCase(),o=[],r=a[1],s=a[0],l="w"===r?-1:1,d="n"===s?-1:1;o.push(new L.Point(t,e));var c=e+d*n,f=i/2,u=Math.atan(n/f);if(this.options.lineStyle===L.CalloutLine.LINESTYLE.ARC?u=Math.atan(Math.pow(n,2)/f):this.options.lineStyle===L.CalloutLine.LINESTYLE.STRAIGHT&&(u=Math.atan(n/i)),this._angle=u,this.options.lineStyle!==L.CalloutLine.LINESTYLE.STRAIGHT){var h=new L.Point(t+l*f,c);o.push(h)}var p=new L.Point(t+l*i,c);return o.push(p),o},getBounds:function(){var t=this._map,e=t.project(this._latlng),i=new L.Point(e.x+this.options.position.x,e.y+this.options.position.y),n=new L.Point(i.x+this.options.size.x,i.y-this.options.size.y),a=t.unproject(i),o=t.unproject(n);return new L.LatLngBounds(a,o)},setLatLng:function(t){this._latlng=t,this.redraw()},getLatLng:function(){return this._latlng},getPathString:function(){this._path.setAttribute("shape-rendering","geometricPrecision");var t=this.options.lineStyle||L.CalloutLine.LINESTYLE.ANGLE,e="";return e+=t===L.CalloutLine.LINESTYLE.ANGLE||t===L.CalloutLine.LINESTYLE.STRAIGHT?this._getPathAngle():this._getPathArc()}}),L.calloutLine=function(t,e){return new L.CalloutLine(t,e)},L.Callout=L.LayerGroup.extend({options:{color:"#FFFFFF",fillColor:"#FFFFFF"},initialize:function(t,e){L.Util.setOptions(this,e),L.LayerGroup.prototype.initialize.call(this,e),this._latlng=t},onAdd:function(t){L.LayerGroup.prototype.onAdd.call(this,t),this.addLayers()},addArrow:function(t,e,i){if(this.options.arrow){var t=L.LatLng.RAD_TO_DEG*t,n=this.options.numberOfSides||3,a=this.options.radius||6,o=180/n,r={se:o+t,sw:180+o-t,nw:180+o+t,ne:o-t},s=r[e],l=new L.RegularPolygonMarker(this._latlng,{position:i,numberOfSides:n,rotation:s,fillColor:this.options.fillColor,color:this.options.color,gradient:this.options.gradient,weight:this.options.weight,opacity:this.options.opacity,fillOpacity:this.options.fillOpacity,radius:a,lineCap:"butt",lineJoin:"miter"});this.addLayer(l)}},addLine:function(){var t={};for(var e in this.options)"icon"!==e&&(t[e]=this.options[e]);var i=new L.CalloutLine(this._latlng,t);return this.addLayer(i),i},addIcon:function(t,e){var i=this.options.size,n=this.options.icon,a=n.options.iconSize,o=t[0],r=t[1],s="w"===r?a.x+i.x-e.x:-1*(i.x+e.x),l="n"===o?a.y/2+i.y-e.y:-1*(-a.y/2+i.y+e.y);n.options.iconAnchor=new L.Point(s,l);var d=new L.Marker(this._latlng,{icon:n});this.addLayer(d)},addLayers:function(){var t,e=(this.options.direction||"ne").toLowerCase(),i=this.options.position||new L.Point(0,0);t=this.addLine(),this.addIcon(e,i),this.addArrow(t._angle,e,i)}}),L.callout=function(t,e){return new L.Callout(t,e)},L.FlowLine=L.DataLayer.extend({statics:{LINE_FUNCTION:function(t,e,i){return new L.Polyline([t,e],i)},LINE_FUNCTION_INTERPOLATED:function(t,e,i){var n=this._map.latlngToLayerPoint(t),a=this._map.latlngToLayerPoint(e),o=new L.LinearFunction(n,a),r=Math.ceil(n.distanceTo(a)/i.interpolationOptions.segmentLength);o.samplePoints(r)}}}),L.FlowLine=L.FlowLine.extend({initialize:function(t,e){L.Util.setOptions(this,e),L.DataLayer.prototype.initialize.call(this,t,e)},options:{getLine:L.FlowLine.LINE_FUNCTION},onEachSegment:function(t,e,i){var n={};if(this.options.timeField){var a=L.Util.getFieldValue(t,this.options.timeField),o=L.Util.getFieldValue(e,this.options.timeField),r=this.options.timeFormat,s=r?moment(a,r):moment(a),l=r?moment(o,r):moment(o),d=l.valueOf()-s.valueOf();n.time=d}for(var c in this.options.displayOptions){var f=L.Util.getFieldValue(t,c),u=L.Util.getFieldValue(e,c),h=u-f,p=100*(h/f);n[c]={from:f,to:u,change:h,percentChange:p},n.time&&(n[c].changeOverTime=h/n.time)}var b,g=i.getLatLngs(),y=g[0].distanceTo(g[1]);n.time&&(b=y/(1e3*n.time)),this.options.onEachSegment&&this.options.onEachSegment.call(this,t,e,i,n,y,b)},_loadRecords:function(t){var e,i=this.options.layerOptions,n=[];for(var a in t)if(t.hasOwnProperty(a)){var o=t[a];if(e=this._getLocation(o,a)){var r,s=this._getLayer(e,i,o),l=!0;if(this.options.includeLayer&&(l=this.options.includeLayer(o)),this._lastRecord&&l){var i=this._getDynamicOptions(this._lastRecord);r=this.options.getLine.call(this,this._lastMarker.getLatLng(),s.getLatLng(),i.layerOptions),this.addLayer(r),this.onEachSegment(this._lastRecord,o,r)}l&&(this._lastRecord=o,this._lastMarker=s)}}for(;n.length>0;)this.addLayer(n.pop())}}),L.flowLine=function(t,e){return new L.FlowLine(t,e)},L.ArcedFlowLine=L.FlowLine.extend({options:{getLine:function(t,e,i){return new L.ArcedPolyline([t,e],i)}},initialize:function(t,e){L.FlowLine.prototype.initialize.call(this,t,e)}}),L.arcedFlowLine=function(t,e){return new L.ArcedFlowLine(t,e)},L.ArcedPolyline=L.Path.extend({includes:TextFunctions,initialize:function(t,e){L.Path.prototype.initialize.call(this,e),this._latlngs=t},options:{distanceToHeight:new L.LinearFunction([0,5],[1e3,200]),color:"#FFFFFF",opacity:1,weight:1,fillColor:"#000000",fill:!1,gradient:!1,dropShadow:!1,optimizeSpeed:!1},projectLatlngs:function(){this._points=[];for(var t=0;this._latlngs.length>t;++t)this._points.push(this._map.latLngToLayerPoint(this._latlngs[t]))},getBounds:function(){for(var t=new L.LatLngBounds,e=0;this._latlngs.length>e;++e)t.extend(this._latlngs[e]);return t},setLatLngs:function(t){this._latlngs=t,this.redraw()},getLatLngs:function(){return this._latlngs},drawSegment:function(t,e){var i=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),n=this.options.distanceToHeight.evaluate(i),a=["M",t.x,",",t.y," C",t.x,",",t.y-n," ",e.x,",",e.y-n," ",e.x,",",e.y];return a.join(" ")},getPathString:function(){this.options.optimizeSpeed&&this._path.setAttribute("shape-rendering","optimizeSpeed");for(var t=[],e=0;this._points.length-1>e;++e)t.push(this.drawSegment(this._points[e],this._points[e+1]));return t.join("")}}),L.arcedPolyline=function(t,e){return new L.ArcedPolyline(t,e)},L.Control.Legend=L.Control.extend({options:{position:"bottomright",autoAdd:!0},onAdd:function(t){var e="leaflet-control-legend",i=L.DomUtil.create("div",e),n=this;return this.options.autoAdd&&(t.on("layeradd",function(t){var e=t.layer;n.addLayer(e)}),t.on("layerremove",function(t){var e=t.layer;n.removeLayer(e)})),this.toggleSize=L.bind(this.toggleSize,this),L.DomEvent.addListener(i,"mouseover",this.toggleSize).addListener(i,"mouseout",this.toggleSize).addListener(i,"click",L.DomEvent.stopPropagation).addListener(i,"click",L.DomEvent.preventDefault),i},clear:function(){this._container.innerHTML=""},toggleSize:function(){L.DomUtil.hasClass(this._container,"larger")?L.DomUtil.removeClass(this._container,"larger"):L.DomUtil.addClass(this._container,"larger")},redrawLayer:function(t){this.removeLayer(t),this.addLayer(t)},addLayer:function(t){var e=L.Util.stamp(t),i=this;t.getLegend&&(this.addLegend(e,t.getLegend()),t.on("legendChanged",function(){i.redrawLayer(t) +}))},removeLayer:function(t){var e=L.Util.stamp(t);if(t.getLegend){var i=document.getElementById(e);i.parentNode.removeChild(i),t.off("legendChanged")}},addLegend:function(t,e){var i=this._container,n=document.getElementById(t);n||(n=L.DomUtil.create("div","",i),n.id=t),n.innerHTML=e}}),L.control.legend=function(t){return new L.Control.Legend(t)}; \ No newline at end of file diff --git a/examples/html/sparklines.html b/examples/html/sparklines.html index 5f4a18f..0f1a570 100644 --- a/examples/html/sparklines.html +++ b/examples/html/sparklines.html @@ -1560,7 +1560,10 @@ fillColor: '#FF0000', color: '#000000', displayName: 'Category 1', - fillOpacity: 0.9 + fillOpacity: 0.9, + displayText: function (value) { + return value; + } } }, layerOptions: { diff --git a/src/leaflet.dvf.datalayer.js b/src/leaflet.dvf.datalayer.js index c162568..f5c8519 100644 --- a/src/leaflet.dvf.datalayer.js +++ b/src/leaflet.dvf.datalayer.js @@ -977,14 +977,16 @@ L.MarkerDataLayer = L.DataLayer.extend({ } }); +/* + * + */ L.markerDataLayer = function (data, options) { return new L.MarkerDataLayer(data, options); }; /* - * + * Displays the top 50 photos for a given area on the map */ - L.PanoramioLayer = L.MarkerDataLayer.extend({ statics: { UPLOAD_DATE_FORMAT: 'DD MMM YYYY', diff --git a/src/leaflet.dvf.markers.js b/src/leaflet.dvf.markers.js index fbb4754..406e5e1 100644 --- a/src/leaflet.dvf.markers.js +++ b/src/leaflet.dvf.markers.js @@ -584,6 +584,26 @@ L.MapMarker = L.Path.extend({ return this._latlng; }, + setRadius: function (radius) { + this.options.radius = radius; + return this.redraw(); + }, + + setInnerRadius: function (innerRadius) { + this.options.innerRadius = innerRadius; + return this.redraw(); + }, + + setRotation: function (rotation) { + this.options.rotation = rotation; + return this.redraw(); + }, + + setNumberOfSides: function (numberOfSides) { + this.options.numberOfSides = numberOfSides; + return this.redraw(); + }, + getPathString: function () { var anchorPoint = this.getTextAnchor(); @@ -731,6 +751,40 @@ L.RegularPolygonMarker = L.Path.extend({ return new L.LatLngBounds(sw, ne); }, + setRadius: function (radius) { + this.options.radius = radius; + return this.redraw(); + }, + + setRadiusXY: function (radiusX, radiusY) { + this.options.radius = null; + this.options.radiusX = radiusX; + this.options.radiusY = radiusY; + return this.redraw(); + }, + + setInnerRadius: function (innerRadius) { + this.options.innerRadius = innerRadius; + return this.redraw(); + }, + + setInnerRadiusXY: function (innerRadiusX, innerRadiusY) { + this.options.innerRadius = null; + this.options.innerRadiusX = innerRadiusX; + this.options.innerRadiusY = innerRadiusY; + return this.redraw(); + }, + + setRotation: function (rotation) { + this.options.rotation = rotation; + return this.redraw(); + }, + + setNumberOfSides: function (numberOfSides) { + this.options.numberOfSides = numberOfSides; + return this.redraw(); + }, + getLatLng: function () { return this._latlng; }, @@ -826,6 +880,11 @@ L.StarMarker = L.RegularPolygonMarker.extend({ dropShadow: true }, + setNumberOfPoints: function (numberOfPoints) { + this.options.numberOfPoints = numberOfPoints; + return this.redraw(); + }, + _getPoints: function (inner) { var maxDegrees = this.options.maxDegrees || 360; var angleSize = maxDegrees / this.options.numberOfPoints; diff --git a/src/leaflet.dvf.palettes.js b/src/leaflet.dvf.palettes.js index bb4d631..0692354 100644 --- a/src/leaflet.dvf.palettes.js +++ b/src/leaflet.dvf.palettes.js @@ -369,7 +369,7 @@ L.Palettes = { }; /* - * Pre-defined color palettes for easy use + * Pre-defined color palettes for easy use. Call getPalette passing a min and max value get a pre-defined LinearFunction */ L.DynamicColorPalettes = { rainbow: { @@ -500,6 +500,9 @@ L.DynamicColorPalettes = { } }; +/* + * + */ L.DynamicPaletteElement = L.Class.extend({ initialize: function (key, dynamicPalette) { this._key = key; diff --git a/src/leaflet.dvf.utils.js b/src/leaflet.dvf.utils.js index de1c466..853d441 100644 --- a/src/leaflet.dvf.utils.js +++ b/src/leaflet.dvf.utils.js @@ -965,6 +965,9 @@ L.Color = L.Class.extend({ } }); +/* + * A class representing an RGB color - extends L.Color + */ L.RGBColor = L.Color.extend({ initialize: function (colorDef) { L.Color.prototype.initialize.call(this, colorDef);