(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory();
	else if(typeof define === 'function' && define.amd)
		define("olInteractionFreeHandCircle", [], factory);
	else if(typeof exports === 'object')
		exports["olInteractionFreeHandCircle"] = factory();
	else
		root["olInteractionFreeHandCircle"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// identity function for calling harmony imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, {
/******/ 				configurable: false,
/******/ 				enumerable: true,
/******/ 				get: getter
/******/ 			});
/******/ 		}
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "../";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 114);
/******/ })
/************************************************************************/
/******/ ({

/***/ 114:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

__webpack_require__(127);

var _factory = __webpack_require__(24);

var _factory2 = _interopRequireDefault(_factory);

var _layerUtils = __webpack_require__(17);

var _layerUtils2 = _interopRequireDefault(_layerUtils);

var _observableEmit = __webpack_require__(31);

var _observableEmit2 = _interopRequireDefault(_observableEmit);

var _utils = __webpack_require__(12);

var _mixin = __webpack_require__(19);

var _mixin2 = _interopRequireDefault(_mixin);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

ol.interaction.FreeHandCircle = function (params) {
  this.options = params || {};

  this.wgs84Sphere = new ol.Sphere(typeof this.options['sphere'] === 'number' ? this.options['sphere'] : 6378137);

  this.layerName = this.options['layerName'] || 'FREE_HAND_CIRCLE';

  this.centerStyle = this.options['centerStyle'] || null;

  this.layer = null;

  this.radius = '';

  this.center_ = [];

  this.isMouseDown = false;

  this.isDraging = false;

  this.cursor_ = 'pointer';

  this.drawStart_ = false;

  this.previousCursor_ = undefined;

  this.coordinate_ = null;

  this.feature_ = null;

  this.textOverlay = null;

  this.circleFeature = null;

  this.centerFeature = null;

  this.labelFeature = null;

  this.style_ = {
    fill: {
      fillColor: 'rgba(67, 110, 238, 0)'
    },
    stroke: {
      strokeColor: 'rgba(249, 185, 154, 1)',
      strokeWidth: 2.5
    },
    image: {
      type: '',
      image: {
        fill: {
          fillColor: 'rgba(255, 255, 255, 0.8)'
        },
        points: Infinity,
        radius: 4,
        stroke: {
          strokeColor: 'rgba(255, 0, 0, 1)',
          strokeWidth: 1.5
        }
      }
    }
  };
  if (this.options['style'] && _typeof(this.options['style']) === 'object') {
    this.style_ = this.options['style'];
  }

  ol.interaction.Pointer.call(this, {
    handleMoveEvent: ol.interaction.FreeHandCircle.handleMoveEvent_,
    handleDownEvent: ol.interaction.FreeHandCircle.handleDownEvent_,
    handleUpEvent: ol.interaction.FreeHandCircle.handleUpEvent_,
    handleDragEvent: ol.interaction.FreeHandCircle.handleDragEvent_
  });

  _observableEmit2.default.call(this);
};

ol.inherits(ol.interaction.FreeHandCircle, ol.interaction.Pointer);
(0, _mixin2.default)(ol.interaction.FreeHandCircle, _observableEmit2.default);

ol.interaction.FreeHandCircle.handleMoveEvent_ = function (mapBrowserEvent) {
  if (this.cursor_) {
    var map = mapBrowserEvent.map;
    var feature = map.forEachFeatureAtPixel(mapBrowserEvent.pixel, function (feature) {
      return feature;
    });
    var element = map.getTargetElement();
    if (feature && feature.get('free-hand-circle-lable')) {
      if (element.style.cursor !== this.cursor_) {
        this.previousCursor_ = element.style.cursor;
        element.style.cursor = this.cursor_;
      }
    } else if (this.previousCursor_ !== undefined) {
      element.style.cursor = this.previousCursor_;
      this.previousCursor_ = undefined;
    }
  }
};

ol.interaction.FreeHandCircle.handleDownEvent_ = function (mapBrowserEvent) {
  this.isMouseDown = true;
  if (!this.drawStart_ && mapBrowserEvent.originalEvent.button === 0) {
    var map = mapBrowserEvent.map;
    var feature = map.forEachFeatureAtPixel(mapBrowserEvent.pixel, function (feature) {
      return feature;
    });
    if (feature && feature.get('free-hand-circle-lable')) {
      this.coordinate_ = mapBrowserEvent.coordinate;
      this.feature_ = feature;
    }
    return !!this.feature_;
  }
};

ol.interaction.FreeHandCircle.handleUpEvent_ = function (mapBrowserEvent) {
  if (this.feature_ && this.coordinate_ && this.isDraging) {
    this.dispatch('changeend', this.circleFeature.getGeometry());
  }
  this.coordinate_ = null;
  this.feature_ = null;
  this.isMouseDown = false;
  this.isDraging = false;
  return false;
};

ol.interaction.FreeHandCircle.handleDragEvent_ = function (mapBrowserEvent) {
  if (!this.coordinate_ || !this.feature_) {
    return;
  }
  this.isDraging = true;
  var deltaX = mapBrowserEvent.coordinate[0] - this.coordinate_[0];
  var deltaY = 0;
  var geometry = this.feature_.getGeometry();
  geometry.translate(deltaX, deltaY);
  this.coordinate_[0] = mapBrowserEvent.coordinate[0];
  this.coordinate_[1] = mapBrowserEvent.coordinate[1];
  this.createCircle(this.center_, this.mathRadius(this.center_, geometry.getCoordinates()));
};

ol.interaction.FreeHandCircle.prototype.initDrawInteraction = function () {
  if (!this.getMap()) return;
  var style_ = new _factory2.default(this.style_);
  this.draw = new ol.interaction.Draw({
    type: 'Circle',
    style: style_
  });
  this.draw.set('uuid', (0, _utils.getuuid)());
  this.getMap().addInteraction(this.draw);
  this.draw.on('drawstart', this.drawStartHandle_, this);
  this.draw.on('drawend', this.drawEndHandle_, this);
};

ol.interaction.FreeHandCircle.prototype.removeLastInteraction_ = function () {
  if (!this.getMap()) return;
  this.draw.un('drawstart', this.drawStartHandle_, this);
  this.draw.un('drawend', this.drawEndHandle_, this);
  this.getMap().removeInteraction(this.draw);
};

ol.interaction.FreeHandCircle.prototype.drawStartHandle_ = function (event) {
  this.drawStart_ = true;
};

ol.interaction.FreeHandCircle.prototype.drawEndHandle_ = function (event) {
  if (event && event.feature) {
    var geom_ = event.feature.getGeometry();
    this.center_ = geom_.getCenter();
    var coordinates = geom_.getLastCoordinate();
    this.radius = this.mathRadius(this.center_, coordinates);
    this.createCircle(this.center_, this.radius);
  }
  this.removeLastInteraction_();
  this.drawStart_ = false;
};

ol.interaction.FreeHandCircle.prototype.createCircle = function (center, radius) {
  var _this = this;

  if (!this.getMap()) return;
  var style_ = new _factory2.default(this.style_);
  if (!this.layer) {
    this.layer = new _layerUtils2.default(this.getMap()).createVectorLayer(this.layerName, {
      create: true
    });
    this.layer.setStyle(style_);
  }
  var params = this.transformCenterAndRadius_(center, radius);
  if (!this.circleFeature) {
    this.circleFeature = new ol.Feature({
      geometry: new ol.geom.Circle(params['center'], params['radius'])
    });
    var uuid = this.draw && this.draw.get('uuid') ? this.draw.get('uuid') : (0, _utils.getuuid)();
    this.circleFeature.set('uuid', uuid);
    this.layer.getSource().addFeature(this.circleFeature);
    this.circleFeature.getGeometry().on('change', function (evt) {
      var geom = evt.target;
      var coordinates = geom.getLastCoordinate();
      _this.center_ = geom.getCenter();
      _this.radius = _this.mathRadius(_this.center_, coordinates);
      _this.addLabelFeature_(_this.center_, 'center');
      _this.addLabelFeature_(coordinates, 'endLabel');
      _this.drawTextLabel_(_this.radius + ' m', coordinates);
      if (_this.drawStart_ || !(_this.isMouseDown && _this.isDraging)) {
        _this.dispatch('changeend', geom);
      }
    });
    this.circleFeature.getGeometry().dispatchEvent('change');
  } else {
    this.circleFeature.getGeometry().setCenterAndRadius(params['center'], params['radius']);
  }
};

ol.interaction.FreeHandCircle.prototype.transformCenterAndRadius_ = function (center, radius) {
  var center_ = ol.proj.transform(center, this._getProjectionCode(), 'EPSG:4326');
  var sourceGeom = new ol.geom.Circle(center_, this.transformRadius(center_, radius));
  var trans_ = sourceGeom.transform('EPSG:4326', this._getProjectionCode());
  return {
    center: trans_.getCenter(),
    radius: trans_.getRadius()
  };
};

ol.interaction.FreeHandCircle.prototype.addLabelFeature_ = function (coordinates, type) {
  if (type === 'center') {
    if (!this.centerFeature) {
      this.centerFeature = new ol.Feature({
        uuid: this.circleFeature.get('uuid'),
        geometry: new ol.geom.Point(coordinates)
      });
      if (this.centerStyle) {
        var _style = new _factory2.default(this.centerStyle);
        this.centerFeature.setStyle(_style);
      }
      this.layer.getSource().addFeature(this.centerFeature);
    } else {
      this.centerFeature.setGeometry(new ol.geom.Point(coordinates));
    }
  } else {
    if (!this.labelFeature) {
      this.labelFeature = new ol.Feature({
        uuid: this.circleFeature.get('uuid'),
        geometry: new ol.geom.Point(coordinates)
      });
      var _style2 = new _factory2.default({
        image: {
          type: 'icon',
          image: {
            imageSrc: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAATCAYAAAGCZu9cAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTAyQjQ0OTk5MUZGMTFFN0JCMzdENDYyNTY0RDI4MzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTAyQjQ0OUE5MUZGMTFFN0JCMzdENDYyNTY0RDI4MzAiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBMDJCNDQ5NzkxRkYxMUU3QkIzN0Q0NjI1NjREMjgzMCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBMDJCNDQ5ODkxRkYxMUU3QkIzN0Q0NjI1NjREMjgzMCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Poms414AAAUoSURBVHjaYmxqamJg+PTJn+H//0gGBoYVtT09G1iADMm86uoNDBAQDsSMTEDi+bPHj9/9//eP4dWzZx9AMgABxAjW/vHjCrA6fv4Ixo8fPvwHAgYYYObi4rpnZmoaCLSAYfKUKSIAAcQA0nJkz54nP3/8+I+OTx858hykG2SZiJ6JifS7N28YXEqvMCDTqlpaEiCjAQIIYjkDAwvQAd0gJ0OtfAl0SD5EgoFBubys7A4DJsjr7OoC+unjxyXfv38HGw2ikdmcv36dZ2Lg4Dj5/etXhlXlEgwgGoX948cMJgZ29obZEybs5+TmZuDg5ARjEHt2f/8+Bj6+mQABBHMkI8PPn8YO9vbrbZydZZADCB0wMjIynDx06NnuLVscgR65VVtbCw4ODoYvX+aU1tScNraykgG578ePHwwOhRfANAzD+CB5PVNTqdLm5psMHz70gQwGGSLG8O+fyvcvX+B+8ai8AbYVxgdhEACJw/jfgOqBwAoW5sxA2gdoalVmebnZD6BNhAA7BwfDjK6uMwwCApZA7/wBxctfIN4IFNg9feZMTSBbCYi5cej/BsQPgPgaUP0XmCBAAMECFhK437+LMvz6lQtkq2JoB4U2IyPIn1OBAfoGJgwKWBYomxOYEFaVtbR4srKxMTPgih1gzABBfWtp6XagS7xhwqCAZWP4/HlGZUeHDzD6mP/8/s3w588f7Bgk9/s3I1CtFzAM5yEbouYTHOz+6+dPuGJQUgRhXPxfv34xRKWmBiIbog7MHiK/gbaAMCx6NzcpM8DEQGxYFMPEpBUUBIBBwAszhPPHt29//gBNB+H1NbJgDTA+DIMASA7G//v7939gAH+FGfLm6L59T0DOhNkCyjiBLY/hfBAbJAbjg9SePnr0CVDvP5ghVy5dv77q65cvH/8Cix2Yv5cVi2Bl//37F4S/Hd6/vxAWJqAofsbAyrp26ZIlDDrq6mFmtrZS3Dw8nNhiGJiaf549fvzZuXPnmhl4eDYgGwJy0nmgQS+v3Lt3EIjFQKUbFjNA6l4D8VUGTk64V0AAIMCQUywk1YIM/vVLDJhlE4EZ09vAzExMUU2ND5hfmAUEBdkZiASfP3369e3r1z9PHz78curwYZDlG4CJdQYwMt4hqwOleJhvYA7gBAacBsPXrx2egYG6RhYWEv/+/WMgFwgKC3OBaA0dHRFnb28FRiYm02sXLhRsWLbsEtBBsUAHPUdWzwKNZBFgKHjKiImVx9bWav6FJmxswK38Gpje1alFkhwIqGpriwJznfPmVasOXzl/PgXomAPIDuEHYh1gVMT5hIUp/gQWa9hKaa+a23D2thZVcHZGByBxkDqYg0B8dPAXWJa4BwQoXgElNAYGW+QczAuuy/794+Hm5maD5Q1kjOyIjfUKDNjUwDBIHtnx6PKgkAaWWUx8AgJ8wHaAKHKIgMroXwwsLM8e3b//QUxKSgjdt2uqpMF0SNtTBv/GByhiyAAkj67nN5pZzMzMDO/fvv326ePHG8jFNMgh74H4HjA/7li9aBF/YESErpS8vAiwvYARRStKxeBsbFGDTx5U8QKLf4aP799/XDpr1hlg1Z8Hqj2QHQKqia6DQ4WP79v69etNgBWPRUBUlJKMggLYQaASCJSD8NXw2OoVJiBmZmEBtibYGd69fv1h+Zw5d4BlzWJgSMwHqviCnmtg1SIohT0G6roAxPs2bNsmAWxmqAPDVhHoCn4g5iM5DzMyfmZgYnoLjPZLQDN3ACu6u0DRD9DkgAIAomQEZFjvy7gAAAAASUVORK5CYII='
          }
        }
      });
      this.labelFeature.set('free-hand-circle-lable', true);
      this.labelFeature.setStyle(_style2);
      this.layer.getSource().addFeature(this.labelFeature);
    } else {
      this.labelFeature.setGeometry(new ol.geom.Point(coordinates));
    }
  }
};

ol.interaction.FreeHandCircle.prototype.drawTextLabel_ = function (text, coordinates) {
  if (!this.textOverlay) {
    var editor = document.createElement('span');
    editor.className = 'free-hand-circle-label';
    editor.innerHTML = text;
    this.textOverlay = new ol.Overlay({
      element: editor,
      position: coordinates,
      positioning: 'center-left',
      offset: [20, 0]
    });
    this.getMap().addOverlay(this.textOverlay);
  } else {
    var element = this.textOverlay.getElement();
    element.innerHTML = text;
    this.textOverlay.setPosition(coordinates);
    this.getMap().render();
  }
};

ol.interaction.FreeHandCircle.prototype.getImageSrc_ = function (text) {
  var canvas = document.createElement('canvas');
  var ctx = canvas.getContext('2d');
  ctx.font = '30px Arial';
  ctx.textAlign = 'center';
  var width = ctx.measureText(text).width;
  var height = 20;
  canvas.width = width + 8;
  canvas.height = height + 4;
  ctx.fillText(text, 2, 10);
  ctx.fillStyle = 'white';
  ctx.fillRect(0, 0, width, height);
  var image = canvas.toDataURL('image/.png', 1);
  return image;
};

ol.interaction.FreeHandCircle.prototype.transformRadius = function (center, meterRadius) {
  try {
    var lastCoords = this.wgs84Sphere.offset(center, meterRadius, 270 / 360 * 2 * Math.PI);var ptx = center[0] - lastCoords[0],
        pty = center[1] - lastCoords[1];

    var transformRadiu = Math.sqrt(Math.pow(ptx, 2) + Math.pow(pty, 2));
    return transformRadiu;
  } catch (e) {
    console.log(e);
  }
};

ol.interaction.FreeHandCircle.prototype.mathRadius = function (center, coords) {
  var radius_ = '';
  if (center && coords) {
    var c1 = ol.proj.transform(this.center_, this._getProjectionCode(), 'EPSG:4326');
    var c2 = ol.proj.transform(coords, this._getProjectionCode(), 'EPSG:4326');
    var radius = this.wgs84Sphere.haversineDistance(c1, c2);
    if (this.options['maxRadius'] && radius > this.options['maxRadius']) {
      radius_ = this.options['maxRadius'] - 1;
    } else if (this.options['minRadius'] && radius < this.options['minRadius']) {
      radius_ = this.options['minRadius'] - 1;
    } else {
      radius_ = radius;
    }
    radius_ = Math.floor(radius_) + 1;
  }
  return radius_;
};

ol.interaction.FreeHandCircle.prototype._getProjectionCode = function () {
  var code = '';
  if (this.getMap()) {
    code = this.getMap().getView().getProjection().getCode();
  } else {
    code = 'EPSG:3857';
  }
  return code;
};

ol.interaction.FreeHandCircle.prototype.setActive = function (active) {
  ol.interaction.Pointer.prototype.setActive.call(this, active);
};

ol.interaction.FreeHandCircle.prototype.destroy = function () {
  if (this.draw) {
    this.removeLastInteraction_();
  }
  if (this.textOverlay && this.textOverlay instanceof ol.Overlay) {
    this.getMap().removeOverlay(this.textOverlay);
    this.textOverlay = null;
  }
  if (this.layer) {
    this.layer.getSource().clear();
    this.circleFeature = null;
    this.centerFeature = null;
    this.labelFeature = null;
  }
  this.coordinate_ = null;
  this.feature_ = null;
  this.drawStart_ = false;
  this.center_ = [];
  this.radius = '';
  this.isDraging = false;
  this.isMouseDown = false;
};

var olInteractionFreeHandCircle = ol.interaction.FreeHandCircle;
exports.default = olInteractionFreeHandCircle;
module.exports = exports['default'];

/***/ }),

/***/ 12:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var has = function has(object_, key_) {
  return (typeof object_ === 'undefined' ? 'undefined' : _typeof(object_)) === 'object' && object_.hasOwnProperty(key_);
};

var checkBrowser = function checkBrowser() {
  var userAgent = navigator.userAgent;
  if (userAgent.indexOf('OPR') > -1) {
    return 'Opera';
  } else if (userAgent.indexOf('Firefox') > -1) {
    return 'FF';
  } else if (userAgent.indexOf('Trident') > -1) {
    return 'IE';
  } else if (userAgent.indexOf('Edge') > -1) {
    return 'Edge';
  } else if (userAgent.indexOf('Chrome') > -1) {
    return 'Chrome';
  } else if (userAgent.indexOf('Safari') > -1) {
    return 'Safari';
  }
};

var getuuid = function getuuid() {
  var s = [],
      hexDigits = '0123456789abcdef';

  for (var i = 0; i < 36; i++) {
    s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
  }
  s[14] = '4';
  s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1);
  s[8] = s[13] = s[18] = s[23] = '-';
  return s.join('');
};

exports.has = has;
exports.checkBrowser = checkBrowser;
exports.getuuid = getuuid;

/***/ }),

/***/ 127:
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ 17:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
ol.layer.LayerUtils = function (map) {
  if (map && map instanceof ol.Map) {
    this.map = map;
  } else {
    throw new Error('传入的不是地图对象！');
  }
};

