`\n\t * element instead of an image. Inherits from `Icon` but ignores the `iconUrl` and shadow options.\n\t *\n\t * @example\n\t * ```js\n\t * var myIcon = L.divIcon({className: 'my-div-icon'});\n\t * // you can set .my-div-icon styles in CSS\n\t *\n\t * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);\n\t * ```\n\t *\n\t * By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.\n\t */\n\t\n\tL.DivIcon = L.Icon.extend({\n\t\toptions: {\n\t\t\t// @section\n\t\t\t// @aka DivIcon options\n\t\t\ticonSize: [12, 12], // also can be set through CSS\n\t\n\t\t\t// iconAnchor: (Point),\n\t\t\t// popupAnchor: (Point),\n\t\n\t\t\t// @option html: String = ''\n\t\t\t// Custom HTML code to put inside the div element, empty by default.\n\t\t\thtml: false,\n\t\n\t\t\t// @option bgPos: Point = [0, 0]\n\t\t\t// Optional relative position of the background, in pixels\n\t\t\tbgPos: null,\n\t\n\t\t\tclassName: 'leaflet-div-icon'\n\t\t},\n\t\n\t\tcreateIcon: function (oldIcon) {\n\t\t\tvar div = (oldIcon && oldIcon.tagName === 'DIV') ? oldIcon : document.createElement('div'),\n\t\t\t options = this.options;\n\t\n\t\t\tdiv.innerHTML = options.html !== false ? options.html : '';\n\t\n\t\t\tif (options.bgPos) {\n\t\t\t\tvar bgPos = L.point(options.bgPos);\n\t\t\t\tdiv.style.backgroundPosition = (-bgPos.x) + 'px ' + (-bgPos.y) + 'px';\n\t\t\t}\n\t\t\tthis._setIconStyles(div, 'icon');\n\t\n\t\t\treturn div;\n\t\t},\n\t\n\t\tcreateShadow: function () {\n\t\t\treturn null;\n\t\t}\n\t});\n\t\n\t// @factory L.divIcon(options: DivIcon options)\n\t// Creates a `DivIcon` instance with the given options.\n\tL.divIcon = function (options) {\n\t\treturn new L.DivIcon(options);\n\t};\n\t\n\t\n\t\n\t/*\r\n\t * @class DivOverlay\r\n\t * @inherits Layer\r\n\t * @aka L.DivOverlay\r\n\t * Base model for L.Popup and L.Tooltip. Inherit from it for custom popup like plugins.\r\n\t */\r\n\t\r\n\t// @namespace DivOverlay\r\n\tL.DivOverlay = L.Layer.extend({\r\n\t\r\n\t\t// @section\r\n\t\t// @aka DivOverlay options\r\n\t\toptions: {\r\n\t\t\t// @option offset: Point = Point(0, 7)\r\n\t\t\t// The offset of the popup position. Useful to control the anchor\r\n\t\t\t// of the popup when opening it on some overlays.\r\n\t\t\toffset: [0, 7],\r\n\t\r\n\t\t\t// @option className: String = ''\r\n\t\t\t// A custom CSS class name to assign to the popup.\r\n\t\t\tclassName: '',\r\n\t\r\n\t\t\t// @option pane: String = 'popupPane'\r\n\t\t\t// `Map pane` where the popup will be added.\r\n\t\t\tpane: 'popupPane'\r\n\t\t},\r\n\t\r\n\t\tinitialize: function (options, source) {\r\n\t\t\tL.setOptions(this, options);\r\n\t\r\n\t\t\tthis._source = source;\r\n\t\t},\r\n\t\r\n\t\tonAdd: function (map) {\r\n\t\t\tthis._zoomAnimated = map._zoomAnimated;\r\n\t\r\n\t\t\tif (!this._container) {\r\n\t\t\t\tthis._initLayout();\r\n\t\t\t}\r\n\t\r\n\t\t\tif (map._fadeAnimated) {\r\n\t\t\t\tL.DomUtil.setOpacity(this._container, 0);\r\n\t\t\t}\r\n\t\r\n\t\t\tclearTimeout(this._removeTimeout);\r\n\t\t\tthis.getPane().appendChild(this._container);\r\n\t\t\tthis.update();\r\n\t\r\n\t\t\tif (map._fadeAnimated) {\r\n\t\t\t\tL.DomUtil.setOpacity(this._container, 1);\r\n\t\t\t}\r\n\t\r\n\t\t\tthis.bringToFront();\r\n\t\t},\r\n\t\r\n\t\tonRemove: function (map) {\r\n\t\t\tif (map._fadeAnimated) {\r\n\t\t\t\tL.DomUtil.setOpacity(this._container, 0);\r\n\t\t\t\tthis._removeTimeout = setTimeout(L.bind(L.DomUtil.remove, L.DomUtil, this._container), 200);\r\n\t\t\t} else {\r\n\t\t\t\tL.DomUtil.remove(this._container);\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\t// @namespace Popup\r\n\t\t// @method getLatLng: LatLng\r\n\t\t// Returns the geographical point of popup.\r\n\t\tgetLatLng: function () {\r\n\t\t\treturn this._latlng;\r\n\t\t},\r\n\t\r\n\t\t// @method setLatLng(latlng: LatLng): this\r\n\t\t// Sets the geographical point where the popup will open.\r\n\t\tsetLatLng: function (latlng) {\r\n\t\t\tthis._latlng = L.latLng(latlng);\r\n\t\t\tif (this._map) {\r\n\t\t\t\tthis._updatePosition();\r\n\t\t\t\tthis._adjustPan();\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method getContent: String|HTMLElement\r\n\t\t// Returns the content of the popup.\r\n\t\tgetContent: function () {\r\n\t\t\treturn this._content;\r\n\t\t},\r\n\t\r\n\t\t// @method setContent(htmlContent: String|HTMLElement|Function): this\r\n\t\t// Sets the HTML content of the popup. If a function is passed the source layer will be passed to the function. The function should return a `String` or `HTMLElement` to be used in the popup.\r\n\t\tsetContent: function (content) {\r\n\t\t\tthis._content = content;\r\n\t\t\tthis.update();\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method getElement: String|HTMLElement\r\n\t\t// Alias for [getContent()](#popup-getcontent)\r\n\t\tgetElement: function () {\r\n\t\t\treturn this._container;\r\n\t\t},\r\n\t\r\n\t\t// @method update: null\r\n\t\t// Updates the popup content, layout and position. Useful for updating the popup after something inside changed, e.g. image loaded.\r\n\t\tupdate: function () {\r\n\t\t\tif (!this._map) { return; }\r\n\t\r\n\t\t\tthis._container.style.visibility = 'hidden';\r\n\t\r\n\t\t\tthis._updateContent();\r\n\t\t\tthis._updateLayout();\r\n\t\t\tthis._updatePosition();\r\n\t\r\n\t\t\tthis._container.style.visibility = '';\r\n\t\r\n\t\t\tthis._adjustPan();\r\n\t\t},\r\n\t\r\n\t\tgetEvents: function () {\r\n\t\t\tvar events = {\r\n\t\t\t\tzoom: this._updatePosition,\r\n\t\t\t\tviewreset: this._updatePosition\r\n\t\t\t};\r\n\t\r\n\t\t\tif (this._zoomAnimated) {\r\n\t\t\t\tevents.zoomanim = this._animateZoom;\r\n\t\t\t}\r\n\t\t\treturn events;\r\n\t\t},\r\n\t\r\n\t\t// @method isOpen: Boolean\r\n\t\t// Returns `true` when the popup is visible on the map.\r\n\t\tisOpen: function () {\r\n\t\t\treturn !!this._map && this._map.hasLayer(this);\r\n\t\t},\r\n\t\r\n\t\t// @method bringToFront: this\r\n\t\t// Brings this popup in front of other popups (in the same map pane).\r\n\t\tbringToFront: function () {\r\n\t\t\tif (this._map) {\r\n\t\t\t\tL.DomUtil.toFront(this._container);\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method bringToBack: this\r\n\t\t// Brings this popup to the back of other popups (in the same map pane).\r\n\t\tbringToBack: function () {\r\n\t\t\tif (this._map) {\r\n\t\t\t\tL.DomUtil.toBack(this._container);\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t_updateContent: function () {\r\n\t\t\tif (!this._content) { return; }\r\n\t\r\n\t\t\tvar node = this._contentNode;\r\n\t\t\tvar content = (typeof this._content === 'function') ? this._content(this._source || this) : this._content;\r\n\t\r\n\t\t\tif (typeof content === 'string') {\r\n\t\t\t\tnode.innerHTML = content;\r\n\t\t\t} else {\r\n\t\t\t\twhile (node.hasChildNodes()) {\r\n\t\t\t\t\tnode.removeChild(node.firstChild);\r\n\t\t\t\t}\r\n\t\t\t\tnode.appendChild(content);\r\n\t\t\t}\r\n\t\t\tthis.fire('contentupdate');\r\n\t\t},\r\n\t\r\n\t\t_updatePosition: function () {\r\n\t\t\tif (!this._map) { return; }\r\n\t\r\n\t\t\tvar pos = this._map.latLngToLayerPoint(this._latlng),\r\n\t\t\t offset = L.point(this.options.offset),\r\n\t\t\t anchor = this._getAnchor();\r\n\t\r\n\t\t\tif (this._zoomAnimated) {\r\n\t\t\t\tL.DomUtil.setPosition(this._container, pos.add(anchor));\r\n\t\t\t} else {\r\n\t\t\t\toffset = offset.add(pos).add(anchor);\r\n\t\t\t}\r\n\t\r\n\t\t\tvar bottom = this._containerBottom = -offset.y,\r\n\t\t\t left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;\r\n\t\r\n\t\t\t// bottom position the popup in case the height of the popup changes (images loading etc)\r\n\t\t\tthis._container.style.bottom = bottom + 'px';\r\n\t\t\tthis._container.style.left = left + 'px';\r\n\t\t},\r\n\t\r\n\t\t_getAnchor: function () {\r\n\t\t\treturn [0, 0];\r\n\t\t}\r\n\t\r\n\t});\r\n\t\n\t\n\t\n\t/*\r\n\t * @class Popup\r\n\t * @inherits DivOverlay\r\n\t * @aka L.Popup\r\n\t * Used to open popups in certain places of the map. Use [Map.openPopup](#map-openpopup) to\r\n\t * open popups while making sure that only one popup is open at one time\r\n\t * (recommended for usability), or use [Map.addLayer](#map-addlayer) to open as many as you want.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * If you want to just bind a popup to marker click and then open it, it's really easy:\r\n\t *\r\n\t * ```js\r\n\t * marker.bindPopup(popupContent).openPopup();\r\n\t * ```\r\n\t * Path overlays like polylines also have a `bindPopup` method.\r\n\t * Here's a more complicated way to open a popup on a map:\r\n\t *\r\n\t * ```js\r\n\t * var popup = L.popup()\r\n\t * \t.setLatLng(latlng)\r\n\t * \t.setContent('
Hello world!
This is a nice popup.
')\r\n\t * \t.openOn(map);\r\n\t * ```\r\n\t */\r\n\t\r\n\t\r\n\t// @namespace Popup\r\n\tL.Popup = L.DivOverlay.extend({\r\n\t\r\n\t\t// @section\r\n\t\t// @aka Popup options\r\n\t\toptions: {\r\n\t\t\t// @option maxWidth: Number = 300\r\n\t\t\t// Max width of the popup, in pixels.\r\n\t\t\tmaxWidth: 300,\r\n\t\r\n\t\t\t// @option minWidth: Number = 50\r\n\t\t\t// Min width of the popup, in pixels.\r\n\t\t\tminWidth: 50,\r\n\t\r\n\t\t\t// @option maxHeight: Number = null\r\n\t\t\t// If set, creates a scrollable container of the given height\r\n\t\t\t// inside a popup if its content exceeds it.\r\n\t\t\tmaxHeight: null,\r\n\t\r\n\t\t\t// @option autoPan: Boolean = true\r\n\t\t\t// Set it to `false` if you don't want the map to do panning animation\r\n\t\t\t// to fit the opened popup.\r\n\t\t\tautoPan: true,\r\n\t\r\n\t\t\t// @option autoPanPaddingTopLeft: Point = null\r\n\t\t\t// The margin between the popup and the top left corner of the map\r\n\t\t\t// view after autopanning was performed.\r\n\t\t\tautoPanPaddingTopLeft: null,\r\n\t\r\n\t\t\t// @option autoPanPaddingBottomRight: Point = null\r\n\t\t\t// The margin between the popup and the bottom right corner of the map\r\n\t\t\t// view after autopanning was performed.\r\n\t\t\tautoPanPaddingBottomRight: null,\r\n\t\r\n\t\t\t// @option autoPanPadding: Point = Point(5, 5)\r\n\t\t\t// Equivalent of setting both top left and bottom right autopan padding to the same value.\r\n\t\t\tautoPanPadding: [5, 5],\r\n\t\r\n\t\t\t// @option keepInView: Boolean = false\r\n\t\t\t// Set it to `true` if you want to prevent users from panning the popup\r\n\t\t\t// off of the screen while it is open.\r\n\t\t\tkeepInView: false,\r\n\t\r\n\t\t\t// @option closeButton: Boolean = true\r\n\t\t\t// Controls the presence of a close button in the popup.\r\n\t\t\tcloseButton: true,\r\n\t\r\n\t\t\t// @option autoClose: Boolean = true\r\n\t\t\t// Set it to `false` if you want to override the default behavior of\r\n\t\t\t// the popup closing when user clicks the map (set globally by\r\n\t\t\t// the Map's [closePopupOnClick](#map-closepopuponclick) option).\r\n\t\t\tautoClose: true,\r\n\t\r\n\t\t\t// @option className: String = ''\r\n\t\t\t// A custom CSS class name to assign to the popup.\r\n\t\t\tclassName: ''\r\n\t\t},\r\n\t\r\n\t\t// @namespace Popup\r\n\t\t// @method openOn(map: Map): this\r\n\t\t// Adds the popup to the map and closes the previous one. The same as `map.openPopup(popup)`.\r\n\t\topenOn: function (map) {\r\n\t\t\tmap.openPopup(this);\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\tonAdd: function (map) {\r\n\t\t\tL.DivOverlay.prototype.onAdd.call(this, map);\r\n\t\r\n\t\t\t// @namespace Map\r\n\t\t\t// @section Popup events\r\n\t\t\t// @event popupopen: PopupEvent\r\n\t\t\t// Fired when a popup is opened in the map\r\n\t\t\tmap.fire('popupopen', {popup: this});\r\n\t\r\n\t\t\tif (this._source) {\r\n\t\t\t\t// @namespace Layer\r\n\t\t\t\t// @section Popup events\r\n\t\t\t\t// @event popupopen: PopupEvent\r\n\t\t\t\t// Fired when a popup bound to this layer is opened\r\n\t\t\t\tthis._source.fire('popupopen', {popup: this}, true);\r\n\t\t\t\t// For non-path layers, we toggle the popup when clicking\r\n\t\t\t\t// again the layer, so prevent the map to reopen it.\r\n\t\t\t\tif (!(this._source instanceof L.Path)) {\r\n\t\t\t\t\tthis._source.on('preclick', L.DomEvent.stopPropagation);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\tonRemove: function (map) {\r\n\t\t\tL.DivOverlay.prototype.onRemove.call(this, map);\r\n\t\r\n\t\t\t// @namespace Map\r\n\t\t\t// @section Popup events\r\n\t\t\t// @event popupclose: PopupEvent\r\n\t\t\t// Fired when a popup in the map is closed\r\n\t\t\tmap.fire('popupclose', {popup: this});\r\n\t\r\n\t\t\tif (this._source) {\r\n\t\t\t\t// @namespace Layer\r\n\t\t\t\t// @section Popup events\r\n\t\t\t\t// @event popupclose: PopupEvent\r\n\t\t\t\t// Fired when a popup bound to this layer is closed\r\n\t\t\t\tthis._source.fire('popupclose', {popup: this}, true);\r\n\t\t\t\tif (!(this._source instanceof L.Path)) {\r\n\t\t\t\t\tthis._source.off('preclick', L.DomEvent.stopPropagation);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\tgetEvents: function () {\r\n\t\t\tvar events = L.DivOverlay.prototype.getEvents.call(this);\r\n\t\r\n\t\t\tif ('closeOnClick' in this.options ? this.options.closeOnClick : this._map.options.closePopupOnClick) {\r\n\t\t\t\tevents.preclick = this._close;\r\n\t\t\t}\r\n\t\r\n\t\t\tif (this.options.keepInView) {\r\n\t\t\t\tevents.moveend = this._adjustPan;\r\n\t\t\t}\r\n\t\r\n\t\t\treturn events;\r\n\t\t},\r\n\t\r\n\t\t_close: function () {\r\n\t\t\tif (this._map) {\r\n\t\t\t\tthis._map.closePopup(this);\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\t_initLayout: function () {\r\n\t\t\tvar prefix = 'leaflet-popup',\r\n\t\t\t container = this._container = L.DomUtil.create('div',\r\n\t\t\t\tprefix + ' ' + (this.options.className || '') +\r\n\t\t\t\t' leaflet-zoom-animated');\r\n\t\r\n\t\t\tif (this.options.closeButton) {\r\n\t\t\t\tvar closeButton = this._closeButton = L.DomUtil.create('a', prefix + '-close-button', container);\r\n\t\t\t\tcloseButton.href = '#close';\r\n\t\t\t\tcloseButton.innerHTML = '×';\r\n\t\r\n\t\t\t\tL.DomEvent.on(closeButton, 'click', this._onCloseButtonClick, this);\r\n\t\t\t}\r\n\t\r\n\t\t\tvar wrapper = this._wrapper = L.DomUtil.create('div', prefix + '-content-wrapper', container);\r\n\t\t\tthis._contentNode = L.DomUtil.create('div', prefix + '-content', wrapper);\r\n\t\r\n\t\t\tL.DomEvent\r\n\t\t\t\t.disableClickPropagation(wrapper)\r\n\t\t\t\t.disableScrollPropagation(this._contentNode)\r\n\t\t\t\t.on(wrapper, 'contextmenu', L.DomEvent.stopPropagation);\r\n\t\r\n\t\t\tthis._tipContainer = L.DomUtil.create('div', prefix + '-tip-container', container);\r\n\t\t\tthis._tip = L.DomUtil.create('div', prefix + '-tip', this._tipContainer);\r\n\t\t},\r\n\t\r\n\t\t_updateLayout: function () {\r\n\t\t\tvar container = this._contentNode,\r\n\t\t\t style = container.style;\r\n\t\r\n\t\t\tstyle.width = '';\r\n\t\t\tstyle.whiteSpace = 'nowrap';\r\n\t\r\n\t\t\tvar width = container.offsetWidth;\r\n\t\t\twidth = Math.min(width, this.options.maxWidth);\r\n\t\t\twidth = Math.max(width, this.options.minWidth);\r\n\t\r\n\t\t\tstyle.width = (width + 1) + 'px';\r\n\t\t\tstyle.whiteSpace = '';\r\n\t\r\n\t\t\tstyle.height = '';\r\n\t\r\n\t\t\tvar height = container.offsetHeight,\r\n\t\t\t maxHeight = this.options.maxHeight,\r\n\t\t\t scrolledClass = 'leaflet-popup-scrolled';\r\n\t\r\n\t\t\tif (maxHeight && height > maxHeight) {\r\n\t\t\t\tstyle.height = maxHeight + 'px';\r\n\t\t\t\tL.DomUtil.addClass(container, scrolledClass);\r\n\t\t\t} else {\r\n\t\t\t\tL.DomUtil.removeClass(container, scrolledClass);\r\n\t\t\t}\r\n\t\r\n\t\t\tthis._containerWidth = this._container.offsetWidth;\r\n\t\t},\r\n\t\r\n\t\t_animateZoom: function (e) {\r\n\t\t\tvar pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center),\r\n\t\t\t anchor = this._getAnchor();\r\n\t\t\tL.DomUtil.setPosition(this._container, pos.add(anchor));\r\n\t\t},\r\n\t\r\n\t\t_adjustPan: function () {\r\n\t\t\tif (!this.options.autoPan || (this._map._panAnim && this._map._panAnim._inProgress)) { return; }\r\n\t\r\n\t\t\tvar map = this._map,\r\n\t\t\t marginBottom = parseInt(L.DomUtil.getStyle(this._container, 'marginBottom'), 10) || 0,\r\n\t\t\t containerHeight = this._container.offsetHeight + marginBottom,\r\n\t\t\t containerWidth = this._containerWidth,\r\n\t\t\t layerPos = new L.Point(this._containerLeft, -containerHeight - this._containerBottom);\r\n\t\r\n\t\t\tlayerPos._add(L.DomUtil.getPosition(this._container));\r\n\t\r\n\t\t\tvar containerPos = map.layerPointToContainerPoint(layerPos),\r\n\t\t\t padding = L.point(this.options.autoPanPadding),\r\n\t\t\t paddingTL = L.point(this.options.autoPanPaddingTopLeft || padding),\r\n\t\t\t paddingBR = L.point(this.options.autoPanPaddingBottomRight || padding),\r\n\t\t\t size = map.getSize(),\r\n\t\t\t dx = 0,\r\n\t\t\t dy = 0;\r\n\t\r\n\t\t\tif (containerPos.x + containerWidth + paddingBR.x > size.x) { // right\r\n\t\t\t\tdx = containerPos.x + containerWidth - size.x + paddingBR.x;\r\n\t\t\t}\r\n\t\t\tif (containerPos.x - dx - paddingTL.x < 0) { // left\r\n\t\t\t\tdx = containerPos.x - paddingTL.x;\r\n\t\t\t}\r\n\t\t\tif (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom\r\n\t\t\t\tdy = containerPos.y + containerHeight - size.y + paddingBR.y;\r\n\t\t\t}\r\n\t\t\tif (containerPos.y - dy - paddingTL.y < 0) { // top\r\n\t\t\t\tdy = containerPos.y - paddingTL.y;\r\n\t\t\t}\r\n\t\r\n\t\t\t// @namespace Map\r\n\t\t\t// @section Popup events\r\n\t\t\t// @event autopanstart: Event\r\n\t\t\t// Fired when the map starts autopanning when opening a popup.\r\n\t\t\tif (dx || dy) {\r\n\t\t\t\tmap\r\n\t\t\t\t .fire('autopanstart')\r\n\t\t\t\t .panBy([dx, dy]);\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\t_onCloseButtonClick: function (e) {\r\n\t\t\tthis._close();\r\n\t\t\tL.DomEvent.stop(e);\r\n\t\t},\r\n\t\r\n\t\t_getAnchor: function () {\r\n\t\t\t// Where should we anchor the popup on the source layer?\r\n\t\t\treturn L.point(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0]);\r\n\t\t}\r\n\t\r\n\t});\r\n\t\r\n\t// @namespace Popup\r\n\t// @factory L.popup(options?: Popup options, source?: Layer)\r\n\t// Instantiates a `Popup` object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the popup with a reference to the Layer to which it refers.\r\n\tL.popup = function (options, source) {\r\n\t\treturn new L.Popup(options, source);\r\n\t};\r\n\t\r\n\t\r\n\t/* @namespace Map\r\n\t * @section Interaction Options\r\n\t * @option closePopupOnClick: Boolean = true\r\n\t * Set it to `false` if you don't want popups to close when user clicks the map.\r\n\t */\r\n\tL.Map.mergeOptions({\r\n\t\tclosePopupOnClick: true\r\n\t});\r\n\t\r\n\t\r\n\t// @namespace Map\r\n\t// @section Methods for Layers and Controls\r\n\tL.Map.include({\r\n\t\t// @method openPopup(popup: Popup): this\r\n\t\t// Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).\r\n\t\t// @alternative\r\n\t\t// @method openPopup(content: String|HTMLElement, latlng: LatLng, options?: Popup options): this\r\n\t\t// Creates a popup with the specified content and options and opens it in the given point on a map.\r\n\t\topenPopup: function (popup, latlng, options) {\r\n\t\t\tif (!(popup instanceof L.Popup)) {\r\n\t\t\t\tpopup = new L.Popup(options).setContent(popup);\r\n\t\t\t}\r\n\t\r\n\t\t\tif (latlng) {\r\n\t\t\t\tpopup.setLatLng(latlng);\r\n\t\t\t}\r\n\t\r\n\t\t\tif (this.hasLayer(popup)) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\r\n\t\t\tif (this._popup && this._popup.options.autoClose) {\r\n\t\t\t\tthis.closePopup();\r\n\t\t\t}\r\n\t\r\n\t\t\tthis._popup = popup;\r\n\t\t\treturn this.addLayer(popup);\r\n\t\t},\r\n\t\r\n\t\t// @method closePopup(popup?: Popup): this\r\n\t\t// Closes the popup previously opened with [openPopup](#map-openpopup) (or the given one).\r\n\t\tclosePopup: function (popup) {\r\n\t\t\tif (!popup || popup === this._popup) {\r\n\t\t\t\tpopup = this._popup;\r\n\t\t\t\tthis._popup = null;\r\n\t\t\t}\r\n\t\t\tif (popup) {\r\n\t\t\t\tthis.removeLayer(popup);\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\t});\r\n\t\r\n\t/*\r\n\t * @namespace Layer\r\n\t * @section Popup methods example\r\n\t *\r\n\t * All layers share a set of methods convenient for binding popups to it.\r\n\t *\r\n\t * ```js\r\n\t * var layer = L.Polygon(latlngs).bindPopup('Hi There!').addTo(map);\r\n\t * layer.openPopup();\r\n\t * layer.closePopup();\r\n\t * ```\r\n\t *\r\n\t * Popups will also be automatically opened when the layer is clicked on and closed when the layer is removed from the map or another popup is opened.\r\n\t */\r\n\t\r\n\t// @section Popup methods\r\n\tL.Layer.include({\r\n\t\r\n\t\t// @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this\r\n\t\t// Binds a popup to the layer with the passed `content` and sets up the\r\n\t\t// neccessary event listeners. If a `Function` is passed it will receive\r\n\t\t// the layer as the first argument and should return a `String` or `HTMLElement`.\r\n\t\tbindPopup: function (content, options) {\r\n\t\r\n\t\t\tif (content instanceof L.Popup) {\r\n\t\t\t\tL.setOptions(content, options);\r\n\t\t\t\tthis._popup = content;\r\n\t\t\t\tcontent._source = this;\r\n\t\t\t} else {\r\n\t\t\t\tif (!this._popup || options) {\r\n\t\t\t\t\tthis._popup = new L.Popup(options, this);\r\n\t\t\t\t}\r\n\t\t\t\tthis._popup.setContent(content);\r\n\t\t\t}\r\n\t\r\n\t\t\tif (!this._popupHandlersAdded) {\r\n\t\t\t\tthis.on({\r\n\t\t\t\t\tclick: this._openPopup,\r\n\t\t\t\t\tremove: this.closePopup,\r\n\t\t\t\t\tmove: this._movePopup\r\n\t\t\t\t});\r\n\t\t\t\tthis._popupHandlersAdded = true;\r\n\t\t\t}\r\n\t\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method unbindPopup(): this\r\n\t\t// Removes the popup previously bound with `bindPopup`.\r\n\t\tunbindPopup: function () {\r\n\t\t\tif (this._popup) {\r\n\t\t\t\tthis.off({\r\n\t\t\t\t\tclick: this._openPopup,\r\n\t\t\t\t\tremove: this.closePopup,\r\n\t\t\t\t\tmove: this._movePopup\r\n\t\t\t\t});\r\n\t\t\t\tthis._popupHandlersAdded = false;\r\n\t\t\t\tthis._popup = null;\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method openPopup(latlng?: LatLng): this\r\n\t\t// Opens the bound popup at the specificed `latlng` or at the default popup anchor if no `latlng` is passed.\r\n\t\topenPopup: function (layer, latlng) {\r\n\t\t\tif (!(layer instanceof L.Layer)) {\r\n\t\t\t\tlatlng = layer;\r\n\t\t\t\tlayer = this;\r\n\t\t\t}\r\n\t\r\n\t\t\tif (layer instanceof L.FeatureGroup) {\r\n\t\t\t\tfor (var id in this._layers) {\r\n\t\t\t\t\tlayer = this._layers[id];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\tif (!latlng) {\r\n\t\t\t\tlatlng = layer.getCenter ? layer.getCenter() : layer.getLatLng();\r\n\t\t\t}\r\n\t\r\n\t\t\tif (this._popup && this._map) {\r\n\t\t\t\t// set popup source to this layer\r\n\t\t\t\tthis._popup._source = layer;\r\n\t\r\n\t\t\t\t// update the popup (content, layout, ect...)\r\n\t\t\t\tthis._popup.update();\r\n\t\r\n\t\t\t\t// open the popup on the map\r\n\t\t\t\tthis._map.openPopup(this._popup, latlng);\r\n\t\t\t}\r\n\t\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method closePopup(): this\r\n\t\t// Closes the popup bound to this layer if it is open.\r\n\t\tclosePopup: function () {\r\n\t\t\tif (this._popup) {\r\n\t\t\t\tthis._popup._close();\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method togglePopup(): this\r\n\t\t// Opens or closes the popup bound to this layer depending on its current state.\r\n\t\ttogglePopup: function (target) {\r\n\t\t\tif (this._popup) {\r\n\t\t\t\tif (this._popup._map) {\r\n\t\t\t\t\tthis.closePopup();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.openPopup(target);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method isPopupOpen(): boolean\r\n\t\t// Returns `true` if the popup bound to this layer is currently open.\r\n\t\tisPopupOpen: function () {\r\n\t\t\treturn (this._popup ? this._popup.isOpen() : false);\r\n\t\t},\r\n\t\r\n\t\t// @method setPopupContent(content: String|HTMLElement|Popup): this\r\n\t\t// Sets the content of the popup bound to this layer.\r\n\t\tsetPopupContent: function (content) {\r\n\t\t\tif (this._popup) {\r\n\t\t\t\tthis._popup.setContent(content);\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method getPopup(): Popup\r\n\t\t// Returns the popup bound to this layer.\r\n\t\tgetPopup: function () {\r\n\t\t\treturn this._popup;\r\n\t\t},\r\n\t\r\n\t\t_openPopup: function (e) {\r\n\t\t\tvar layer = e.layer || e.target;\r\n\t\r\n\t\t\tif (!this._popup) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\r\n\t\t\tif (!this._map) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\r\n\t\t\t// prevent map click\r\n\t\t\tL.DomEvent.stop(e);\r\n\t\r\n\t\t\t// if this inherits from Path its a vector and we can just\r\n\t\t\t// open the popup at the new location\r\n\t\t\tif (layer instanceof L.Path) {\r\n\t\t\t\tthis.openPopup(e.layer || e.target, e.latlng);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\r\n\t\t\t// otherwise treat it like a marker and figure out\r\n\t\t\t// if we should toggle it open/closed\r\n\t\t\tif (this._map.hasLayer(this._popup) && this._popup._source === layer) {\r\n\t\t\t\tthis.closePopup();\r\n\t\t\t} else {\r\n\t\t\t\tthis.openPopup(layer, e.latlng);\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\t_movePopup: function (e) {\r\n\t\t\tthis._popup.setLatLng(e.latlng);\r\n\t\t}\r\n\t});\r\n\t\n\t\n\t\n\t/*\n\t * @class Tooltip\n\t * @inherits DivOverlay\n\t * @aka L.Tooltip\n\t * Used to display small texts on top of map layers.\n\t *\n\t * @example\n\t *\n\t * ```js\n\t * marker.bindTooltip(\"my tooltip text\").openTooltip();\n\t * ```\n\t * Note about tooltip offset. Leaflet takes two options in consideration\n\t * for computing tooltip offseting:\n\t * - the `offset` Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.\n\t * Add a positive x offset to move the tooltip to the right, and a positive y offset to\n\t * move it to the bottom. Negatives will move to the left and top.\n\t * - the `tooltipAnchor` Icon option: this will only be considered for Marker. You\n\t * should adapt this value if you use a custom icon.\n\t */\n\t\n\t\n\t// @namespace Tooltip\n\tL.Tooltip = L.DivOverlay.extend({\n\t\n\t\t// @section\n\t\t// @aka Tooltip options\n\t\toptions: {\n\t\t\t// @option pane: String = 'tooltipPane'\n\t\t\t// `Map pane` where the tooltip will be added.\n\t\t\tpane: 'tooltipPane',\n\t\n\t\t\t// @option offset: Point = Point(0, 0)\n\t\t\t// Optional offset of the tooltip position.\n\t\t\toffset: [0, 0],\n\t\n\t\t\t// @option direction: String = 'auto'\n\t\t\t// Direction where to open the tooltip. Possible values are: `right`, `left`,\n\t\t\t// `top`, `bottom`, `center`, `auto`.\n\t\t\t// `auto` will dynamicaly switch between `right` and `left` according to the tooltip\n\t\t\t// position on the map.\n\t\t\tdirection: 'auto',\n\t\n\t\t\t// @option permanent: Boolean = false\n\t\t\t// Whether to open the tooltip permanently or only on mouseover.\n\t\t\tpermanent: false,\n\t\n\t\t\t// @option sticky: Boolean = false\n\t\t\t// If true, the tooltip will follow the mouse instead of being fixed at the feature center.\n\t\t\tsticky: false,\n\t\n\t\t\t// @option interactive: Boolean = false\n\t\t\t// If true, the tooltip will listen to the feature events.\n\t\t\tinteractive: false,\n\t\n\t\t\t// @option opacity: Number = 0.9\n\t\t\t// Tooltip container opacity.\n\t\t\topacity: 0.9\n\t\t},\n\t\n\t\tonAdd: function (map) {\n\t\t\tL.DivOverlay.prototype.onAdd.call(this, map);\n\t\t\tthis.setOpacity(this.options.opacity);\n\t\n\t\t\t// @namespace Map\n\t\t\t// @section Tooltip events\n\t\t\t// @event tooltipopen: TooltipEvent\n\t\t\t// Fired when a tooltip is opened in the map.\n\t\t\tmap.fire('tooltipopen', {tooltip: this});\n\t\n\t\t\tif (this._source) {\n\t\t\t\t// @namespace Layer\n\t\t\t\t// @section Tooltip events\n\t\t\t\t// @event tooltipopen: TooltipEvent\n\t\t\t\t// Fired when a tooltip bound to this layer is opened.\n\t\t\t\tthis._source.fire('tooltipopen', {tooltip: this}, true);\n\t\t\t}\n\t\t},\n\t\n\t\tonRemove: function (map) {\n\t\t\tL.DivOverlay.prototype.onRemove.call(this, map);\n\t\n\t\t\t// @namespace Map\n\t\t\t// @section Tooltip events\n\t\t\t// @event tooltipclose: TooltipEvent\n\t\t\t// Fired when a tooltip in the map is closed.\n\t\t\tmap.fire('tooltipclose', {tooltip: this});\n\t\n\t\t\tif (this._source) {\n\t\t\t\t// @namespace Layer\n\t\t\t\t// @section Tooltip events\n\t\t\t\t// @event tooltipclose: TooltipEvent\n\t\t\t\t// Fired when a tooltip bound to this layer is closed.\n\t\t\t\tthis._source.fire('tooltipclose', {tooltip: this}, true);\n\t\t\t}\n\t\t},\n\t\n\t\tgetEvents: function () {\n\t\t\tvar events = L.DivOverlay.prototype.getEvents.call(this);\n\t\n\t\t\tif (L.Browser.touch && !this.options.permanent) {\n\t\t\t\tevents.preclick = this._close;\n\t\t\t}\n\t\n\t\t\treturn events;\n\t\t},\n\t\n\t\t_close: function () {\n\t\t\tif (this._map) {\n\t\t\t\tthis._map.closeTooltip(this);\n\t\t\t}\n\t\t},\n\t\n\t\t_initLayout: function () {\n\t\t\tvar prefix = 'leaflet-tooltip',\n\t\t\t className = prefix + ' ' + (this.options.className || '') + ' leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');\n\t\n\t\t\tthis._contentNode = this._container = L.DomUtil.create('div', className);\n\t\t},\n\t\n\t\t_updateLayout: function () {},\n\t\n\t\t_adjustPan: function () {},\n\t\n\t\t_setPosition: function (pos) {\n\t\t\tvar map = this._map,\n\t\t\t container = this._container,\n\t\t\t centerPoint = map.latLngToContainerPoint(map.getCenter()),\n\t\t\t tooltipPoint = map.layerPointToContainerPoint(pos),\n\t\t\t direction = this.options.direction,\n\t\t\t tooltipWidth = container.offsetWidth,\n\t\t\t tooltipHeight = container.offsetHeight,\n\t\t\t offset = L.point(this.options.offset),\n\t\t\t anchor = this._getAnchor();\n\t\n\t\t\tif (direction === 'top') {\n\t\t\t\tpos = pos.add(L.point(-tooltipWidth / 2 + offset.x, -tooltipHeight + offset.y + anchor.y, true));\n\t\t\t} else if (direction === 'bottom') {\n\t\t\t\tpos = pos.subtract(L.point(tooltipWidth / 2 - offset.x, -offset.y, true));\n\t\t\t} else if (direction === 'center') {\n\t\t\t\tpos = pos.subtract(L.point(tooltipWidth / 2 + offset.x, tooltipHeight / 2 - anchor.y + offset.y, true));\n\t\t\t} else if (direction === 'right' || direction === 'auto' && tooltipPoint.x < centerPoint.x) {\n\t\t\t\tdirection = 'right';\n\t\t\t\tpos = pos.add(L.point(offset.x + anchor.x, anchor.y - tooltipHeight / 2 + offset.y, true));\n\t\t\t} else {\n\t\t\t\tdirection = 'left';\n\t\t\t\tpos = pos.subtract(L.point(tooltipWidth + anchor.x - offset.x, tooltipHeight / 2 - anchor.y - offset.y, true));\n\t\t\t}\n\t\n\t\t\tL.DomUtil.removeClass(container, 'leaflet-tooltip-right');\n\t\t\tL.DomUtil.removeClass(container, 'leaflet-tooltip-left');\n\t\t\tL.DomUtil.removeClass(container, 'leaflet-tooltip-top');\n\t\t\tL.DomUtil.removeClass(container, 'leaflet-tooltip-bottom');\n\t\t\tL.DomUtil.addClass(container, 'leaflet-tooltip-' + direction);\n\t\t\tL.DomUtil.setPosition(container, pos);\n\t\t},\n\t\n\t\t_updatePosition: function () {\n\t\t\tvar pos = this._map.latLngToLayerPoint(this._latlng);\n\t\t\tthis._setPosition(pos);\n\t\t},\n\t\n\t\tsetOpacity: function (opacity) {\n\t\t\tthis.options.opacity = opacity;\n\t\n\t\t\tif (this._container) {\n\t\t\t\tL.DomUtil.setOpacity(this._container, opacity);\n\t\t\t}\n\t\t},\n\t\n\t\t_animateZoom: function (e) {\n\t\t\tvar pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center);\n\t\t\tthis._setPosition(pos);\n\t\t},\n\t\n\t\t_getAnchor: function () {\n\t\t\t// Where should we anchor the tooltip on the source layer?\n\t\t\treturn L.point(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0]);\n\t\t}\n\t\n\t});\n\t\n\t// @namespace Tooltip\n\t// @factory L.tooltip(options?: Tooltip options, source?: Layer)\n\t// Instantiates a Tooltip object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the tooltip with a reference to the Layer to which it refers.\n\tL.tooltip = function (options, source) {\n\t\treturn new L.Tooltip(options, source);\n\t};\n\t\n\t// @namespace Map\n\t// @section Methods for Layers and Controls\n\tL.Map.include({\n\t\n\t\t// @method openTooltip(tooltip: Tooltip): this\n\t\t// Opens the specified tooltip.\n\t\t// @alternative\n\t\t// @method openTooltip(content: String|HTMLElement, latlng: LatLng, options?: Tooltip options): this\n\t\t// Creates a tooltip with the specified content and options and open it.\n\t\topenTooltip: function (tooltip, latlng, options) {\n\t\t\tif (!(tooltip instanceof L.Tooltip)) {\n\t\t\t\ttooltip = new L.Tooltip(options).setContent(tooltip);\n\t\t\t}\n\t\n\t\t\tif (latlng) {\n\t\t\t\ttooltip.setLatLng(latlng);\n\t\t\t}\n\t\n\t\t\tif (this.hasLayer(tooltip)) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\n\t\t\treturn this.addLayer(tooltip);\n\t\t},\n\t\n\t\t// @method closeTooltip(tooltip?: Tooltip): this\n\t\t// Closes the tooltip given as parameter.\n\t\tcloseTooltip: function (tooltip) {\n\t\t\tif (tooltip) {\n\t\t\t\tthis.removeLayer(tooltip);\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\n\t});\n\t\n\t/*\n\t * @namespace Layer\n\t * @section Tooltip methods example\n\t *\n\t * All layers share a set of methods convenient for binding tooltips to it.\n\t *\n\t * ```js\n\t * var layer = L.Polygon(latlngs).bindTooltip('Hi There!').addTo(map);\n\t * layer.openTooltip();\n\t * layer.closeTooltip();\n\t * ```\n\t */\n\t\n\t// @section Tooltip methods\n\tL.Layer.include({\n\t\n\t\t// @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this\n\t\t// Binds a tooltip to the layer with the passed `content` and sets up the\n\t\t// neccessary event listeners. If a `Function` is passed it will receive\n\t\t// the layer as the first argument and should return a `String` or `HTMLElement`.\n\t\tbindTooltip: function (content, options) {\n\t\n\t\t\tif (content instanceof L.Tooltip) {\n\t\t\t\tL.setOptions(content, options);\n\t\t\t\tthis._tooltip = content;\n\t\t\t\tcontent._source = this;\n\t\t\t} else {\n\t\t\t\tif (!this._tooltip || options) {\n\t\t\t\t\tthis._tooltip = L.tooltip(options, this);\n\t\t\t\t}\n\t\t\t\tthis._tooltip.setContent(content);\n\t\n\t\t\t}\n\t\n\t\t\tthis._initTooltipInteractions();\n\t\n\t\t\tif (this._tooltip.options.permanent && this._map && this._map.hasLayer(this)) {\n\t\t\t\tthis.openTooltip();\n\t\t\t}\n\t\n\t\t\treturn this;\n\t\t},\n\t\n\t\t// @method unbindTooltip(): this\n\t\t// Removes the tooltip previously bound with `bindTooltip`.\n\t\tunbindTooltip: function () {\n\t\t\tif (this._tooltip) {\n\t\t\t\tthis._initTooltipInteractions(true);\n\t\t\t\tthis.closeTooltip();\n\t\t\t\tthis._tooltip = null;\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\n\t\t_initTooltipInteractions: function (remove) {\n\t\t\tif (!remove && this._tooltipHandlersAdded) { return; }\n\t\t\tvar onOff = remove ? 'off' : 'on',\n\t\t\t events = {\n\t\t\t\tremove: this.closeTooltip,\n\t\t\t\tmove: this._moveTooltip\n\t\t\t };\n\t\t\tif (!this._tooltip.options.permanent) {\n\t\t\t\tevents.mouseover = this._openTooltip;\n\t\t\t\tevents.mouseout = this.closeTooltip;\n\t\t\t\tif (this._tooltip.options.sticky) {\n\t\t\t\t\tevents.mousemove = this._moveTooltip;\n\t\t\t\t}\n\t\t\t\tif (L.Browser.touch) {\n\t\t\t\t\tevents.click = this._openTooltip;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tevents.add = this._openTooltip;\n\t\t\t}\n\t\t\tthis[onOff](events);\n\t\t\tthis._tooltipHandlersAdded = !remove;\n\t\t},\n\t\n\t\t// @method openTooltip(latlng?: LatLng): this\n\t\t// Opens the bound tooltip at the specificed `latlng` or at the default tooltip anchor if no `latlng` is passed.\n\t\topenTooltip: function (layer, latlng) {\n\t\t\tif (!(layer instanceof L.Layer)) {\n\t\t\t\tlatlng = layer;\n\t\t\t\tlayer = this;\n\t\t\t}\n\t\n\t\t\tif (layer instanceof L.FeatureGroup) {\n\t\t\t\tfor (var id in this._layers) {\n\t\t\t\t\tlayer = this._layers[id];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tif (!latlng) {\n\t\t\t\tlatlng = layer.getCenter ? layer.getCenter() : layer.getLatLng();\n\t\t\t}\n\t\n\t\t\tif (this._tooltip && this._map) {\n\t\n\t\t\t\t// set tooltip source to this layer\n\t\t\t\tthis._tooltip._source = layer;\n\t\n\t\t\t\t// update the tooltip (content, layout, ect...)\n\t\t\t\tthis._tooltip.update();\n\t\n\t\t\t\t// open the tooltip on the map\n\t\t\t\tthis._map.openTooltip(this._tooltip, latlng);\n\t\n\t\t\t\t// Tooltip container may not be defined if not permanent and never\n\t\t\t\t// opened.\n\t\t\t\tif (this._tooltip.options.interactive && this._tooltip._container) {\n\t\t\t\t\tL.DomUtil.addClass(this._tooltip._container, 'leaflet-clickable');\n\t\t\t\t\tthis.addInteractiveTarget(this._tooltip._container);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\treturn this;\n\t\t},\n\t\n\t\t// @method closeTooltip(): this\n\t\t// Closes the tooltip bound to this layer if it is open.\n\t\tcloseTooltip: function () {\n\t\t\tif (this._tooltip) {\n\t\t\t\tthis._tooltip._close();\n\t\t\t\tif (this._tooltip.options.interactive && this._tooltip._container) {\n\t\t\t\t\tL.DomUtil.removeClass(this._tooltip._container, 'leaflet-clickable');\n\t\t\t\t\tthis.removeInteractiveTarget(this._tooltip._container);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\n\t\t// @method toggleTooltip(): this\n\t\t// Opens or closes the tooltip bound to this layer depending on its current state.\n\t\ttoggleTooltip: function (target) {\n\t\t\tif (this._tooltip) {\n\t\t\t\tif (this._tooltip._map) {\n\t\t\t\t\tthis.closeTooltip();\n\t\t\t\t} else {\n\t\t\t\t\tthis.openTooltip(target);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\n\t\t// @method isTooltipOpen(): boolean\n\t\t// Returns `true` if the tooltip bound to this layer is currently open.\n\t\tisTooltipOpen: function () {\n\t\t\treturn this._tooltip.isOpen();\n\t\t},\n\t\n\t\t// @method setTooltipContent(content: String|HTMLElement|Tooltip): this\n\t\t// Sets the content of the tooltip bound to this layer.\n\t\tsetTooltipContent: function (content) {\n\t\t\tif (this._tooltip) {\n\t\t\t\tthis._tooltip.setContent(content);\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\n\t\t// @method getTooltip(): Tooltip\n\t\t// Returns the tooltip bound to this layer.\n\t\tgetTooltip: function () {\n\t\t\treturn this._tooltip;\n\t\t},\n\t\n\t\t_openTooltip: function (e) {\n\t\t\tvar layer = e.layer || e.target;\n\t\n\t\t\tif (!this._tooltip || !this._map) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.openTooltip(layer, this._tooltip.options.sticky ? e.latlng : undefined);\n\t\t},\n\t\n\t\t_moveTooltip: function (e) {\n\t\t\tvar latlng = e.latlng, containerPoint, layerPoint;\n\t\t\tif (this._tooltip.options.sticky && e.originalEvent) {\n\t\t\t\tcontainerPoint = this._map.mouseEventToContainerPoint(e.originalEvent);\n\t\t\t\tlayerPoint = this._map.containerPointToLayerPoint(containerPoint);\n\t\t\t\tlatlng = this._map.layerPointToLatLng(layerPoint);\n\t\t\t}\n\t\t\tthis._tooltip.setLatLng(latlng);\n\t\t}\n\t});\n\t\n\t\n\t\n\t/*\r\n\t * @class LayerGroup\r\n\t * @aka L.LayerGroup\r\n\t * @inherits Layer\r\n\t *\r\n\t * Used to group several layers and handle them as one. If you add it to the map,\r\n\t * any layers added or removed from the group will be added/removed on the map as\r\n\t * well. Extends `Layer`.\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * ```js\r\n\t * L.layerGroup([marker1, marker2])\r\n\t * \t.addLayer(polyline)\r\n\t * \t.addTo(map);\r\n\t * ```\r\n\t */\r\n\t\r\n\tL.LayerGroup = L.Layer.extend({\r\n\t\r\n\t\tinitialize: function (layers) {\r\n\t\t\tthis._layers = {};\r\n\t\r\n\t\t\tvar i, len;\r\n\t\r\n\t\t\tif (layers) {\r\n\t\t\t\tfor (i = 0, len = layers.length; i < len; i++) {\r\n\t\t\t\t\tthis.addLayer(layers[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\t// @method addLayer(layer: Layer): this\r\n\t\t// Adds the given layer to the group.\r\n\t\taddLayer: function (layer) {\r\n\t\t\tvar id = this.getLayerId(layer);\r\n\t\r\n\t\t\tthis._layers[id] = layer;\r\n\t\r\n\t\t\tif (this._map) {\r\n\t\t\t\tthis._map.addLayer(layer);\r\n\t\t\t}\r\n\t\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method removeLayer(layer: Layer): this\r\n\t\t// Removes the given layer from the group.\r\n\t\t// @alternative\r\n\t\t// @method removeLayer(id: Number): this\r\n\t\t// Removes the layer with the given internal ID from the group.\r\n\t\tremoveLayer: function (layer) {\r\n\t\t\tvar id = layer in this._layers ? layer : this.getLayerId(layer);\r\n\t\r\n\t\t\tif (this._map && this._layers[id]) {\r\n\t\t\t\tthis._map.removeLayer(this._layers[id]);\r\n\t\t\t}\r\n\t\r\n\t\t\tdelete this._layers[id];\r\n\t\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method hasLayer(layer: Layer): Boolean\r\n\t\t// Returns `true` if the given layer is currently added to the group.\r\n\t\thasLayer: function (layer) {\r\n\t\t\treturn !!layer && (layer in this._layers || this.getLayerId(layer) in this._layers);\r\n\t\t},\r\n\t\r\n\t\t// @method clearLayers(): this\r\n\t\t// Removes all the layers from the group.\r\n\t\tclearLayers: function () {\r\n\t\t\tfor (var i in this._layers) {\r\n\t\t\t\tthis.removeLayer(this._layers[i]);\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method invoke(methodName: String, …): this\r\n\t\t// Calls `methodName` on every layer contained in this group, passing any\r\n\t\t// additional parameters. Has no effect if the layers contained do not\r\n\t\t// implement `methodName`.\r\n\t\tinvoke: function (methodName) {\r\n\t\t\tvar args = Array.prototype.slice.call(arguments, 1),\r\n\t\t\t i, layer;\r\n\t\r\n\t\t\tfor (i in this._layers) {\r\n\t\t\t\tlayer = this._layers[i];\r\n\t\r\n\t\t\t\tif (layer[methodName]) {\r\n\t\t\t\t\tlayer[methodName].apply(layer, args);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\tonAdd: function (map) {\r\n\t\t\tfor (var i in this._layers) {\r\n\t\t\t\tmap.addLayer(this._layers[i]);\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\tonRemove: function (map) {\r\n\t\t\tfor (var i in this._layers) {\r\n\t\t\t\tmap.removeLayer(this._layers[i]);\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\t// @method eachLayer(fn: Function, context?: Object): this\r\n\t\t// Iterates over the layers of the group, optionally specifying context of the iterator function.\r\n\t\t// ```js\r\n\t\t// group.eachLayer(function (layer) {\r\n\t\t// \tlayer.bindPopup('Hello');\r\n\t\t// });\r\n\t\t// ```\r\n\t\teachLayer: function (method, context) {\r\n\t\t\tfor (var i in this._layers) {\r\n\t\t\t\tmethod.call(context, this._layers[i]);\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\r\n\t\t// @method getLayer(id: Number): Layer\r\n\t\t// Returns the layer with the given internal ID.\r\n\t\tgetLayer: function (id) {\r\n\t\t\treturn this._layers[id];\r\n\t\t},\r\n\t\r\n\t\t// @method getLayers(): Layer[]\r\n\t\t// Returns an array of all the layers added to the group.\r\n\t\tgetLayers: function () {\r\n\t\t\tvar layers = [];\r\n\t\r\n\t\t\tfor (var i in this._layers) {\r\n\t\t\t\tlayers.push(this._layers[i]);\r\n\t\t\t}\r\n\t\t\treturn layers;\r\n\t\t},\r\n\t\r\n\t\t// @method setZIndex(zIndex: Number): this\r\n\t\t// Calls `setZIndex` on every layer contained in this group, passing the z-index.\r\n\t\tsetZIndex: function (zIndex) {\r\n\t\t\treturn this.invoke('setZIndex', zIndex);\r\n\t\t},\r\n\t\r\n\t\t// @method getLayerId(layer: Layer): Number\r\n\t\t// Returns the internal ID for a layer\r\n\t\tgetLayerId: function (layer) {\r\n\t\t\treturn L.stamp(layer);\r\n\t\t}\r\n\t});\r\n\t\r\n\t\r\n\t// @factory L.layerGroup(layers: Layer[])\r\n\t// Create a layer group, optionally given an initial set of layers.\r\n\tL.layerGroup = function (layers) {\r\n\t\treturn new L.LayerGroup(layers);\r\n\t};\r\n\t\n\t\n\t\n\t/*\r\n\t * @class FeatureGroup\r\n\t * @aka L.FeatureGroup\r\n\t * @inherits LayerGroup\r\n\t *\r\n\t * Extended `LayerGroup` that makes it easier to do the same thing to all its member layers:\r\n\t * * [`bindPopup`](#layer-bindpopup) binds a popup to all of the layers at once (likewise with [`bindTooltip`](#layer-bindtooltip))\r\n\t * * Events are propagated to the `FeatureGroup`, so if the group has an event\r\n\t * handler, it will handle events from any of the layers. This includes mouse events\r\n\t * and custom events.\r\n\t * * Has `layeradd` and `layerremove` events\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * ```js\r\n\t * L.featureGroup([marker1, marker2, polyline])\r\n\t * \t.bindPopup('Hello world!')\r\n\t * \t.on('click', function() { alert('Clicked on a member of the group!'); })\r\n\t * \t.addTo(map);\r\n\t * ```\r\n\t */\r\n\t\r\n\tL.FeatureGroup = L.LayerGroup.extend({\r\n\t\r\n\t\taddLayer: function (layer) {\r\n\t\t\tif (this.hasLayer(layer)) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\r\n\t\t\tlayer.addEventParent(this);\r\n\t\r\n\t\t\tL.LayerGroup.prototype.addLayer.call(this, layer);\r\n\t\r\n\t\t\t// @event layeradd: LayerEvent\r\n\t\t\t// Fired when a layer is added to this `FeatureGroup`\r\n\t\t\treturn this.fire('layeradd', {layer: layer});\r\n\t\t},\r\n\t\r\n\t\tremoveLayer: function (layer) {\r\n\t\t\tif (!this.hasLayer(layer)) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t\tif (layer in this._layers) {\r\n\t\t\t\tlayer = this._layers[layer];\r\n\t\t\t}\r\n\t\r\n\t\t\tlayer.removeEventParent(this);\r\n\t\r\n\t\t\tL.LayerGroup.prototype.removeLayer.call(this, layer);\r\n\t\r\n\t\t\t// @event layerremove: LayerEvent\r\n\t\t\t// Fired when a layer is removed from this `FeatureGroup`\r\n\t\t\treturn this.fire('layerremove', {layer: layer});\r\n\t\t},\r\n\t\r\n\t\t// @method setStyle(style: Path options): this\r\n\t\t// Sets the given path options to each layer of the group that has a `setStyle` method.\r\n\t\tsetStyle: function (style) {\r\n\t\t\treturn this.invoke('setStyle', style);\r\n\t\t},\r\n\t\r\n\t\t// @method bringToFront(): this\r\n\t\t// Brings the layer group to the top of all other layers\r\n\t\tbringToFront: function () {\r\n\t\t\treturn this.invoke('bringToFront');\r\n\t\t},\r\n\t\r\n\t\t// @method bringToBack(): this\r\n\t\t// Brings the layer group to the top of all other layers\r\n\t\tbringToBack: function () {\r\n\t\t\treturn this.invoke('bringToBack');\r\n\t\t},\r\n\t\r\n\t\t// @method getBounds(): LatLngBounds\r\n\t\t// Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).\r\n\t\tgetBounds: function () {\r\n\t\t\tvar bounds = new L.LatLngBounds();\r\n\t\r\n\t\t\tfor (var id in this._layers) {\r\n\t\t\t\tvar layer = this._layers[id];\r\n\t\t\t\tbounds.extend(layer.getBounds ? layer.getBounds() : layer.getLatLng());\r\n\t\t\t}\r\n\t\t\treturn bounds;\r\n\t\t}\r\n\t});\r\n\t\r\n\t// @factory L.featureGroup(layers: Layer[])\r\n\t// Create a feature group, optionally given an initial set of layers.\r\n\tL.featureGroup = function (layers) {\r\n\t\treturn new L.FeatureGroup(layers);\r\n\t};\r\n\t\n\t\n\t\n\t/*\n\t * @class Renderer\n\t * @inherits Layer\n\t * @aka L.Renderer\n\t *\n\t * Base class for vector renderer implementations (`SVG`, `Canvas`). Handles the\n\t * DOM container of the renderer, its bounds, and its zoom animation.\n\t *\n\t * A `Renderer` works as an implicit layer group for all `Path`s - the renderer\n\t * itself can be added or removed to the map. All paths use a renderer, which can\n\t * be implicit (the map will decide the type of renderer and use it automatically)\n\t * or explicit (using the [`renderer`](#path-renderer) option of the path).\n\t *\n\t * Do not use this class directly, use `SVG` and `Canvas` instead.\n\t *\n\t * @event update: Event\n\t * Fired when the renderer updates its bounds, center and zoom, for example when\n\t * its map has moved\n\t */\n\t\n\tL.Renderer = L.Layer.extend({\n\t\n\t\t// @section\n\t\t// @aka Renderer options\n\t\toptions: {\n\t\t\t// @option padding: Number = 0.1\n\t\t\t// How much to extend the clip area around the map view (relative to its size)\n\t\t\t// e.g. 0.1 would be 10% of map view in each direction\n\t\t\tpadding: 0.1\n\t\t},\n\t\n\t\tinitialize: function (options) {\n\t\t\tL.setOptions(this, options);\n\t\t\tL.stamp(this);\n\t\t\tthis._layers = this._layers || {};\n\t\t},\n\t\n\t\tonAdd: function () {\n\t\t\tif (!this._container) {\n\t\t\t\tthis._initContainer(); // defined by renderer implementations\n\t\n\t\t\t\tif (this._zoomAnimated) {\n\t\t\t\t\tL.DomUtil.addClass(this._container, 'leaflet-zoom-animated');\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tthis.getPane().appendChild(this._container);\n\t\t\tthis._update();\n\t\t\tthis.on('update', this._updatePaths, this);\n\t\t},\n\t\n\t\tonRemove: function () {\n\t\t\tL.DomUtil.remove(this._container);\n\t\t\tthis.off('update', this._updatePaths, this);\n\t\t},\n\t\n\t\tgetEvents: function () {\n\t\t\tvar events = {\n\t\t\t\tviewreset: this._reset,\n\t\t\t\tzoom: this._onZoom,\n\t\t\t\tmoveend: this._update,\n\t\t\t\tzoomend: this._onZoomEnd\n\t\t\t};\n\t\t\tif (this._zoomAnimated) {\n\t\t\t\tevents.zoomanim = this._onAnimZoom;\n\t\t\t}\n\t\t\treturn events;\n\t\t},\n\t\n\t\t_onAnimZoom: function (ev) {\n\t\t\tthis._updateTransform(ev.center, ev.zoom);\n\t\t},\n\t\n\t\t_onZoom: function () {\n\t\t\tthis._updateTransform(this._map.getCenter(), this._map.getZoom());\n\t\t},\n\t\n\t\t_updateTransform: function (center, zoom) {\n\t\t\tvar scale = this._map.getZoomScale(zoom, this._zoom),\n\t\t\t position = L.DomUtil.getPosition(this._container),\n\t\t\t viewHalf = this._map.getSize().multiplyBy(0.5 + this.options.padding),\n\t\t\t currentCenterPoint = this._map.project(this._center, zoom),\n\t\t\t destCenterPoint = this._map.project(center, zoom),\n\t\t\t centerOffset = destCenterPoint.subtract(currentCenterPoint),\n\t\n\t\t\t topLeftOffset = viewHalf.multiplyBy(-scale).add(position).add(viewHalf).subtract(centerOffset);\n\t\n\t\t\tif (L.Browser.any3d) {\n\t\t\t\tL.DomUtil.setTransform(this._container, topLeftOffset, scale);\n\t\t\t} else {\n\t\t\t\tL.DomUtil.setPosition(this._container, topLeftOffset);\n\t\t\t}\n\t\t},\n\t\n\t\t_reset: function () {\n\t\t\tthis._update();\n\t\t\tthis._updateTransform(this._center, this._zoom);\n\t\n\t\t\tfor (var id in this._layers) {\n\t\t\t\tthis._layers[id]._reset();\n\t\t\t}\n\t\t},\n\t\n\t\t_onZoomEnd: function () {\n\t\t\tfor (var id in this._layers) {\n\t\t\t\tthis._layers[id]._project();\n\t\t\t}\n\t\t},\n\t\n\t\t_updatePaths: function () {\n\t\t\tfor (var id in this._layers) {\n\t\t\t\tthis._layers[id]._update();\n\t\t\t}\n\t\t},\n\t\n\t\t_update: function () {\n\t\t\t// Update pixel bounds of renderer container (for positioning/sizing/clipping later)\n\t\t\t// Subclasses are responsible of firing the 'update' event.\n\t\t\tvar p = this.options.padding,\n\t\t\t size = this._map.getSize(),\n\t\t\t min = this._map.containerPointToLayerPoint(size.multiplyBy(-p)).round();\n\t\n\t\t\tthis._bounds = new L.Bounds(min, min.add(size.multiplyBy(1 + p * 2)).round());\n\t\n\t\t\tthis._center = this._map.getCenter();\n\t\t\tthis._zoom = this._map.getZoom();\n\t\t}\n\t});\n\t\n\t\n\tL.Map.include({\n\t\t// @namespace Map; @method getRenderer(layer: Path): Renderer\n\t\t// Returns the instance of `Renderer` that should be used to render the given\n\t\t// `Path`. It will ensure that the `renderer` options of the map and paths\n\t\t// are respected, and that the renderers do exist on the map.\n\t\tgetRenderer: function (layer) {\n\t\t\t// @namespace Path; @option renderer: Renderer\n\t\t\t// Use this specific instance of `Renderer` for this path. Takes\n\t\t\t// precedence over the map's [default renderer](#map-renderer).\n\t\t\tvar renderer = layer.options.renderer || this._getPaneRenderer(layer.options.pane) || this.options.renderer || this._renderer;\n\t\n\t\t\tif (!renderer) {\n\t\t\t\t// @namespace Map; @option preferCanvas: Boolean = false\n\t\t\t\t// Whether `Path`s should be rendered on a `Canvas` renderer.\n\t\t\t\t// By default, all `Path`s are rendered in a `SVG` renderer.\n\t\t\t\trenderer = this._renderer = (this.options.preferCanvas && L.canvas()) || L.svg();\n\t\t\t}\n\t\n\t\t\tif (!this.hasLayer(renderer)) {\n\t\t\t\tthis.addLayer(renderer);\n\t\t\t}\n\t\t\treturn renderer;\n\t\t},\n\t\n\t\t_getPaneRenderer: function (name) {\n\t\t\tif (name === 'overlayPane' || name === undefined) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\n\t\t\tvar renderer = this._paneRenderers[name];\n\t\t\tif (renderer === undefined) {\n\t\t\t\trenderer = (L.SVG && L.svg({pane: name})) || (L.Canvas && L.canvas({pane: name}));\n\t\t\t\tthis._paneRenderers[name] = renderer;\n\t\t\t}\n\t\t\treturn renderer;\n\t\t}\n\t});\n\t\n\t\n\t\n\t/*\n\t * @class Path\n\t * @aka L.Path\n\t * @inherits Interactive layer\n\t *\n\t * An abstract class that contains options and constants shared between vector\n\t * overlays (Polygon, Polyline, Circle). Do not use it directly. Extends `Layer`.\n\t */\n\t\n\tL.Path = L.Layer.extend({\n\t\n\t\t// @section\n\t\t// @aka Path options\n\t\toptions: {\n\t\t\t// @option stroke: Boolean = true\n\t\t\t// Whether to draw stroke along the path. Set it to `false` to disable borders on polygons or circles.\n\t\t\tstroke: true,\n\t\n\t\t\t// @option color: String = '#3388ff'\n\t\t\t// Stroke color\n\t\t\tcolor: '#3388ff',\n\t\n\t\t\t// @option weight: Number = 3\n\t\t\t// Stroke width in pixels\n\t\t\tweight: 3,\n\t\n\t\t\t// @option opacity: Number = 1.0\n\t\t\t// Stroke opacity\n\t\t\topacity: 1,\n\t\n\t\t\t// @option lineCap: String= 'round'\n\t\t\t// A string that defines [shape to be used at the end](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap) of the stroke.\n\t\t\tlineCap: 'round',\n\t\n\t\t\t// @option lineJoin: String = 'round'\n\t\t\t// A string that defines [shape to be used at the corners](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin) of the stroke.\n\t\t\tlineJoin: 'round',\n\t\n\t\t\t// @option dashArray: String = null\n\t\t\t// A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).\n\t\t\tdashArray: null,\n\t\n\t\t\t// @option dashOffset: String = null\n\t\t\t// A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).\n\t\t\tdashOffset: null,\n\t\n\t\t\t// @option fill: Boolean = depends\n\t\t\t// Whether to fill the path with color. Set it to `false` to disable filling on polygons or circles.\n\t\t\tfill: false,\n\t\n\t\t\t// @option fillColor: String = *\n\t\t\t// Fill color. Defaults to the value of the [`color`](#path-color) option\n\t\t\tfillColor: null,\n\t\n\t\t\t// @option fillOpacity: Number = 0.2\n\t\t\t// Fill opacity.\n\t\t\tfillOpacity: 0.2,\n\t\n\t\t\t// @option fillRule: String = 'evenodd'\n\t\t\t// A string that defines [how the inside of a shape](https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule) is determined.\n\t\t\tfillRule: 'evenodd',\n\t\n\t\t\t// className: '',\n\t\n\t\t\t// Option inherited from \"Interactive layer\" abstract class\n\t\t\tinteractive: true\n\t\t},\n\t\n\t\tbeforeAdd: function (map) {\n\t\t\t// Renderer is set here because we need to call renderer.getEvents\n\t\t\t// before this.getEvents.\n\t\t\tthis._renderer = map.getRenderer(this);\n\t\t},\n\t\n\t\tonAdd: function () {\n\t\t\tthis._renderer._initPath(this);\n\t\t\tthis._reset();\n\t\t\tthis._renderer._addPath(this);\n\t\t},\n\t\n\t\tonRemove: function () {\n\t\t\tthis._renderer._removePath(this);\n\t\t},\n\t\n\t\t// @method redraw(): this\n\t\t// Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.\n\t\tredraw: function () {\n\t\t\tif (this._map) {\n\t\t\t\tthis._renderer._updatePath(this);\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\n\t\t// @method setStyle(style: Path options): this\n\t\t// Changes the appearance of a Path based on the options in the `Path options` object.\n\t\tsetStyle: function (style) {\n\t\t\tL.setOptions(this, style);\n\t\t\tif (this._renderer) {\n\t\t\t\tthis._renderer._updateStyle(this);\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\n\t\t// @method bringToFront(): this\n\t\t// Brings the layer to the top of all path layers.\n\t\tbringToFront: function () {\n\t\t\tif (this._renderer) {\n\t\t\t\tthis._renderer._bringToFront(this);\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\n\t\t// @method bringToBack(): this\n\t\t// Brings the layer to the bottom of all path layers.\n\t\tbringToBack: function () {\n\t\t\tif (this._renderer) {\n\t\t\t\tthis._renderer._bringToBack(this);\n\t\t\t}\n\t\t\treturn this;\n\t\t},\n\t\n\t\tgetElement: function () {\n\t\t\treturn this._path;\n\t\t},\n\t\n\t\t_reset: function () {\n\t\t\t// defined in children classes\n\t\t\tthis._project();\n\t\t\tthis._update();\n\t\t},\n\t\n\t\t_clickTolerance: function () {\n\t\t\t// used when doing hit detection for Canvas layers\n\t\t\treturn (this.options.stroke ? this.options.weight / 2 : 0) + (L.Browser.touch ? 10 : 0);\n\t\t}\n\t});\n\t\n\t\n\t\n\t/*\r\n\t * @namespace LineUtil\r\n\t *\r\n\t * Various utility functions for polyine points processing, used by Leaflet internally to make polylines lightning-fast.\r\n\t */\r\n\t\r\n\tL.LineUtil = {\r\n\t\r\n\t\t// Simplify polyline with vertex reduction and Douglas-Peucker simplification.\r\n\t\t// Improves rendering performance dramatically by lessening the number of points to draw.\r\n\t\r\n\t\t// @function simplify(points: Point[], tolerance: Number): Point[]\r\n\t\t// Dramatically reduces the number of points in a polyline while retaining\r\n\t\t// its shape and returns a new array of simplified points, using the\r\n\t\t// [Douglas-Peucker algorithm](http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm).\r\n\t\t// Used for a huge performance boost when processing/displaying Leaflet polylines for\r\n\t\t// each zoom level and also reducing visual noise. tolerance affects the amount of\r\n\t\t// simplification (lesser value means higher quality but slower and with more points).\r\n\t\t// Also released as a separated micro-library [Simplify.js](http://mourner.github.com/simplify-js/).\r\n\t\tsimplify: function (points, tolerance) {\r\n\t\t\tif (!tolerance || !points.length) {\r\n\t\t\t\treturn points.slice();\r\n\t\t\t}\r\n\t\r\n\t\t\tvar sqTolerance = tolerance * tolerance;\r\n\t\r\n\t\t\t// stage 1: vertex reduction\r\n\t\t\tpoints = this._reducePoints(points, sqTolerance);\r\n\t\r\n\t\t\t// stage 2: Douglas-Peucker simplification\r\n\t\t\tpoints = this._simplifyDP(points, sqTolerance);\r\n\t\r\n\t\t\treturn points;\r\n\t\t},\r\n\t\r\n\t\t// @function pointToSegmentDistance(p: Point, p1: Point, p2: Point): Number\r\n\t\t// Returns the distance between point `p` and segment `p1` to `p2`.\r\n\t\tpointToSegmentDistance: function (p, p1, p2) {\r\n\t\t\treturn Math.sqrt(this._sqClosestPointOnSegment(p, p1, p2, true));\r\n\t\t},\r\n\t\r\n\t\t// @function closestPointOnSegment(p: Point, p1: Point, p2: Point): Number\r\n\t\t// Returns the closest point from a point `p` on a segment `p1` to `p2`.\r\n\t\tclosestPointOnSegment: function (p, p1, p2) {\r\n\t\t\treturn this._sqClosestPointOnSegment(p, p1, p2);\r\n\t\t},\r\n\t\r\n\t\t// Douglas-Peucker simplification, see http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm\r\n\t\t_simplifyDP: function (points, sqTolerance) {\r\n\t\r\n\t\t\tvar len = points.length,\r\n\t\t\t ArrayConstructor = typeof Uint8Array !== undefined + '' ? Uint8Array : Array,\r\n\t\t\t markers = new ArrayConstructor(len);\r\n\t\r\n\t\t\tmarkers[0] = markers[len - 1] = 1;\r\n\t\r\n\t\t\tthis._simplifyDPStep(points, markers, sqTolerance, 0, len - 1);\r\n\t\r\n\t\t\tvar i,\r\n\t\t\t newPoints = [];\r\n\t\r\n\t\t\tfor (i = 0; i < len; i++) {\r\n\t\t\t\tif (markers[i]) {\r\n\t\t\t\t\tnewPoints.push(points[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\treturn newPoints;\r\n\t\t},\r\n\t\r\n\t\t_simplifyDPStep: function (points, markers, sqTolerance, first, last) {\r\n\t\r\n\t\t\tvar maxSqDist = 0,\r\n\t\t\t index, i, sqDist;\r\n\t\r\n\t\t\tfor (i = first + 1; i <= last - 1; i++) {\r\n\t\t\t\tsqDist = this._sqClosestPointOnSegment(points[i], points[first], points[last], true);\r\n\t\r\n\t\t\t\tif (sqDist > maxSqDist) {\r\n\t\t\t\t\tindex = i;\r\n\t\t\t\t\tmaxSqDist = sqDist;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\tif (maxSqDist > sqTolerance) {\r\n\t\t\t\tmarkers[index] = 1;\r\n\t\r\n\t\t\t\tthis._simplifyDPStep(points, markers, sqTolerance, first, index);\r\n\t\t\t\tthis._simplifyDPStep(points, markers, sqTolerance, index, last);\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\t// reduce points that are too close to each other to a single point\r\n\t\t_reducePoints: function (points, sqTolerance) {\r\n\t\t\tvar reducedPoints = [points[0]];\r\n\t\r\n\t\t\tfor (var i = 1, prev = 0, len = points.length; i < len; i++) {\r\n\t\t\t\tif (this._sqDist(points[i], points[prev]) > sqTolerance) {\r\n\t\t\t\t\treducedPoints.push(points[i]);\r\n\t\t\t\t\tprev = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (prev < len - 1) {\r\n\t\t\t\treducedPoints.push(points[len - 1]);\r\n\t\t\t}\r\n\t\t\treturn reducedPoints;\r\n\t\t},\r\n\t\r\n\t\r\n\t\t// @function clipSegment(a: Point, b: Point, bounds: Bounds, useLastCode?: Boolean, round?: Boolean): Point[]|Boolean\r\n\t\t// Clips the segment a to b by rectangular bounds with the\r\n\t\t// [Cohen-Sutherland algorithm](https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm)\r\n\t\t// (modifying the segment points directly!). Used by Leaflet to only show polyline\r\n\t\t// points that are on the screen or near, increasing performance.\r\n\t\tclipSegment: function (a, b, bounds, useLastCode, round) {\r\n\t\t\tvar codeA = useLastCode ? this._lastCode : this._getBitCode(a, bounds),\r\n\t\t\t codeB = this._getBitCode(b, bounds),\r\n\t\r\n\t\t\t codeOut, p, newCode;\r\n\t\r\n\t\t\t// save 2nd code to avoid calculating it on the next segment\r\n\t\t\tthis._lastCode = codeB;\r\n\t\r\n\t\t\twhile (true) {\r\n\t\t\t\t// if a,b is inside the clip window (trivial accept)\r\n\t\t\t\tif (!(codeA | codeB)) {\r\n\t\t\t\t\treturn [a, b];\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t// if a,b is outside the clip window (trivial reject)\r\n\t\t\t\tif (codeA & codeB) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t// other cases\r\n\t\t\t\tcodeOut = codeA || codeB;\r\n\t\t\t\tp = this._getEdgeIntersection(a, b, codeOut, bounds, round);\r\n\t\t\t\tnewCode = this._getBitCode(p, bounds);\r\n\t\r\n\t\t\t\tif (codeOut === codeA) {\r\n\t\t\t\t\ta = p;\r\n\t\t\t\t\tcodeA = newCode;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tb = p;\r\n\t\t\t\t\tcodeB = newCode;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\r\n\t\t_getEdgeIntersection: function (a, b, code, bounds, round) {\r\n\t\t\tvar dx = b.x - a.x,\r\n\t\t\t dy = b.y - a.y,\r\n\t\t\t min = bounds.min,\r\n\t\t\t max = bounds.max,\r\n\t\t\t x, y;\r\n\t\r\n\t\t\tif (code & 8) { // top\r\n\t\t\t\tx = a.x + dx * (max.y - a.y) / dy;\r\n\t\t\t\ty = max.y;\r\n\t\r\n\t\t\t} else if (code & 4) { // bottom\r\n\t\t\t\tx = a.x + dx * (min.y - a.y) / dy;\r\n\t\t\t\ty = min.y;\r\n\t\r\n\t\t\t} else if (code & 2) { // right\r\n\t\t\t\tx = max.x;\r\n\t\t\t\ty = a.y + dy * (max.x - a.x) / dx;\r\n\t\r\n\t\t\t} else if (code & 1) { // left\r\n\t\t\t\tx = min.x;\r\n\t\t\t\ty = a.y + dy * (min.x - a.x) / dx;\r\n\t\t\t}\r\n\t\r\n\t\t\treturn new L.Point(x, y, round);\r\n\t\t},\r\n\t\r\n\t\t_getBitCode: function (p, bounds) {\r\n\t\t\tvar code = 0;\r\n\t\r\n\t\t\tif (p.x < bounds.min.x) { // left\r\n\t\t\t\tcode |= 1;\r\n\t\t\t} else if (p.x > bounds.max.x) { // right\r\n\t\t\t\tcode |= 2;\r\n\t\t\t}\r\n\t\r\n\t\t\tif (p.y < bounds.min.y) { // bottom\r\n\t\t\t\tcode |= 4;\r\n\t\t\t} else if (p.y > bounds.max.y) { // top\r\n\t\t\t\tcode |= 8;\r\n\t\t\t}\r\n\t\r\n\t\t\treturn code;\r\n\t\t},\r\n\t\r\n\t\t// square distance (to avoid unnecessary Math.sqrt calls)\r\n\t\t_sqDist: function (p1, p2) {\r\n\t\t\tvar dx = p2.x - p1.x,\r\n\t\t\t dy = p2.y - p1.y;\r\n\t\t\treturn dx * dx + dy * dy;\r\n\t\t},\r\n\t\r\n\t\t// return closest point on segment or distance to that point\r\n\t\t_sqClosestPointOnSegment: function (p, p1, p2, sqDist) {\r\n\t\t\tvar x = p1.x,\r\n\t\t\t y = p1.y,\r\n\t\t\t dx = p2.x - x,\r\n\t\t\t dy = p2.y - y,\r\n\t\t\t dot = dx * dx + dy * dy,\r\n\t\t\t t;\r\n\t\r\n\t\t\tif (dot > 0) {\r\n\t\t\t\tt = ((p.x - x) * dx + (p.y - y) * dy) / dot;\r\n\t\r\n\t\t\t\tif (t > 1) {\r\n\t\t\t\t\tx = p2.x;\r\n\t\t\t\t\ty = p2.y;\r\n\t\t\t\t} else if (t > 0) {\r\n\t\t\t\t\tx += dx * t;\r\n\t\t\t\t\ty += dy * t;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\tdx = p.x - x;\r\n\t\t\tdy = p.y - y;\r\n\t\r\n\t\t\treturn sqDist ? dx * dx + dy * dy : new L.Point(x, y);\r\n\t\t}\r\n\t};\r\n\t\n\t\n\t\n\t/*\n\t * @class Polyline\n\t * @aka L.Polyline\n\t * @inherits Path\n\t *\n\t * A class for drawing polyline overlays on a map. Extends `Path`.\n\t *\n\t * @example\n\t *\n\t * ```js\n\t * // create a red polyline from an array of LatLng points\n\t * var latlngs = [\n\t * \t[45.51, -122.68],\n\t * \t[37.77, -122.43],\n\t * \t[34.04, -118.2]\n\t * ];\n\t *\n\t * var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);\n\t *\n\t * // zoom the map to the polyline\n\t * map.fitBounds(polyline.getBounds());\n\t * ```\n\t *\n\t * You can also pass a multi-dimensional array to represent a `MultiPolyline` shape:\n\t *\n\t * ```js\n\t * // create a red polyline from an array of arrays of LatLng points\n\t * var latlngs = [\n\t * \t[[45.51, -122.68],\n\t * \t [37.77, -122.43],\n\t * \t [34.04, -118.2]],\n\t * \t[[40.78, -73.91],\n\t * \t [41.83, -87.62],\n\t * \t [32.76, -96.72]]\n\t * ];\n\t * ```\n\t */\n\t\n\tL.Polyline = L.Path.extend({\n\t\n\t\t// @section\n\t\t// @aka Polyline options\n\t\toptions: {\n\t\t\t// @option smoothFactor: Number = 1.0\n\t\t\t// How much to simplify the polyline on each zoom level. More means\n\t\t\t// better performance and smoother look, and less means more accurate representation.\n\t\t\tsmoothFactor: 1.0,\n\t\n\t\t\t// @option noClip: Boolean = false\n\t\t\t// Disable polyline clipping.\n\t\t\tnoClip: false\n\t\t},\n\t\n\t\tinitialize: function (latlngs, options) {\n\t\t\tL.setOptions(this, options);\n\t\t\tthis._setLatLngs(latlngs);\n\t\t},\n\t\n\t\t// @method getLatLngs(): LatLng[]\n\t\t// Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.\n\t\tgetLatLngs: function () {\n\t\t\treturn this._latlngs;\n\t\t},\n\t\n\t\t// @method setLatLngs(latlngs: LatLng[]): this\n\t\t// Replaces all the points in the polyline with the given array of geographical points.\n\t\tsetLatLngs: function (latlngs) {\n\t\t\tthis._setLatLngs(latlngs);\n\t\t\treturn this.redraw();\n\t\t},\n\t\n\t\t// @method isEmpty(): Boolean\n\t\t// Returns `true` if the Polyline has no LatLngs.\n\t\tisEmpty: function () {\n\t\t\treturn !this._latlngs.length;\n\t\t},\n\t\n\t\tclosestLayerPoint: function (p) {\n\t\t\tvar minDistance = Infinity,\n\t\t\t minPoint = null,\n\t\t\t closest = L.LineUtil._sqClosestPointOnSegment,\n\t\t\t p1, p2;\n\t\n\t\t\tfor (var j = 0, jLen = this._parts.length; j < jLen; j++) {\n\t\t\t\tvar points = this._parts[j];\n\t\n\t\t\t\tfor (var i = 1, len = points.length; i < len; i++) {\n\t\t\t\t\tp1 = points[i - 1];\n\t\t\t\t\tp2 = points[i];\n\t\n\t\t\t\t\tvar sqDist = closest(p, p1, p2, true);\n\t\n\t\t\t\t\tif (sqDist < minDistance) {\n\t\t\t\t\t\tminDistance = sqDist;\n\t\t\t\t\t\tminPoint = closest(p, p1, p2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (minPoint) {\n\t\t\t\tminPoint.distance = Math.sqrt(minDistance);\n\t\t\t}\n\t\t\treturn minPoint;\n\t\t},\n\t\n\t\t// @method getCenter(): LatLng\n\t\t// Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the polyline.\n\t\tgetCenter: function () {\n\t\t\t// throws error when not yet added to map as this center calculation requires projected coordinates\n\t\t\tif (!this._map) {\n\t\t\t\tthrow new Error('Must add layer to map before using getCenter()');\n\t\t\t}\n\t\n\t\t\tvar i, halfDist, segDist, dist, p1, p2, ratio,\n\t\t\t points = this._rings[0],\n\t\t\t len = points.length;\n\t\n\t\t\tif (!len) { return null; }\n\t\n\t\t\t// polyline centroid algorithm; only uses the first ring if there are multiple\n\t\n\t\t\tfor (i = 0, halfDist = 0; i < len - 1; i++) {\n\t\t\t\thalfDist += points[i].distanceTo(points[i + 1]) / 2;\n\t\t\t}\n\t\n\t\t\t// The line is so small in the current view that all points are on the same pixel.\n\t\t\tif (halfDist === 0) {\n\t\t\t\treturn this._map.layerPointToLatLng(points[0]);\n\t\t\t}\n\t\n\t\t\tfor (i = 0, dist = 0; i < len - 1; i++) {\n\t\t\t\tp1 = points[i];\n\t\t\t\tp2 = points[i + 1];\n\t\t\t\tsegDist = p1.distanceTo(p2);\n\t\t\t\tdist += segDist;\n\t\n\t\t\t\tif (dist > halfDist) {\n\t\t\t\t\tratio = (dist - halfDist) / segDist;\n\t\t\t\t\treturn this._map.layerPointToLatLng([\n\t\t\t\t\t\tp2.x - ratio * (p2.x - p1.x),\n\t\t\t\t\t\tp2.y - ratio * (p2.y - p1.y)\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\n\t\t// @method getBounds(): LatLngBounds\n\t\t// Returns the `LatLngBounds` of the path.\n\t\tgetBounds: function () {\n\t\t\treturn this._bounds;\n\t\t},\n\t\n\t\t// @method addLatLng(latlng: LatLng, latlngs? LatLng[]): this\n\t\t// Adds a given point to the polyline. By default, adds to the first ring of\n\t\t// the polyline in case of a multi-polyline, but can be overridden by passing\n\t\t// a specific ring as a LatLng array (that you can earlier access with [`getLatLngs`](#polyline-getlatlngs)).\n\t\taddLatLng: function (latlng, latlngs) {\n\t\t\tlatlngs = latlngs || this._defaultShape();\n\t\t\tlatlng = L.latLng(latlng);\n\t\t\tlatlngs.push(latlng);\n\t\t\tthis._bounds.extend(latlng);\n\t\t\treturn this.redraw();\n\t\t},\n\t\n\t\t_setLatLngs: function (latlngs) {\n\t\t\tthis._bounds = new L.LatLngBounds();\n\t\t\tthis._latlngs = this._convertLatLngs(latlngs);\n\t\t},\n\t\n\t\t_defaultShape: function () {\n\t\t\treturn L.Polyline._flat(this._latlngs) ? this._latlngs : this._latlngs[0];\n\t\t},\n\t\n\t\t// recursively convert latlngs input into actual LatLng instances; calculate bounds along the way\n\t\t_convertLatLngs: function (latlngs) {\n\t\t\tvar result = [],\n\t\t\t flat = L.Polyline._flat(latlngs);\n\t\n\t\t\tfor (var i = 0, len = latlngs.length; i < len; i++) {\n\t\t\t\tif (flat) {\n\t\t\t\t\tresult[i] = L.latLng(latlngs[i]);\n\t\t\t\t\tthis._bounds.extend(result[i]);\n\t\t\t\t} else {\n\t\t\t\t\tresult[i] = this._convertLatLngs(latlngs[i]);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\treturn result;\n\t\t},\n\t\n\t\t_project: function () {\n\t\t\tvar pxBounds = new L.Bounds();\n\t\t\tthis._rings = [];\n\t\t\tthis._projectLatlngs(this._latlngs, this._rings, pxBounds);\n\t\n\t\t\tvar w = this._clickTolerance(),\n\t\t\t p = new L.Point(w, w);\n\t\n\t\t\tif (this._bounds.isValid() && pxBounds.isValid()) {\n\t\t\t\tpxBounds.min._subtract(p);\n\t\t\t\tpxBounds.max._add(p);\n\t\t\t\tthis._pxBounds = pxBounds;\n\t\t\t}\n\t\t},\n\t\n\t\t// recursively turns latlngs into a set of rings with projected coordinates\n\t\t_projectLatlngs: function (latlngs, result, projectedBounds) {\n\t\t\tvar flat = latlngs[0] instanceof L.LatLng,\n\t\t\t len = latlngs.length,\n\t\t\t i, ring;\n\t\n\t\t\tif (flat) {\n\t\t\t\tring = [];\n\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\tring[i] = this._map.latLngToLayerPoint(latlngs[i]);\n\t\t\t\t\tprojectedBounds.extend(ring[i]);\n\t\t\t\t}\n\t\t\t\tresult.push(ring);\n\t\t\t} else {\n\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\tthis._projectLatlngs(latlngs[i], result, projectedBounds);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\n\t\t// clip polyline by renderer bounds so that we have less to render for performance\n\t\t_clipPoints: function () {\n\t\t\tvar bounds = this._renderer._bounds;\n\t\n\t\t\tthis._parts = [];\n\t\t\tif (!this._pxBounds || !this._pxBounds.intersects(bounds)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tif (this.options.noClip) {\n\t\t\t\tthis._parts = this._rings;\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tvar parts = this._parts,\n\t\t\t i, j, k, len, len2, segment, points;\n\t\n\t\t\tfor (i = 0, k = 0, len = this._rings.length; i < len; i++) {\n\t\t\t\tpoints = this._rings[i];\n\t\n\t\t\t\tfor (j = 0, len2 = points.length; j < len2 - 1; j++) {\n\t\t\t\t\tsegment = L.LineUtil.clipSegment(points[j], points[j + 1], bounds, j, true);\n\t\n\t\t\t\t\tif (!segment) { continue; }\n\t\n\t\t\t\t\tparts[k] = parts[k] || [];\n\t\t\t\t\tparts[k].push(segment[0]);\n\t\n\t\t\t\t\t// if segment goes out of screen, or it's the last one, it's the end of the line part\n\t\t\t\t\tif ((segment[1] !== points[j + 1]) || (j === len2 - 2)) {\n\t\t\t\t\t\tparts[k].push(segment[1]);\n\t\t\t\t\t\tk++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\n\t\t// simplify each clipped part of the polyline for performance\n\t\t_simplifyPoints: function () {\n\t\t\tvar parts = this._parts,\n\t\t\t tolerance = this.options.smoothFactor;\n\t\n\t\t\tfor (var i = 0, len = parts.length; i < len; i++) {\n\t\t\t\tparts[i] = L.LineUtil.simplify(parts[i], tolerance);\n\t\t\t}\n\t\t},\n\t\n\t\t_update: function () {\n\t\t\tif (!this._map) { return; }\n\t\n\t\t\tthis._clipPoints();\n\t\t\tthis._simplifyPoints();\n\t\t\tthis._updatePath();\n\t\t},\n\t\n\t\t_updatePath: function () {\n\t\t\tthis._renderer._updatePoly(this);\n\t\t}\n\t});\n\t\n\t// @factory L.polyline(latlngs: LatLng[], options?: Polyline options)\n\t// Instantiates a polyline object given an array of geographical points and\n\t// optionally an options object. You can create a `Polyline` object with\n\t// multiple separate lines (`MultiPolyline`) by passing an array of arrays\n\t// of geographic points.\n\tL.polyline = function (latlngs, options) {\n\t\treturn new L.Polyline(latlngs, options);\n\t};\n\t\n\tL.Polyline._flat = function (latlngs) {\n\t\t// true if it's a flat array of latlngs; false if nested\n\t\treturn !L.Util.isArray(latlngs[0]) || (typeof latlngs[0][0] !== 'object' && typeof latlngs[0][0] !== 'undefined');\n\t};\n\t\n\t\n\t\n\t/*\r\n\t * @namespace PolyUtil\r\n\t * Various utility functions for polygon geometries.\r\n\t */\r\n\t\r\n\tL.PolyUtil = {};\r\n\t\r\n\t/* @function clipPolygon(points: Point[], bounds: Bounds, round?: Boolean): Point[]\r\n\t * Clips the polygon geometry defined by the given `points` by the given bounds (using the [Sutherland-Hodgeman algorithm](https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm)).\r\n\t * Used by Leaflet to only show polygon points that are on the screen or near, increasing\r\n\t * performance. Note that polygon points needs different algorithm for clipping\r\n\t * than polyline, so there's a seperate method for it.\r\n\t */\r\n\tL.PolyUtil.clipPolygon = function (points, bounds, round) {\r\n\t\tvar clippedPoints,\r\n\t\t edges = [1, 4, 2, 8],\r\n\t\t i, j, k,\r\n\t\t a, b,\r\n\t\t len, edge, p,\r\n\t\t lu = L.LineUtil;\r\n\t\r\n\t\tfor (i = 0, len = points.length; i < len; i++) {\r\n\t\t\tpoints[i]._code = lu._getBitCode(points[i], bounds);\r\n\t\t}\r\n\t\r\n\t\t// for each edge (left, bottom, right, top)\r\n\t\tfor (k = 0; k < 4; k++) {\r\n\t\t\tedge = edges[k];\r\n\t\t\tclippedPoints = [];\r\n\t\r\n\t\t\tfor (i = 0, len = points.length, j = len - 1; i < len; j = i++) {\r\n\t\t\t\ta = points[i];\r\n\t\t\t\tb = points[j];\r\n\t\r\n\t\t\t\t// if a is inside the clip window\r\n\t\t\t\tif (!(a._code & edge)) {\r\n\t\t\t\t\t// if b is outside the clip window (a->b goes out of screen)\r\n\t\t\t\t\tif (b._code & edge) {\r\n\t\t\t\t\t\tp = lu._getEdgeIntersection(b, a, edge, bounds, round);\r\n\t\t\t\t\t\tp._code = lu._getBitCode(p, bounds);\r\n\t\t\t\t\t\tclippedPoints.push(p);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclippedPoints.push(a);\r\n\t\r\n\t\t\t\t// else if b is inside the clip window (a->b enters the screen)\r\n\t\t\t\t} else if (!(b._code & edge)) {\r\n\t\t\t\t\tp = lu._getEdgeIntersection(b, a, edge, bounds, round);\r\n\t\t\t\t\tp._code = lu._getBitCode(p, bounds);\r\n\t\t\t\t\tclippedPoints.push(p);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tpoints = clippedPoints;\r\n\t\t}\r\n\t\r\n\t\treturn points;\r\n\t};\r\n\t\n\t\n\t\n\t/*\n\t * @class Polygon\n\t * @aka L.Polygon\n\t * @inherits Polyline\n\t *\n\t * A class for drawing polygon overlays on a map. Extends `Polyline`.\n\t *\n\t * Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.\n\t *\n\t *\n\t * @example\n\t *\n\t * ```js\n\t * // create a red polygon from an array of LatLng points\n\t * var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];\n\t *\n\t * var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);\n\t *\n\t * // zoom the map to the polygon\n\t * map.fitBounds(polygon.getBounds());\n\t * ```\n\t *\n\t * You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:\n\t *\n\t * ```js\n\t * var latlngs = [\n\t * [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring\n\t * [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole\n\t * ];\n\t * ```\n\t *\n\t * Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.\n\t *\n\t * ```js\n\t * var latlngs = [\n\t * [ // first polygon\n\t * [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring\n\t * [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole\n\t * ],\n\t * [ // second polygon\n\t * [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]\n\t * ]\n\t * ];\n\t * ```\n\t */\n\t\n\tL.Polygon = L.Polyline.extend({\n\t\n\t\toptions: {\n\t\t\tfill: true\n\t\t},\n\t\n\t\tisEmpty: function () {\n\t\t\treturn !this._latlngs.length || !this._latlngs[0].length;\n\t\t},\n\t\n\t\tgetCenter: function () {\n\t\t\t// throws error when not yet added to map as this center calculation requires projected coordinates\n\t\t\tif (!this._map) {\n\t\t\t\tthrow new Error('Must add layer to map before using getCenter()');\n\t\t\t}\n\t\n\t\t\tvar i, j, p1, p2, f, area, x, y, center,\n\t\t\t points = this._rings[0],\n\t\t\t len = points.length;\n\t\n\t\t\tif (!len) { return null; }\n\t\n\t\t\t// polygon centroid algorithm; only uses the first ring if there are multiple\n\t\n\t\t\tarea = x = y = 0;\n\t\n\t\t\tfor (i = 0, j = len - 1; i < len; j = i++) {\n\t\t\t\tp1 = points[i];\n\t\t\t\tp2 = points[j];\n\t\n\t\t\t\tf = p1.y * p2.x - p2.y * p1.x;\n\t\t\t\tx += (p1.x + p2.x) * f;\n\t\t\t\ty += (p1.y + p2.y) * f;\n\t\t\t\tarea += f * 3;\n\t\t\t}\n\t\n\t\t\tif (area === 0) {\n\t\t\t\t// Polygon is so small that all points are on same pixel.\n\t\t\t\tcenter = points[0];\n\t\t\t} else {\n\t\t\t\tcenter = [x / area, y / area];\n\t\t\t}\n\t\t\treturn this._map.layerPointToLatLng(center);\n\t\t},\n\t\n\t\t_convertLatLngs: function (latlngs) {\n\t\t\tvar result = L.Polyline.prototype._convertLatLngs.call(this, latlngs),\n\t\t\t len = result.length;\n\t\n\t\t\t// remove last point if it equals first one\n\t\t\tif (len >= 2 && result[0] instanceof L.LatLng && result[0].equals(result[len - 1])) {\n\t\t\t\tresult.pop();\n\t\t\t}\n\t\t\treturn result;\n\t\t},\n\t\n\t\t_setLatLngs: function (latlngs) {\n\t\t\tL.Polyline.prototype._setLatLngs.call(this, latlngs);\n\t\t\tif (L.Polyline._flat(this._latlngs)) {\n\t\t\t\tthis._latlngs = [this._latlngs];\n\t\t\t}\n\t\t},\n\t\n\t\t_defaultShape: function () {\n\t\t\treturn L.Polyline._flat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0];\n\t\t},\n\t\n\t\t_clipPoints: function () {\n\t\t\t// polygons need a different clipping algorithm so we redefine that\n\t\n\t\t\tvar bounds = this._renderer._bounds,\n\t\t\t w = this.options.weight,\n\t\t\t p = new L.Point(w, w);\n\t\n\t\t\t// increase clip padding by stroke width to avoid stroke on clip edges\n\t\t\tbounds = new L.Bounds(bounds.min.subtract(p), bounds.max.add(p));\n\t\n\t\t\tthis._parts = [];\n\t\t\tif (!this._pxBounds || !this._pxBounds.intersects(bounds)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tif (this.options.noClip) {\n\t\t\t\tthis._parts = this._rings;\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tfor (var i = 0, len = this._rings.length, clipped; i < len; i++) {\n\t\t\t\tclipped = L.PolyUtil.clipPolygon(this._rings[i], bounds, true);\n\t\t\t\tif (clipped.length) {\n\t\t\t\t\tthis._parts.push(clipped);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\n\t\t_updatePath: function () {\n\t\t\tthis._renderer._updatePoly(this, true);\n\t\t}\n\t});\n\t\n\t\n\t// @factory L.polygon(latlngs: LatLng[], options?: Polyline options)\n\tL.polygon = function (latlngs, options) {\n\t\treturn new L.Polygon(latlngs, options);\n\t};\n\t\n\t\n\t\n\t/*\n\t * L.Rectangle extends Polygon and creates a rectangle when passed a LatLngBounds object.\n\t */\n\t\n\t/*\n\t * @class Rectangle\n\t * @aka L.Retangle\n\t * @inherits Polygon\n\t *\n\t * A class for drawing rectangle overlays on a map. Extends `Polygon`.\n\t *\n\t * @example\n\t *\n\t * ```js\n\t * // define rectangle geographical bounds\n\t * var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];\n\t *\n\t * // create an orange rectangle\n\t * L.rectangle(bounds, {color: \"#ff7800\", weight: 1}).addTo(map);\n\t *\n\t * // zoom the map to the rectangle bounds\n\t * map.fitBounds(bounds);\n\t * ```\n\t *\n\t */\n\t\n\t\n\tL.Rectangle = L.Polygon.extend({\n\t\tinitialize: function (latLngBounds, options) {\n\t\t\tL.Polygon.prototype.initialize.call(this, this._boundsToLatLngs(latLngBounds), options);\n\t\t},\n\t\n\t\t// @method setBounds(latLngBounds: LatLngBounds): this\n\t\t// Redraws the rectangle with the passed bounds.\n\t\tsetBounds: function (latLngBounds) {\n\t\t\treturn this.setLatLngs(this._boundsToLatLngs(latLngBounds));\n\t\t},\n\t\n\t\t_boundsToLatLngs: function (latLngBounds) {\n\t\t\tlatLngBounds = L.latLngBounds(latLngBounds);\n\t\t\treturn [\n\t\t\t\tlatLngBounds.getSouthWest(),\n\t\t\t\tlatLngBounds.getNorthWest(),\n\t\t\t\tlatLngBounds.getNorthEast(),\n\t\t\t\tlatLngBounds.getSouthEast()\n\t\t\t];\n\t\t}\n\t});\n\t\n\t\n\t// @factory L.rectangle(latLngBounds: LatLngBounds, options?: Polyline options)\n\tL.rectangle = function (latLngBounds, options) {\n\t\treturn new L.Rectangle(latLngBounds, options);\n\t};\n\t\n\t\n\t\n\t/*\n\t * @class CircleMarker\n\t * @aka L.CircleMarker\n\t * @inherits Path\n\t *\n\t * A circle of a fixed size with radius specified in pixels. Extends `Path`.\n\t */\n\t\n\tL.CircleMarker = L.Path.extend({\n\t\n\t\t// @section\n\t\t// @aka CircleMarker options\n\t\toptions: {\n\t\t\tfill: true,\n\t\n\t\t\t// @option radius: Number = 10\n\t\t\t// Radius of the circle marker, in pixels\n\t\t\tradius: 10\n\t\t},\n\t\n\t\tinitialize: function (latlng, options) {\n\t\t\tL.setOptions(this, options);\n\t\t\tthis._latlng = L.latLng(latlng);\n\t\t\tthis._radius = this.options.radius;\n\t\t},\n\t\n\t\t// @method setLatLng(latLng: LatLng): this\n\t\t// Sets the position of a circle marker to a new location.\n\t\tsetLatLng: function (latlng) {\n\t\t\tthis._latlng = L.latLng(latlng);\n\t\t\tthis.redraw();\n\t\t\treturn this.fire('move', {latlng: this._latlng});\n\t\t},\n\t\n\t\t// @method getLatLng(): LatLng\n\t\t// Returns the current geographical position of the circle marker\n\t\tgetLatLng: function () {\n\t\t\treturn this._latlng;\n\t\t},\n\t\n\t\t// @method setRadius(radius: Number): this\n\t\t// Sets the radius of a circle marker. Units are in pixels.\n\t\tsetRadius: function (radius) {\n\t\t\tthis.options.radius = this._radius = radius;\n\t\t\treturn this.redraw();\n\t\t},\n\t\n\t\t// @method getRadius(): Number\n\t\t// Returns the current radius of the circle\n\t\tgetRadius: function () {\n\t\t\treturn this._radius;\n\t\t},\n\t\n\t\tsetStyle : function (options) {\n\t\t\tvar radius = options && options.radius || this._radius;\n\t\t\tL.Path.prototype.setStyle.call(this, options);\n\t\t\tthis.setRadius(radius);\n\t\t\treturn this;\n\t\t},\n\t\n\t\t_project: function () {\n\t\t\tthis._point = this._map.latLngToLayerPoint(this._latlng);\n\t\t\tthis._updateBounds();\n\t\t},\n\t\n\t\t_updateBounds: function () {\n\t\t\tvar r = this._radius,\n\t\t\t r2 = this._radiusY || r,\n\t\t\t w = this._clickTolerance(),\n\t\t\t p = [r + w, r2 + w];\n\t\t\tthis._pxBounds = new L.Bounds(this._point.subtract(p), this._point.add(p));\n\t\t},\n\t\n\t\t_update: function () {\n\t\t\tif (this._map) {\n\t\t\t\tthis._updatePath();\n\t\t\t}\n\t\t},\n\t\n\t\t_updatePath: function () {\n\t\t\tthis._renderer._updateCircle(this);\n\t\t},\n\t\n\t\t_empty: function () {\n\t\t\treturn this._radius && !this._renderer._bounds.intersects(this._pxBounds);\n\t\t}\n\t});\n\t\n\t\n\t// @factory L.circleMarker(latlng: LatLng, options?: CircleMarker options)\n\t// Instantiates a circle marker object given a geographical point, and an optional options object.\n\tL.circleMarker = function (latlng, options) {\n\t\treturn new L.CircleMarker(latlng, options);\n\t};\n\t\n\t\n\t\n\t/*\n\t * @class Circle\n\t * @aka L.Circle\n\t * @inherits CircleMarker\n\t *\n\t * A class for drawing circle overlays on a map. Extends `CircleMarker`.\n\t *\n\t * It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).\n\t *\n\t * @example\n\t *\n\t * ```js\n\t * L.circle([50.5, 30.5], {radius: 200}).addTo(map);\n\t * ```\n\t */\n\t\n\tL.Circle = L.CircleMarker.extend({\n\t\n\t\tinitialize: function (latlng, options, legacyOptions) {\n\t\t\tif (typeof options === 'number') {\n\t\t\t\t// Backwards compatibility with 0.7.x factory (latlng, radius, options?)\n\t\t\t\toptions = L.extend({}, legacyOptions, {radius: options});\n\t\t\t}\n\t\t\tL.setOptions(this, options);\n\t\t\tthis._latlng = L.latLng(latlng);\n\t\n\t\t\tif (isNaN(this.options.radius)) { throw new Error('Circle radius cannot be NaN'); }\n\t\n\t\t\t// @section\n\t\t\t// @aka Circle options\n\t\t\t// @option radius: Number; Radius of the circle, in meters.\n\t\t\tthis._mRadius = this.options.radius;\n\t\t},\n\t\n\t\t// @method setRadius(radius: Number): this\n\t\t// Sets the radius of a circle. Units are in meters.\n\t\tsetRadius: function (radius) {\n\t\t\tthis._mRadius = radius;\n\t\t\treturn this.redraw();\n\t\t},\n\t\n\t\t// @method getRadius(): Number\n\t\t// Returns the current radius of a circle. Units are in meters.\n\t\tgetRadius: function () {\n\t\t\treturn this._mRadius;\n\t\t},\n\t\n\t\t// @method getBounds(): LatLngBounds\n\t\t// Returns the `LatLngBounds` of the path.\n\t\tgetBounds: function () {\n\t\t\tvar half = [this._radius, this._radiusY || this._radius];\n\t\n\t\t\treturn new L.LatLngBounds(\n\t\t\t\tthis._map.layerPointToLatLng(this._point.subtract(half)),\n\t\t\t\tthis._map.layerPointToLatLng(this._point.add(half)));\n\t\t},\n\t\n\t\tsetStyle: L.Path.prototype.setStyle,\n\t\n\t\t_project: function () {\n\t\n\t\t\tvar lng = this._latlng.lng,\n\t\t\t lat = this._latlng.lat,\n\t\t\t map = this._map,\n\t\t\t crs = map.options.crs;\n\t\n\t\t\tif (crs.distance === L.CRS.Earth.distance) {\n\t\t\t\tvar d = Math.PI / 180,\n\t\t\t\t latR = (this._mRadius / L.CRS.Earth.R) / d,\n\t\t\t\t top = map.project([lat + latR, lng]),\n\t\t\t\t bottom = map.project([lat - latR, lng]),\n\t\t\t\t p = top.add(bottom).divideBy(2),\n\t\t\t\t lat2 = map.unproject(p).lat,\n\t\t\t\t lngR = Math.acos((Math.cos(latR * d) - Math.sin(lat * d) * Math.sin(lat2 * d)) /\n\t\t\t\t (Math.cos(lat * d) * Math.cos(lat2 * d))) / d;\n\t\n\t\t\t\tif (isNaN(lngR) || lngR === 0) {\n\t\t\t\t\tlngR = latR / Math.cos(Math.PI / 180 * lat); // Fallback for edge case, #2425\n\t\t\t\t}\n\t\n\t\t\t\tthis._point = p.subtract(map.getPixelOrigin());\n\t\t\t\tthis._radius = isNaN(lngR) ? 0 : Math.max(Math.round(p.x - map.project([lat2, lng - lngR]).x), 1);\n\t\t\t\tthis._radiusY = Math.max(Math.round(p.y - top.y), 1);\n\t\n\t\t\t} else {\n\t\t\t\tvar latlng2 = crs.unproject(crs.project(this._latlng).subtract([this._mRadius, 0]));\n\t\n\t\t\t\tthis._point = map.latLngToLayerPoint(this._latlng);\n\t\t\t\tthis._radius = this._point.x - map.latLngToLayerPoint(latlng2).x;\n\t\t\t}\n\t\n\t\t\tthis._updateBounds();\n\t\t}\n\t});\n\t\n\t// @factory L.circle(latlng: LatLng, options?: Circle options)\n\t// Instantiates a circle object given a geographical point, and an options object\n\t// which contains the circle radius.\n\t// @alternative\n\t// @factory L.circle(latlng: LatLng, radius: Number, options?: Circle options)\n\t// Obsolete way of instantiating a circle, for compatibility with 0.7.x code.\n\t// Do not use in new applications or plugins.\n\tL.circle = function (latlng, options, legacyOptions) {\n\t\treturn new L.Circle(latlng, options, legacyOptions);\n\t};\n\t\n\t\n\t\n\t/*\n\t * @class SVG\n\t * @inherits Renderer\n\t * @aka L.SVG\n\t *\n\t * Allows vector layers to be displayed with [SVG](https://developer.mozilla.org/docs/Web/SVG).\n\t * Inherits `Renderer`.\n\t *\n\t * Due to [technical limitations](http://caniuse.com/#search=svg), SVG is not\n\t * available in all web browsers, notably Android 2.x and 3.x.\n\t *\n\t * Although SVG is not available on IE7 and IE8, these browsers support\n\t * [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language)\n\t * (a now deprecated technology), and the SVG renderer will fall back to VML in\n\t * this case.\n\t *\n\t * @example\n\t *\n\t * Use SVG by default for all paths in the map:\n\t *\n\t * ```js\n\t * var map = L.map('map', {\n\t * \trenderer: L.svg()\n\t * });\n\t * ```\n\t *\n\t * Use a SVG renderer with extra padding for specific vector geometries:\n\t *\n\t * ```js\n\t * var map = L.map('map');\n\t * var myRenderer = L.svg({ padding: 0.5 });\n\t * var line = L.polyline( coordinates, { renderer: myRenderer } );\n\t * var circle = L.circle( center, { renderer: myRenderer } );\n\t * ```\n\t */\n\t\n\tL.SVG = L.Renderer.extend({\n\t\n\t\tgetEvents: function () {\n\t\t\tvar events = L.Renderer.prototype.getEvents.call(this);\n\t\t\tevents.zoomstart = this._onZoomStart;\n\t\t\treturn events;\n\t\t},\n\t\n\t\t_initContainer: function () {\n\t\t\tthis._container = L.SVG.create('svg');\n\t\n\t\t\t// makes it possible to click through svg root; we'll reset it back in individual paths\n\t\t\tthis._container.setAttribute('pointer-events', 'none');\n\t\n\t\t\tthis._rootGroup = L.SVG.create('g');\n\t\t\tthis._container.appendChild(this._rootGroup);\n\t\t},\n\t\n\t\t_onZoomStart: function () {\n\t\t\t// Drag-then-pinch interactions might mess up the center and zoom.\n\t\t\t// In this case, the easiest way to prevent this is re-do the renderer\n\t\t\t// bounds and padding when the zooming starts.\n\t\t\tthis._update();\n\t\t},\n\t\n\t\t_update: function () {\n\t\t\tif (this._map._animatingZoom && this._bounds) { return; }\n\t\n\t\t\tL.Renderer.prototype._update.call(this);\n\t\n\t\t\tvar b = this._bounds,\n\t\t\t size = b.getSize(),\n\t\t\t container = this._container;\n\t\n\t\t\t// set size of svg-container if changed\n\t\t\tif (!this._svgSize || !this._svgSize.equals(size)) {\n\t\t\t\tthis._svgSize = size;\n\t\t\t\tcontainer.setAttribute('width', size.x);\n\t\t\t\tcontainer.setAttribute('height', size.y);\n\t\t\t}\n\t\n\t\t\t// movement: update container viewBox so that we don't have to change coordinates of individual layers\n\t\t\tL.DomUtil.setPosition(container, b.min);\n\t\t\tcontainer.setAttribute('viewBox', [b.min.x, b.min.y, size.x, size.y].join(' '));\n\t\n\t\t\tthis.fire('update');\n\t\t},\n\t\n\t\t// methods below are called by vector layers implementations\n\t\n\t\t_initPath: function (layer) {\n\t\t\tvar path = layer._path = L.SVG.create('path');\n\t\n\t\t\t// @namespace Path\n\t\t\t// @option className: String = null\n\t\t\t// Custom class name set on an element. Only for SVG renderer.\n\t\t\tif (layer.options.className) {\n\t\t\t\tL.DomUtil.addClass(path, layer.options.className);\n\t\t\t}\n\t\n\t\t\tif (layer.options.interactive) {\n\t\t\t\tL.DomUtil.addClass(path, 'leaflet-interactive');\n\t\t\t}\n\t\n\t\t\tthis._updateStyle(layer);\n\t\t\tthis._layers[L.stamp(layer)] = layer;\n\t\t},\n\t\n\t\t_addPath: function (layer) {\n\t\t\tthis._rootGroup.appendChild(layer._path);\n\t\t\tlayer.addInteractiveTarget(layer._path);\n\t\t},\n\t\n\t\t_removePath: function (layer) {\n\t\t\tL.DomUtil.remove(layer._path);\n\t\t\tlayer.removeInteractiveTarget(layer._path);\n\t\t\tdelete this._layers[L.stamp(layer)];\n\t\t},\n\t\n\t\t_updatePath: function (layer) {\n\t\t\tlayer._project();\n\t\t\tlayer._update();\n\t\t},\n\t\n\t\t_updateStyle: function (layer) {\n\t\t\tvar path = layer._path,\n\t\t\t options = layer.options;\n\t\n\t\t\tif (!path) { return; }\n\t\n\t\t\tif (options.stroke) {\n\t\t\t\tpath.setAttribute('stroke', options.color);\n\t\t\t\tpath.setAttribute('stroke-opacity', options.opacity);\n\t\t\t\tpath.setAttribute('stroke-width', options.weight);\n\t\t\t\tpath.setAttribute('stroke-linecap', options.lineCap);\n\t\t\t\tpath.setAttribute('stroke-linejoin', options.lineJoin);\n\t\n\t\t\t\tif (options.dashArray) {\n\t\t\t\t\tpath.setAttribute('stroke-dasharray', options.dashArray);\n\t\t\t\t} else {\n\t\t\t\t\tpath.removeAttribute('stroke-dasharray');\n\t\t\t\t}\n\t\n\t\t\t\tif (options.dashOffset) {\n\t\t\t\t\tpath.setAttribute('stroke-dashoffset', options.dashOffset);\n\t\t\t\t} else {\n\t\t\t\t\tpath.removeAttribute('stroke-dashoffset');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpath.setAttribute('stroke', 'none');\n\t\t\t}\n\t\n\t\t\tif (options.fill) {\n\t\t\t\tpath.setAttribute('fill', options.fillColor || options.color);\n\t\t\t\tpath.setAttribute('fill-opacity', options.fillOpacity);\n\t\t\t\tpath.setAttribute('fill-rule', options.fillRule || 'evenodd');\n\t\t\t} else {\n\t\t\t\tpath.setAttribute('fill', 'none');\n\t\t\t}\n\t\t},\n\t\n\t\t_updatePoly: function (layer, closed) {\n\t\t\tthis._setPath(layer, L.SVG.pointsToPath(layer._parts, closed));\n\t\t},\n\t\n\t\t_updateCircle: function (layer) {\n\t\t\tvar p = layer._point,\n\t\t\t r = layer._radius,\n\t\t\t r2 = layer._radiusY || r,\n\t\t\t arc = 'a' + r + ',' + r2 + ' 0 1,0 ';\n\t\n\t\t\t// drawing a circle with two half-arcs\n\t\t\tvar d = layer._empty() ? 'M0 0' :\n\t\t\t\t\t'M' + (p.x - r) + ',' + p.y +\n\t\t\t\t\tarc + (r * 2) + ',0 ' +\n\t\t\t\t\tarc + (-r * 2) + ',0 ';\n\t\n\t\t\tthis._setPath(layer, d);\n\t\t},\n\t\n\t\t_setPath: function (layer, path) {\n\t\t\tlayer._path.setAttribute('d', path);\n\t\t},\n\t\n\t\t// SVG does not have the concept of zIndex so we resort to changing the DOM order of elements\n\t\t_bringToFront: function (layer) {\n\t\t\tL.DomUtil.toFront(layer._path);\n\t\t},\n\t\n\t\t_bringToBack: function (layer) {\n\t\t\tL.DomUtil.toBack(layer._path);\n\t\t}\n\t});\n\t\n\t\n\t// @namespace SVG; @section\n\t// There are several static functions which can be called without instantiating L.SVG:\n\tL.extend(L.SVG, {\n\t\t// @function create(name: String): SVGElement\n\t\t// Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement),\n\t\t// corresponding to the class name passed. For example, using 'line' will return\n\t\t// an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement).\n\t\tcreate: function (name) {\n\t\t\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n\t\t},\n\t\n\t\t// @function pointsToPath(rings: Point[], closed: Boolean): String\n\t\t// Generates a SVG path string for multiple rings, with each ring turning\n\t\t// into \"M..L..L..\" instructions\n\t\tpointsToPath: function (rings, closed) {\n\t\t\tvar str = '',\n\t\t\t i, j, len, len2, points, p;\n\t\n\t\t\tfor (i = 0, len = rings.length; i < len; i++) {\n\t\t\t\tpoints = rings[i];\n\t\n\t\t\t\tfor (j = 0, len2 = points.length; j < len2; j++) {\n\t\t\t\t\tp = points[j];\n\t\t\t\t\tstr += (j ? 'L' : 'M') + p.x + ' ' + p.y;\n\t\t\t\t}\n\t\n\t\t\t\t// closes the ring for polygons; \"x\" is VML syntax\n\t\t\t\tstr += closed ? (L.Browser.svg ? 'z' : 'x') : '';\n\t\t\t}\n\t\n\t\t\t// SVG complains about empty path strings\n\t\t\treturn str || 'M0 0';\n\t\t}\n\t});\n\t\n\t// @namespace Browser; @property svg: Boolean\n\t// `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).\n\tL.Browser.svg = !!(document.createElementNS && L.SVG.create('svg').createSVGRect);\n\t\n\t\n\t// @namespace SVG\n\t// @factory L.svg(options?: Renderer options)\n\t// Creates a SVG renderer with the given options.\n\tL.svg = function (options) {\n\t\treturn L.Browser.svg || L.Browser.vml ? new L.SVG(options) : null;\n\t};\n\t\n\t\n\t\n\t/*\n\t * Thanks to Dmitry Baranovsky and his Raphael library for inspiration!\n\t */\n\t\n\t/*\n\t * @class SVG\n\t *\n\t * Although SVG is not available on IE7 and IE8, these browsers support [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language), and the SVG renderer will fall back to VML in this case.\n\t *\n\t * VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility\n\t * with old versions of Internet Explorer.\n\t */\n\t\n\t// @namespace Browser; @property vml: Boolean\n\t// `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).\n\tL.Browser.vml = !L.Browser.svg && (function () {\n\t\ttry {\n\t\t\tvar div = document.createElement('div');\n\t\t\tdiv.innerHTML = '
';\n\t\n\t\t\tvar shape = div.firstChild;\n\t\t\tshape.style.behavior = 'url(#default#VML)';\n\t\n\t\t\treturn shape && (typeof shape.adj === 'object');\n\t\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t}());\n\t\n\t// redefine some SVG methods to handle VML syntax which is similar but with some differences\n\tL.SVG.include(!L.Browser.vml ? {} : {\n\t\n\t\t_initContainer: function () {\n\t\t\tthis._container = L.DomUtil.create('div', 'leaflet-vml-container');\n\t\t},\n\t\n\t\t_update: function () {\n\t\t\tif (this._map._animatingZoom) { return; }\n\t\t\tL.Renderer.prototype._update.call(this);\n\t\t\tthis.fire('update');\n\t\t},\n\t\n\t\t_initPath: function (layer) {\n\t\t\tvar container = layer._container = L.SVG.create('shape');\n\t\n\t\t\tL.DomUtil.addClass(container, 'leaflet-vml-shape ' + (this.options.className || ''));\n\t\n\t\t\tcontainer.coordsize = '1 1';\n\t\n\t\t\tlayer._path = L.SVG.create('path');\n\t\t\tcontainer.appendChild(layer._path);\n\t\n\t\t\tthis._updateStyle(layer);\n\t\t\tthis._layers[L.stamp(layer)] = layer;\n\t\t},\n\t\n\t\t_addPath: function (layer) {\n\t\t\tvar container = layer._container;\n\t\t\tthis._container.appendChild(container);\n\t\n\t\t\tif (layer.options.interactive) {\n\t\t\t\tlayer.addInteractiveTarget(container);\n\t\t\t}\n\t\t},\n\t\n\t\t_removePath: function (layer) {\n\t\t\tvar container = layer._container;\n\t\t\tL.DomUtil.remove(container);\n\t\t\tlayer.removeInteractiveTarget(container);\n\t\t\tdelete this._layers[L.stamp(layer)];\n\t\t},\n\t\n\t\t_updateStyle: function (layer) {\n\t\t\tvar stroke = layer._stroke,\n\t\t\t fill = layer._fill,\n\t\t\t options = layer.options,\n\t\t\t container = layer._container;\n\t\n\t\t\tcontainer.stroked = !!options.stroke;\n\t\t\tcontainer.filled = !!options.fill;\n\t\n\t\t\tif (options.stroke) {\n\t\t\t\tif (!stroke) {\n\t\t\t\t\tstroke = layer._stroke = L.SVG.create('stroke');\n\t\t\t\t}\n\t\t\t\tcontainer.appendChild(stroke);\n\t\t\t\tstroke.weight = options.weight + 'px';\n\t\t\t\tstroke.color = options.color;\n\t\t\t\tstroke.opacity = options.opacity;\n\t\n\t\t\t\tif (options.dashArray) {\n\t\t\t\t\tstroke.dashStyle = L.Util.isArray(options.dashArray) ?\n\t\t\t\t\t options.dashArray.join(' ') :\n\t\t\t\t\t options.dashArray.replace(/( *, *)/g, ' ');\n\t\t\t\t} else {\n\t\t\t\t\tstroke.dashStyle = '';\n\t\t\t\t}\n\t\t\t\tstroke.endcap = options.lineCap.replace('butt', 'flat');\n\t\t\t\tstroke.joinstyle = options.lineJoin;\n\t\n\t\t\t} else if (stroke) {\n\t\t\t\tcontainer.removeChild(stroke);\n\t\t\t\tlayer._stroke = null;\n\t\t\t}\n\t\n\t\t\tif (options.fill) {\n\t\t\t\tif (!fill) {\n\t\t\t\t\tfill = layer._fill = L.SVG.create('fill');\n\t\t\t\t}\n\t\t\t\tcontainer.appendChild(fill);\n\t\t\t\tfill.color = options.fillColor || options.color;\n\t\t\t\tfill.opacity = options.fillOpacity;\n\t\n\t\t\t} else if (fill) {\n\t\t\t\tcontainer.removeChild(fill);\n\t\t\t\tlayer._fill = null;\n\t\t\t}\n\t\t},\n\t\n\t\t_updateCircle: function (layer) {\n\t\t\tvar p = layer._point.round(),\n\t\t\t r = Math.round(layer._radius),\n\t\t\t r2 = Math.round(layer._radiusY || r);\n\t\n\t\t\tthis._setPath(layer, layer._empty() ? 'M0 0' :\n\t\t\t\t\t'AL ' + p.x + ',' + p.y + ' ' + r + ',' + r2 + ' 0,' + (65535 * 360));\n\t\t},\n\t\n\t\t_setPath: function (layer, path) {\n\t\t\tlayer._path.v = path;\n\t\t},\n\t\n\t\t_bringToFront: function (layer) {\n\t\t\tL.DomUtil.toFront(layer._container);\n\t\t},\n\t\n\t\t_bringToBack: function (layer) {\n\t\t\tL.DomUtil.toBack(layer._container);\n\t\t}\n\t});\n\t\n\tif (L.Browser.vml) {\n\t\tL.SVG.create = (function () {\n\t\t\ttry {\n\t\t\t\tdocument.namespaces.add('lvml', 'urn:schemas-microsoft-com:vml');\n\t\t\t\treturn function (name) {\n\t\t\t\t\treturn document.createElement('');\n\t\t\t\t};\n\t\t\t} catch (e) {\n\t\t\t\treturn function (name) {\n\t\t\t\t\treturn document.createElement('<' + name + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"lvml\">');\n\t\t\t\t};\n\t\t\t}\n\t\t})();\n\t}\n\t\n\t\n\t\n\t/*\n\t * @class Canvas\n\t * @inherits Renderer\n\t * @aka L.Canvas\n\t *\n\t * Allows vector layers to be displayed with [`