webpack-bootstrap-ui-kit/dist/js/app_Site.Controllers.MapElementController.js

1 line
12 KiB
JavaScript
Raw Normal View History

2020-12-24 23:42:33 +01:00
!function(){"use strict";var e={n:function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return e.d(t,{a:t}),t},d:function(o,t){for(var n in t)e.o(t,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:t[n]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)}},o=jQuery,t=e.n(o),n="ajax-load",a="load",r="map-loaded",i="map-api-loaded",c="map-marker-click",l="map-popup-close";function s(e){return(s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,o){for(var t=0;t<o.length;t++){var n=o[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,o){return(p=Object.setPrototypeOf||function(e,o){return e.__proto__=o,e})(e,o)}function f(e){var o=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=m(e);if(o){var a=m(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return d(this,t)}}function d(e,o){return!o||"object"!==s(o)&&"function"!==typeof o?g(e):o}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v={init:function(){return function(e){!function(e,o){if("function"!==typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(o&&o.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),o&&p(e,o)}(i,google.maps.OverlayView);var o,n,a,r=f(i);function i(e){var o;!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,i);var t=g(o=r.call(this));return t.setMap(e.map),t.position=e.position,t.html=e.html?e.html:'<div class="mapboxgl-marker"><i class="marker-icon fas fa-map-marker-alt"></i></div>',t.divClass=e.divClass,t.align=e.align,t.isDebugMode=e.debug,t.onClick=e.onClick,t.onMouseOver=e.onMouseOver,t.isBoolean=function(e){return"boolean"===typeof e},t.isNotUndefined=function(e){return"undefined"!==typeof e},t.hasContent=function(e){return e.length>0},t.isString=function(e){return"string"===typeof e},t.isFunction=function(e){return"function"===typeof e},o}return o=i,(n=[{key:"onAdd",value:function(){var e=this;e.div=document.createElement("div"),e.div.style.position="absolute",e.isNotUndefined(e.divClass)&&e.hasContent(e.divClass)&&(e.div.className=e.divClass),e.isNotUndefined(e.html)&&e.hasContent(e.html)&&e.isString(e.html)&&(e.div.innerHTML=e.html),e.isBoolean(e.isDebugMode)&&e.isDebugMode&&(e.div.className="debug-mode",e.div.innerHTML='<div style="height: 10px; width: 10px; background: red; border-radius: 100%;"></div><div style="position: absolute; top: 5px; padding: 5px; width: 130px; text-align: center; font-size: 18px; text-transform: uppercase; font-weight: bolder; background: red; color: white; font-family: Arial;">Debug mode</div>',e.div.setAttribute("style","position: absolute;border: 5px dashed red;height: 150px;width: 150px;display: flex;justify-content: center;align-items: center;")),e.getPanes().overlayMouseTarget.appendChild(e.div),google.maps.event.addDomListener(e.div,"click",(function(o){google.maps.event.trigger(e,"click"),e.isFunction(e.onClick)&&e.onClick(),o.stopPropagation()})),google.maps.event.addDomListener(e.div,"mouseover",(function(o){google.maps.event.trigger(e,"mouseover"),e.isFunction(e.onMouseOver)&&e.onMouseOver(),o.stopPropagation()}))}},{key:"draw",value:function(){var e=this,o=t()(e.div).find(".mapboxgl-marker,.marker-pin,.mapboxgl-popup,.popup");o.length||(o=t()(e.div));var n=e.getProjection().fromLatLngToDivPixel(new google.maps.LatLng(