ol.layer.LayerUtils.prototype.getLayerByLayerName = function (layerName) {
  try {
    var targetLayer = null;
    if (this.map) {
      var layers = this.map.getLayers().getArray();
      targetLayer = this.getLayerInternal(layers, 'layerName', layerName);
    }
    return targetLayer;
  } catch (e) {
    console.log(e);
  }
};

ol.layer.LayerUtils.prototype.getLayerInternal = function (layers, key, value) {
  var _this = this;

  var _target = null;
  if (layers.length > 0) {
    layers.every(function (layer) {
      if (layer instanceof ol.layer.Group) {
        var _layers = layer.getLayers().getArray();
        _target = _this.getLayerInternal(_layers, key, value);
        if (_target) {
          return false;
        } else {
          return true;
        }
      } else if (layer.get(key) === value) {
        _target = layer;
        return false;
      } else {
        return true;
      }
    });
  }
  return _target;
};

ol.layer.LayerUtils.prototype.getLayersArrayInternal = function (layers, key, value) {
  var _this2 = this;

  var _target = [];
  if (layers.length > 0) {
    layers.forEach(function (layer) {
      if (layer instanceof ol.layer.Group) {
        var _layers2 = layer.getLayers().getArray();
        _target = _this2.getLayerInternal(_layers2, key, value);
        if (_target) {
          _target.push(layer);
        }
      } else if (layer.get(key) === value) {
        _target.push(layer);
      }
    });
  }
  return _target;
};

