text: (function (global, factory) {
  	typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('leaflet')) :
  	typeof define === 'function' && define.amd ? define(['leaflet'], factory) :
  	(factory(global.L));
  }(this, (function (L$1) { 'use strict';
  
  L$1 = L$1 && L$1.hasOwnProperty('default') ? L$1['default'] : L$1;
  
  /*
   * Leaflet.curve v0.1.0 - a plugin for Leaflet mapping library. https://github.com/elfalem/Leaflet.curve
   * (c) elfalem 2015
   */
  /*
   * note that SVG (x, y) corresponds to (long, lat)
   */
  
  L.Curve = L.Path.extend({
  	options: {
  	},
  	
  	initialize: function(path, options){
  		L.setOptions(this, options);
  		this._initialUpdate = true;
  		this._setPath(path);
  	},
  	
  	getPath: function(){
  		return this._coords;
  	},
  	
  	setPath: function(path){
  		this._setPath(path);
  		return this.redraw();
  	},
  	
  	getBounds: function() {
  		return this._bounds;
  	},
  
  	_setPath: function(path){
  		this._coords = path;
  		this._bounds = this._computeBounds();
  	},
  	
  	_computeBounds: function(){
  		var bound = new L.LatLngBounds();
  		var lastPoint;
  		var lastCommand;
  		var coord;
  		for(var i = 0; i < this._coords.length; i++){
  			coord = this._coords[i];
  			if(typeof coord == 'string' || coord instanceof String){
  				lastCommand = coord;
  			}else if(lastCommand == 'H'){
  				bound.extend([lastPoint.lat,coord[0]]);
  				lastPoint = new L.latLng(lastPoint.lat,coord[0]);
  			}else if(lastCommand == 'V'){
  				bound.extend([coord[0], lastPoint.lng]);
  				lastPoint = new L.latLng(coord[0], lastPoint.lng);
  			}else if(lastCommand == 'C'){
  				var controlPoint1 = new L.latLng(coord[0], coord[1]);
  				coord = this._coords[++i];
  				var controlPoint2 = new L.latLng(coord[0], coord[1]);
  				coord = this._coords[++i];
  				var endPoint = new L.latLng(coord[0], coord[1]);
  
  				bound.extend(controlPoint1);
  				bound.extend(controlPoint2);
  				bound.extend(endPoint);
  
  				endPoint.controlPoint1 = controlPoint1;
  				endPoint.controlPoint2 = controlPoint2;
  				lastPoint = endPoint;
  			}else if(lastCommand == 'S'){
  				var controlPoint2 = new L.latLng(coord[0], coord[1]);
  				coord = this._coords[++i];
  				var endPoint = new L.latLng(coord[0], coord[1]);
  
  				var controlPoint1 = lastPoint;
  				if(lastPoint.controlPoint2){
  					var diffLat = lastPoint.lat - lastPoint.controlPoint2.lat;
  					var diffLng = lastPoint.lng - lastPoint.controlPoint2.lng;
  					controlPoint1 = new L.latLng(lastPoint.lat + diffLat, lastPoint.lng + diffLng);
  				}
  
  				bound.extend(controlPoint1);
  				bound.extend(controlPoint2);
  				bound.extend(endPoint);
  
  				endPoint.controlPoint1 = controlPoint1;
  				endPoint.controlPoint2 = controlPoint2;
  				lastPoint = endPoint;
  			}else if(lastCommand == 'Q'){
  				var controlPoint = new L.latLng(coord[0], coord[1]);
  				coord = this._coords[++i];
  				var endPoint = new L.latLng(coord[0], coord[1]);
  
  				bound.extend(controlPoint);
  				bound.extend(endPoint);
  
  				endPoint.controlPoint = controlPoint;
  				lastPoint = endPoint;
  			}else if(lastCommand == 'T'){
  				var endPoint = new L.latLng(coord[0], coord[1]);
  
  				var controlPoint = lastPoint;
  				if(lastPoint.controlPoint){
  					var diffLat = lastPoint.lat - lastPoint.controlPoint.lat;
  					var diffLng = lastPoint.lng - lastPoint.controlPoint.lng;
  					controlPoint = new L.latLng(lastPoint.lat + diffLat, lastPoint.lng + diffLng);
  				}
  
  				bound.extend(controlPoint);
  				bound.extend(endPoint);
  
  				endPoint.controlPoint = controlPoint;
  				lastPoint = endPoint;
  			}else{
  				bound.extend(coord);
  				lastPoint = new L.latLng(coord[0], coord[1]);
  			}
  		}
  		return bound;
  	},
  	
  	//TODO: use a centroid algorithm instead
  	getCenter: function () {
  		return this._bounds.getCenter();
  	},
  	
  	_update: function(){
  		if (!this._map) { return; }
  		
  		this._updatePath();
  	},
  	
  	_updatePath: function() {
  		this._renderer._updatecurve(this);
  	},
  
  	_project: function() {
  		var coord, lastCoord, curCommand, curPoint;
  
  		this._points = [];
  		
  		for(var i = 0; i < this._coords.length; i++){
  			coord = this._coords[i];
  			if(typeof coord == 'string' || coord instanceof String){
  				this._points.push(coord);
  				curCommand = coord;
  			}else {
  				switch(coord.length){
  					case 2:
  						curPoint = this._map.latLngToLayerPoint(coord);
  						lastCoord = coord;
  					break;
  					case 1:
  						if(curCommand == 'H'){
  							curPoint = this._map.latLngToLayerPoint([lastCoord[0], coord[0]]);
  							lastCoord = [lastCoord[0], coord[0]];
  						}else{
  							curPoint = this._map.latLngToLayerPoint([coord[0], lastCoord[1]]);
  							lastCoord = [coord[0], lastCoord[1]];
  						}
  					break;
  				}
  				this._points.push(curPoint);
  			}
  		}
  	}	
  });
  
  L.curve = function (path, options){
  	return new L.Curve(path, options);
  };
  
  L.SVG.include({
  	_updatecurve: function(layer){
  		this._setPath(layer, this._curvePointsToPath(layer._points));
  
  		if(layer.options.animate){
  			var path = layer._path;
  			var length = path.getTotalLength();
  			
  			if(!layer.options.dashArray){
  				path.style.strokeDasharray = length + ' ' + length;
  			}
  			
  			if(layer._initialUpdate){
  				path.animate([
  						{strokeDashoffset: length},
  						{strokeDashoffset: 0}
  					], layer.options.animate);
  				layer._initialUpdate = false;
  			}
  		}
  	},
  	
   	_curvePointsToPath: function(points){
  		var point, curCommand, str = '';
  		for(var i = 0; i < points.length; i++){
  			point = points[i];
  			if(typeof point == 'string' || point instanceof String){
  				curCommand = point;
  				str += curCommand;
  			}else{
  				switch(curCommand){
  					case 'H':
  						str += point.x + ' ';
  						break;
  					case 'V':
  						str += point.y + ' ';
  						break;
  					default:
  						str += point.x + ',' + point.y + ' ';
  						break;
  				}
  			}
  		}
  		return str || 'M0 0';
  	}
  });
  
  /**
   * Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.
   */
  
  /**
   * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.
   *
   * @name feature
   * @param {Geometry} geometry input geometry
   * @param {Object} [properties={}] an Object of key-value pairs to add as properties
   * @param {Object} [options={}] Optional Parameters
   * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
   * @param {string|number} [options.id] Identifier associated with the Feature
   * @returns {Feature} a GeoJSON Feature
   * @example
   * var geometry = {
   *   "type": "Point",
   *   "coordinates": [110, 50]
   * };
   *
   * var feature = turf.feature(geometry);
   *
   * //=feature
   */
  function feature(geometry, properties, options) {
      // Optional Parameters
      options = options || {};
      if (!isObject(options)) throw new Error('options is invalid');
      var bbox = options.bbox;
      var id = options.id;
  
      // Validation
      if (geometry === undefined) throw new Error('geometry is required');
      if (properties && properties.constructor !== Object) throw new Error('properties must be an Object');
      if (bbox) validateBBox(bbox);
      if (id) validateId(id);
  
      // Main
      var feat = {type: 'Feature'};
      if (id) feat.id = id;
      if (bbox) feat.bbox = bbox;
      feat.properties = properties || {};
      feat.geometry = geometry;
      return feat;
  }
  
  /**
   * Creates a {@link Point} {@link Feature} from a Position.
   *
   * @name point
   * @param {Array<number>} coordinates longitude, latitude position (each in decimal degrees)
   * @param {Object} [properties={}] an Object of key-value pairs to add as properties
   * @param {Object} [options={}] Optional Parameters
   * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
   * @param {string|number} [options.id] Identifier associated with the Feature
   * @returns {Feature<Point>} a Point feature
   * @example
   * var point = turf.point([-75.343, 39.984]);
   *
   * //=point
   */
  function point(coordinates, properties, options) {
      if (!coordinates) throw new Error('coordinates is required');
      if (!Array.isArray(coordinates)) throw new Error('coordinates must be an Array');
      if (coordinates.length < 2) throw new Error('coordinates must be at least 2 numbers long');
      if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) throw new Error('coordinates must contain numbers');
  
      return feature({
          type: 'Point',
          coordinates: coordinates
      }, properties, options);
  }
  
  /**
   * Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}.
   *
   * @name featureCollection
   * @param {Feature[]} features input features
   * @param {Object} [options={}] Optional Parameters
   * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature
   * @param {string|number} [options.id] Identifier associated with the Feature
   * @returns {FeatureCollection} FeatureCollection of Features
   * @example
   * var locationA = turf.point([-75.343, 39.984], {name: 'Location A'});
   * var locationB = turf.point([-75.833, 39.284], {name: 'Location B'});
   * var locationC = turf.point([-75.534, 39.123], {name: 'Location C'});
   *
   * var collection = turf.featureCollection([
   *   locationA,
   *   locationB,
   *   locationC
   * ]);
   *
   * //=collection
   */
  function featureCollection(features, options) {
      // Optional Parameters
      options = options || {};
      if (!isObject(options)) throw new Error('options is invalid');
      var bbox = options.bbox;
      var id = options.id;
  
      // Validation
      if (!features) throw new Error('No features passed');
      if (!Array.isArray(features)) throw new Error('features must be an Array');
      if (bbox) validateBBox(bbox);
      if (id) validateId(id);
  
      // Main
      var fc = {type: 'FeatureCollection'};
      if (id) fc.id = id;
      if (bbox) fc.bbox = bbox;
      fc.features = features;
      return fc;
  }
  
  /**
   * isNumber
   *
   * @param {*} num Number to validate
   * @returns {boolean} true/false
   * @example
   * turf.isNumber(123)
   * //=true
   * turf.isNumber('foo')
   * //=false
   */
  function isNumber(num) {
      return !isNaN(num) && num !== null && !Array.isArray(num);
  }
  
  /**
   * isObject
   *
   * @param {*} input variable to validate
   * @returns {boolean} true/false
   * @example
   * turf.isObject({elevation: 10})
   * //=true
   * turf.isObject('foo')
   * //=false
   */
  function isObject(input) {
      return (!!input) && (input.constructor === Object);
  }
  
  /**
   * Validate BBox
   *
   * @private
   * @param {Array<number>} bbox BBox to validate
   * @returns {void}
   * @throws Error if BBox is not valid
   * @example
   * validateBBox([-180, -40, 110, 50])
   * //=OK
   * validateBBox([-180, -40])
   * //=Error
   * validateBBox('Foo')
   * //=Error
   * validateBBox(5)
   * //=Error
   * validateBBox(null)
   * //=Error
   * validateBBox(undefined)
   * //=Error
   */
  function validateBBox(bbox) {
      if (!bbox) throw new Error('bbox is required');
      if (!Array.isArray(bbox)) throw new Error('bbox must be an Array');
      if (bbox.length !== 4 && bbox.length !== 6) throw new Error('bbox must be an Array of 4 or 6 numbers');
      bbox.forEach(function (num) {
          if (!isNumber(num)) throw new Error('bbox must only contain numbers');
      });
  }
  
  /**
   * Validate Id
   *
   * @private
   * @param {string|number} id Id to validate
   * @returns {void}
   * @throws Error if Id is not valid
   * @example
   * validateId([-180, -40, 110, 50])
   * //=Error
   * validateId([-180, -40])
   * //=Error
   * validateId('Foo')
   * //=OK
   * validateId(5)
   * //=OK
   * validateId(null)
   * //=Error
   * validateId(undefined)
   * //=Error
   */
  function validateId(id) {
      if (!id) throw new Error('id is required');
      if (['string', 'number'].indexOf(typeof id) === -1) throw new Error('id must be a number or a string');
  }
  
  /**
   * Callback for coordEach
   *
   * @callback coordEachCallback
   * @param {Array<number>} currentCoord The current coordinate being processed.
   * @param {number} coordIndex The current index of the coordinate being processed.
   * @param {number} featureIndex The current index of the Feature being processed.
   * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.
   * @param {number} geometryIndex The current index of the Geometry being processed.
   */
  
  /**
   * Iterate over coordinates in any GeoJSON object, similar to Array.forEach()
   *
   * @name coordEach
   * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object
   * @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex)
   * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration.
   * @returns {void}
   * @example
   * var features = turf.featureCollection([
   *   turf.point([26, 37], {"foo": "bar"}),
   *   turf.point([36, 53], {"hello": "world"})
   * ]);
   *
   * turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {
   *   //=currentCoord
   *   //=coordIndex
   *   //=featureIndex
   *   //=multiFeatureIndex
   *   //=geometryIndex
   * });
   */
  function coordEach(geojson, callback, excludeWrapCoord) {
      // Handles null Geometry -- Skips this GeoJSON
      if (geojson === null) return;
      var j, k, l, geometry$$1, stopG, coords,
          geometryMaybeCollection,
          wrapShrink = 0,
          coordIndex = 0,
          isGeometryCollection,
          type = geojson.type,
          isFeatureCollection = type === 'FeatureCollection',
          isFeature = type === 'Feature',
          stop = isFeatureCollection ? geojson.features.length : 1;
  
      // This logic may look a little weird. The reason why it is that way
      // is because it's trying to be fast. GeoJSON supports multiple kinds
      // of objects at its root: FeatureCollection, Features, Geometries.
      // This function has the responsibility of handling all of them, and that
      // means that some of the `for` loops you see below actually just don't apply
      // to certain inputs. For instance, if you give this just a
      // Point geometry, then both loops are short-circuited and all we do
      // is gradually rename the input until it's called 'geometry'.
      //
      // This also aims to allocate as few resources as possible: just a
      // few numbers and booleans, rather than any temporary arrays as would
      // be required with the normalization approach.
      for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
          geometryMaybeCollection = (isFeatureCollection ? geojson.features[featureIndex].geometry :
              (isFeature ? geojson.geometry : geojson));
          isGeometryCollection = (geometryMaybeCollection) ? geometryMaybeCollection.type === 'GeometryCollection' : false;
          stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
  
          for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
              var multiFeatureIndex = 0;
              var geometryIndex = 0;
              geometry$$1 = isGeometryCollection ?
                  geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
  
              // Handles null Geometry -- Skips this geometry
              if (geometry$$1 === null) continue;
              coords = geometry$$1.coordinates;
              var geomType = geometry$$1.type;
  
              wrapShrink = (excludeWrapCoord && (geomType === 'Polygon' || geomType === 'MultiPolygon')) ? 1 : 0;
  
              switch (geomType) {
              case null:
                  break;
              case 'Point':
                  if (callback(coords, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) === false) return false;
                  coordIndex++;
                  multiFeatureIndex++;
                  break;
              case 'LineString':
              case 'MultiPoint':
                  for (j = 0; j < coords.length; j++) {
                      if (callback(coords[j], coordIndex, featureIndex, multiFeatureIndex, geometryIndex) === false) return false;
                      coordIndex++;
                      if (geomType === 'MultiPoint') multiFeatureIndex++;
                  }
                  if (geomType === 'LineString') multiFeatureIndex++;
                  break;
              case 'Polygon':
              case 'MultiLineString':
                  for (j = 0; j < coords.length; j++) {
                      for (k = 0; k < coords[j].length - wrapShrink; k++) {
                          if (callback(coords[j][k], coordIndex, featureIndex, multiFeatureIndex, geometryIndex) === false) return false;
                          coordIndex++;
                      }
                      if (geomType === 'MultiLineString') multiFeatureIndex++;
                      if (geomType === 'Polygon') geometryIndex++;
                  }
                  if (geomType === 'Polygon') multiFeatureIndex++;
                  break;
              case 'MultiPolygon':
                  for (j = 0; j < coords.length; j++) {
                      if (geomType === 'MultiPolygon') geometryIndex = 0;
                      for (k = 0; k < coords[j].length; k++) {
                          for (l = 0; l < coords[j][k].length - wrapShrink; l++) {
                              if (callback(coords[j][k][l], coordIndex, featureIndex, multiFeatureIndex, geometryIndex) === false) return false;
                              coordIndex++;
                          }
                          geometryIndex++;
                      }
                      multiFeatureIndex++;
                  }
                  break;
              case 'GeometryCollection':
                  for (j = 0; j < geometry$$1.geometries.length; j++)
                      if (coordEach(geometry$$1.geometries[j], callback, excludeWrapCoord) === false) return false;
                  break;
              default:
                  throw new Error('Unknown Geometry Type');
              }
          }
      }
  }
  
  /**
   * Takes a set of features, calculates the bbox of all input features, and returns a bounding box.
   *
   * @name bbox
   * @param {GeoJSON} geojson any GeoJSON object
   * @returns {BBox} bbox extent in [minX, minY, maxX, maxY] order
   * @example
   * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]);
   * var bbox = turf.bbox(line);
   * var bboxPolygon = turf.bboxPolygon(bbox);
   *
   * //addToMap
   * var addToMap = [line, bboxPolygon]
   */
  function bbox(geojson) {
      var BBox = [Infinity, Infinity, -Infinity, -Infinity];
      coordEach(geojson, function (coord) {
          if (BBox[0] > coord[0]) BBox[0] = coord[0];
          if (BBox[1] > coord[1]) BBox[1] = coord[1];
          if (BBox[2] < coord[0]) BBox[2] = coord[0];
          if (BBox[3] < coord[1]) BBox[3] = coord[1];
      });
      return BBox;
  }
  
  /**
   * Takes a {@link Feature} or {@link FeatureCollection} and returns the absolute center point of all features.
   *
   * @name center
   * @param {GeoJSON} geojson GeoJSON to be centered
   * @param {Object} [options={}] Optional parameters
   * @param {Object} [options.properties={}] an Object that is used as the {@link Feature}'s properties
   * @returns {Feature<Point>} a Point feature at the absolute center point of all input features
   * @example
   * var features = turf.featureCollection([
   *   turf.point( [-97.522259, 35.4691]),
   *   turf.point( [-97.502754, 35.463455]),
   *   turf.point( [-97.508269, 35.463245])
   * ]);
   *
   * var center = turf.center(features);
   *
   * //addToMap
   * var addToMap = [features, center]
   * center.properties['marker-size'] = 'large';
   * center.properties['marker-color'] = '#000';
   */
  function center(geojson, options) {
      // Optional parameters
      options = options || {};
      if (!isObject(options)) throw new Error('options is invalid');
      var properties = options.properties;
  
      // Input validation
      if (!geojson) throw new Error('geojson is required');
  
      var ext = bbox(geojson);
      var x = (ext[0] + ext[2]) / 2;
      var y = (ext[1] + ext[3]) / 2;
      return point([x, y], properties);
  }
  
  var id = 0;
  
  L$1.SwoopyArrow = L$1.Layer.extend({
    fromLatlng: [],
    toLatlng: [],
    options: {
      color: '#222222',
      weight: 1,
      opacity: 1,
      factor: 0.5,
      arrowFilled: false,
      hideArrowHead: false,
      arrowId: null,
      minZoom: 0,
      maxZoom: 22,
      label: '',
      labelClassName: '',
      labelFontSize: 12,
      labelColor: '#222222',
      html: '',
      iconAnchor: [0, 0],
      iconSize: [50, 20],
      labelAt: 'from'
    },
  
    initialize: function initialize(fromLatlng, toLatlng, options) {
      L$1.Util.setOptions(this, options);
  
      this._currentPathVisible = true;
      this._fromLatlng = L$1.latLng(fromLatlng);
      this._toLatlng = L$1.latLng(toLatlng);
      this._factor = this.options.factor;
      this._label = this.options.label;
      this._labelFontSize = this.options.labelFontSize;
      this._labelColor = this.options.labelColor;
      this._color = this.options.color;
      this._labelClassName = this.options.labelClassName;
      this._html = this.options.html;
      this._opacity = this.options.opacity;
      this._minZoom = this.options.minZoom;
      this._maxZoom = this.options.maxZoom;
      this._iconAnchor = this.options.iconAnchor;
      this._iconSize = this.options.iconSize;
      this._weight = this.options.weight;
      this._arrowFilled = this.options.arrowFilled;
      this._hideArrowHead = this.options.hideArrowHead;
      this._arrowId = this.options.arrowId;
      this._labelAt = this.options.labelAt;
  
      this._initSVG();
    },
  
    _initSVG: function _initSVG() {
      this._svg = L$1.SVG.create('svg');
      this._svg.setAttribute('pointer-events', 'none');
      this._currentId = id++;
      this._arrow = this._createArrow();
      this._svg.appendChild(this._arrow);
    },
  
    onAdd: function onAdd(map) {
      this._map = map;
      this.getPane().appendChild(this._svg);
  
      this._drawSwoopyArrows();
  
      this.update(this._map);
    },
  
    getEvents: function getEvents() {
      return {
        zoom: this.update,
        viewreset: this.update
      };
    },
  
    _drawSwoopyArrows: function _drawSwoopyArrows() {
      var swoopyPath = this._createPath();
      this._currentPath = swoopyPath._path;
  
      var swoopyLabel = this._createLabel();
      this._currentMarker = L$1.marker([this['_' + this._labelAt + 'Latlng'].lat, this['_' + this._labelAt + 'Latlng'].lng], { icon: swoopyLabel }).addTo(this._map);
    },
  
    _createArrow: function _createArrow() {
      this._container = this._container || L$1.SVG.create('defs');
      var marker = L$1.SVG.create('marker');
      var path = L$1.SVG.create('polyline');
  
      marker.setAttribute('class', 'swoopyArrow__marker');
      marker.setAttribute('id', 'swoopyarrow__arrowhead' + this._currentId);
      marker.setAttribute('markerWidth', '6.75');
      marker.setAttribute('markerHeight', '6.75');
      marker.setAttribute('viewBox', '-10 -10 20 20');
      marker.setAttribute('orient', 'auto');
      marker.setAttribute('refX', '0');
      marker.setAttribute('refY', '0');
      marker.setAttribute('fill', 'none');
      marker.setAttribute('stroke', this._color);
      marker.setAttribute('stroke-width', this._weight);
      marker.setAttribute('opacity', this._opacity);
  
      if (!this._hideArrowHead) {
        path.setAttribute('stroke-linejoin', 'bevel');
        path.setAttribute('fill', this._arrowFilled ? this._color : 'none');
        path.setAttribute('stroke', this._color);
        path.setAttribute('points', '-6.75,-6.75 0,0 -6.75,6.75');
        marker.appendChild(path);
      }
  
      this._container.appendChild(marker);
  
      return this._container;
    },
  
    _createPath: function _createPath() {
      var controlLatlng = this._getControlPoint(L$1.latLng(this._fromLatlng), L$1.latLng(this._toLatlng), this.options.factor);
      var pathOne = L$1.curve(['M', [this._fromLatlng.lat, this._fromLatlng.lng], 'Q', [controlLatlng.lat, controlLatlng.lng], [this._toLatlng.lat, this._toLatlng.lng]], {
        animate: false,
        color: this._color,
        fill: false,
        opacity: this._opacity,
        weight: this._weight,
        className: 'swoopyarrow__path'
      }).addTo(this._map);
  
      pathOne._path.setAttribute('id', 'swoopyarrow__path' + this._currentId);
      pathOne._path.setAttribute('marker-end', !this._arrowId ? 'url(#swoopyarrow__arrowhead' + this._currentId + ')' : 'url(' + this._arrowId + ')');
  
      return pathOne;
    },
  
    _rotatePoint: function _rotatePoint(origin, point$$1, angle) {
      var radians = angle * Math.PI / 180.0;
  
      return {
        x: Math.cos(radians) * (point$$1.x - origin.x) - Math.sin(radians) * (point$$1.y - origin.y) + origin.x,
        y: Math.sin(radians) * (point$$1.x - origin.x) + Math.cos(radians) * (point$$1.y - origin.y) + origin.y
      };
    },
  
    _getControlPoint: function _getControlPoint(start, end, factor) {
      var features = featureCollection([point([start.lat, start.lng]), point([end.lat, end.lng])]);
  
      var center$$1 = center(features);
  
      // get pixel coordinates for start, end and center
      var startPx = this._map.latLngToContainerPoint(start);
      var centerPx = this._map.latLngToContainerPoint(L$1.latLng(center$$1.geometry.coordinates[0], center$$1.geometry.coordinates[1]));
      var rotatedPx = this._rotatePoint(centerPx, startPx, 90);
  
      var distance = Math.sqrt(Math.pow(startPx.x - centerPx.x, 2) + Math.pow(startPx.y - centerPx.y, 2));
      var angle = Math.atan2(rotatedPx.y - centerPx.y, rotatedPx.x - centerPx.x);
      var offset = factor * distance - distance;
  
      var sin = Math.sin(angle) * offset;
      var cos = Math.cos(angle) * offset;
  
      var controlPoint = L$1.point(rotatedPx.x + cos, rotatedPx.y + sin);
  
      return this._map.containerPointToLatLng(controlPoint);
    },
  
    _createLabel: function _createLabel() {
      return L$1.divIcon({
        className: this._html === '' && this._labelClassName,
        html: this._html === '' ? '<span id="marker-label' + this._currentId + '" style="font-size: ' + this._labelFontSize + 'px; color: ' + this._labelColor + '">' + this._label + '</span>' : this._html,
        iconAnchor: this._iconAnchor,
        iconSize: this._iconSize
      });
    },
  
    update: function update(map) {
      this._checkZoomLevel();
  
      var arrowHead = this._svg.getElementById('swoopyarrow__arrowhead' + this._currentId);
      arrowHead.setAttribute('markerWidth', '' + 2.5 * this._map.getZoom());
      arrowHead.setAttribute('markerHeight', '' + 2.5 * this._map.getZoom());
  
      return this;
    },
  
    _checkZoomLevel: function _checkZoomLevel() {
      var currentZoomLevel = this._map.getZoom();
  
      if (!this._currentPathVisible) {
        this._currentPath.setAttribute('opacity', this._opacity);
        this._currentMarker.setOpacity(this._opacity);
      }
  
      if (currentZoomLevel < this._minZoom || currentZoomLevel > this._maxZoom) {
        this._currentPath.setAttribute('opacity', 0);
        this._currentMarker.setOpacity(0);
  
        this._currentPathVisible = false;
      }
    },
  
    onRemove: function onRemove(map) {
      this._map = map;
      this._currentPath.parentNode.removeChild(this._currentPath);
      this._map.removeLayer(this._currentMarker);
      this._map.removeLayer(this._svg);
    }
  });
  
  L$1.swoopyArrow = function (fromLatlng, toLatlng, options) {
    return new L$1.SwoopyArrow(fromLatlng, toLatlng, options);
  };
  
  })));
  //# sourceMappingURL=Leaflet.SwoopyArrow.js.map
  