From 755bb6fa260d9ebd69a3fb3769aaeb31426ee6fd Mon Sep 17 00:00:00 2001 From: Paulius Varna Date: Wed, 25 Jul 2018 15:36:33 +0300 Subject: [PATCH] Bump --- lib/MeasureTool.min.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/MeasureTool.min.js b/lib/MeasureTool.min.js index 7de7378..965a675 100644 --- a/lib/MeasureTool.min.js +++ b/lib/MeasureTool.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("MeasureTool",[],e):"object"==typeof exports?exports.MeasureTool=e():t.MeasureTool=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=32)}([function(t,e,n){"use strict";function i(t,e){this._groups=t,this._parents=e}function o(){return new i([[document.documentElement]],U)}n.d(e,"c",function(){return U}),e.b=i;var r=n(68),a=n(69),s=n(57),u=n(51),c=n(18),l=n(56),h=n(61),f=n(64),p=n(71),d=n(48),g=n(63),v=n(62),_=n(70),m=n(55),y=n(54),x=n(47),A=n(20),b=n(65),w=n(49),C=n(72),T=n(58),L=n(66),E=n(60),k=n(46),B=n(59),M=n(67),P=n(50),j=n(52),S=n(8),O=n(53),U=[null];i.prototype=o.prototype={constructor:i,select:r.a,selectAll:a.a,filter:s.a,data:u.a,enter:c.a,exit:l.a,merge:h.a,order:f.a,sort:p.a,call:d.a,nodes:g.a,node:v.a,size:_.a,empty:m.a,each:y.a,attr:x.a,style:A.b,property:b.a,classed:w.a,text:C.a,html:T.a,raise:L.a,lower:E.a,append:k.a,insert:B.a,remove:M.a,clone:P.a,datum:j.a,on:S.c,dispatch:O.a},e.a=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(42);n.d(e,"create",function(){return i.a});var o=n(2);n.d(e,"creator",function(){return o.a});var r=n(43);n.d(e,"local",function(){return r.a});var a=n(16);n.d(e,"matcher",function(){return a.a});var s=n(44);n.d(e,"mouse",function(){return s.a});var u=n(6);n.d(e,"namespace",function(){return u.a});var c=n(7);n.d(e,"namespaces",function(){return c.a});var l=n(3);n.d(e,"clientPoint",function(){return l.a});var h=n(17);n.d(e,"select",function(){return h.a});var f=n(45);n.d(e,"selectAll",function(){return f.a});var p=n(0);n.d(e,"selection",function(){return p.a});var d=n(9);n.d(e,"selector",function(){return d.a});var g=n(21);n.d(e,"selectorAll",function(){return g.a});var v=n(20);n.d(e,"style",function(){return v.a});var _=n(73);n.d(e,"touch",function(){return _.a});var m=n(74);n.d(e,"touches",function(){return m.a});var y=n(11);n.d(e,"window",function(){return y.a});var x=n(8);n.d(e,"event",function(){return x.a}),n.d(e,"customEvent",function(){return x.b})},function(t,e,n){"use strict";function i(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===a.b&&e.documentElement.namespaceURI===a.b?e.createElement(t):e.createElementNS(n,t)}}function o(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var r=n(6),a=n(7);e.a=function(t){var e=n.i(r.a)(t);return(e.local?o:i)(e)}},function(t,e,n){"use strict";e.a=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Config={prefix:"measure-tool",tooltipText1:"Drag to change, click to remove",tooltipText2:"Drag to change"}},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),i.a.hasOwnProperty(e)?{space:i.a[e],local:t}:t}},function(t,e,n){"use strict";n.d(e,"b",function(){return i});var i="http://www.w3.org/1999/xhtml";e.a={svg:"http://www.w3.org/2000/svg",xhtml:i,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(t,e,n){"use strict";function i(t,e,n){return t=o(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function o(t,e,n){return function(i){var o=l;l=i;try{t.call(this,this.__data__,e,n)}finally{l=o}}}function r(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function a(t){return function(){var e=this.__on;if(e){for(var n,i=0,o=-1,r=e.length;i=0&&m.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function s(t){var e=document.createElement("link");return e.rel="stylesheet",o(t,e),e}function u(t,e){var n,i,o;if(e.singleton){var u=_++;n=v||(v=a(e)),i=c.bind(null,n,u,!1),o=c.bind(null,n,u,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=s(e),i=h.bind(null,n),o=function(){r(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(e),i=l.bind(null,n),o=function(){r(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else o()}}function c(t,e,n,i){var o=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=y(e,o);else{var r=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}function l(t,e){var n=e.css,i=e.media;if(i&&t.setAttribute("media",i),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function h(t,e){var n=e.css,i=e.sourceMap;i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([n],{type:"text/css"}),r=t.href;t.href=URL.createObjectURL(o),r&&URL.revokeObjectURL(r)}var f={},p=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}},d=p(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),g=p(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,_=0,m=[];t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},void 0===e.singleton&&(e.singleton=d()),void 0===e.insertAt&&(e.insertAt="bottom");var o=i(t);return n(o,e),function(t){for(var r=[],a=0;a1?this.each((null==e?i:"function"==typeof e?r:o)(t,e,null==n?"":n)):a(this.node(),t)}},function(t,e,n){"use strict";function i(){return[]}e.a=function(t){return null==t?i:function(){return this.querySelectorAll(t)}}},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:this,r=document.createElement("li"),a=document.createTextNode(t);return r.appendChild(a),r.onclick=function(t){t.preventDefault(),n.apply(o),i.hide()},e?this.showItem(r):this.hideItem(r),this._list.appendChild(r),r}},{key:"hideItem",value:function(t){t.style.cssText="display: none"}},{key:"showItem",value:function(t){t.style.cssText="display: block"}},{key:"toggleItems",value:function(t,e){var n=this;t.forEach(function(t){return n.showItem(t)}),e.forEach(function(t){return n.hideItem(t)})}},{key:"show",value:function(t){this._isVisible=!0,this._containerDiv.style.cssText="\n display: block;\n visibility: hidden;\n position: absolute;\n width: "+this._options.width+"px; \n ";var e=this._parentDiv.getBoundingClientRect().width<=t.x+this.width,n=this._parentDiv.getBoundingClientRect().height<=t.y+this.height;this._containerDiv.style.cssText+="\n "+(e?"right: 0px;":"left: "+t.x+"px;")+"\n "+(n?"bottom: 14px;":"top: "+t.y+"px;")+"\n visibility: visible;\n "}},{key:"hide",value:function(){this._isVisible=!1,this._containerDiv.style.cssText="display: none"}},{key:"toggle",value:function(t){this._isVisible?this.hide():this.show(t)}}]),t}();e.default=u,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={EVENT_START:"measure_start",EVENT_END:"measure_end",EVENT_CHANGE:"measure_change",EVENT_TICK:"measure_tick"},t.exports=e.default},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n1)for(var e=1;e=1?(e="km",t/=1e3):e="m",this._numberToLocale(this._roundUp(t,2))+" "+e}},{key:"_formatLengthImperial",value:function(t){var e=void 0;return t/5280>=1?(e="mi",t/=5280):e="ft",this._numberToLocale(this._roundUp(t,2))+" "+e}},{key:"_formatLengthNautical",value:function(t){return t/=1852,this._numberToLocale(this._roundUp(t,2))+" NM"}},{key:"_formatAreaMetric",value:function(t){var e=void 0;return t/1e6>=1?(e="km²",t/=1e6):e="m²",this._numberToLocale(this._roundUp(t,2))+" "+e}},{key:"_formatAreaImperial",value:function(t){var e=void 0;return 3.587e-8*t>=1?(e="mi²",t*=3.587e-8):e="ft²",this._numberToLocale(this._roundUp(t,2))+" "+e}},{key:"_roundUp",value:function(t,e){return Number(Math.round(t+"e"+e)+"e-"+e).toFixed(e)}},{key:"_numberToLocale",value:function(t){return(new Intl.NumberFormat).format(t)}}],[{key:"findTouchPoint",value:function(t,e){var n=((t[1][1]-t[0][1])*(e[0]-t[0][0])-(t[1][0]-t[0][0])*(e[1]-t[0][1]))/(Math.pow(t[1][1]-t[0][1],2)+Math.pow(t[1][0]-t[0][0],2));return[e[0]-n*(t[1][1]-t[0][1]),e[1]+n*(t[1][0]-t[0][0])]}},{key:"findMidPoint",value:function(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}},{key:"transformText",value:function(e,n){var i=t.findMidPoint([e,n]),o=void 0;return o=e[0]===n[0]?n[1]>e[1]?90:n[1]=t._contextMenu.left&&e.clientX<=t._contextMenu.left+t._contextMenu.width&&e.clientY>=t._contextMenu.top&&e.clientY<=t._contextMenu.top+t._contextMenu.height||t._contextMenu.hide()})}},{key:"start",value:function(){var t=this;this._started||(this._overlay.setMap(this._map),this._geometry=new v.Geometry,this._segments=[],this._options.contextMenu&&this._firstClick&&(this._checkClick(this._firstClick),this._contextMenu.toggleItems([this._endElementNode],[this._startElementNode])),this._mapClickEvent=this._map.addListener("click",function(e){return t._checkClick(e)}),this._mapZoomChangedEvent=this._map.addListener("zoom_changed",function(){return t._redrawOverlay()}),this._map.setOptions({draggableCursor:"default"}),this._started=!0,"function"==typeof this._events.get(b.EVENT_START)&&this._events.get(b.EVENT_START)())}},{key:"end",value:function(){this._started&&(this._options.contextMenu&&this._contextMenu.toggleItems([this._startElementNode],[this._endElementNode]),this._mapClickEvent.remove(),this._mapZoomChangedEvent.remove(),this._geometry=new v.Geometry,this._onRemoveOverlay(),this._setOverlay(),this._overlay.setMap(null),this._map.setOptions({draggableCursor:null}),this._started=!1,"function"==typeof this._events.get(b.EVENT_END)&&this._events.get(b.EVENT_END)({result:{length:this.length,lengthText:this.lengthText,area:this.area,areaText:this.areaText,segments:this.segments}}))}},{key:"addListener",value:function(t,e){this._events.set(t,e)}},{key:"removeListener",value:function(t){this._events.delete(t)}},{key:"setOption",value:function(t,e){if(!this._options[t])throw new Error(t+" is not a valid option on MeasureTool");this._options[t]=e,this._helper._options[t]&&this._helper.setOption(t,e),this._overlay&&this._nodeCircles&&this._redrawOverlay()}},{key:"_initOverlay",value:function(){this._setOverlay(),this._initComplete=!1}},{key:"_setOverlay",value:function(){this._overlay=new google.maps.OverlayView,this._overlay.onAdd=this._onAddOverlay.bind(this),this._overlay.draw=this._onDrawOverlay.bind(this),this._overlay.onRemove=this._onRemoveOverlay.bind(this),this._overlay.setMap(this._map)}},{key:"_onAddOverlay",value:function(){this._initComplete||(this._initComplete=!0),this._projection=this._overlay.getProjection(),this._projectionUtility=new g.default(this._containerDiv,this._projection),this._svgOverlay=(0,p.select)(this._overlay.getPanes().overlayMouseTarget).append("div").attr("class",u.Config.prefix+"-measure-points-"+this._id).append("svg").attr("class",u.Config.prefix+"-svg-overlay"),this._linesBase=this._svgOverlay.append("g").attr("class","base"),this._linesBase.selectAll("line").data(this._geometry?this._geometry.lines:[]),this._linesAux=this._svgOverlay.append("g").attr("class","aux"),this._linesAux.selectAll("line").data(this._geometry?this._geometry.lines:[]),this._nodeCircles=this._svgOverlay.append("g").attr("class","node-circle"),this._nodeCircles.selectAll("circle").data(this._geometry?this._geometry.nodes:[]),this._options.showSegmentLength&&(this._segmentText=this._svgOverlay.append("g").attr("class","segment-text"),this._segmentText.selectAll("text").data(this._geometry?this._geometry.lines:[])),this._options.showAccumulativeLength&&(this._nodeText=this._svgOverlay.append("g").attr("class","node-text"),this._nodeText.selectAll("text").data(this._geometry?this._geometry.nodes:[])),this._hoverCircle=this._svgOverlay.append("g").attr("class","hover-circle"),this._hoverCircle.append("circle").attr("class","grey-circle").attr("r",5),this._initComplete&&!this._started&&this._overlay.setMap(null)}},{key:"_onDrawOverlay",value:function(){this._updateCircles(),this._updateLine(),this._options.showSegmentLength&&this._updateSegmentText(),this._options.showAccumulativeLength&&this._updateNodeText(),this._geometry&&this._updateArea(this._geometry.nodes.length-1,this._geometry.nodes[this._geometry.nodes.length-1]),this._dispatchMeasureEvent()}},{key:"_onRemoveOverlay",value:function(){(0,p.select)("."+u.Config.prefix+"-measure-points-"+this._id).remove()}},{key:"_redrawOverlay",value:function(){this._onRemoveOverlay(),this._setOverlay(),this._overlay.draw()}},{key:"_checkClick",value:function(t){if(!this._dragged&&0==this._nodeCircles.selectAll('circle[r="6"]').size()&&!this._hoverCircle.select("circle").attr("cx")){var e=[t.latLng.lng(),t.latLng.lat()];this._geometry.addNode(e),this._overlay.draw()}this._dragged=!1}},{key:"_updateCircles",value:function(){var t=this,e=this;this._nodeCircles.selectAll("circle").data(this._geometry?this._geometry.nodes:[]).attr("class",function(t,e){return 0===e?"cover-circle head-circle":"cover-circle"}).attr("r",5).attr("cx",function(e){return t._projectionUtility.latLngToSvgPoint(e)[0]}).attr("cy",function(e){return t._projectionUtility.latLngToSvgPoint(e)[1]}).on("mouseover",function(t,n){e._onOverCircle(t,n,this)}).on("mouseout",function(t){e._onOutCircle(t,this)}).on("touchstart",function(t,n){e._onOverCircle(t,n,this)}).on("touchleave",function(t){e._onOutCircle(t,this)}).on("mousedown",function(){return t._hideTooltip()}).call(this._onDragCircle()).enter().append("circle").attr("class","cover-circle").attr("r",5).attr("cx",function(e){return t._projectionUtility.latLngToSvgPoint(e)[0]}).attr("cy",function(e){return t._projectionUtility.latLngToSvgPoint(e)[1]}).on("mouseover",function(t,n){e._onOverCircle(t,n,this)}).on("mouseout",function(t){e._onOutCircle(t,this)}).on("touchstart",function(t,n){e._onOverCircle(t,n,this)}).on("touchleave",function(t){e._onOutCircle(t,this)}).on("mousedown",function(){return t._hideTooltip()}).call(this._onDragCircle()),this._nodeCircles.selectAll(".removed-circle").remove()}},{key:"_updateLine",value:function(){var t=this;this._segments=[];var e=this._linesBase.selectAll("line").data(this._geometry?this._geometry.lines:[]).attr("class","base-line").attr("x1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[0]}).attr("y1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[1]}).attr("x2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[0]}).attr("y2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[1]}).each(function(e){return t._updateSegment(e)});e.enter().append("line").attr("class","base-line").attr("x1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[0]}).attr("y1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[1]}).attr("x2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[0]}).attr("y2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[1]}).each(function(e){return t._updateSegment(e)}),e.exit().remove();var n=this._linesAux.selectAll("line").data(this._geometry?this._geometry.lines:[]).attr("class","aux-line").attr("x1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[0]}).attr("y1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[1]}).attr("x2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[0]}).attr("y2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[1]}).on("mousemove",function(e){var n=x.default.findTouchPoint([t._projectionUtility.latLngToSvgPoint(e[0]),t._projectionUtility.latLngToSvgPoint(e[1])],[p.event.offsetX,p.event.offsetY]);t._updateHoverCirclePosition(n[0],n[1])}).on("mouseout",function(e){return t._hideHoverCircle()}).on("mousedown",function(){return t._hideTooltip()}).call(this._onDragLine());n.enter().append("line").attr("class","aux-line").attr("x1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[0]}).attr("y1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[1]}).attr("x2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[0]}).attr("y2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[1]}).on("mousemove",function(e){var n=x.default.findTouchPoint([t._projectionUtility.latLngToSvgPoint(e[0]),t._projectionUtility.latLngToSvgPoint(e[1])],[p.event.offsetX,p.event.offsetY]);t._updateHoverCirclePosition(n[0],n[1])}).on("mouseout",function(e){return t._hideHoverCircle()}).on("mousedown",function(){return t._hideTooltip()}).call(this._onDragLine()),n.exit().remove()}},{key:"_updateSegmentText",value:function(){var t=this,e=this._segmentText.selectAll("text").data(this._geometry?this._geometry.lines:[]).attr("class","segment-measure-text").attr("text-anchor","middle").attr("dominant-baseline","text-before-edge").attr("transform",function(e){var n=t._projectionUtility.latLngToSvgPoint(e[0]),i=t._projectionUtility.latLngToSvgPoint(e[1]);return x.default.transformText(n,i)}).text(function(e,n){return t._helper.formatLength(t._helper.computeLengthBetween(e[0],e[1]))});e.enter().append("text").attr("class","segment-measure-text").attr("text-anchor","middle").attr("dominant-baseline","text-before-edge").attr("transform",function(e){var n=t._projectionUtility.latLngToSvgPoint(e[0]),i=t._projectionUtility.latLngToSvgPoint(e[1]);return x.default.transformText(n,i)}).text(function(e,n){return t._helper.formatLength(t._helper.computeLengthBetween(e[0],e[1]))}),e.exit().remove()}},{key:"_updateNodeText",value:function(){var t=this,e=this._nodeText.selectAll("text").data(this._geometry?this._geometry.nodes:[]).attr("class",function(t,e){return 0===e?"node-measure-text head-text":"node-measure-text"}).attr("text-anchor","middle").attr("dominant-baseline","text-after-edge").attr("x",function(e){return t._projectionUtility.latLngToSvgPoint(e)[0]}).attr("y",this._transformNodeTextY.bind(this)).text(function(e,n){var i=t._helper.computePathLength(t._geometry.nodes.slice(0,n+1));return n===t._geometry.nodes.length-1&&(t._length=i),t._helper.formatLength(i)});e.enter().append("text").attr("class",function(t,e){return 0===e?"node-measure-text head-text":"node-measure-text"}).attr("text-anchor","middle").attr("dominant-baseline","text-after-edge").attr("x",function(e){return t._projectionUtility.latLngToSvgPoint(e)[0]}).attr("y",this._transformNodeTextY.bind(this)).text(function(e,n){var i=t._helper.computePathLength(t._geometry.nodes.slice(0,n+1));return n===t._geometry.nodes.length-1&&(t._length=i),t._helper.formatLength(i)}),e.exit().remove()}},{key:"_onOverCircle",value:function(t,e,n){this._dragging||((0,p.select)(n).attr("r",6),this._options.tooltip&&this._tooltip.show(this._projectionUtility.latLngToContainerPoint(t),0===e?u.Config.tooltipText2:u.Config.tooltipText1))}},{key:"_onOutCircle",value:function(t,e){(0,p.select)(e).attr("r",5),this._hideTooltip()}},{key:"_onDragCircle",value:function(){var t=this,e=!1,n=(0,m.drag)().on("drag",function(n,i){e=!0,t._dragging=!0,(0,p.select)(this).attr("cx",p.event.x).attr("cy",p.event.y),t._updateLinePosition.call(t,t._linesBase,i),t._updateLinePosition.call(t,t._linesAux,i),t._options.showSegmentLength&&t._updateSegmentTextPosition(i),t._options.showAccumulativeLength&&t._updateNodeTextPosition(i),t._updateArea(i,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y]))});return n.on("start",function(e){p.event.sourceEvent.stopPropagation(),(0,p.select)(this).raise().attr("r",6),t._disableMapScroll()}),n.on("end",function(n,i){t._enableMapScroll(),e?(t._geometry.updateNode(i,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])),t._showTooltipOnEvent(0===i?u.Config.tooltipText2:u.Config.tooltipText1)):i>0?(t._geometry.removeNode(i),(0,p.select)(this).classed("removed-circle",!0)):(t._geometry.addNode(n),t._dragged=!0),e=!1,t._dragging=!1,t._overlay.draw()}),n}},{key:"_onDragLine",value:function(){var t=this,e=!1,n=(0,m.drag)().on("drag",function(n,i){t._dragging=!0,e||(e=!0,t._geometry.insertNode(i+1,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])),t._updateLine(),t._options.showSegmentLength&&t._updateSegmentText(),t._options.showAccumulativeLength&&t._updateNodeText()),t._updateHoverCirclePosition(p.event.x,p.event.y),t._updateLinePosition(t._linesBase,i+1),t._updateLinePosition(t._linesAux,i+1),t._options.showSegmentLength&&t._updateSegmentTextPosition(i+1),t._options.showAccumulativeLength&&t._updateNodeTextPosition(i+1),t._updateArea(i+1,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y]))});return n.on("start",function(){p.event.sourceEvent.stopPropagation(),t._hoverCircle.select("circle").attr("class","cover-circle"),t._disableMapScroll()}),n.on("end",function(n,i){t._enableMapScroll(),e&&(t._geometry.updateNode(i+1,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])),t._hideHoverCircle(),t._overlay.draw(),e=!1,t._showTooltipOnEvent(u.Config.tooltipText1)),t._updateArea(i+1,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])),t._hoverCircle.select("circle").attr("class","grey-circle"),t._dragging=!1}),n}},{key:"_updateLinePosition",value:function(t,e){e0&&t.select("line:nth-child("+e+")").attr("x2",p.event.x).attr("y2",p.event.y)}},{key:"_updateSegmentTextPosition",value:function(t){var e=this;t0&&this._segmentText.select("text:nth-child("+t+")").attr("transform",function(t){var n=e._projectionUtility.latLngToSvgPoint(t[0]),i=[p.event.x,p.event.y];return x.default.transformText(n,i)}).text(function(t){return e._helper.formatLength(e._helper.computeLengthBetween(t[0],e._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])))})}},{key:"_updateNodeTextPosition",value:function(t){var e=this;this._nodeText.select("text:nth-child("+(t+1)+")").attr("x",p.event.x).attr("y",function(){var n=void 0;return n=t>0&&e._projectionUtility.latLngToSvgPoint(e._geometry.nodes[t-1])[1]0&&p.event.y=t}).text(function(n,i){var r=e._helper.computePathLength([].concat(o(e._geometry.nodes.slice(0,t)),[e._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])],o(e._geometry.nodes.slice(t+1,t+1+i))));return t+i===e._geometry.nodes.length-1&&(e._length=r),e._helper.formatLength(r)})}},{key:"_updateHoverCirclePosition",value:function(t,e){this._hoverCircle.select("circle").attr("cx",t).attr("cy",e),this._dragging||this._options.tooltip&&this._tooltip.show(this._projectionUtility.svgPointToContainerPoint([t,e]),u.Config.tooltipText2)}},{key:"_hideHoverCircle",value:function(){this._hoverCircle.select("circle").attr("cx",null).attr("cy",null),this._hideTooltip()}},{key:"_disableMapScroll",value:function(){this._zoomControl=!!document.querySelector("button[aria-label='Zoom in']"),this._map.setOptions({scrollwheel:!1,gestureHandling:"none",zoomControl:!1})}},{key:"_enableMapScroll",value:function(){this._map.setOptions({scrollwheel:!0,gestureHandling:"auto",zoomControl:this._zoomControl})}},{key:"_transformNodeTextY",value:function(t,e){var n=void 0;return n=e>0&&this._geometry.nodes[e-1][1]>t[1]?23:-7,this._projectionUtility.latLngToSvgPoint(t)[1]+n}},{key:"_updateArea",value:function(t,e){if(this._geometry){var n=this._geometry.nodes.length,i=1/80*this.length,r=void 0,a=0;n>2&&(0===t?(r=this._helper.computeLengthBetween(this._geometry.nodes[n-1],e),a=r>i?0:this._helper.computeArea([e].concat(o(this._geometry.nodes.slice(1,n-1))))):t===n-1?(r=this._helper.computeLengthBetween(e,this._geometry.nodes[0]),a=r>i?0:this._helper.computeArea(this._geometry.nodes.slice(0,n-1))):t>0&&ti?0:this._helper.computeArea([].concat(o(this._geometry.nodes.slice(0,t)),[e],o(this._geometry.nodes.slice(t+1))))):(r=this._helper.computeLengthBetween(this._geometry.nodes[0],this._geometry.nodes[n-1]),a=r>i?0:this._helper.computeArea(this._geometry.nodes))),this._area=a,"function"==typeof this._events.get(b.EVENT_TICK)&&this._events.get(b.EVENT_TICK)({result:{length:this.length,lengthText:this.lengthText,area:this.area,areaText:this.areaText,segments:this.segments}}),a>0&&this._nodeText.select(":last-child").text("Total distance: "+this.lengthText+"; Total area: "+this.areaText+".")}}},{key:"_showTooltipOnEvent",value:function(t){this._options.tooltip&&this._tooltip.show(this._projectionUtility.svgPointToContainerPoint([p.event.x,p.event.y]),t)}},{key:"_hideTooltip",value:function(){this._options.tooltip&&this._tooltip.hide()}},{key:"_dispatchMeasureEvent",value:function(){if(this._started){var t={result:{length:this.length,lengthText:this.lengthText,area:this.area,areaText:this.areaText,segments:this.segments}};this._lastMeasure&&this._lastMeasure.result.lengthText===this.lengthText&&this._lastMeasure.result.areaText===this.areaText||"function"==typeof this._events.get(b.EVENT_CHANGE)&&this._events.get(b.EVENT_CHANGE)(this._lastMeasure=t)}}},{key:"_updateSegment",value:function(t){var e=this._helper.computeLengthBetween(t[0],t[1]),n=this._helper.formatLength(e);this.segments.push(new _.Segment(t[0],t[1],e,n).toJSON())}}]),t}();e.default=C,t.exports=e.default},function(t,e,n){e=t.exports=n(5)(),e.push([t.i,".measure-tool-context-menu {\n font-family: Roboto, Arial, sans-serif;\n border: 1px solid rgba(0, 0, 0, 0.2);\n outline: none;\n position: fixed;\n display: none;\n box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);\n transform: translate3d(0, 0, 0);\n max-width: 265px;\n z-index: 1;\n outline-offset: -2px;\n background: #fff;\n padding: 6px 0;\n white-space: nowrap;\n cursor: default;\n margin: 0; }\n .measure-tool-context-menu ul {\n padding: 0px;\n margin: 0px;\n background-color: white; }\n .measure-tool-context-menu ul li {\n cursor: pointer;\n display: flex;\n align-items: center;\n border-color: transparent;\n border-style: dotted;\n border-width: 1px 0;\n color: #333;\n font-size: 13px;\n font-weight: normal;\n margin: 0;\n padding: 4px 44px 4px 16px;\n position: relative;\n white-space: nowrap; }\n .measure-tool-context-menu ul li:hover {\n background-color: #f1f1f1;\n border-color: #f1f1f1;\n color: #222;\n transition: background 0s; }\n","",{version:3,sources:["/home/varna/Projects/MeasureTool-GoogleMaps-V3/src/context-menu.scss"],names:[],mappings:"AACA;EACE,uCAFqC;EAGrC,qCAAiC;EACjC,cAAa;EACb,gBAAe;EACf,cAAa;EAEb,yCAAqC;EACrC,gCAA6B;EAC7B,iBAAgB;EAChB,WAAU;EACV,qBAAoB;EAEpB,iBAAgB;EAChB,eAAc;EACd,oBAAmB;EACnB,gBAAe;EACf,UAAS,EA6BV;EA9CD;IAmBI,aAAY;IACZ,YAAW;IACX,wBAAuB,EAwBxB;IA7CH;MAwBM,gBAAe;MACf,cAAa;MACb,oBAAmB;MACnB,0BAAyB;MACzB,qBAAoB;MACpB,oBAAmB;MACnB,YAAW;MACX,gBAAe;MACf,oBAAmB;MACnB,UAAS;MACT,2BAA0B;MAC1B,mBAAkB;MAClB,oBAAmB,EAQpB;MA5CL;QAuCQ,0BAAyB;QACzB,sBAAqB;QACrB,YAAW;QACX,0BAAyB,EAC1B",file:"context-menu.scss",sourcesContent:["$font-family: Roboto, Arial, sans-serif;\n.measure-tool-context-menu {\n font-family: $font-family;\n border: 1px solid rgba(0,0,0,0.2);\n outline: none;\n position: fixed;\n display: none;\n\n box-shadow: 0 2px 2px rgba(0,0,0,0.2);\n transform: translate3d(0,0,0);\n max-width: 265px;\n z-index: 1;\n outline-offset: -2px;\n\n background: #fff;\n padding: 6px 0;\n white-space: nowrap;\n cursor: default;\n margin: 0;\n ul {\n padding: 0px;\n margin: 0px;\n background-color: white;\n\n li {\n cursor: pointer;\n display: flex;\n align-items: center;\n border-color: transparent;\n border-style: dotted;\n border-width: 1px 0;\n color: #333;\n font-size: 13px;\n font-weight: normal;\n margin: 0;\n padding: 4px 44px 4px 16px;\n position: relative;\n white-space: nowrap;\n\n &:hover {\n background-color: #f1f1f1;\n border-color: #f1f1f1;\n color: #222;\n transition: background 0s;\n }\n }\n }\n}"],sourceRoot:""}])},function(t,e,n){e=t.exports=n(5)(),e.push([t.i,".measure-tool-svg-overlay {\n position: absolute;\n top: -4000px;\n left: -4000px;\n width: 8000px;\n height: 8000px; }\n\n.dragging-circle,\n.cover-circle {\n fill: white;\n stroke: black;\n stroke-width: 2.5px; }\n .dragging-circle:hover,\n .cover-circle:hover {\n cursor: pointer; }\n\n.grey-circle {\n fill: #fcfcfc;\n stroke: #646464;\n stroke-width: 2.5px;\n pointer-events: none; }\n\n.base-line {\n fill: none;\n stroke: black;\n stroke-width: 2.5px; }\n\n.aux-line {\n fill: none;\n stroke: transparent;\n stroke-width: 8px;\n cursor: pointer; }\n\n.segment-measure-text {\n stroke: black;\n pointer-events: none; }\n\n.node-measure-text {\n text-shadow: -1.4px -1.4px rgba(255, 255, 255, 0.4), -1.4px 1.4px rgba(255, 255, 255, 0.4), 1.4px 1.4px rgba(255, 255, 255, 0.4), 1.4px -1.4px rgba(255, 255, 255, 0.4), -1.4px 0 rgba(255, 255, 255, 0.4), 0 1.4px rgba(255, 255, 255, 0.4), 1.4px 0 rgba(255, 255, 255, 0.4), 0 -1.4px rgba(255, 255, 255, 0.4);\n pointer-events: none; }\n .node-measure-text.head-text {\n visibility: hidden; }\n","",{version:3,sources:["/home/varna/Projects/MeasureTool-GoogleMaps-V3/src/index.scss"],names:[],mappings:"AAEA;EACE,mBAAkB;EAClB,aAAY;EACZ,cAAa;EACb,cAAa;EACb,eAAc,EACf;;AAED;;EAEE,YAAW;EACX,cAAa;EACb,oBAAmB,EAIpB;EARD;;IAMI,gBAAe,EAChB;;AAGH;EACE,cAAwB;EACxB,gBAA0B;EAC1B,oBAAmB;EACnB,qBAAoB,EAIrB;;AAED;EACE,WAAU;EACV,cAAa;EACb,oBAAmB,EACpB;;AAED;EACE,WAAU;EACV,oBAAmB;EACnB,kBAAiB;EACjB,gBAAe,EAChB;;AAED;EACE,cAAa;EACb,qBAAoB,EACrB;;AAED;EACE,kTAjDqC;EAyDrC,qBAAoB,EAKrB;EAdD;IAYI,mBAAkB,EACnB",file:"index.scss",sourcesContent:["$opaque-white: rgba(255, 255, 255, 0.4);\n\n.measure-tool-svg-overlay{\n position: absolute;\n top: -4000px;\n left: -4000px;\n width: 8000px;\n height: 8000px;\n}\n\n.dragging-circle,\n.cover-circle {\n fill: white;\n stroke: black;\n stroke-width: 2.5px;\n &:hover {\n cursor: pointer;\n }\n}\n\n.grey-circle {\n fill: rgb(252, 252, 252);\n stroke: rgb(100, 100, 100);\n stroke-width: 2.5px;\n pointer-events: none;\n //&:hover {\n // cursor: pointer;\n //}\n}\n\n.base-line {\n fill: none;\n stroke: black;\n stroke-width: 2.5px;\n}\n\n.aux-line {\n fill: none;\n stroke: transparent;\n stroke-width: 8px;\n cursor: pointer;\n}\n\n.segment-measure-text {\n stroke: black;\n pointer-events: none;\n}\n\n.node-measure-text {\n text-shadow: -1.4px -1.4px $opaque-white,\n -1.4px 1.4px $opaque-white,\n 1.4px 1.4px $opaque-white,\n 1.4px -1.4px $opaque-white,\n -1.4px 0 $opaque-white,\n 0 1.4px $opaque-white,\n 1.4px 0 $opaque-white,\n 0 -1.4px $opaque-white;\n pointer-events: none;\n\n &.head-text {\n visibility: hidden;\n }\n}\n"],sourceRoot:""}])},function(t,e,n){e=t.exports=n(5)(),e.push([t.i,".measure-tool-tooltip {\n display: none;\n font-family: Roboto, Arial, sans-serif;\n margin: 6px 15px;\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);\n padding: 10px;\n overflow: hidden;\n pointer-events: none;\n font-size: 0.7rem;\n z-index: 999; }\n","",{version:3,sources:["/home/varna/Projects/MeasureTool-GoogleMaps-V3/src/tooltip.scss"],names:[],mappings:"AACA;EACE,cAAa;EACb,uCAHqC;EAIrC,iBAAgB;EAChB,uBAAsB;EACtB,mBAAkB;EAClB,yCAAqC;EACrC,cAAa;EACb,iBAAgB;EAChB,qBAAoB;EACpB,kBAAiB;EACjB,aAAY,EACb",file:"tooltip.scss",sourcesContent:["$font-family: Roboto, Arial, sans-serif;\n.measure-tool-tooltip {\n display: none;\n font-family: $font-family;\n margin: 6px 15px;\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 1px 4px rgba(0,0,0,0.3);\n padding: 10px;\n overflow: hidden;\n pointer-events: none;\n font-size: 0.7rem;\n z-index: 999;\n}"],sourceRoot:""}])},function(t,e,n){"use strict";var i=n(37);n.d(e,"a",function(){return i.a})},function(t,e,n){"use strict";function i(){for(var t,e=0,n=arguments.length,i={};e=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function a(t,e){for(var n,i=0,o=t.length;i0)for(var n,i,o=new Array(n),r=0;rM}E.mouse("drag")}function d(){n.i(u.select)(u.event.view).on("mousemove.drag mouseup.drag",null),n.i(c.b)(u.event.view,A),n.i(l.a)(),E.mouse("end")}function g(){if(w.apply(this,arguments)){var t,e,i=u.event.changedTouches,o=C.apply(this,arguments),r=i.length;for(t=0;t=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}},e.a=function(t,e){var n=i(t+"");if(arguments.length<2){for(var r=o(this.node()),a=-1,s=n.length;++a=T&&(T=C+1);!(w=A[T])&&++T=0;)(i=o[r])&&(a&&a!==i.nextSibling&&a.parentNode.insertBefore(i,a),a=i);return this}},function(t,e,n){"use strict";function i(t){return function(){delete this[t]}}function o(t,e){return function(){this[t]=e}}function r(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}e.a=function(t,e){return arguments.length>1?this.each((null==e?i:"function"==typeof e?r:o)(t,e)):this.node()[t]}},function(t,e,n){"use strict";function i(){this.nextSibling&&this.parentNode.appendChild(this)}e.a=function(){return this.each(i)}},function(t,e,n){"use strict";function i(){var t=this.parentNode;t&&t.removeChild(this)}e.a=function(){return this.each(i)}},function(t,e,n){"use strict";var i=n(0),o=n(9);e.a=function(t){"function"!=typeof t&&(t=n.i(o.a)(t));for(var e=this._groups,r=e.length,a=new Array(r),s=0;se?1:t>=e?0:NaN}var o=n(0);e.a=function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=i);for(var n=this._groups,r=n.length,a=new Array(r),s=0;s=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),i.a.hasOwnProperty(e)?{space:i.a[e],local:t}:t}},function(t,e,n){"use strict";n.d(e,"b",function(){return i});var i="http://www.w3.org/1999/xhtml";e.a={svg:"http://www.w3.org/2000/svg",xhtml:i,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(t,e,n){"use strict";function i(t,e,n){return t=o(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function o(t,e,n){return function(i){var o=l;l=i;try{t.call(this,this.__data__,e,n)}finally{l=o}}}function r(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}function a(t){return function(){var e=this.__on;if(e){for(var n,i=0,o=-1,r=e.length;i=0&&m.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function s(t){var e=document.createElement("link");return e.rel="stylesheet",o(t,e),e}function u(t,e){var n,i,o;if(e.singleton){var u=_++;n=v||(v=a(e)),i=c.bind(null,n,u,!1),o=c.bind(null,n,u,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=s(e),i=h.bind(null,n),o=function(){r(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(e),i=l.bind(null,n),o=function(){r(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else o()}}function c(t,e,n,i){var o=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=y(e,o);else{var r=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}function l(t,e){var n=e.css,i=e.media;if(i&&t.setAttribute("media",i),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function h(t,e){var n=e.css,i=e.sourceMap;i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([n],{type:"text/css"}),r=t.href;t.href=URL.createObjectURL(o),r&&URL.revokeObjectURL(r)}var f={},p=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}},d=p(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),g=p(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,_=0,m=[];t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},void 0===e.singleton&&(e.singleton=d()),void 0===e.insertAt&&(e.insertAt="bottom");var o=i(t);return n(o,e),function(t){for(var r=[],a=0;a1?this.each((null==e?i:"function"==typeof e?r:o)(t,e,null==n?"":n)):a(this.node(),t)}},function(t,e,n){"use strict";function i(){return[]}e.a=function(t){return null==t?i:function(){return this.querySelectorAll(t)}}},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:this,r=document.createElement("li"),a=document.createTextNode(t);return r.appendChild(a),r.onclick=function(t){t.preventDefault(),n.apply(o),i.hide()},e?this.showItem(r):this.hideItem(r),this._list.appendChild(r),r}},{key:"hideItem",value:function(t){t.style.cssText="display: none"}},{key:"showItem",value:function(t){t.style.cssText="display: block"}},{key:"toggleItems",value:function(t,e){var n=this;t.forEach(function(t){return n.showItem(t)}),e.forEach(function(t){return n.hideItem(t)})}},{key:"show",value:function(t){this._isVisible=!0,this._containerDiv.style.cssText="\n display: block;\n visibility: hidden;\n position: absolute;\n width: "+this._options.width+"px; \n ";var e=this._parentDiv.getBoundingClientRect().width<=t.x+this.width,n=this._parentDiv.getBoundingClientRect().height<=t.y+this.height;this._containerDiv.style.cssText+="\n "+(e?"right: 0px;":"left: "+t.x+"px;")+"\n "+(n?"bottom: 14px;":"top: "+t.y+"px;")+"\n visibility: visible;\n "}},{key:"hide",value:function(){this._isVisible=!1,this._containerDiv.style.cssText="display: none"}},{key:"toggle",value:function(t){this._isVisible?this.hide():this.show(t)}}]),t}();e.default=u,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={EVENT_START:"measure_start",EVENT_END:"measure_end",EVENT_CHANGE:"measure_change",EVENT_TICK:"measure_tick"},t.exports=e.default},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n1)for(var e=1;e=1?(e="km",t/=1e3):e="m",this._numberToLocale(this._roundUp(t,2))+" "+e}},{key:"_formatLengthImperial",value:function(t){var e=void 0;return t/5280>=1?(e="mi",t/=5280):e="ft",this._numberToLocale(this._roundUp(t,2))+" "+e}},{key:"_formatLengthNautical",value:function(t){return t/=1852,this._numberToLocale(this._roundUp(t,2))+" NM"}},{key:"_formatAreaMetric",value:function(t){var e=void 0;return t/1e6>=1?(e="km²",t/=1e6):e="m²",this._numberToLocale(this._roundUp(t,2))+" "+e}},{key:"_formatAreaImperial",value:function(t){var e=void 0;return 3.587e-8*t>=1?(e="mi²",t*=3.587e-8):e="ft²",this._numberToLocale(this._roundUp(t,2))+" "+e}},{key:"_roundUp",value:function(t,e){return Number(Math.round(t+"e"+e)+"e-"+e).toFixed(e)}},{key:"_numberToLocale",value:function(t){return(new Intl.NumberFormat).format(t)}}],[{key:"findTouchPoint",value:function(t,e){var n=((t[1][1]-t[0][1])*(e[0]-t[0][0])-(t[1][0]-t[0][0])*(e[1]-t[0][1]))/(Math.pow(t[1][1]-t[0][1],2)+Math.pow(t[1][0]-t[0][0],2));return[e[0]-n*(t[1][1]-t[0][1]),e[1]+n*(t[1][0]-t[0][0])]}},{key:"findMidPoint",value:function(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}},{key:"transformText",value:function(e,n){var i=t.findMidPoint([e,n]),o=void 0;return o=e[0]===n[0]?n[1]>e[1]?90:n[1]=t._contextMenu.left&&e.clientX<=t._contextMenu.left+t._contextMenu.width&&e.clientY>=t._contextMenu.top&&e.clientY<=t._contextMenu.top+t._contextMenu.height||t._contextMenu.hide()})}},{key:"start",value:function(){var t=this;this._started||(this._overlay.setMap(this._map),this._geometry=new v.Geometry,this._segments=[],this._options.contextMenu&&this._firstClick&&(this._checkClick(this._firstClick),this._contextMenu.toggleItems([this._endElementNode],[this._startElementNode])),this._mapClickEvent=this._map.addListener("click",function(e){return t._checkClick(e)}),this._mapZoomChangedEvent=this._map.addListener("zoom_changed",function(){return t._redrawOverlay()}),this._map.setOptions({draggableCursor:"default"}),this._started=!0,"function"==typeof this._events.get(w.EVENT_START)&&this._events.get(w.EVENT_START)())}},{key:"end",value:function(){if(this._started){this._options.contextMenu&&this._contextMenu.toggleItems([this._startElementNode],[this._endElementNode]),this._mapClickEvent.remove(),this._mapZoomChangedEvent.remove();var t=this._geometry.nodes;this._geometry=new v.Geometry,this._onRemoveOverlay(),this._setOverlay(),this._overlay.setMap(null),this._map.setOptions({draggableCursor:null}),this._started=!1,"function"==typeof this._events.get(w.EVENT_END)&&this._events.get(w.EVENT_END)({result:{length:this.length,lengthText:this.lengthText,area:this.area,areaText:this.areaText,segments:this.segments,coordinates:t}})}}},{key:"addListener",value:function(t,e){this._events.set(t,e)}},{key:"removeListener",value:function(t){this._events.delete(t)}},{key:"setOption",value:function(t,e){if(!this._options[t])throw new Error(t+" is not a valid option on MeasureTool");this._options[t]=e,this._helper._options[t]&&this._helper.setOption(t,e),this._overlay&&this._nodeCircles&&this._redrawOverlay()}},{key:"_initOverlay",value:function(){this._setOverlay(),this._initComplete=!1}},{key:"_setOverlay",value:function(){this._overlay=new google.maps.OverlayView,this._overlay.onAdd=this._onAddOverlay.bind(this),this._overlay.draw=this._onDrawOverlay.bind(this),this._overlay.onRemove=this._onRemoveOverlay.bind(this),this._overlay.setMap(this._map)}},{key:"_onAddOverlay",value:function(){this._initComplete||(this._initComplete=!0),this._projection=this._overlay.getProjection(),this._projectionUtility=new g.default(this._containerDiv,this._projection),this._svgOverlay=(0,p.select)(this._overlay.getPanes().overlayMouseTarget).append("div").attr("class",u.Config.prefix+"-measure-points-"+this._id).append("svg").attr("class",u.Config.prefix+"-svg-overlay"),this._linesBase=this._svgOverlay.append("g").attr("class","base"),this._linesBase.selectAll("line").data(this._geometry?this._geometry.lines:[]),this._linesAux=this._svgOverlay.append("g").attr("class","aux"),this._linesAux.selectAll("line").data(this._geometry?this._geometry.lines:[]),this._nodeCircles=this._svgOverlay.append("g").attr("class","node-circle"),this._nodeCircles.selectAll("circle").data(this._geometry?this._geometry.nodes:[]),this._options.showSegmentLength&&(this._segmentText=this._svgOverlay.append("g").attr("class","segment-text"),this._segmentText.selectAll("text").data(this._geometry?this._geometry.lines:[])),this._options.showAccumulativeLength&&(this._nodeText=this._svgOverlay.append("g").attr("class","node-text"),this._nodeText.selectAll("text").data(this._geometry?this._geometry.nodes:[])),this._hoverCircle=this._svgOverlay.append("g").attr("class","hover-circle"),this._hoverCircle.append("circle").attr("class","grey-circle").attr("r",5),this._initComplete&&!this._started&&this._overlay.setMap(null)}},{key:"_onDrawOverlay",value:function(){this._updateCircles(),this._updateLine(),this._options.showSegmentLength&&this._updateSegmentText(),this._options.showAccumulativeLength&&this._updateNodeText(),this._geometry&&this._updateArea(this._geometry.nodes.length-1,this._geometry.nodes[this._geometry.nodes.length-1]),this._dispatchMeasureEvent()}},{key:"_onRemoveOverlay",value:function(){(0,p.select)("."+u.Config.prefix+"-measure-points-"+this._id).remove()}},{key:"_redrawOverlay",value:function(){this._onRemoveOverlay(),this._setOverlay(),this._overlay.draw()}},{key:"_checkClick",value:function(t){if(!this._dragged&&0==this._nodeCircles.selectAll('circle[r="6"]').size()&&!this._hoverCircle.select("circle").attr("cx")){var e=[t.latLng.lng(),t.latLng.lat()];this._geometry.addNode(e),this._overlay.draw()}this._dragged=!1}},{key:"_updateCircles",value:function(){var t=this,e=this;this._nodeCircles.selectAll("circle").data(this._geometry?this._geometry.nodes:[]).attr("class",function(t,e){return 0===e?"cover-circle head-circle":"cover-circle"}).attr("r",5).attr("cx",function(e){return t._projectionUtility.latLngToSvgPoint(e)[0]}).attr("cy",function(e){return t._projectionUtility.latLngToSvgPoint(e)[1]}).on("mouseover",function(t,n){e._onOverCircle(t,n,this)}).on("mouseout",function(t){e._onOutCircle(t,this)}).on("touchstart",function(t,n){e._onOverCircle(t,n,this)}).on("touchleave",function(t){e._onOutCircle(t,this)}).on("mousedown",function(){return t._hideTooltip()}).call(this._onDragCircle()).enter().append("circle").attr("class","cover-circle").attr("r",5).attr("cx",function(e){return t._projectionUtility.latLngToSvgPoint(e)[0]}).attr("cy",function(e){return t._projectionUtility.latLngToSvgPoint(e)[1]}).on("mouseover",function(t,n){e._onOverCircle(t,n,this)}).on("mouseout",function(t){e._onOutCircle(t,this)}).on("touchstart",function(t,n){e._onOverCircle(t,n,this)}).on("touchleave",function(t){e._onOutCircle(t,this)}).on("mousedown",function(){return t._hideTooltip()}).call(this._onDragCircle()),this._nodeCircles.selectAll(".removed-circle").remove()}},{key:"_updateLine",value:function(){var t=this;this._segments=[];var e=this._linesBase.selectAll("line").data(this._geometry?this._geometry.lines:[]).attr("class","base-line").attr("x1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[0]}).attr("y1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[1]}).attr("x2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[0]}).attr("y2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[1]}).each(function(e){return t._updateSegment(e)});e.enter().append("line").attr("class","base-line").attr("x1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[0]}).attr("y1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[1]}).attr("x2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[0]}).attr("y2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[1]}).each(function(e){return t._updateSegment(e)}),e.exit().remove();var n=this._linesAux.selectAll("line").data(this._geometry?this._geometry.lines:[]).attr("class","aux-line").attr("x1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[0]}).attr("y1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[1]}).attr("x2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[0]}).attr("y2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[1]}).on("mousemove",function(e){var n=x.default.findTouchPoint([t._projectionUtility.latLngToSvgPoint(e[0]),t._projectionUtility.latLngToSvgPoint(e[1])],[p.event.offsetX,p.event.offsetY]);t._updateHoverCirclePosition(n[0],n[1])}).on("mouseout",function(e){return t._hideHoverCircle()}).on("mousedown",function(){return t._hideTooltip()}).call(this._onDragLine());n.enter().append("line").attr("class","aux-line").attr("x1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[0]}).attr("y1",function(e){return t._projectionUtility.latLngToSvgPoint(e[0])[1]}).attr("x2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[0]}).attr("y2",function(e){return t._projectionUtility.latLngToSvgPoint(e[1])[1]}).on("mousemove",function(e){var n=x.default.findTouchPoint([t._projectionUtility.latLngToSvgPoint(e[0]),t._projectionUtility.latLngToSvgPoint(e[1])],[p.event.offsetX,p.event.offsetY]);t._updateHoverCirclePosition(n[0],n[1])}).on("mouseout",function(e){return t._hideHoverCircle()}).on("mousedown",function(){return t._hideTooltip()}).call(this._onDragLine()),n.exit().remove()}},{key:"_updateSegmentText",value:function(){var t=this,e=this._segmentText.selectAll("text").data(this._geometry?this._geometry.lines:[]).attr("class","segment-measure-text").attr("text-anchor","middle").attr("dominant-baseline","text-before-edge").attr("transform",function(e){var n=t._projectionUtility.latLngToSvgPoint(e[0]),i=t._projectionUtility.latLngToSvgPoint(e[1]);return x.default.transformText(n,i)}).text(function(e,n){return t._helper.formatLength(t._helper.computeLengthBetween(e[0],e[1]))});e.enter().append("text").attr("class","segment-measure-text").attr("text-anchor","middle").attr("dominant-baseline","text-before-edge").attr("transform",function(e){var n=t._projectionUtility.latLngToSvgPoint(e[0]),i=t._projectionUtility.latLngToSvgPoint(e[1]);return x.default.transformText(n,i)}).text(function(e,n){return t._helper.formatLength(t._helper.computeLengthBetween(e[0],e[1]))}),e.exit().remove()}},{key:"_updateNodeText",value:function(){var t=this,e=this._nodeText.selectAll("text").data(this._geometry?this._geometry.nodes:[]).attr("class",function(t,e){return 0===e?"node-measure-text head-text":"node-measure-text"}).attr("text-anchor","middle").attr("dominant-baseline","text-after-edge").attr("x",function(e){return t._projectionUtility.latLngToSvgPoint(e)[0]}).attr("y",this._transformNodeTextY.bind(this)).text(function(e,n){var i=t._helper.computePathLength(t._geometry.nodes.slice(0,n+1));return n===t._geometry.nodes.length-1&&(t._length=i),t._helper.formatLength(i)});e.enter().append("text").attr("class",function(t,e){return 0===e?"node-measure-text head-text":"node-measure-text"}).attr("text-anchor","middle").attr("dominant-baseline","text-after-edge").attr("x",function(e){return t._projectionUtility.latLngToSvgPoint(e)[0]}).attr("y",this._transformNodeTextY.bind(this)).text(function(e,n){var i=t._helper.computePathLength(t._geometry.nodes.slice(0,n+1));return n===t._geometry.nodes.length-1&&(t._length=i),t._helper.formatLength(i)}),e.exit().remove()}},{key:"_onOverCircle",value:function(t,e,n){this._dragging||((0,p.select)(n).attr("r",6),this._options.tooltip&&this._tooltip.show(this._projectionUtility.latLngToContainerPoint(t),0===e?u.Config.tooltipText2:u.Config.tooltipText1))}},{key:"_onOutCircle",value:function(t,e){(0,p.select)(e).attr("r",5),this._hideTooltip()}},{key:"_onDragCircle",value:function(){var t=this,e=!1,n=(0,m.drag)().on("drag",function(n,i){e=!0,t._dragging=!0,(0,p.select)(this).attr("cx",p.event.x).attr("cy",p.event.y),t._updateLinePosition.call(t,t._linesBase,i),t._updateLinePosition.call(t,t._linesAux,i),t._options.showSegmentLength&&t._updateSegmentTextPosition(i),t._options.showAccumulativeLength&&t._updateNodeTextPosition(i),t._updateArea(i,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y]))});return n.on("start",function(e){p.event.sourceEvent.stopPropagation(),(0,p.select)(this).raise().attr("r",6),t._disableMapScroll()}),n.on("end",function(n,i){t._enableMapScroll(),e?(t._geometry.updateNode(i,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])),t._showTooltipOnEvent(0===i?u.Config.tooltipText2:u.Config.tooltipText1)):i>0?(t._geometry.removeNode(i),(0,p.select)(this).classed("removed-circle",!0)):(t._geometry.addNode(n),t._dragged=!0),e=!1,t._dragging=!1,t._overlay.draw()}),n}},{key:"_onDragLine",value:function(){var t=this,e=!1,n=(0,m.drag)().on("drag",function(n,i){t._dragging=!0,e||(e=!0,t._geometry.insertNode(i+1,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])),t._updateLine(),t._options.showSegmentLength&&t._updateSegmentText(),t._options.showAccumulativeLength&&t._updateNodeText()),t._updateHoverCirclePosition(p.event.x,p.event.y),t._updateLinePosition(t._linesBase,i+1),t._updateLinePosition(t._linesAux,i+1),t._options.showSegmentLength&&t._updateSegmentTextPosition(i+1),t._options.showAccumulativeLength&&t._updateNodeTextPosition(i+1),t._updateArea(i+1,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y]))});return n.on("start",function(){p.event.sourceEvent.stopPropagation(),t._hoverCircle.select("circle").attr("class","cover-circle"),t._disableMapScroll()}),n.on("end",function(n,i){t._enableMapScroll(),e&&(t._geometry.updateNode(i+1,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])),t._hideHoverCircle(),t._overlay.draw(),e=!1,t._showTooltipOnEvent(u.Config.tooltipText1)),t._updateArea(i+1,t._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])),t._hoverCircle.select("circle").attr("class","grey-circle"),t._dragging=!1}),n}},{key:"_updateLinePosition",value:function(t,e){e0&&t.select("line:nth-child("+e+")").attr("x2",p.event.x).attr("y2",p.event.y)}},{key:"_updateSegmentTextPosition",value:function(t){var e=this;t0&&this._segmentText.select("text:nth-child("+t+")").attr("transform",function(t){var n=e._projectionUtility.latLngToSvgPoint(t[0]),i=[p.event.x,p.event.y];return x.default.transformText(n,i)}).text(function(t){return e._helper.formatLength(e._helper.computeLengthBetween(t[0],e._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])))})}},{key:"_updateNodeTextPosition",value:function(t){var e=this;this._nodeText.select("text:nth-child("+(t+1)+")").attr("x",p.event.x).attr("y",function(){var n=void 0;return n=t>0&&e._projectionUtility.latLngToSvgPoint(e._geometry.nodes[t-1])[1]0&&p.event.y=t}).text(function(n,i){var r=e._helper.computePathLength([].concat(o(e._geometry.nodes.slice(0,t)),[e._projectionUtility.svgPointToLatLng([p.event.x,p.event.y])],o(e._geometry.nodes.slice(t+1,t+1+i))));return t+i===e._geometry.nodes.length-1&&(e._length=r),e._helper.formatLength(r)})}},{key:"_updateHoverCirclePosition",value:function(t,e){this._hoverCircle.select("circle").attr("cx",t).attr("cy",e),this._dragging||this._options.tooltip&&this._tooltip.show(this._projectionUtility.svgPointToContainerPoint([t,e]),u.Config.tooltipText2)}},{key:"_hideHoverCircle",value:function(){this._hoverCircle.select("circle").attr("cx",null).attr("cy",null),this._hideTooltip()}},{key:"_disableMapScroll",value:function(){this._zoomControl=!!document.querySelector("button[aria-label='Zoom in']"),this._map.setOptions({scrollwheel:!1,gestureHandling:"none",zoomControl:!1})}},{key:"_enableMapScroll",value:function(){this._map.setOptions({scrollwheel:!0,gestureHandling:"auto",zoomControl:this._zoomControl})}},{key:"_transformNodeTextY",value:function(t,e){var n=void 0;return n=e>0&&this._geometry.nodes[e-1][1]>t[1]?23:-7,this._projectionUtility.latLngToSvgPoint(t)[1]+n}},{key:"_updateArea",value:function(t,e){if(this._geometry){var n=0;if(this._geometry.nodes.length>2){var i=this._geometry.nodes;t&&e&&(i[t]=e),n=this._helper.computeArea(i)}this._area=n,"function"==typeof this._events.get(w.EVENT_TICK)&&this._events.get(w.EVENT_TICK)({result:{length:this.length,lengthText:this.lengthText,area:this.area,areaText:this.areaText,segments:this.segments,coordinates:this._geometry.nodes}}),this._options.showFinal&&n>0&&this._nodeText.select(":last-child").text("Total distance: "+this.lengthText+"; Total area: "+this.areaText+".")}}},{key:"_showTooltipOnEvent",value:function(t){this._options.tooltip&&this._tooltip.show(this._projectionUtility.svgPointToContainerPoint([p.event.x,p.event.y]),t)}},{key:"_hideTooltip",value:function(){this._options.tooltip&&this._tooltip.hide()}},{key:"_dispatchMeasureEvent",value:function(){if(this._started){var t={result:{length:this.length,lengthText:this.lengthText,area:this.area,areaText:this.areaText,segments:this.segments,coordinates:this._geometry.nodes}};this._lastMeasure&&this._lastMeasure.result.lengthText===this.lengthText&&this._lastMeasure.result.areaText===this.areaText||"function"==typeof this._events.get(w.EVENT_CHANGE)&&this._events.get(w.EVENT_CHANGE)(this._lastMeasure=t)}}},{key:"_updateSegment",value:function(t){var e=this._helper.computeLengthBetween(t[0],t[1]),n=this._helper.formatLength(e);this.segments.push(new _.Segment(t[0],t[1],e,n).toJSON())}}]),t}();e.default=C,t.exports=e.default},function(t,e,n){e=t.exports=n(5)(),e.push([t.i,".measure-tool-context-menu {\n font-family: Roboto, Arial, sans-serif;\n border: 1px solid rgba(0, 0, 0, 0.2);\n outline: none;\n position: fixed;\n display: none;\n box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);\n transform: translate3d(0, 0, 0);\n max-width: 265px;\n z-index: 1;\n outline-offset: -2px;\n background: #fff;\n padding: 6px 0;\n white-space: nowrap;\n cursor: default;\n margin: 0; }\n .measure-tool-context-menu ul {\n padding: 0px;\n margin: 0px;\n background-color: white; }\n .measure-tool-context-menu ul li {\n cursor: pointer;\n display: flex;\n align-items: center;\n border-color: transparent;\n border-style: dotted;\n border-width: 1px 0;\n color: #333;\n font-size: 13px;\n font-weight: normal;\n margin: 0;\n padding: 4px 44px 4px 16px;\n position: relative;\n white-space: nowrap; }\n .measure-tool-context-menu ul li:hover {\n background-color: #f1f1f1;\n border-color: #f1f1f1;\n color: #222;\n transition: background 0s; }\n","",{version:3,sources:["/home/varna/Projects/MeasureTool-GoogleMaps-V3/src/context-menu.scss"],names:[],mappings:"AACA;EACE,uCAFqC;EAGrC,qCAAiC;EACjC,cAAa;EACb,gBAAe;EACf,cAAa;EAEb,yCAAqC;EACrC,gCAA6B;EAC7B,iBAAgB;EAChB,WAAU;EACV,qBAAoB;EAEpB,iBAAgB;EAChB,eAAc;EACd,oBAAmB;EACnB,gBAAe;EACf,UAAS,EA6BV;EA9CD;IAmBI,aAAY;IACZ,YAAW;IACX,wBAAuB,EAwBxB;IA7CH;MAwBM,gBAAe;MACf,cAAa;MACb,oBAAmB;MACnB,0BAAyB;MACzB,qBAAoB;MACpB,oBAAmB;MACnB,YAAW;MACX,gBAAe;MACf,oBAAmB;MACnB,UAAS;MACT,2BAA0B;MAC1B,mBAAkB;MAClB,oBAAmB,EAQpB;MA5CL;QAuCQ,0BAAyB;QACzB,sBAAqB;QACrB,YAAW;QACX,0BAAyB,EAC1B",file:"context-menu.scss",sourcesContent:["$font-family: Roboto, Arial, sans-serif;\n.measure-tool-context-menu {\n font-family: $font-family;\n border: 1px solid rgba(0,0,0,0.2);\n outline: none;\n position: fixed;\n display: none;\n\n box-shadow: 0 2px 2px rgba(0,0,0,0.2);\n transform: translate3d(0,0,0);\n max-width: 265px;\n z-index: 1;\n outline-offset: -2px;\n\n background: #fff;\n padding: 6px 0;\n white-space: nowrap;\n cursor: default;\n margin: 0;\n ul {\n padding: 0px;\n margin: 0px;\n background-color: white;\n\n li {\n cursor: pointer;\n display: flex;\n align-items: center;\n border-color: transparent;\n border-style: dotted;\n border-width: 1px 0;\n color: #333;\n font-size: 13px;\n font-weight: normal;\n margin: 0;\n padding: 4px 44px 4px 16px;\n position: relative;\n white-space: nowrap;\n\n &:hover {\n background-color: #f1f1f1;\n border-color: #f1f1f1;\n color: #222;\n transition: background 0s;\n }\n }\n }\n}"],sourceRoot:""}])},function(t,e,n){e=t.exports=n(5)(),e.push([t.i,".measure-tool-svg-overlay {\n position: absolute;\n top: -4000px;\n left: -4000px;\n width: 8000px;\n height: 8000px; }\n\n.dragging-circle,\n.cover-circle {\n fill: black;\n stroke: white;\n stroke-width: 2.5px; }\n .dragging-circle:hover,\n .cover-circle:hover {\n cursor: pointer; }\n\n.grey-circle {\n fill: #9b9b9b;\n stroke: dimgray;\n stroke-width: 2.5px;\n pointer-events: none; }\n\n.base-line {\n fill: none;\n stroke: white;\n stroke-width: 2.5px; }\n\n.aux-line {\n fill: none;\n stroke: transparent;\n stroke-width: 8px;\n cursor: pointer; }\n\n.segment-measure-text {\n stroke: white;\n pointer-events: none; }\n\n.node-measure-text {\n fill: white;\n pointer-events: none; }\n .node-measure-text.head-text {\n visibility: hidden; }\n","",{version:3,sources:["/home/varna/Projects/MeasureTool-GoogleMaps-V3/src/index.scss"],names:[],mappings:"AAEA;EACE,mBAAkB;EAClB,aAAY;EACZ,cAAa;EACb,cAAa;EACb,eAAc,EACf;;AAED;;EAEE,YAAW;EACX,cAAa;EACb,oBAAmB,EAIpB;EARD;;IAMI,gBAAe,EAChB;;AAGH;EACE,cAAwB;EACxB,gBAA0B;EAC1B,oBAAmB;EACnB,qBAAoB,EAIrB;;AAED;EACE,WAAU;EACV,cAAa;EACb,oBAAmB,EACpB;;AAED;EACE,WAAU;EACV,oBAAmB;EACnB,kBAAiB;EACjB,gBAAe,EAChB;;AAED;EACE,cAAa;EACb,qBAAoB,EACrB;;AAED;EACE,YAAW;EASX,qBAAoB,EAKrB;EAfD;IAaI,mBAAkB,EACnB",file:"index.scss",sourcesContent:["$opaque-white: rgba(255, 255, 255, 0.4);\n\n.measure-tool-svg-overlay{\n position: absolute;\n top: -4000px;\n left: -4000px;\n width: 8000px;\n height: 8000px;\n}\n\n.dragging-circle,\n.cover-circle {\n fill: black;\n stroke: white;\n stroke-width: 2.5px;\n &:hover {\n cursor: pointer;\n }\n}\n\n.grey-circle {\n fill: rgb(155, 155, 155);\n stroke: rgb(105, 105, 105);\n stroke-width: 2.5px;\n pointer-events: none;\n //&:hover {\n // cursor: pointer;\n //}\n}\n\n.base-line {\n fill: none;\n stroke: white;\n stroke-width: 2.5px;\n}\n\n.aux-line {\n fill: none;\n stroke: transparent;\n stroke-width: 8px;\n cursor: pointer;\n}\n\n.segment-measure-text {\n stroke: white;\n pointer-events: none;\n}\n\n.node-measure-text {\n fill: white;\n // text-shadow: -1.4px -1.4px $opaque-white,\n // -1.4px 1.4px $opaque-white,\n // 1.4px 1.4px $opaque-white,\n // 1.4px -1.4px $opaque-white,\n // -1.4px 0 $opaque-white,\n // 0 1.4px $opaque-white,\n // 1.4px 0 $opaque-white,\n // 0 -1.4px $opaque-white;\n pointer-events: none;\n\n &.head-text {\n visibility: hidden;\n }\n}\n"],sourceRoot:""}])},function(t,e,n){e=t.exports=n(5)(),e.push([t.i,".measure-tool-tooltip {\n display: none;\n font-family: Roboto, Arial, sans-serif;\n margin: 6px 15px;\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);\n padding: 10px;\n overflow: hidden;\n pointer-events: none;\n font-size: 0.7rem;\n z-index: 999; }\n","",{version:3,sources:["/home/varna/Projects/MeasureTool-GoogleMaps-V3/src/tooltip.scss"],names:[],mappings:"AACA;EACE,cAAa;EACb,uCAHqC;EAIrC,iBAAgB;EAChB,uBAAsB;EACtB,mBAAkB;EAClB,yCAAqC;EACrC,cAAa;EACb,iBAAgB;EAChB,qBAAoB;EACpB,kBAAiB;EACjB,aAAY,EACb",file:"tooltip.scss",sourcesContent:["$font-family: Roboto, Arial, sans-serif;\n.measure-tool-tooltip {\n display: none;\n font-family: $font-family;\n margin: 6px 15px;\n background-color: #fff;\n border-radius: 2px;\n box-shadow: 0 1px 4px rgba(0,0,0,0.3);\n padding: 10px;\n overflow: hidden;\n pointer-events: none;\n font-size: 0.7rem;\n z-index: 999;\n}"],sourceRoot:""}])},function(t,e,n){"use strict";var i=n(37);n.d(e,"a",function(){return i.a})},function(t,e,n){"use strict";function i(){for(var t,e=0,n=arguments.length,i={};e=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function a(t,e){for(var n,i=0,o=t.length;i0)for(var n,i,o=new Array(n),r=0;rM}L.mouse("drag")}function d(){n.i(u.select)(u.event.view).on("mousemove.drag mouseup.drag",null),n.i(c.b)(u.event.view,A),n.i(l.a)(),L.mouse("end")}function g(){if(b.apply(this,arguments)){var t,e,i=u.event.changedTouches,o=C.apply(this,arguments),r=i.length;for(t=0;t=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}},e.a=function(t,e){var n=i(t+"");if(arguments.length<2){for(var r=o(this.node()),a=-1,s=n.length;++a=T&&(T=C+1);!(b=A[T])&&++T=0;)(i=o[r])&&(a&&a!==i.nextSibling&&a.parentNode.insertBefore(i,a),a=i);return this}},function(t,e,n){"use strict";function i(t){return function(){delete this[t]}}function o(t,e){return function(){this[t]=e}}function r(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}e.a=function(t,e){return arguments.length>1?this.each((null==e?i:"function"==typeof e?r:o)(t,e)):this.node()[t]}},function(t,e,n){"use strict";function i(){this.nextSibling&&this.parentNode.appendChild(this)}e.a=function(){return this.each(i)}},function(t,e,n){"use strict";function i(){var t=this.parentNode;t&&t.removeChild(this)}e.a=function(){return this.each(i)}},function(t,e,n){"use strict";var i=n(0),o=n(9);e.a=function(t){"function"!=typeof t&&(t=n.i(o.a)(t));for(var e=this._groups,r=e.length,a=new Array(r),s=0;se?1:t>=e?0:NaN}var o=n(0);e.a=function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=i);for(var n=this._groups,r=n.length,a=new Array(r),s=0;s