ol.layer.LayerUtils.prototype.getLayerByKeyValue = function (key, value) {
  try {
    var targetLayer = null;
    if (this.map) {
      var layers = this.map.getLayers().getArray();
      targetLayer = this.getLayerInternal(layers, key, value);
    }
    return targetLayer;
  } catch (e) {
    console.log(e);
  }
};

ol.layer.LayerUtils.prototype.getLayersArrayByKeyValue = function (key, value) {
  try {
    var targetLayers = [];
    if (this.map) {
      var layers = this.map.getLayers().getArray();
      targetLayers = this.getLayersArrayInternal(layers, key, value);
    }
    return targetLayers;
  } catch (e) {
    console.log(e);
  }
};

ol.layer.LayerUtils.prototype.createVectorLayer = function (layerName, params) {
  try {
    if (this.map) {
      var vectorLayer = this.getLayerByLayerName(layerName);
      if (!(vectorLayer instanceof ol.layer.Vector)) {
        vectorLayer = null;
      }
      if (!vectorLayer) {
        if (params && params.create) {
          vectorLayer = new ol.layer.Vector({
            layerName: layerName,
            params: params,
            layerType: 'vector',
            source: new ol.source.Vector({
              wrapX: false
            }),
            style: new ol.style.Style({
              fill: new ol.style.Fill({
                color: 'rgba(67, 110, 238, 0.4)'
              }),
              stroke: new ol.style.Stroke({
                color: '#4781d9',
                width: 2
              }),
              image: new ol.style.Circle({
                radius: 7,
                fill: new ol.style.Fill({
                  color: '#ffcc33'
                })
              })
            })
          });
        }
      }
      if (this.map && vectorLayer) {
        if (params && params.hasOwnProperty('selectable')) {
          vectorLayer.set('selectable', params.selectable);
        }

        var _vectorLayer = this.getLayerByLayerName(layerName);
        if (!_vectorLayer || !(_vectorLayer instanceof ol.layer.Vector)) {
          this.map.addLayer(vectorLayer);
        }
      }
      return vectorLayer;
    }
  } catch (e) {
    console.log(e);
  }
};

