Socket
Socket
Sign inDemoInstall

measuretool-googlemaps-v3

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

measuretool-googlemaps-v3 - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

lib/MeasureTool.min.js

@@ -1,1 +0,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(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},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=68)}([function(t,e,n){"use strict";function r(t,e){this._groups=t,this._parents=e}function i(){return new r([[document.documentElement]],U)}var o=n(59),a=n(60),s=n(48),u=n(42),c=n(16),l=n(47),h=n(52),f=n(55),p=n(62),d=n(40),g=n(54),v=n(53),_=n(61),m=n(46),y=n(45),x=n(39),A=n(63),w=n(56),b=n(41),C=n(64),L=n(49),T=n(57),k=n(51),E=n(38),B=n(50),M=n(58),P=n(43),S=n(6),j=n(44);n.d(e,"c",function(){return U}),e.b=r;var U=[null];r.prototype=i.prototype={constructor:r,select:o.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.a,property:w.a,classed:b.a,text:C.a,html:L.a,raise:T.a,lower:k.a,append:E.a,insert:B.a,remove:M.a,datum:P.a,on:S.c,dispatch:j.a},e.a=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);n.d(e,"creator",function(){return r.a});var i=n(34);n.d(e,"local",function(){return i.a});var o=n(15);n.d(e,"matcher",function(){return o.a});var a=n(35);n.d(e,"mouse",function(){return a.a});var s=n(3);n.d(e,"namespace",function(){return s.a});var u=n(4);n.d(e,"namespaces",function(){return u.a});var c=n(36);n.d(e,"select",function(){return c.a});var l=n(37);n.d(e,"selectAll",function(){return l.a});var h=n(0);n.d(e,"selection",function(){return h.a});var f=n(7);n.d(e,"selector",function(){return f.a});var p=n(18);n.d(e,"selectorAll",function(){return p.a});var d=n(65);n.d(e,"touch",function(){return d.a});var g=n(66);n.d(e,"touches",function(){return g.a});var v=n(9);n.d(e,"window",function(){return v.a});var _=n(6);n.d(e,"event",function(){return _.a}),n.d(e,"customEvent",function(){return _.b})},function(t,e,n){"use strict";function r(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 i(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var o=n(3),a=n(4);e.a=function(t){var e=n.i(o.a)(t);return(e.local?i:r)(e)}},function(t,e,n){"use strict";var r=n(4);e.a=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),r.a.hasOwnProperty(e)?{space:r.a[e],local:t}:t}},function(t,e,n){"use strict";n.d(e,"b",function(){return r});var r="http://www.w3.org/1999/xhtml";e.a={svg:"http://www.w3.org/2000/svg",xhtml:r,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";e.a=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}},function(t,e,n){"use strict";function r(t,e,n){return t=i(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function i(t,e,n){return function(r){var i=l;l=r;try{t.call(this,this.__data__,e,n)}finally{l=i}}}function o(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,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function s(t,e,n){var o=c.hasOwnProperty(t.type)?r:i;return function(r,i,a){var s,u=this.__on,c=o(e,i,a);if(u)for(var l=0,h=u.length;l<h;++l)if((s=u[l]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=c,s.capture=n),void(s.value=e);this.addEventListener(t.type,c,n),s={type:t.type,name:t.name,value:e,listener:c,capture:n},u?u.push(s):this.__on=[s]}}function u(t,e,n,r){var i=l;t.sourceEvent=l,l=t;try{return e.apply(n,r)}finally{l=i}}n.d(e,"a",function(){return l}),e.b=u;var c={},l=null;if("undefined"!=typeof document){"onmouseenter"in document.documentElement||(c={mouseenter:"mouseover",mouseleave:"mouseout"})}e.c=function(t,e,n){var r,i,u=o(t+""),c=u.length;{if(!(arguments.length<2)){for(l=e?s:a,null==n&&(n=!1),r=0;r<c;++r)this.each(l(u[r],e,n));return this}var l=this.node().__on;if(l)for(var h,f=0,p=l.length;f<p;++f)for(r=0,h=l[f];r<c;++r)if((i=u[r]).type===h.type&&i.name===h.name)return h.value}}},function(t,e,n){"use strict";function r(){}e.a=function(t){return null==t?r:function(){return this.querySelector(t)}}},function(t,e,n){"use strict";var r=n(6);e.a=function(){for(var t,e=r.a;t=e.sourceEvent;)e=t;return e}},function(t,e,n){"use strict";e.a=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.UnitTypeId={METRIC:"metric",IMPERIAL:"imperial"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Config={version:"0.0.1",prefix:"measure-tool"}},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(t,e,n){"use strict";function r(t,e){var r=t.document.documentElement,a=n.i(i.select)(t).on("dragstart.drag",null);e&&(a.on("click.drag",o.a,!0),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var i=n(1),o=n(14);e.b=r,e.a=function(t){var e=t.document.documentElement,r=n.i(i.select)(t).on("dragstart.drag",o.a,!0);"onselectstart"in e?r.on("selectstart.drag",o.a,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}},function(t,e,n){"use strict";function r(){i.event.stopImmediatePropagation()}var i=n(1);e.b=r,e.a=function(){i.event.preventDefault(),i.event.stopImmediatePropagation()}},function(t,e,n){"use strict";var r=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var i=document.documentElement;if(!i.matches){var o=i.webkitMatchesSelector||i.msMatchesSelector||i.mozMatchesSelector||i.oMatchesSelector;r=function(t){return function(){return o.call(this,t)}}}}e.a=r},function(t,e,n){"use strict";function r(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}var i=n(17),o=n(0);e.b=r,e.a=function(){return new o.b(this._enter||this._groups.map(i.a),this._parents)},r.prototype={constructor:r,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}}},function(t,e,n){"use strict";e.a=function(t){return new Array(t.length)}},function(t,e,n){"use strict";function r(){return[]}e.a=function(t){return null==t?r:function(){return this.querySelectorAll(t)}}},function(t,e){function n(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=f[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(u(r.parts[o],e))}else{for(var a=[],o=0;o<r.parts.length;o++)a.push(u(r.parts[o],e));f[r.id]={id:r.id,refs:1,parts:a}}}}function r(t){for(var e=[],n={},r=0;r<t.length;r++){var i=t[r],o=i[0],a=i[1],s=i[2],u=i[3],c={css:a,media:s,sourceMap:u};n[o]?n[o].parts.push(c):e.push(n[o]={id:o,parts:[c]})}return e}function i(t,e){var n=g(),r=m[m.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),m.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(e)}}function o(t){t.parentNode.removeChild(t);var e=m.indexOf(t);e>=0&&m.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",i(t,e),e}function s(t){var e=document.createElement("link");return e.rel="stylesheet",i(t,e),e}function u(t,e){var n,r,i;if(e.singleton){var u=_++;n=v||(v=a(e)),r=c.bind(null,n,u,!1),i=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),r=h.bind(null,n),i=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(e),r=l.bind(null,n),i=function(){o(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}function c(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=y(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function l(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),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,r=e.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var i=new Blob([n],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}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 i=r(t);return n(i,e),function(t){for(var o=[],a=0;a<i.length;a++){var s=i[a],u=f[s.id];u.refs--,o.push(u)}if(t){n(r(t),e)}for(var a=0;a<o.length;a++){var u=o[a];if(0===u.refs){for(var c=0;c<u.parts.length;c++)u.parts[c]();delete f[u.id]}}}};var y=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}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;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),a=n(11),s=n(67),u=r(s),c=function(){function t(e,n){i(this,t),this._defaultOptions={width:150},this._options=Object.assign({},this._defaultOptions,n||{}),this._parentDiv=e,this._containerDiv=document.createElement("div"),this._containerDiv.classList.add(a.Config.prefix+"-context-menu"),this._containerDiv.stylesheet=u.default,this._containerDiv.oncontextmenu=function(t){return t.preventDefault()},this._list=document.createElement("ul"),this._containerDiv.appendChild(this._list),e.appendChild(this._containerDiv),this._isVisible=!1}return o(t,[{key:"left",get:function(){return this._containerDiv.getBoundingClientRect().left}},{key:"top",get:function(){return this._containerDiv.getBoundingClientRect().top}},{key:"width",get:function(){return this._containerDiv.getBoundingClientRect().width}},{key:"height",get:function(){return this._containerDiv.getBoundingClientRect().height}}]),o(t,[{key:"addItem",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this,o=document.createElement("li"),a=document.createTextNode(t);return o.appendChild(a),o.onclick=function(t){t.preventDefault(),n.apply(i),r.hide()},e?this.showItem(o):this.hideItem(o),this._list.appendChild(o),o}},{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=c,t.exports=e.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.Geometry=function(){function t(){r(this,t),this._nodes=[]}return i(t,[{key:"nodes",get:function(){return this._nodes}},{key:"lines",get:function(){var t=[];if(this._nodes.length>1)for(var e=1;e<this._nodes.length;e++)t.push([this._nodes[e-1],this._nodes[e]]);return t}}]),i(t,[{key:"addNode",value:function(t){this._nodes.push(t)}},{key:"updateNode",value:function(t,e){this._nodes[t]=e}},{key:"removeNode",value:function(t){this._nodes.splice(t,1)}},{key:"insertNode",value:function(t,e){this._nodes.splice(t,0,e)}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(10),a=function(){function t(e){r(this,t),this._options={unit:o.UnitTypeId.METRIC},Object.assign(this._options,e),this.init()}return i(t,[{key:"init",value:function(){switch(this._options.unit.toLowerCase()){case o.UnitTypeId.METRIC:this._lengthMultiplier=1,this.formatLength=this._formatLengthMetric,this._areaMultiplier=1,this.formatArea=this._formatAreaMetric;break;case o.UnitTypeId.IMPERIAL:this._lengthMultiplier=3.28084,this.formatLength=this._formatLengthImperial,this._areaMultiplier=10.7639,this.formatArea=this._formatAreaImperial;break;default:this._lengthMultiplier=1,this.formatLength=this._formatLengthMetric,this._areaMultiplier=1,this.formatArea=this._formatAreaMetric}}},{key:"computeLengthBetween",value:function(t,e){return google.maps.geometry.spherical.computeDistanceBetween(new google.maps.LatLng(t[1],t[0]),new google.maps.LatLng(e[1],e[0]))*this._lengthMultiplier}},{key:"computePathLength",value:function(t){for(var e=0,n=1;n<t.length;n++)e+=google.maps.geometry.spherical.computeDistanceBetween(new google.maps.LatLng(t[n-1][1],t[n-1][0]),new google.maps.LatLng(t[n][1],t[n][0]));return e*this._lengthMultiplier}},{key:"computeArea",value:function(t){return google.maps.geometry.spherical.computeArea(t.map(function(t){return new google.maps.LatLng(t[1],t[0])}))*this._areaMultiplier}},{key:"_formatLengthMetric",value:function(t){var e=void 0;return t/1e3>=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:"_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:"computePixelLength",value:function(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}},{key:"_interpolate",value:function(t,e,n){var r=google.maps.geometry.spherical.interpolate(new google.maps.LatLng(t[1],t[0]),new google.maps.LatLng(e[1],e[0]),n);return[r.lng(),r.lat()]}}]),t}();e.default=a,t.exports=e.default},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function(){function t(e,n,i){r(this,t),this._defaultOptions={offsetRate:8e3},this._options=Object.assign({},this._defaultOptions,i||{}),this._container=e,this._projection=n}return i(t,[{key:"latLngToSvgPoint",value:function(t){var e=this._options.offsetRate/2,n=new google.maps.LatLng(t[1],t[0]),r=this._projection.fromLatLngToDivPixel(n);return[r.x+e,r.y+e]}},{key:"svgPointToLatLng",value:function(t){var e=this._options.offsetRate/2,n=new google.maps.Point(t[0]-e,t[1]-e),r=this._projection.fromDivPixelToLatLng(n);return[r.lng(),r.lat()]}}]),t}();e.default=o,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(31);n.d(e,"drag",function(){return r.a});var i=n(13);n.d(e,"dragDisable",function(){return i.a}),n.d(e,"dragEnable",function(){return i.b})},function(t,e,n){var r=n(27);"string"==typeof r&&(r=[[t.i,r,""]]);n(19)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){e=t.exports=n(12)(),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:["/Users/zhenyanghua/Documents/myGit/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(12)(),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\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\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:["/Users/zhenyanghua/Documents/myGit/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,EACpB;;AACD;EACE,cAAwB;EACxB,gBAA0B;EAC1B,oBAAmB;EACnB,qBAAoB,EACrB;;AAED;EACE,WAAU;EACV,cAAa;EACb,oBAAmB,EACpB;;AAED;EACE,WAAU;EACV,oBAAmB;EACnB,kBAAiB,EAClB;;AAED;EACE,cAAa;EACb,qBAAoB,EACrB;;AAED;EACE,kTAzCqC;EAiDrC,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}\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}\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}\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){"use strict";var r=n(29);n.d(e,"a",function(){return r.a})},function(t,e,n){"use strict";function r(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new i(r)}function i(t){this._=t}function o(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function a(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function s(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=u,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}var u={value:function(){}};i.prototype=r.prototype={constructor:i,on:function(t,e){var n,r=this._,i=o(t+"",r),u=-1,c=i.length;{if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++u<c;)if(n=(t=i[u]).type)r[n]=s(r[n],t.name,e);else if(null==e)for(n in r)r[n]=s(r[n],t.name,null);return this}for(;++u<c;)if((n=(t=i[u]).type)&&(n=a(r[n],t.name)))return n}},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new i(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,n=r.length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}},e.a=r},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e,n){"use strict";function r(){return!s.event.button}function i(){return this.parentNode}function o(t){return null==t?{x:s.event.x,y:s.event.y}:t}var a=n(28),s=n(1),u=n(13),c=n(14),l=n(30),h=n(32);e.a=function(){function t(t){t.on("mousedown.drag",e).on("touchstart.drag",d).on("touchmove.drag",g).on("touchend.drag touchcancel.drag",v).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function e(){if(!y&&x.apply(this,arguments)){var t=_("mouse",A.apply(this,arguments),s.mouse,this,arguments);t&&(n.i(s.select)(s.event.view).on("mousemove.drag",f,!0).on("mouseup.drag",p,!0),n.i(u.a)(s.event.view),n.i(c.b)(),m=!1,t("start"))}}function f(){n.i(c.a)(),m=!0,b.mouse("drag")}function p(){n.i(s.select)(s.event.view).on("mousemove.drag mouseup.drag",null),n.i(u.b)(s.event.view,m),n.i(c.a)(),b.mouse("end")}function d(){if(x.apply(this,arguments)){var t,e,r=s.event.changedTouches,i=A.apply(this,arguments),o=r.length;for(t=0;t<o;++t)(e=_(r[t].identifier,i,s.touch,this,arguments))&&(n.i(c.b)(),e("start"))}}function g(){var t,e,r=s.event.changedTouches,i=r.length;for(t=0;t<i;++t)(e=b[r[t].identifier])&&(n.i(c.a)(),e("drag"))}function v(){var t,e,r=s.event.changedTouches,i=r.length;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),t=0;t<i;++t)(e=b[r[t].identifier])&&(n.i(c.b)(),e("end"))}function _(e,r,i,o,a){var u,c,l,f=i(r,e),p=C.copy();if(n.i(s.customEvent)(new h.a(t,"beforestart",u,e,L,f[0],f[1],0,0,p),function(){return null!=(s.event.subject=u=w.apply(o,a))&&(c=u.x-f[0]||0,l=u.y-f[1]||0,!0)}))return function d(g){var v,_=f;switch(g){case"start":b[e]=d,v=L++;break;case"end":delete b[e],--L;case"drag":f=i(r,e),v=L}n.i(s.customEvent)(new h.a(t,g,u,e,v,f[0]+c,f[1]+l,f[0]-_[0],f[1]-_[1],p),p.apply,p,[g,o,a])}}var m,y,x=r,A=i,w=o,b={},C=n.i(a.a)("start","drag","end"),L=0;return t.filter=function(e){return arguments.length?(x="function"==typeof e?e:n.i(l.a)(!!e),t):x},t.container=function(e){return arguments.length?(A="function"==typeof e?e:n.i(l.a)(e),t):A},t.subject=function(e){return arguments.length?(w="function"==typeof e?e:n.i(l.a)(e),t):w},t.on=function(){var e=C.on.apply(C,arguments);return e===C?t:e},t}},function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s,u,c){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=s,this.dy=u,this._=c}e.a=r,r.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e,n){"use strict";function r(){return new i}function i(){this._="@"+(++o).toString(36)}e.a=r;var o=0;i.prototype=r.prototype={constructor:i,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}}},function(t,e,n){"use strict";var r=n(8),i=n(5);e.a=function(t){var e=n.i(r.a)();return e.changedTouches&&(e=e.changedTouches[0]),n.i(i.a)(t,e)}},function(t,e,n){"use strict";var r=n(0);e.a=function(t){return"string"==typeof t?new r.b([[document.querySelector(t)]],[document.documentElement]):new r.b([[t]],r.c)}},function(t,e,n){"use strict";var r=n(0);e.a=function(t){return"string"==typeof t?new r.b([document.querySelectorAll(t)],[document.documentElement]):new r.b([null==t?[]:t],r.c)}},function(t,e,n){"use strict";var r=n(2);e.a=function(t){var e="function"==typeof t?t:n.i(r.a)(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}},function(t,e,n){"use strict";function r(t){return function(){this.removeAttribute(t)}}function i(t){return function(){this.removeAttributeNS(t.space,t.local)}}function o(t,e){return function(){this.setAttribute(t,e)}}function a(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function s(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function u(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var c=n(3);e.a=function(t,e){var l=n.i(c.a)(t);if(arguments.length<2){var h=this.node();return l.local?h.getAttributeNS(l.space,l.local):h.getAttribute(l)}return this.each((null==e?l.local?i:r:"function"==typeof e?l.local?u:s:l.local?a:o)(l,e))}},function(t,e,n){"use strict";e.a=function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}},function(t,e,n){"use strict";function r(t){return t.trim().split(/^|\s+/)}function i(t){return t.classList||new o(t)}function o(t){this._node=t,this._names=r(t.getAttribute("class")||"")}function a(t,e){for(var n=i(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function s(t,e){for(var n=i(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function u(t){return function(){a(this,t)}}function c(t){return function(){s(this,t)}}function l(t,e){return function(){(e.apply(this,arguments)?a:s)(this,t)}}o.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=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=r(t+"");if(arguments.length<2){for(var o=i(this.node()),a=-1,s=n.length;++a<s;)if(!o.contains(n[a]))return!1;return!0}return this.each(("function"==typeof e?l:e?u:c)(n,e))}},function(t,e,n){"use strict";function r(t,e,n,r,i,o){for(var s,u=0,c=e.length,l=o.length;u<l;++u)(s=e[u])?(s.__data__=o[u],r[u]=s):n[u]=new a.b(t,o[u]);for(;u<c;++u)(s=e[u])&&(i[u]=s)}function i(t,e,n,r,i,o,s){var c,l,h,f={},p=e.length,d=o.length,g=new Array(p);for(c=0;c<p;++c)(l=e[c])&&(g[c]=h=u+s.call(l,l.__data__,c,e),h in f?i[c]=l:f[h]=l);for(c=0;c<d;++c)h=u+s.call(t,o[c],c,o),(l=f[h])?(r[c]=l,l.__data__=o[c],f[h]=null):n[c]=new a.b(t,o[c]);for(c=0;c<p;++c)(l=e[c])&&f[g[c]]===l&&(i[c]=l)}var o=n(0),a=n(16),s=n(33),u="$";e.a=function(t,e){if(!t)return m=new Array(this.size()),d=-1,this.each(function(t){m[++d]=t}),m;var a=e?i:r,u=this._parents,c=this._groups;"function"!=typeof t&&(t=n.i(s.a)(t));for(var l=c.length,h=new Array(l),f=new Array(l),p=new Array(l),d=0;d<l;++d){var g=u[d],v=c[d],_=v.length,m=t.call(g,g&&g.__data__,d,u),y=m.length,x=f[d]=new Array(y),A=h[d]=new Array(y);a(g,v,x,A,p[d]=new Array(_),m,e);for(var w,b,C=0,L=0;C<y;++C)if(w=x[C]){for(C>=L&&(L=C+1);!(b=A[L])&&++L<y;);w._next=b||null}}return h=new o.b(h,u),h._enter=f,h._exit=p,h}},function(t,e,n){"use strict";e.a=function(t){return arguments.length?this.property("__data__",t):this.node().__data__}},function(t,e,n){"use strict";function r(t,e,r){var i=n.i(a.a)(t),o=i.CustomEvent;o?o=new o(e,r):(o=i.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function i(t,e){return function(){return r(this,t,e)}}function o(t,e){return function(){return r(this,t,e.apply(this,arguments))}}var a=n(9);e.a=function(t,e){return this.each(("function"==typeof e?o:i)(t,e))}},function(t,e,n){"use strict";e.a=function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,s=o.length;a<s;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this}},function(t,e,n){"use strict";e.a=function(){return!this.node()}},function(t,e,n){"use strict";var r=n(17),i=n(0);e.a=function(){return new i.b(this._exit||this._groups.map(r.a),this._parents)}},function(t,e,n){"use strict";var r=n(0),i=n(15);e.a=function(t){"function"!=typeof t&&(t=n.i(i.a)(t));for(var e=this._groups,o=e.length,a=new Array(o),s=0;s<o;++s)for(var u,c=e[s],l=c.length,h=a[s]=[],f=0;f<l;++f)(u=c[f])&&t.call(u,u.__data__,f,c)&&h.push(u);return new r.b(a,this._parents)}},function(t,e,n){"use strict";function r(){this.innerHTML=""}function i(t){return function(){this.innerHTML=t}}function o(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}e.a=function(t){return arguments.length?this.each(null==t?r:("function"==typeof t?o:i)(t)):this.node().innerHTML}},function(t,e,n){"use strict";function r(){return null}var i=n(2),o=n(7);e.a=function(t,e){var a="function"==typeof t?t:n.i(i.a)(t),s=null==e?r:"function"==typeof e?e:n.i(o.a)(e);return this.select(function(){return this.insertBefore(a.apply(this,arguments),s.apply(this,arguments)||null)})}},function(t,e,n){"use strict";function r(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}e.a=function(){return this.each(r)}},function(t,e,n){"use strict";var r=n(0);e.a=function(t){for(var e=this._groups,n=t._groups,i=e.length,o=n.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var c,l=e[u],h=n[u],f=l.length,p=s[u]=new Array(f),d=0;d<f;++d)(c=l[d]||h[d])&&(p[d]=c);for(;u<i;++u)s[u]=e[u];return new r.b(s,this._parents)}},function(t,e,n){"use strict";e.a=function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}},function(t,e,n){"use strict";e.a=function(){var t=new Array(this.size()),e=-1;return this.each(function(){t[++e]=this}),t}},function(t,e,n){"use strict";e.a=function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this}},function(t,e,n){"use strict";function r(t){return function(){delete this[t]}}function i(t,e){return function(){this[t]=e}}function o(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?r:"function"==typeof e?o:i)(t,e)):this.node()[t]}},function(t,e,n){"use strict";function r(){this.nextSibling&&this.parentNode.appendChild(this)}e.a=function(){return this.each(r)}},function(t,e,n){"use strict";function r(){var t=this.parentNode;t&&t.removeChild(this)}e.a=function(){return this.each(r)}},function(t,e,n){"use strict";var r=n(0),i=n(7);e.a=function(t){"function"!=typeof t&&(t=n.i(i.a)(t));for(var e=this._groups,o=e.length,a=new Array(o),s=0;s<o;++s)for(var u,c,l=e[s],h=l.length,f=a[s]=new Array(h),p=0;p<h;++p)(u=l[p])&&(c=t.call(u,u.__data__,p,l))&&("__data__"in u&&(c.__data__=u.__data__),f[p]=c);return new r.b(a,this._parents)}},function(t,e,n){"use strict";var r=n(0),i=n(18);e.a=function(t){"function"!=typeof t&&(t=n.i(i.a)(t));for(var e=this._groups,o=e.length,a=[],s=[],u=0;u<o;++u)for(var c,l=e[u],h=l.length,f=0;f<h;++f)(c=l[f])&&(a.push(t.call(c,c.__data__,f,l)),s.push(c));return new r.b(a,s)}},function(t,e,n){"use strict";e.a=function(){var t=0;return this.each(function(){++t}),t}},function(t,e,n){"use strict";function r(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var i=n(0);e.a=function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=r);for(var n=this._groups,o=n.length,a=new Array(o),s=0;s<o;++s){for(var u,c=n[s],l=c.length,h=a[s]=new Array(l),f=0;f<l;++f)(u=c[f])&&(h[f]=u);h.sort(e)}return new i.b(a,this._parents).order()}},function(t,e,n){"use strict";function r(t){return function(){this.style.removeProperty(t)}}function i(t,e,n){return function(){this.style.setProperty(t,e,n)}}function o(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}var a=n(9);e.a=function(t,e,s){var u;return arguments.length>1?this.each((null==e?r:"function"==typeof e?o:i)(t,e,null==s?"":s)):n.i(a.a)(u=this.node()).getComputedStyle(u,null).getPropertyValue(t)}},function(t,e,n){"use strict";function r(){this.textContent=""}function i(t){return function(){this.textContent=t}}function o(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}e.a=function(t){return arguments.length?this.each(null==t?r:("function"==typeof t?o:i)(t)):this.node().textContent}},function(t,e,n){"use strict";var r=n(8),i=n(5);e.a=function(t,e,o){arguments.length<3&&(o=e,e=n.i(r.a)().changedTouches);for(var a,s=0,u=e?e.length:0;s<u;++s)if((a=e[s]).identifier===o)return n.i(i.a)(t,a);return null}},function(t,e,n){"use strict";var r=n(8),i=n(5);e.a=function(t,e){null==e&&(e=n.i(r.a)().touches);for(var o=0,a=e?e.length:0,s=new Array(a);o<a;++o)s[o]=n.i(i.a)(t,e[o]);return s}},function(t,e,n){var r=n(26);"string"==typeof r&&(r=[[t.i,r,""]]);n(19)(r,{});r.locals&&(t.exports=r.locals)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(25),u=(r(s),n(11)),c=n(20),l=r(c),h=n(1),f=n(23),p=r(f),d=n(21),g=n(24),v=n(22),_=r(v),m=n(10),y=function(){function t(e,n){o(this,t),this._options={showSegmentLength:!0,showAccumulativeLength:!0,unit:m.UnitTypeId.METRIC},Object.assign(this._options,n),this._map=e,this._map.setClickableIcons(!1),this._init()}return a(t,[{key:"lengthText",get:function(){return this._helper.formatLength(this._length||0)}},{key:"areaText",get:function(){return this._helper.formatArea(this._area||0)}},{key:"length",get:function(){return this._length||0}},{key:"area",get:function(){return this._area||0}}],[{key:"version",get:function(){return u.Config.prefix+"-v"+u.Config.version}},{key:"UnitTypeId",get:function(){return m.UnitTypeId}}]),a(t,[{key:"_init",value:function(){this._contextMenu=new l.default(this._map.getDiv(),{width:160}),this._startElementNode=this._contextMenu.addItem("Measure distance",!0,this._startMeasure,this),this._endElementNode=this._contextMenu.addItem("Clear measurement",!1,this._endMeasure,this),this._helper=new _.default({unit:this._options.unit}),this._overlay=new google.maps.OverlayView,this._setOverlay(),this._bindToggleContextMenu()}},{key:"_bindToggleContextMenu",value:function(){var t=this;this._map.addListener("rightclick",function(e){t._firstClick=e,t._contextMenu.show(t._projection.fromLatLngToContainerPixel(e.latLng))}),document.addEventListener("keydown",function(e){27===e.which&&t._contextMenu.hide()}),this._map.getDiv().addEventListener("mousedown",function(e){e.clientX>=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:"_startMeasure",value:function(){var t=this;console.log("start measure"),this._geometry=new d.Geometry,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"})}},{key:"_endMeasure",value:function(){console.log("end measure"),this._contextMenu.toggleItems([this._startElementNode],[this._endElementNode]),this._mapClickEvent.remove(),this._mapZoomChangedEvent.remove(),this._geometry=new d.Geometry,this._onRemoveOverlay(),this._setOverlay(),this._map.setOptions({draggableCursor:null})}},{key:"_setOverlay",value:function(){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._projection=this._overlay.getProjection(),this._projectionUtility=new p.default(this._map.getDiv(),this._projection),this._svgOverlay=(0,h.select)(this._overlay.getPanes().overlayMouseTarget).append("div").attr("id",u.Config.prefix+"-svg-container").attr("class",u.Config.prefix+"-measure-points").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)}},{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])}},{key:"_onRemoveOverlay",value:function(){(0,h.select)("."+u.Config.prefix+"-measure-points").remove()}},{key:"_redrawOverlay",value:function(){this._onRemoveOverlay(),this._setOverlay(),this._overlay.draw()}},{key:"_checkClick",value:function(t){if(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()}}},{key:"_updateCircles",value:function(){var t=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){(0,h.select)(this).attr("r",6)}).on("mouseout",function(t){(0,h.select)(this).attr("r",5)}).on("touchstart",function(t){(0,h.select)(this).attr("r",6)}).on("touchleave",function(t){(0,h.select)(this).attr("r",5)}).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){(0,h.select)(this).attr("r",6)}).on("mouseout",function(t){(0,h.select)(this).attr("r",5)}).on("touchstart",function(t){(0,h.select)(this).attr("r",6)}).on("touchleave",function(t){(0,h.select)(this).attr("r",5)}).call(this._onDragCircle()),this._nodeCircles.selectAll(".removed-circle").remove()}},{key:"_updateLine",value:function(){var t=this,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]});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]}),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=_.default.findTouchPoint([t._projectionUtility.latLngToSvgPoint(e[0]),t._projectionUtility.latLngToSvgPoint(e[1])],[h.event.offsetX,h.event.offsetY]);t._updateHoverCirclePosition(n[0],n[1])}).on("mouseout",function(e){return t._hideHoverCircle()}).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=_.default.findTouchPoint([t._projectionUtility.latLngToSvgPoint(e[0]),t._projectionUtility.latLngToSvgPoint(e[1])],[h.event.offsetX,h.event.offsetY]);t._updateHoverCirclePosition(n[0],n[1])}).on("mouseout",function(e){return t._hideHoverCircle()}).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-after-edge").attr("transform",function(e){var n=t._projectionUtility.latLngToSvgPoint(e[0]),r=t._projectionUtility.latLngToSvgPoint(e[1]);return t._doTextTransform(n,r)}).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-after-edge").attr("transform",function(e){var n=t._projectionUtility.latLngToSvgPoint(e[0]),r=t._projectionUtility.latLngToSvgPoint(e[1]);return t._doTextTransform(n,r)}).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 r=t._helper.computePathLength(t._geometry.nodes.slice(0,n+1));return n===t._geometry.nodes.length-1&&(t._length=r),t._helper.formatLength(r)});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 r=t._helper.computePathLength(t._geometry.nodes.slice(0,n+1));return n===t._geometry.nodes.length-1&&(t._length=r),t._helper.formatLength(r)}),e.exit().remove()}},{key:"_onDragCircle",value:function(){var t=this,e=!1,n=(0,g.drag)().on("drag",function(n,r){e=!0,(0,h.select)(this).attr("cx",h.event.x).attr("cy",h.event.y),t._updateLinePosition.call(t,t._linesBase,r),t._updateLinePosition.call(t,t._linesAux,r),t._options.showSegmentLength&&t._updateSegmentTextPosition(r),t._options.showAccumulativeLength&&t._updateNodeTextPosition(r),t._updateArea(r,t._projectionUtility.svgPointToLatLng([h.event.x,h.event.y]))});return n.on("start",function(e){h.event.sourceEvent.stopPropagation(),(0,h.select)(this).raise().attr("r",6),t._disableMapScroll()}),n.on("end",function(n,r){t._enableMapScroll(),e?t._geometry.updateNode(r,t._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])):r>0?(t._geometry.removeNode(r),(0,h.select)(this).classed("removed-circle",!0)):t._geometry.addNode(n),e=!1,t._overlay.draw()}),n}},{key:"_onDragLine",value:function(){var t=this,e=!1,n=(0,g.drag)().on("drag",function(n,r){e||(e=!0,t._geometry.insertNode(r+1,t._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])),t._updateLine(),t._options.showSegmentLength&&t._updateSegmentText(),t._options.showAccumulativeLength&&t._updateNodeText()),t._updateHoverCirclePosition(h.event.x,h.event.y),t._updateLinePosition(t._linesBase,r+1),t._updateLinePosition(t._linesAux,r+1),t._options.showSegmentLength&&t._updateSegmentTextPosition(r+1),t._options.showAccumulativeLength&&t._updateNodeTextPosition(r+1),t._updateArea(r+1,t._projectionUtility.svgPointToLatLng([h.event.x,h.event.y]))});return n.on("start",function(){h.event.sourceEvent.stopPropagation(),t._hoverCircle.select("circle").attr("class","cover-circle"),t._disableMapScroll()}),n.on("end",function(n,r){t._enableMapScroll(),e&&(t._geometry.updateNode(r+1,t._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])),t._hideHoverCircle(),t._overlay.draw(),e=!1),t._updateArea(r+1,t._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])),t._hoverCircle.select("circle").attr("class","grey-circle")}),n}},{key:"_updateLinePosition",value:function(t,e){e<this._geometry.lines.length&&t.select("line:nth-child("+(e+1)+")").attr("x1",h.event.x).attr("y1",h.event.y),e>0&&t.select("line:nth-child("+e+")").attr("x2",h.event.x).attr("y2",h.event.y)}},{key:"_updateSegmentTextPosition",value:function(t){var e=this;t<this._geometry.lines.length&&this._segmentText.select("text:nth-child("+(t+1)+")").attr("transform",function(t){var n=[h.event.x,h.event.y],r=e._projectionUtility.latLngToSvgPoint(t[1]);return e._doTextTransform(n,r)}).text(function(t){return e._helper.formatLength(e._helper.computeLengthBetween(e._projectionUtility.svgPointToLatLng([h.event.x,h.event.y]),t[1]))}),t>0&&this._segmentText.select("text:nth-child("+t+")").attr("transform",function(t){var n=e._projectionUtility.latLngToSvgPoint(t[0]),r=[h.event.x,h.event.y];return e._doTextTransform(n,r)}).text(function(t){return e._helper.formatLength(e._helper.computeLengthBetween(t[0],e._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])))})}},{key:"_updateNodeTextPosition",value:function(t){var e=this;this._nodeText.select("text:nth-child("+(t+1)+")").attr("x",h.event.x).attr("y",function(){var n=void 0;return n=t>0&&e._projectionUtility.latLngToSvgPoint(e._geometry.nodes[t-1])[1]<h.event.y?23:-7,h.event.y+n}),this._nodeText.select("text:nth-child("+(t+2)+")").attr("y",function(n){var r=void 0;return r=t+1>0&&h.event.y<e._projectionUtility.latLngToSvgPoint(n)[1]?23:-7,e._projectionUtility.latLngToSvgPoint(n)[1]+r}),this._nodeText.selectAll("text").filter(function(e,n){return n>=t}).text(function(n,r){var o=e._helper.computePathLength([].concat(i(e._geometry.nodes.slice(0,t)),[e._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])],i(e._geometry.nodes.slice(t+1,t+1+r))));return t+r===e._geometry.nodes.length-1&&(e._length=o),e._helper.formatLength(o)})}},{key:"_doTextTransform",value:function(t,e){var n=_.default.findMidPoint([t,e]),r=void 0;return r=t[0]===e[0]?e[1]>t[1]?90:e[1]<t[1]?270:0:180*Math.atan((e[1]-t[1])/(e[0]-t[0]))/Math.PI,"translate("+n[0]+", "+n[1]+") rotate("+r+")"}},{key:"_updateHoverCirclePosition",value:function(t,e){this._hoverCircle.select("circle").attr("cx",t).attr("cy",e)}},{key:"_hideHoverCircle",value:function(){this._hoverCircle.select("circle").attr("cx",null).attr("cy",null)}},{key:"_disableMapScroll",value:function(){this._map.setOptions({scrollwheel:!1,zoomControl:!1})}},{key:"_enableMapScroll",value:function(){this._map.setOptions({scrollwheel:!0,zoomControl:!0})}},{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,r=1/80*this.length,o=void 0,a=0;n>2&&(0===t?(o=this._helper.computeLengthBetween(this._geometry.nodes[n-1],e),a=o>r?0:this._helper.computeArea([e].concat(i(this._geometry.nodes.slice(1,n-1))))):t===n-1?(o=this._helper.computeLengthBetween(e,this._geometry.nodes[0]),a=o>r?0:this._helper.computeArea(this._geometry.nodes.slice(0,n-1))):t>0&&t<n-1?(o=this._helper.computeLengthBetween(this._geometry.nodes[0],this._geometry.nodes[n-1]),a=o>r?0:this._helper.computeArea([].concat(i(this._geometry.nodes.slice(0,t)),[e],i(this._geometry.nodes.slice(t+1))))):(o=this._helper.computeLengthBetween(this._geometry.nodes[0],this._geometry.nodes[n-1]),a=o>r?0:this._helper.computeArea(this._geometry.nodes))),this._area=a,a>0&&this._nodeText.select(":last-child").text("Total distance: "+this.lengthText+"; Total area: "+this.areaText+".")}}}]),t}();e.default=y,t.exports=e.default}])});
!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 r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.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=68)}([function(t,e,n){"use strict";function i(t,e){this._groups=t,this._parents=e}function r(){return new i([[document.documentElement]],U)}var o=n(59),a=n(60),s=n(48),u=n(42),c=n(16),l=n(47),h=n(52),f=n(55),p=n(62),d=n(40),g=n(54),v=n(53),_=n(61),m=n(46),y=n(45),x=n(39),A=n(63),w=n(56),b=n(41),C=n(64),L=n(49),T=n(57),k=n(51),E=n(38),B=n(50),P=n(58),M=n(43),S=n(6),j=n(44);n.d(e,"c",function(){return U}),e.b=i;var U=[null];i.prototype=r.prototype={constructor:i,select:o.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.a,property:w.a,classed:b.a,text:C.a,html:L.a,raise:T.a,lower:k.a,append:E.a,insert:B.a,remove:P.a,datum:M.a,on:S.c,dispatch:j.a},e.a=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2);n.d(e,"creator",function(){return i.a});var r=n(34);n.d(e,"local",function(){return r.a});var o=n(15);n.d(e,"matcher",function(){return o.a});var a=n(35);n.d(e,"mouse",function(){return a.a});var s=n(3);n.d(e,"namespace",function(){return s.a});var u=n(4);n.d(e,"namespaces",function(){return u.a});var c=n(36);n.d(e,"select",function(){return c.a});var l=n(37);n.d(e,"selectAll",function(){return l.a});var h=n(0);n.d(e,"selection",function(){return h.a});var f=n(7);n.d(e,"selector",function(){return f.a});var p=n(18);n.d(e,"selectorAll",function(){return p.a});var d=n(65);n.d(e,"touch",function(){return d.a});var g=n(66);n.d(e,"touches",function(){return g.a});var v=n(9);n.d(e,"window",function(){return v.a});var _=n(6);n.d(e,"event",function(){return _.a}),n.d(e,"customEvent",function(){return _.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 r(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var o=n(3),a=n(4);e.a=function(t){var e=n.i(o.a)(t);return(e.local?r:i)(e)}},function(t,e,n){"use strict";var i=n(4);e.a=function(t){var e=t+="",n=e.indexOf(":");return n>=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";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 r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}},function(t,e,n){"use strict";function i(t,e,n){return t=r(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function r(t,e,n){return function(i){var r=l;l=i;try{t.call(this,this.__data__,e,n)}finally{l=r}}}function o(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,r=-1,o=e.length;i<o;++i)n=e[i],t.type&&n.type!==t.type||n.name!==t.name?e[++r]=n:this.removeEventListener(n.type,n.listener,n.capture);++r?e.length=r:delete this.__on}}}function s(t,e,n){var o=c.hasOwnProperty(t.type)?i:r;return function(i,r,a){var s,u=this.__on,c=o(e,r,a);if(u)for(var l=0,h=u.length;l<h;++l)if((s=u[l]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=c,s.capture=n),void(s.value=e);this.addEventListener(t.type,c,n),s={type:t.type,name:t.name,value:e,listener:c,capture:n},u?u.push(s):this.__on=[s]}}function u(t,e,n,i){var r=l;t.sourceEvent=l,l=t;try{return e.apply(n,i)}finally{l=r}}n.d(e,"a",function(){return l}),e.b=u;var c={},l=null;if("undefined"!=typeof document){"onmouseenter"in document.documentElement||(c={mouseenter:"mouseover",mouseleave:"mouseout"})}e.c=function(t,e,n){var i,r,u=o(t+""),c=u.length;{if(!(arguments.length<2)){for(l=e?s:a,null==n&&(n=!1),i=0;i<c;++i)this.each(l(u[i],e,n));return this}var l=this.node().__on;if(l)for(var h,f=0,p=l.length;f<p;++f)for(i=0,h=l[f];i<c;++i)if((r=u[i]).type===h.type&&r.name===h.name)return h.value}}},function(t,e,n){"use strict";function i(){}e.a=function(t){return null==t?i:function(){return this.querySelector(t)}}},function(t,e,n){"use strict";var i=n(6);e.a=function(){for(var t,e=i.a;t=e.sourceEvent;)e=t;return e}},function(t,e,n){"use strict";e.a=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.UnitTypeId={METRIC:"metric",IMPERIAL:"imperial"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Config={version:"0.0.1",prefix:"measure-tool"}},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];"number"==typeof o&&(i[o]=!0)}for(r=0;r<e.length;r++){var a=e[r];"number"==typeof a[0]&&i[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(t,e,n){"use strict";function i(t,e){var i=t.document.documentElement,a=n.i(r.select)(t).on("dragstart.drag",null);e&&(a.on("click.drag",o.a,!0),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in i?a.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}var r=n(1),o=n(14);e.b=i,e.a=function(t){var e=t.document.documentElement,i=n.i(r.select)(t).on("dragstart.drag",o.a,!0);"onselectstart"in e?i.on("selectstart.drag",o.a,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}},function(t,e,n){"use strict";function i(){r.event.stopImmediatePropagation()}var r=n(1);e.b=i,e.a=function(){r.event.preventDefault(),r.event.stopImmediatePropagation()}},function(t,e,n){"use strict";var i=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var r=document.documentElement;if(!r.matches){var o=r.webkitMatchesSelector||r.msMatchesSelector||r.mozMatchesSelector||r.oMatchesSelector;i=function(t){return function(){return o.call(this,t)}}}}e.a=i},function(t,e,n){"use strict";function i(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}var r=n(17),o=n(0);e.b=i,e.a=function(){return new o.b(this._enter||this._groups.map(r.a),this._parents)},i.prototype={constructor:i,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}}},function(t,e,n){"use strict";e.a=function(t){return new Array(t.length)}},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){function n(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=f[i.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](i.parts[o]);for(;o<i.parts.length;o++)r.parts.push(u(i.parts[o],e))}else{for(var a=[],o=0;o<i.parts.length;o++)a.push(u(i.parts[o],e));f[i.id]={id:i.id,refs:1,parts:a}}}}function i(t){for(var e=[],n={},i=0;i<t.length;i++){var r=t[i],o=r[0],a=r[1],s=r[2],u=r[3],c={css:a,media:s,sourceMap:u};n[o]?n[o].parts.push(c):e.push(n[o]={id:o,parts:[c]})}return e}function r(t,e){var n=g(),i=m[m.length-1];if("top"===t.insertAt)i?i.nextSibling?n.insertBefore(e,i.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),m.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(e)}}function o(t){t.parentNode.removeChild(t);var e=m.indexOf(t);e>=0&&m.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",r(t,e),e}function s(t){var e=document.createElement("link");return e.rel="stylesheet",r(t,e),e}function u(t,e){var n,i,r;if(e.singleton){var u=_++;n=v||(v=a(e)),i=c.bind(null,n,u,!1),r=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),r=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=a(e),i=l.bind(null,n),r=function(){o(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 r()}}function c(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=y(e,r);else{var o=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}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 r=new Blob([n],{type:"text/css"}),o=t.href;t.href=URL.createObjectURL(r),o&&URL.revokeObjectURL(o)}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 r=i(t);return n(r,e),function(t){for(var o=[],a=0;a<r.length;a++){var s=r[a],u=f[s.id];u.refs--,o.push(u)}if(t){n(i(t),e)}for(var a=0;a<o.length;a++){var u=o[a];if(0===u.refs){for(var c=0;c<u.parts.length;c++)u.parts[c]();delete f[u.id]}}}};var y=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(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;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(11),s=n(67),u=i(s),c=function(){function t(e,n){r(this,t),this._defaultOptions={width:150},this._options=Object.assign({},this._defaultOptions,n||{}),this._parentDiv=e,this._containerDiv=document.createElement("div"),this._containerDiv.classList.add(a.Config.prefix+"-context-menu"),this._containerDiv.stylesheet=u.default,this._containerDiv.oncontextmenu=function(t){return t.preventDefault()},this._list=document.createElement("ul"),this._containerDiv.appendChild(this._list),e.appendChild(this._containerDiv),this._isVisible=!1}return o(t,[{key:"left",get:function(){return this._containerDiv.getBoundingClientRect().left}},{key:"top",get:function(){return this._containerDiv.getBoundingClientRect().top}},{key:"width",get:function(){return this._containerDiv.getBoundingClientRect().width}},{key:"height",get:function(){return this._containerDiv.getBoundingClientRect().height}}]),o(t,[{key:"addItem",value:function(t,e,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this,o=document.createElement("li"),a=document.createTextNode(t);return o.appendChild(a),o.onclick=function(t){t.preventDefault(),n.apply(r),i.hide()},e?this.showItem(o):this.hideItem(o),this._list.appendChild(o),o}},{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=c,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 r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();e.Geometry=function(){function t(){i(this,t),this._nodes=[]}return r(t,[{key:"nodes",get:function(){return this._nodes}},{key:"lines",get:function(){var t=[];if(this._nodes.length>1)for(var e=1;e<this._nodes.length;e++)t.push([this._nodes[e-1],this._nodes[e]]);return t}}]),r(t,[{key:"addNode",value:function(t){this._nodes.push(t)}},{key:"updateNode",value:function(t,e){this._nodes[t]=e}},{key:"removeNode",value:function(t){this._nodes.splice(t,1)}},{key:"insertNode",value:function(t,e){this._nodes.splice(t,0,e)}}]),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 r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(10),a=function(){function t(e){i(this,t),this._options={unit:o.UnitTypeId.METRIC},Object.assign(this._options,e),this.init()}return r(t,[{key:"init",value:function(){switch(this._options.unit.toLowerCase()){case o.UnitTypeId.METRIC:this._lengthMultiplier=1,this.formatLength=this._formatLengthMetric,this._areaMultiplier=1,this.formatArea=this._formatAreaMetric;break;case o.UnitTypeId.IMPERIAL:this._lengthMultiplier=3.28084,this.formatLength=this._formatLengthImperial,this._areaMultiplier=10.7639,this.formatArea=this._formatAreaImperial;break;default:this._lengthMultiplier=1,this.formatLength=this._formatLengthMetric,this._areaMultiplier=1,this.formatArea=this._formatAreaMetric}}},{key:"computeLengthBetween",value:function(t,e){return google.maps.geometry.spherical.computeDistanceBetween(new google.maps.LatLng(t[1],t[0]),new google.maps.LatLng(e[1],e[0]))*this._lengthMultiplier}},{key:"computePathLength",value:function(t){for(var e=0,n=1;n<t.length;n++)e+=google.maps.geometry.spherical.computeDistanceBetween(new google.maps.LatLng(t[n-1][1],t[n-1][0]),new google.maps.LatLng(t[n][1],t[n][0]));return e*this._lengthMultiplier}},{key:"computeArea",value:function(t){return google.maps.geometry.spherical.computeArea(t.map(function(t){return new google.maps.LatLng(t[1],t[0])}))*this._areaMultiplier}},{key:"_formatLengthMetric",value:function(t){var e=void 0;return t/1e3>=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:"_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:"makeId",value:function(t){return(Math.random().toString(36)+"00000000000000000").slice(2,t+2)}},{key:"_interpolate",value:function(t,e,n){var i=google.maps.geometry.spherical.interpolate(new google.maps.LatLng(t[1],t[0]),new google.maps.LatLng(e[1],e[0]),n);return[i.lng(),i.lat()]}}]),t}();e.default=a,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 r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=function(){function t(e,n,r){i(this,t),this._defaultOptions={offsetRate:8e3},this._options=Object.assign({},this._defaultOptions,r||{}),this._container=e,this._projection=n}return r(t,[{key:"latLngToSvgPoint",value:function(t){var e=this._options.offsetRate/2,n=new google.maps.LatLng(t[1],t[0]),i=this._projection.fromLatLngToDivPixel(n);return[i.x+e,i.y+e]}},{key:"svgPointToLatLng",value:function(t){var e=this._options.offsetRate/2,n=new google.maps.Point(t[0]-e,t[1]-e),i=this._projection.fromDivPixelToLatLng(n);return[i.lng(),i.lat()]}}]),t}();e.default=o,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(31);n.d(e,"drag",function(){return i.a});var r=n(13);n.d(e,"dragDisable",function(){return r.a}),n.d(e,"dragEnable",function(){return r.b})},function(t,e,n){var i=n(27);"string"==typeof i&&(i=[[t.i,i,""]]);n(19)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){e=t.exports=n(12)(),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:["/./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:"webpack://"}])},function(t,e,n){e=t.exports=n(12)(),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\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\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:["/./src/index.scss"],names:[],mappings:"AAEA;EACE,mBAAkB;EAClB,aAAY;EACZ,cAAa;EACb,cAAa;EACb,eAAc,EACf;;AAED;;EAEE,YAAW;EACX,cAAa;EACb,oBAAmB,EACpB;;AACD;EACE,cAAwB;EACxB,gBAA0B;EAC1B,oBAAmB;EACnB,qBAAoB,EACrB;;AAED;EACE,WAAU;EACV,cAAa;EACb,oBAAmB,EACpB;;AAED;EACE,WAAU;EACV,oBAAmB;EACnB,kBAAiB,EAClB;;AAED;EACE,cAAa;EACb,qBAAoB,EACrB;;AAED;EACE,kTAzCqC;EAiDrC,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}\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}\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}\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:"webpack://"}])},function(t,e,n){"use strict";var i=n(29);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<n;++e){if(!(t=arguments[e]+"")||t in i)throw new Error("illegal type: "+t);i[t]=[]}return new r(i)}function r(t){this._=t}function o(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",i=t.indexOf(".");if(i>=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,r=t.length;i<r;++i)if((n=t[i]).name===e)return n.value}function s(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=u,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}var u={value:function(){}};r.prototype=i.prototype={constructor:r,on:function(t,e){var n,i=this._,r=o(t+"",i),u=-1,c=r.length;{if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++u<c;)if(n=(t=r[u]).type)i[n]=s(i[n],t.name,e);else if(null==e)for(n in i)i[n]=s(i[n],t.name,null);return this}for(;++u<c;)if((n=(t=r[u]).type)&&(n=a(i[n],t.name)))return n}},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new r(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],o=0,n=i.length;o<n;++o)i[o].value.apply(e,r)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}},e.a=i},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e,n){"use strict";function i(){return!s.event.button}function r(){return this.parentNode}function o(t){return null==t?{x:s.event.x,y:s.event.y}:t}var a=n(28),s=n(1),u=n(13),c=n(14),l=n(30),h=n(32);e.a=function(){function t(t){t.on("mousedown.drag",e).on("touchstart.drag",d).on("touchmove.drag",g).on("touchend.drag touchcancel.drag",v).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function e(){if(!y&&x.apply(this,arguments)){var t=_("mouse",A.apply(this,arguments),s.mouse,this,arguments);t&&(n.i(s.select)(s.event.view).on("mousemove.drag",f,!0).on("mouseup.drag",p,!0),n.i(u.a)(s.event.view),n.i(c.b)(),m=!1,t("start"))}}function f(){n.i(c.a)(),m=!0,b.mouse("drag")}function p(){n.i(s.select)(s.event.view).on("mousemove.drag mouseup.drag",null),n.i(u.b)(s.event.view,m),n.i(c.a)(),b.mouse("end")}function d(){if(x.apply(this,arguments)){var t,e,i=s.event.changedTouches,r=A.apply(this,arguments),o=i.length;for(t=0;t<o;++t)(e=_(i[t].identifier,r,s.touch,this,arguments))&&(n.i(c.b)(),e("start"))}}function g(){var t,e,i=s.event.changedTouches,r=i.length;for(t=0;t<r;++t)(e=b[i[t].identifier])&&(n.i(c.a)(),e("drag"))}function v(){var t,e,i=s.event.changedTouches,r=i.length;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),t=0;t<r;++t)(e=b[i[t].identifier])&&(n.i(c.b)(),e("end"))}function _(e,i,r,o,a){var u,c,l,f=r(i,e),p=C.copy();if(n.i(s.customEvent)(new h.a(t,"beforestart",u,e,L,f[0],f[1],0,0,p),function(){return null!=(s.event.subject=u=w.apply(o,a))&&(c=u.x-f[0]||0,l=u.y-f[1]||0,!0)}))return function d(g){var v,_=f;switch(g){case"start":b[e]=d,v=L++;break;case"end":delete b[e],--L;case"drag":f=r(i,e),v=L}n.i(s.customEvent)(new h.a(t,g,u,e,v,f[0]+c,f[1]+l,f[0]-_[0],f[1]-_[1],p),p.apply,p,[g,o,a])}}var m,y,x=i,A=r,w=o,b={},C=n.i(a.a)("start","drag","end"),L=0;return t.filter=function(e){return arguments.length?(x="function"==typeof e?e:n.i(l.a)(!!e),t):x},t.container=function(e){return arguments.length?(A="function"==typeof e?e:n.i(l.a)(e),t):A},t.subject=function(e){return arguments.length?(w="function"==typeof e?e:n.i(l.a)(e),t):w},t.on=function(){var e=C.on.apply(C,arguments);return e===C?t:e},t}},function(t,e,n){"use strict";function i(t,e,n,i,r,o,a,s,u,c){this.target=t,this.type=e,this.subject=n,this.identifier=i,this.active=r,this.x=o,this.y=a,this.dx=s,this.dy=u,this._=c}e.a=i,i.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t}},function(t,e,n){"use strict";e.a=function(t){return function(){return t}}},function(t,e,n){"use strict";function i(){return new r}function r(){this._="@"+(++o).toString(36)}e.a=i;var o=0;r.prototype=i.prototype={constructor:r,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}}},function(t,e,n){"use strict";var i=n(8),r=n(5);e.a=function(t){var e=n.i(i.a)();return e.changedTouches&&(e=e.changedTouches[0]),n.i(r.a)(t,e)}},function(t,e,n){"use strict";var i=n(0);e.a=function(t){return"string"==typeof t?new i.b([[document.querySelector(t)]],[document.documentElement]):new i.b([[t]],i.c)}},function(t,e,n){"use strict";var i=n(0);e.a=function(t){return"string"==typeof t?new i.b([document.querySelectorAll(t)],[document.documentElement]):new i.b([null==t?[]:t],i.c)}},function(t,e,n){"use strict";var i=n(2);e.a=function(t){var e="function"==typeof t?t:n.i(i.a)(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}},function(t,e,n){"use strict";function i(t){return function(){this.removeAttribute(t)}}function r(t){return function(){this.removeAttributeNS(t.space,t.local)}}function o(t,e){return function(){this.setAttribute(t,e)}}function a(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function s(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function u(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var c=n(3);e.a=function(t,e){var l=n.i(c.a)(t);if(arguments.length<2){var h=this.node();return l.local?h.getAttributeNS(l.space,l.local):h.getAttribute(l)}return this.each((null==e?l.local?r:i:"function"==typeof e?l.local?u:s:l.local?a:o)(l,e))}},function(t,e,n){"use strict";e.a=function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}},function(t,e,n){"use strict";function i(t){return t.trim().split(/^|\s+/)}function r(t){return t.classList||new o(t)}function o(t){this._node=t,this._names=i(t.getAttribute("class")||"")}function a(t,e){for(var n=r(t),i=-1,o=e.length;++i<o;)n.add(e[i])}function s(t,e){for(var n=r(t),i=-1,o=e.length;++i<o;)n.remove(e[i])}function u(t){return function(){a(this,t)}}function c(t){return function(){s(this,t)}}function l(t,e){return function(){(e.apply(this,arguments)?a:s)(this,t)}}o.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=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 o=r(this.node()),a=-1,s=n.length;++a<s;)if(!o.contains(n[a]))return!1;return!0}return this.each(("function"==typeof e?l:e?u:c)(n,e))}},function(t,e,n){"use strict";function i(t,e,n,i,r,o){for(var s,u=0,c=e.length,l=o.length;u<l;++u)(s=e[u])?(s.__data__=o[u],i[u]=s):n[u]=new a.b(t,o[u]);for(;u<c;++u)(s=e[u])&&(r[u]=s)}function r(t,e,n,i,r,o,s){var c,l,h,f={},p=e.length,d=o.length,g=new Array(p);for(c=0;c<p;++c)(l=e[c])&&(g[c]=h=u+s.call(l,l.__data__,c,e),h in f?r[c]=l:f[h]=l);for(c=0;c<d;++c)h=u+s.call(t,o[c],c,o),(l=f[h])?(i[c]=l,l.__data__=o[c],f[h]=null):n[c]=new a.b(t,o[c]);for(c=0;c<p;++c)(l=e[c])&&f[g[c]]===l&&(r[c]=l)}var o=n(0),a=n(16),s=n(33),u="$";e.a=function(t,e){if(!t)return m=new Array(this.size()),d=-1,this.each(function(t){m[++d]=t}),m;var a=e?r:i,u=this._parents,c=this._groups;"function"!=typeof t&&(t=n.i(s.a)(t));for(var l=c.length,h=new Array(l),f=new Array(l),p=new Array(l),d=0;d<l;++d){var g=u[d],v=c[d],_=v.length,m=t.call(g,g&&g.__data__,d,u),y=m.length,x=f[d]=new Array(y),A=h[d]=new Array(y);a(g,v,x,A,p[d]=new Array(_),m,e);for(var w,b,C=0,L=0;C<y;++C)if(w=x[C]){for(C>=L&&(L=C+1);!(b=A[L])&&++L<y;);w._next=b||null}}return h=new o.b(h,u),h._enter=f,h._exit=p,h}},function(t,e,n){"use strict";e.a=function(t){return arguments.length?this.property("__data__",t):this.node().__data__}},function(t,e,n){"use strict";function i(t,e,i){var r=n.i(a.a)(t),o=r.CustomEvent;o?o=new o(e,i):(o=r.document.createEvent("Event"),i?(o.initEvent(e,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function r(t,e){return function(){return i(this,t,e)}}function o(t,e){return function(){return i(this,t,e.apply(this,arguments))}}var a=n(9);e.a=function(t,e){return this.each(("function"==typeof e?o:r)(t,e))}},function(t,e,n){"use strict";e.a=function(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r,o=e[n],a=0,s=o.length;a<s;++a)(r=o[a])&&t.call(r,r.__data__,a,o);return this}},function(t,e,n){"use strict";e.a=function(){return!this.node()}},function(t,e,n){"use strict";var i=n(17),r=n(0);e.a=function(){return new r.b(this._exit||this._groups.map(i.a),this._parents)}},function(t,e,n){"use strict";var i=n(0),r=n(15);e.a=function(t){"function"!=typeof t&&(t=n.i(r.a)(t));for(var e=this._groups,o=e.length,a=new Array(o),s=0;s<o;++s)for(var u,c=e[s],l=c.length,h=a[s]=[],f=0;f<l;++f)(u=c[f])&&t.call(u,u.__data__,f,c)&&h.push(u);return new i.b(a,this._parents)}},function(t,e,n){"use strict";function i(){this.innerHTML=""}function r(t){return function(){this.innerHTML=t}}function o(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}e.a=function(t){return arguments.length?this.each(null==t?i:("function"==typeof t?o:r)(t)):this.node().innerHTML}},function(t,e,n){"use strict";function i(){return null}var r=n(2),o=n(7);e.a=function(t,e){var a="function"==typeof t?t:n.i(r.a)(t),s=null==e?i:"function"==typeof e?e:n.i(o.a)(e);return this.select(function(){return this.insertBefore(a.apply(this,arguments),s.apply(this,arguments)||null)})}},function(t,e,n){"use strict";function i(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}e.a=function(){return this.each(i)}},function(t,e,n){"use strict";var i=n(0);e.a=function(t){for(var e=this._groups,n=t._groups,r=e.length,o=n.length,a=Math.min(r,o),s=new Array(r),u=0;u<a;++u)for(var c,l=e[u],h=n[u],f=l.length,p=s[u]=new Array(f),d=0;d<f;++d)(c=l[d]||h[d])&&(p[d]=c);for(;u<r;++u)s[u]=e[u];return new i.b(s,this._parents)}},function(t,e,n){"use strict";e.a=function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var a=i[r];if(a)return a}return null}},function(t,e,n){"use strict";e.a=function(){var t=new Array(this.size()),e=-1;return this.each(function(){t[++e]=this}),t}},function(t,e,n){"use strict";e.a=function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,r=t[e],o=r.length-1,a=r[o];--o>=0;)(i=r[o])&&(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 r(t,e){return function(){this[t]=e}}function o(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?o:r)(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),r=n(7);e.a=function(t){"function"!=typeof t&&(t=n.i(r.a)(t));for(var e=this._groups,o=e.length,a=new Array(o),s=0;s<o;++s)for(var u,c,l=e[s],h=l.length,f=a[s]=new Array(h),p=0;p<h;++p)(u=l[p])&&(c=t.call(u,u.__data__,p,l))&&("__data__"in u&&(c.__data__=u.__data__),f[p]=c);return new i.b(a,this._parents)}},function(t,e,n){"use strict";var i=n(0),r=n(18);e.a=function(t){"function"!=typeof t&&(t=n.i(r.a)(t));for(var e=this._groups,o=e.length,a=[],s=[],u=0;u<o;++u)for(var c,l=e[u],h=l.length,f=0;f<h;++f)(c=l[f])&&(a.push(t.call(c,c.__data__,f,l)),s.push(c));return new i.b(a,s)}},function(t,e,n){"use strict";e.a=function(){var t=0;return this.each(function(){++t}),t}},function(t,e,n){"use strict";function i(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var r=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,o=n.length,a=new Array(o),s=0;s<o;++s){for(var u,c=n[s],l=c.length,h=a[s]=new Array(l),f=0;f<l;++f)(u=c[f])&&(h[f]=u);h.sort(e)}return new r.b(a,this._parents).order()}},function(t,e,n){"use strict";function i(t){return function(){this.style.removeProperty(t)}}function r(t,e,n){return function(){this.style.setProperty(t,e,n)}}function o(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}var a=n(9);e.a=function(t,e,s){var u;return arguments.length>1?this.each((null==e?i:"function"==typeof e?o:r)(t,e,null==s?"":s)):n.i(a.a)(u=this.node()).getComputedStyle(u,null).getPropertyValue(t)}},function(t,e,n){"use strict";function i(){this.textContent=""}function r(t){return function(){this.textContent=t}}function o(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}e.a=function(t){return arguments.length?this.each(null==t?i:("function"==typeof t?o:r)(t)):this.node().textContent}},function(t,e,n){"use strict";var i=n(8),r=n(5);e.a=function(t,e,o){arguments.length<3&&(o=e,e=n.i(i.a)().changedTouches);for(var a,s=0,u=e?e.length:0;s<u;++s)if((a=e[s]).identifier===o)return n.i(r.a)(t,a);return null}},function(t,e,n){"use strict";var i=n(8),r=n(5);e.a=function(t,e){null==e&&(e=n.i(i.a)().touches);for(var o=0,a=e?e.length:0,s=new Array(a);o<a;++o)s[o]=n.i(r.a)(t,e[o]);return s}},function(t,e,n){var i=n(26);"string"==typeof i&&(i=[[t.i,i,""]]);n(19)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=n(25),u=(i(s),n(11)),c=n(20),l=i(c),h=n(1),f=n(23),p=i(f),d=n(21),g=n(24),v=n(22),_=i(v),m=n(10),y=function(){function t(e,n){o(this,t),this._options={showSegmentLength:!0,showAccumulativeLength:!0,contextMenu:!0,unit:m.UnitTypeId.METRIC},Object.assign(this._options,n),this._map=e,this._map.setClickableIcons(!1),this._id=_.default.makeId(4),this._init()}return a(t,[{key:"lengthText",get:function(){return this._helper.formatLength(this._length||0)}},{key:"areaText",get:function(){return this._helper.formatArea(this._area||0)}},{key:"length",get:function(){return this._length||0}},{key:"area",get:function(){return this._area||0}}],[{key:"version",get:function(){return u.Config.prefix+"-v"+u.Config.version}},{key:"UnitTypeId",get:function(){return m.UnitTypeId}}]),a(t,[{key:"_init",value:function(){this._options.contextMenu&&(this._contextMenu=new l.default(this._map.getDiv(),{width:160}),this._startElementNode=this._contextMenu.addItem("Measure distance",!0,this.start,this),this._endElementNode=this._contextMenu.addItem("Clear measurement",!1,this.end,this),this._bindToggleContextMenu()),this._helper=new _.default({unit:this._options.unit}),this._overlay=new google.maps.OverlayView,this._setOverlay()}},{key:"_bindToggleContextMenu",value:function(){var t=this;this._map.addListener("rightclick",function(e){t._firstClick=e,t._contextMenu.show(t._projection.fromLatLngToContainerPixel(e.latLng))}),document.addEventListener("keydown",function(e){27===e.which&&t._contextMenu.hide()}),this._map.getDiv().addEventListener("mousedown",function(e){e.clientX>=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._geometry=new d.Geometry,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)}},{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 d.Geometry,this._onRemoveOverlay(),this._setOverlay(),this._map.setOptions({draggableCursor:null}),this._started=!1)}},{key:"_setOverlay",value:function(){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._projection=this._overlay.getProjection(),this._projectionUtility=new p.default(this._map.getDiv(),this._projection),this._svgOverlay=(0,h.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)}},{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])}},{key:"_onRemoveOverlay",value:function(){(0,h.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;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){(0,h.select)(this).attr("r",6)}).on("mouseout",function(t){(0,h.select)(this).attr("r",5)}).on("touchstart",function(t){(0,h.select)(this).attr("r",6)}).on("touchleave",function(t){(0,h.select)(this).attr("r",5)}).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){(0,h.select)(this).attr("r",6)}).on("mouseout",function(t){(0,h.select)(this).attr("r",5)}).on("touchstart",function(t){(0,h.select)(this).attr("r",6)}).on("touchleave",function(t){(0,h.select)(this).attr("r",5)}).call(this._onDragCircle()),this._nodeCircles.selectAll(".removed-circle").remove()}},{key:"_updateLine",value:function(){var t=this,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]});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]}),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=_.default.findTouchPoint([t._projectionUtility.latLngToSvgPoint(e[0]),t._projectionUtility.latLngToSvgPoint(e[1])],[h.event.offsetX,h.event.offsetY]);t._updateHoverCirclePosition(n[0],n[1])}).on("mouseout",function(e){return t._hideHoverCircle()}).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=_.default.findTouchPoint([t._projectionUtility.latLngToSvgPoint(e[0]),t._projectionUtility.latLngToSvgPoint(e[1])],[h.event.offsetX,h.event.offsetY]);t._updateHoverCirclePosition(n[0],n[1])}).on("mouseout",function(e){return t._hideHoverCircle()}).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-after-edge").attr("transform",function(e){var n=t._projectionUtility.latLngToSvgPoint(e[0]),i=t._projectionUtility.latLngToSvgPoint(e[1]);return t._doTextTransform(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-after-edge").attr("transform",function(e){var n=t._projectionUtility.latLngToSvgPoint(e[0]),i=t._projectionUtility.latLngToSvgPoint(e[1]);return t._doTextTransform(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:"_onDragCircle",value:function(){var t=this,e=!1,n=(0,g.drag)().on("drag",function(n,i){e=!0,(0,h.select)(this).attr("cx",h.event.x).attr("cy",h.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([h.event.x,h.event.y]))});return n.on("start",function(e){h.event.sourceEvent.stopPropagation(),(0,h.select)(this).raise().attr("r",6),t._disableMapScroll()}),n.on("end",function(n,i){t._enableMapScroll(),e?t._geometry.updateNode(i,t._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])):i>0?(t._geometry.removeNode(i),(0,h.select)(this).classed("removed-circle",!0)):(t._geometry.addNode(n),t._dragged=!0),e=!1,t._overlay.draw()}),n}},{key:"_onDragLine",value:function(){var t=this,e=!1,n=(0,g.drag)().on("drag",function(n,i){e||(e=!0,t._geometry.insertNode(i+1,t._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])),t._updateLine(),t._options.showSegmentLength&&t._updateSegmentText(),t._options.showAccumulativeLength&&t._updateNodeText()),t._updateHoverCirclePosition(h.event.x,h.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([h.event.x,h.event.y]))});return n.on("start",function(){h.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([h.event.x,h.event.y])),t._hideHoverCircle(),t._overlay.draw(),e=!1),t._updateArea(i+1,t._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])),t._hoverCircle.select("circle").attr("class","grey-circle")}),n}},{key:"_updateLinePosition",value:function(t,e){e<this._geometry.lines.length&&t.select("line:nth-child("+(e+1)+")").attr("x1",h.event.x).attr("y1",h.event.y),e>0&&t.select("line:nth-child("+e+")").attr("x2",h.event.x).attr("y2",h.event.y)}},{key:"_updateSegmentTextPosition",value:function(t){var e=this;t<this._geometry.lines.length&&this._segmentText.select("text:nth-child("+(t+1)+")").attr("transform",function(t){var n=[h.event.x,h.event.y],i=e._projectionUtility.latLngToSvgPoint(t[1]);return e._doTextTransform(n,i)}).text(function(t){return e._helper.formatLength(e._helper.computeLengthBetween(e._projectionUtility.svgPointToLatLng([h.event.x,h.event.y]),t[1]))}),t>0&&this._segmentText.select("text:nth-child("+t+")").attr("transform",function(t){var n=e._projectionUtility.latLngToSvgPoint(t[0]),i=[h.event.x,h.event.y];return e._doTextTransform(n,i)}).text(function(t){return e._helper.formatLength(e._helper.computeLengthBetween(t[0],e._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])))})}},{key:"_updateNodeTextPosition",value:function(t){var e=this;this._nodeText.select("text:nth-child("+(t+1)+")").attr("x",h.event.x).attr("y",function(){var n=void 0;return n=t>0&&e._projectionUtility.latLngToSvgPoint(e._geometry.nodes[t-1])[1]<h.event.y?23:-7,h.event.y+n}),this._nodeText.select("text:nth-child("+(t+2)+")").attr("y",function(n){var i=void 0;return i=t+1>0&&h.event.y<e._projectionUtility.latLngToSvgPoint(n)[1]?23:-7,e._projectionUtility.latLngToSvgPoint(n)[1]+i}),this._nodeText.selectAll("text").filter(function(e,n){return n>=t}).text(function(n,i){var o=e._helper.computePathLength([].concat(r(e._geometry.nodes.slice(0,t)),[e._projectionUtility.svgPointToLatLng([h.event.x,h.event.y])],r(e._geometry.nodes.slice(t+1,t+1+i))));return t+i===e._geometry.nodes.length-1&&(e._length=o),e._helper.formatLength(o)})}},{key:"_doTextTransform",value:function(t,e){var n=_.default.findMidPoint([t,e]),i=void 0;return i=t[0]===e[0]?e[1]>t[1]?90:e[1]<t[1]?270:0:180*Math.atan((e[1]-t[1])/(e[0]-t[0]))/Math.PI,"translate("+n[0]+", "+n[1]+") rotate("+i+")"}},{key:"_updateHoverCirclePosition",value:function(t,e){this._hoverCircle.select("circle").attr("cx",t).attr("cy",e)}},{key:"_hideHoverCircle",value:function(){this._hoverCircle.select("circle").attr("cx",null).attr("cy",null)}},{key:"_disableMapScroll",value:function(){this._map.setOptions({scrollwheel:!1,zoomControl:!1})}},{key:"_enableMapScroll",value:function(){this._map.setOptions({scrollwheel:!0,zoomControl:!0})}},{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,o=void 0,a=0;n>2&&(0===t?(o=this._helper.computeLengthBetween(this._geometry.nodes[n-1],e),a=o>i?0:this._helper.computeArea([e].concat(r(this._geometry.nodes.slice(1,n-1))))):t===n-1?(o=this._helper.computeLengthBetween(e,this._geometry.nodes[0]),a=o>i?0:this._helper.computeArea(this._geometry.nodes.slice(0,n-1))):t>0&&t<n-1?(o=this._helper.computeLengthBetween(this._geometry.nodes[0],this._geometry.nodes[n-1]),a=o>i?0:this._helper.computeArea([].concat(r(this._geometry.nodes.slice(0,t)),[e],r(this._geometry.nodes.slice(t+1))))):(o=this._helper.computeLengthBetween(this._geometry.nodes[0],this._geometry.nodes[n-1]),a=o>i?0:this._helper.computeArea(this._geometry.nodes))),this._area=a,a>0&&this._nodeText.select(":last-child").text("Total distance: "+this.lengthText+"; Total area: "+this.areaText+".")}}}]),t}();e.default=y,t.exports=e.default}])});
{
"name": "measuretool-googlemaps-v3",
"version": "0.0.4",
"version": "0.0.5",
"description": "This is an in-progress handy measurement tool for Google Maps API V3 similar to what Google Maps offers.",

@@ -36,3 +36,2 @@ "main": "lib/index.js",

"d3-drag": "^1.0.3",
"d3-geo": "^1.6.1",
"d3-selection": "^1.0.4",

@@ -39,0 +38,0 @@ "node-sass": "^4.5.0",

# Measurement Tool for Google Maps API V3
A handy measurement widget for Google Maps API v3. The functionalities are implemented as close as what current Google Maps offers.
A handy measurement widget for Google Maps API v3. The functionalities are implemented as close as to what current Google Maps offers.

@@ -10,5 +10,11 @@ ## Demo

## Developer Usage
To create the measurement widget, pass in a `MeasureTool Object Specification`
```JavaScript
## Developer usage
#### Basic use
To create the measurement widget, pass in a Google Map instance.
```javascript
var measureTool = new MeasureTool(map);
```
#### Pass in `MeasureToolOptions`
You could also pass in a `MeasureToolOptions` as the second argument to customize to your preference.
```javascript
var measureTool = new MeasureTool(map, {

@@ -19,17 +25,24 @@ showSegmentLength: true,

```
#### Bind to your own UI
The `MeasureTool` comes with a context menu out of box for saving your time to create your own. However, if you'd like to bind the `MeasureTool` to your own UI, you could specify `contextMenu` to `false` when constructing the `MeasureTool`. The `MeasureTool` exposes two public methods `start()` and `end()` to start and end measuring. For example,
```html
<button onclick="measureTool.start()">start</button>
<button onclick="measureTool.end()">end</button>
```
```javascript
var measureTool = new MeasureTool(map, {
contextMenu: false
// some other options...
});
```
## User Usage
To start measuring, right click a map and choose measure distance.
## User usage
1. To **start** measuring, *right click* the map and choose **Measure distance**.
1. *Left click* the map, and the measurement between the two locations will display. Keep clicking to **add** more measurement waypoints.
1. To **remove** a waypoint, *left click* on the waypoint *(the first point cannot be removed)*.
1. To **insert** a waypoint on the measurement line, click the line. Waypoints can be moved by *clicking and dragging* them.
1. When the *first* point and the *last* point are close enough, the **area** will display.
1. To **end** measuring, *right click* the map and choose **Clear measurement**.
To end measuring, right click a map and choose clear measurement.
To add a way point, click on the map.
To remove a way point, click on the waypoint (the first point can not be removed).
To insert a way point, hover on the line and drag it.
When the first point and the last point are close enough, the area will show.
## API

@@ -39,11 +52,16 @@ ### MeasureTool class

|-----------|-----------|
|MeasureTool(map:`google.maps.Map`, opts?:`MeasureToolOptions`)|Creates a new measure tool for the `google.maps.Map` instance.|
|**MeasureTool(map:`google.maps.Map`, opts?:`MeasureToolOptions`)**|Creates a new measure tool for the `google.maps.Map` instance.|
|Methods|Description|
|-------|-----------|
|**end()**|Return Value: **None** - starts measuring.|
|**start()**|Return Value: **None** - ends measuring.|
|Properties|Description|
|-------|-----------|
|area|Type: `number` - the total area of the enclosed polygon, the unit is **m²** for `metric` unit and **ft²** for `imperial` unit.|
|areaText|Type: `string` - the formatted total area with unit of the enclosed polygon.|
|length|Type: `number` - the total length of the path drawn, the unit is **m** for `metric` unit and **ft** for `imperial` unit.|
|lengthText|Type: `string` - the formatted total length with unit of the path drawn.|
|version|Type: `string` - the current version number of **`MeasureTool`**|
|**area**|Type: `number` - the total area of the enclosed polygon, the unit is **m²** for `metric` unit and **ft²** for `imperial` unit.|
|**areaText**|Type: `string` - the formatted total area with unit of the enclosed polygon.|
|**length**|Type: `number` - the total length of the path drawn, the unit is **m** for `metric` unit and **ft** for `imperial` unit.|
|**lengthText**|Type: `string` - the formatted total length with unit of the path drawn.|
|**version**|Type: `string` - the current version number of **`MeasureTool`**|

@@ -53,4 +71,4 @@ ### MeasureToolOptions object specification

|-------|-----------|
|showSegmentLength|Type: `boolean` - display segment length along the path. Enabled by default.|
|unit|Type: `UnitTypeId` - the unit type to use for the measured length and area. Defaults to `MeasureTool.UnitTypeId.METRIC`.|
|**showSegmentLength**|Type: `boolean` - display segment length along the path. Enabled by default.|
|**unit**|Type: `UnitTypeId` - the unit type to use for the measured length and area. Defaults to `MeasureTool.UnitTypeId.METRIC`.|

@@ -62,4 +80,3 @@ ### UnitTypeId constants

|--------|-----------|
|IMPERIAL|This unit type shows measured length in US foot (ft) and mile (mi), and area in US square foot (ft²) and square mile (mi²).|
|METRIC|This unit type shows measured length in meter (m) and kilometer (km), and area in square meter (m²) and square kilometer (km²).|
|**IMPERIAL**|This unit type shows measured length in US foot (ft) and mile (mi), and area in US square foot (ft²) and square mile (mi²).|
|**METRIC**|This unit type shows measured length in meter (m) and kilometer (km), and area in square meter (m²) and square kilometer (km²).|

@@ -52,4 +52,4 @@ import {UnitTypeId} from './UnitTypeId';

static computePixelLength(p1, p2) {
return Math.sqrt(Math.pow(p1[0] - p2[0], 2) + Math.pow(p1[1] - p2[1], 2));
static makeId(n) {
return (Math.random().toString(36)+'00000000000000000').slice(2, n + 2);
}

@@ -56,0 +56,0 @@ /**

@@ -24,2 +24,3 @@ import css from 'index.scss';

showAccumulativeLength: true,
contextMenu: true,
unit: UnitTypeId.METRIC

@@ -30,2 +31,3 @@ };

this._map.setClickableIcons(false);
this._id = Helper.makeId(4);
this._init();

@@ -35,5 +37,8 @@ }

_init() {
this._contextMenu = new ContextMenu(this._map.getDiv(), { width: 160 });
this._startElementNode = this._contextMenu.addItem("Measure distance", true, this._startMeasure, this);
this._endElementNode = this._contextMenu.addItem("Clear measurement", false, this._endMeasure, this);
if (this._options.contextMenu) {
this._contextMenu = new ContextMenu(this._map.getDiv(), { width: 160 });
this._startElementNode = this._contextMenu.addItem("Measure distance", true, this.start, this);
this._endElementNode = this._contextMenu.addItem("Clear measurement", false, this.end, this);
this._bindToggleContextMenu();
}

@@ -45,3 +50,2 @@ this._helper = new Helper({

this._setOverlay();
this._bindToggleContextMenu();
}

@@ -70,16 +74,28 @@

_startMeasure() {
console.log("start measure");
/**
* start measuring
*/
start() {
if (this._started) return;
this._geometry = new Geometry();
this._checkClick(this._firstClick);
this._contextMenu.toggleItems([this._endElementNode], [this._startElementNode]);
if (this._options.contextMenu && this._firstClick) {
this._checkClick(this._firstClick);
this._contextMenu.toggleItems([this._endElementNode], [this._startElementNode]);
}
this._mapClickEvent = this._map.addListener('click', mouseEvent => this._checkClick(mouseEvent));
this._mapZoomChangedEvent = this._map.addListener('zoom_changed', () => this._redrawOverlay());
this._map.setOptions({draggableCursor: 'default'});
this._started = true;
}
_endMeasure() {
console.log("end measure");
this._contextMenu.toggleItems([this._startElementNode], [this._endElementNode]);
/**
* end measuring
*/
end() {
if (!this._started) return;
if (this._options.contextMenu) {
this._contextMenu.toggleItems([this._startElementNode], [this._endElementNode]);
}

@@ -93,2 +109,3 @@ this._mapClickEvent.remove();

this._map.setOptions({draggableCursor: null});
this._started = false;
}

@@ -108,4 +125,6 @@

this._svgOverlay = select(this._overlay.getPanes().overlayMouseTarget)
.append('div').attr('id', `${Config.prefix}-svg-container`).attr('class',`${Config.prefix}-measure-points`)
.append('svg').attr('class',`${Config.prefix}-svg-overlay`);
.append('div')
.attr('class',`${Config.prefix}-measure-points-${this._id}`)
.append('svg')
.attr('class',`${Config.prefix}-svg-overlay`);

@@ -175,3 +194,3 @@ this._linesBase = this._svgOverlay

_onRemoveOverlay() {
select(`.${Config.prefix}-measure-points`).remove();
select(`.${Config.prefix}-measure-points-${this._id}`).remove();
}

@@ -192,3 +211,3 @@

// Use circle radius 'r' as a flag to determine if it is a delete or add event.
if(this._nodeCircles.selectAll('circle[r="6"]').size() == 0 &&
if(!this._dragged && this._nodeCircles.selectAll('circle[r="6"]').size() == 0 &&
!this._hoverCircle.select("circle").attr('cx')) {

@@ -199,3 +218,3 @@ let latLng = [mouseEvent.latLng.lng(), mouseEvent.latLng.lat()];

}
this._dragged = false;
}

@@ -390,3 +409,3 @@

self._geometry.addNode(d);
// self._overlay.draw();
self._dragged = true;
}

@@ -393,0 +412,0 @@ } else {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc