silverstripe-webpack/app/client/dist/js/app_Site.Controllers.MapEle...

1 line
30 KiB
JavaScript
Raw Normal View History

2021-08-02 22:17:27 +02:00
!function(){"use strict";var e="ajax-load",t="load-ready",r="map-loaded",o="map-api-loaded",s="map-marker-click",n="map-popup-close",i=function extendStatics(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function __extends(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var a=function __assign(){return(a=Object.assign||function __assign(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};var l=function OverlayViewSafe(){!function extend(e,t){for(var r in t.prototype)e.prototype[r]=t.prototype[r]}(OverlayViewSafe,google.maps.OverlayView)};function toCssText(e){return Object.keys(e).reduce((function(t,r){return e[r]&&t.push(r+":"+e[r]),t}),[]).join(";")}function coercePixels(e){return e?e+"px":void 0}var u=function(e){function ClusterIcon(t,r){var o=e.call(this)||this;return o.cluster_=t,o.styles_=r,o.center_=null,o.div_=null,o.sums_=null,o.visible_=!1,o.style=null,o.setMap(t.getMap()),o}return __extends(ClusterIcon,e),ClusterIcon.prototype.onAdd=function(){var e,t,r=this,o=this.cluster_.getMarkerClusterer(),s=google.maps.version.split("."),n=s[0],i=s[1],a=100*parseInt(n,10)+parseInt(i,10);this.div_=document.createElement("div"),this.visible_&&this.show(),this.getPanes().overlayMouseTarget.appendChild(this.div_),this.boundsChangedListener_=google.maps.event.addListener(this.getMap(),"bounds_changed",(function(){t=e})),google.maps.event.addDomListener(this.div_,"mousedown",(function(){e=!0,t=!1})),google.maps.event.addDomListener(this.div_,"contextmenu",(function(){google.maps.event.trigger(o,"contextmenu",r.cluster_)})),a>=332&&google.maps.event.addDomListener(this.div_,"touchstart",(function(e){e.stopPropagation()})),google.maps.event.addDomListener(this.div_,"click",(function(s){if(e=!1,!t){if(google.maps.event.trigger(o,"click",r.cluster_),google.maps.event.trigger(o,"clusterclick",r.cluster_),o.getZoomOnClick()){var n=o.getMaxZoom(),i=r.cluster_.getBounds();o.getMap().fitBounds(i),setTimeout((function(){o.getMap().fitBounds(i),null!==n&&o.getMap().getZoom()>n&&o.getMap().setZoom(n+1)}),100)}s.cancelBubble=!0,s.stopPropagation&&s.stopPropagation()}})),google.maps.event.addDomListener(this.div_,"mouseover",(function(){google.maps.event.trigger(o,"mouseover",r.cluster_)})),google.maps.event.addDomListener(this.div_,"mouseout",(function(){google.maps.event.trigger(o,"mouseout",r.cluster_)}))},ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},ClusterIcon.prototype.draw=function(){if(this.visible_){var e=this.getPosFromLatLng_(this.center_);this.div_.style.top=e.y+"px",this.div_.style.left=e.x+"px"}},ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},ClusterIcon.prototype.show=function(){this.div_&&(this.div_.className=this.className_,this.div_.style.cssText=this.createCss_(this.getPosFromLatLng_(this.center_)),this.div_.innerHTML=(this.style.url?this.getImageElementHtml():"")+this.getLabelDivHtml(),"undefined"===typeof this.sums_.title||""===this.sums_.title?this.div_.title=this.cluster_.getMarkerClusterer().getTitle():this.div_.title=this.sums_.title,this.div_.style.display=""),this.visible_=!0},ClusterIcon.prototype.getLabelDivHtml=function(){return'\n<div aria-label="'+this.cluster_.getMarkerClusterer().ariaLabelFn(this.sums_.text)+'" style="'+toCssText({position:"absolute",top:coercePixels(this.anchorText_[0]),left:coercePixels(this.anchorText_[1]),color:this.style.textColor,"font-size":coercePixels(this.style.textSize),"font-