var olLayerLayerUtils = ol.layer.LayerUtils;
exports.default = olLayerLayerUtils;
module.exports = exports['default'];

/***/ }),

/***/ 19:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var copyProperties = function copyProperties(target, source) {
  var _iteratorNormalCompletion = true;
  var _didIteratorError = false;
  var _iteratorError = undefined;

  try {
    for (var _iterator = Object.getOwnPropertyNames(source)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
      var key = _step.value;

      if (!key.match(/^(?:constructor|prototype|arguments|caller|name|bind|call|apply|toString|length)$/)) {
        var desc = Object.getOwnPropertyDescriptor(source, key);
        Object.defineProperty(target, key, desc);
      }
    }
  } catch (err) {
    _didIteratorError = true;
    _iteratorError = err;
  } finally {
    try {
      if (!_iteratorNormalCompletion && _iterator.return) {
        _iterator.return();
      }
    } finally {
      if (_didIteratorError) {
        throw _iteratorError;
      }
    }
  }
};

var mixin = function mixin(childCtor) {
  for (var _len = arguments.length, mixins = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    mixins[_key - 1] = arguments[_key];
  }

  for (var key in mixins) {
    var _mixin = mixins[key];
    copyProperties(childCtor, _mixin);
    copyProperties(childCtor.prototype, _mixin.prototype);
  }
};

exports.default = mixin;
module.exports = exports["default"];

/***/ }),

/***/ 24:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

ol.style.Factory = function (options) {
  var option = options && (typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object' ? options : {};
  var style = new ol.style.Style({});
  if (option['geometry'] && option['geometry'] instanceof ol.geom.Geometry) {
    style.setGeometry(option['geometry']);
  }
  if (option['zIndex'] && typeof option['zIndex'] === 'number') {
    style.setZIndex(option['zIndex']);
  }
  if (option['fill'] && _typeof(option['fill']) === 'object') {
    style.setFill(this._getFill(option['fill']));
  }
  if (option['image'] && _typeof(option['image']) === 'object') {
    style.setImage(this._getImage(option['image']));
  }
  if (option['stroke'] && _typeof(option['stroke']) === 'object') {
    style.setStroke(this._getStroke(option['stroke']));
  }
  if (option['text'] && _typeof(option['text']) === 'object') {
    style.setText(this._getText(option['text']));
  }
  return style;
};

ol.style.Factory.prototype._getRegularShape = function (options) {
  try {
    var regularShape = new ol.style.RegularShape({
      fill: this._getFill(options['fill']) || undefined,
      points: typeof options['points'] === 'number' ? options['points'] : 1,
      radius: typeof options['radius'] === 'number' ? options['radius'] : undefined,
      radius1: typeof options['radius1'] === 'number' ? options['radius1'] : undefined,
      radius2: typeof options['radius2'] === 'number' ? options['radius2'] : undefined,
      angle: typeof options['angle'] === 'number' ? options['angle'] : 0,
      snapToPixel: typeof options['snapToPixel'] === 'boolean' ? options['snapToPixel'] : true,
      stroke: this._getStroke(options['stroke']) || undefined,
      rotation: typeof options['rotation'] === 'number' ? options['rotation'] : 0,
      rotateWithView: typeof options['rotateWithView'] === 'boolean' ? options['rotateWithView'] : false,
      atlasManager: options['atlasManager'] ? options['atlasManager'] : undefined
    });
    return regularShape;
  } catch (e) {
    console.log(e);
  }
};

ol.style.Factory.prototype._getImage = function (options) {
  try {
    var image = void 0;
    options = options || {};
    if (options['type'] === 'icon') {
      image = this._getIcon(options['image']);
    } else {
      image = this._getRegularShape(options['image']);
    }
    return image;
  } catch (e) {
    console.log(e);
  }
};

ol.style.Factory.prototype._getIcon = function (options) {
  try {
    options = options || {};
    var icon = new ol.style.Icon({
      anchor: options['imageAnchor'] ? options['imageAnchor'] : [0.5, 0.5],
      anchorXUnits: options['imageAnchorXUnits'] ? options['imageAnchorXUnits'] : 'fraction',
      anchorYUnits: options['imageAnchorYUnits'] ? options['imageAnchorYUnits'] : 'fraction',
      anchorOrigin: options['imageAnchorOrigin'] ? options['imageAnchorYUnits'] : 'top-left',
      color: options['imageColor'] ? options['imageColor'] : undefined,
      crossOrigin: options['crossOrigin'] ? options['crossOrigin'] : undefined,
      img: options['img'] ? options['img'] : undefined,
      offset: options['offset'] && Array.isArray(options['offset']) && options['offset'].length === 2 ? options['offset'] : [0, 0],
      offsetOrigin: options['offsetOrigin'] ? options['offsetOrigin'] : 'top-left',
      scale: typeof options['scale'] === 'number' ? options['scale'] : 1,
      snapToPixel: typeof options['snapToPixel'] === 'boolean' ? options['snapToPixel'] : true,
      rotateWithView: typeof options['rotateWithView'] === 'boolean' ? options['rotateWithView'] : false,
      opacity: typeof options['imageOpacity'] === 'number' ? options['imageOpacity'] : 1,
      rotation: typeof options['imageRotation'] === 'number' ? options['imageRotation'] : 0,
      size: options['size'] && Array.isArray(options['size']) && options['size'].length === 2 ? options['size'] : undefined,
      imgSize: options['imgSize'] && Array.isArray(options['imgSize']) && options['imgSize'].length === 2 ? options['imgSize'] : undefined,
      src: options['imageSrc'] ? options['imageSrc'] : undefined
    });
    return icon;
  } catch (error) {
    console.log(error);
  }
};

ol.style.Factory.prototype._getStroke = function (options) {
  try {
    options = options || {};
    var stroke = new ol.style.Stroke({
      color: options['strokeColor'] ? options['strokeColor'] : undefined,
      lineCap: options['strokeLineCap'] && typeof options['strokeLineCap'] === 'string' ? options['strokeLineCap'] : 'round',
      lineJoin: options['strokeLineJoin'] && typeof options['strokeLineJoin'] === 'string' ? options['strokeLineJoin'] : 'round',
      lineDash: options['strokeLineDash'] ? options['strokeLineDash'] : undefined,
      lineDashOffset: typeof options['strokeLineDashOffset'] === 'number' ? options['strokeLineDashOffset'] : '0',
      miterLimit: typeof options['strokeMiterLimit'] === 'number' ? options['strokeMiterLimit'] : 10,
      width: typeof options['strokeWidth'] === 'number' ? options['strokeWidth'] : undefined
    });
    return stroke;
  } catch (error) {
    console.log(error);
  }
};

ol.style.Factory.prototype._getText = function (options) {
  try {
    var text = new ol.style.Text({
      font: options['textFont'] && typeof options['textFont'] === 'string' ? options['textFont'] : '10px sans-serif',
      offsetX: typeof options['textOffsetX'] === 'number' ? options['textOffsetX'] : 0,
      offsetY: typeof options['textOffsetY'] === 'number' ? options['textOffsetY'] : 0,
      scale: typeof options['textScale'] === 'number' ? options['textScale'] : undefined,
      rotation: typeof options['textRotation'] === 'number' ? options['textRotation'] : 0,
      text: options['text'] && typeof options['text'] === 'string' ? options['text'] : undefined,
      textAlign: options['textAlign'] && typeof options['textAlign'] === 'string' ? options['textAlign'] : 'start',
      textBaseline: options['textBaseline'] && typeof options['textBaseline'] === 'string' ? options['textBaseline'] : 'alphabetic',
      rotateWithView: typeof options['rotateWithView'] === 'boolean' ? options['rotateWithView'] : false,
      fill: this._getFill(options['textFill']),
      stroke: this._getStroke(options['textStroke'])
    });
    return text;
  } catch (error) {
    console.log(error);
  }
};

ol.style.Factory.prototype._getFill = function (options) {
  try {
    options = options || {};
    var fill = new ol.style.Fill({
      color: options['fillColor'] ? options['fillColor'] : undefined
    });
    return fill;
  } catch (error) {
    console.log(error);
  }
};

var olStyleFactory = ol.style.Factory;
exports.default = olStyleFactory;
module.exports = exports['default'];

/***/ }),

/***/ 31:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
const Observable = function () {
  this.Events = {}
  this.__cnt = 0
}

Observable.hasOwnKey = Function.call.bind(Object.hasOwnProperty)

Observable.slice = Function.call.bind(Array.prototype.slice)

/**
 * 事件分发
 * @param eventName
 * @param callback
 * @param context
 * @returns {(*|*)[]}
 */
Observable.prototype.on = function (eventName, callback, context) {
  return (this.bindEvent(eventName, callback, 0, context))
}

/**
 * 取消监听
 * @param event
 * @returns {boolean}
 */
Observable.prototype.un = function (event) {
  var eventName = ''
  var key = ''
  var r = false
  var type = typeof event
  var that = this
  if (type === 'string') {
    if (Observable.hasOwnKey(this.Events, event)) {
      delete this.Events[event]
      return true
    }
    return false
  } else if (type === 'object') {
    eventName = event[0]
    key = event[1]
    if (Observable.hasOwnKey(this.Events, eventName) && Observable.hasOwnKey(this.Events[eventName], key)) {
      delete this.Events[eventName][key]
      return true
    }
    return false
  } else if (type === 'function') {
    that.eachEvent(that.Events, function (keyA, itemA) {
      that.eachEvent(itemA, function (keyB, itemB) {
        if (itemB[0] === event) {
          delete that.Events[keyA][keyB]
          r = true
        }
      })
    })
    return r
  }
  return true
}

/**
 * 事件监听（只触发一次）
 * @param eventName
 * @param callback
 * @param context
 * @returns {(*|*)[]}
 */
Observable.prototype.once = function (eventName, callback, context) {
  return (this.bindEvent(eventName, callback, 1, context))
}

/**
 * 响应事件
 * @param eventName
 * @param args
 */
Observable.prototype.action = function (eventName, args) {
  if (Observable.hasOwnKey(this.Events, eventName)) {
    this.eachEvent(this.Events[eventName], function (key, item) {
      item[0].apply(item[2], args)
      if (item[1]) {
        delete this.Events[eventName][key]
      }
    })
  }
}

/**
 * 实时触发响应
 * @param eventName
 */
Observable.prototype.dispatch = function (eventName) {
  var that = this
  var args = Observable.slice(arguments, 1)
  setTimeout(function () {
    that.action(eventName, args)
  })
}

/**
 * 延后触发响应
 * @param eventName
 */
Observable.prototype.dispatchSync = function (eventName) {
  this.action(eventName, Observable.slice(arguments, 1))
}

/**
 * 清空发布中心
 */
Observable.prototype.clear = function () {
  this.Events = {}
}

/**
 * 绑定事件
 * @param eventName
 * @param callback
 * @param isOne
 * @param context
 * @returns {[*,*]}
 */
Observable.prototype.bindEvent = function (eventName, callback, isOne, context) {
  if (typeof eventName !== 'string' || typeof callback !== 'function') {
    throw new Error('传入的事件名称和回调函数有误！')
  }
  if (!Observable.hasOwnKey(this.Events, eventName)) {
    this.Events[eventName] = {}
  }
  this.Events[eventName][++this.__cnt] = [callback, isOne, context]
  return [eventName, this.__cnt]
}

/**
 * 循环触发事件
 * @param obj
 * @param callback
 */
Observable.prototype.eachEvent = function (obj, callback) {
  for (var key in obj) {
    if (Observable.hasOwnKey(obj, key)) {
      callback(key, obj[key])
    }
  }
}

/* harmony default export */ __webpack_exports__["default"] = (Observable);


/***/ })

/******/ });
});
//# sourceMappingURL=olInteractionFreeHandCircle.js.map