@syncfusion/ej2-maps
Version:
The Maps component is used to visualize the geographical data and represent the statistical data of a particular geographical area on earth with user interactivity, and provides various customizing options
10 lines • 396 kB
JavaScript
/*!
* filename: ej2-maps.umd.min.js
* version : 29.1.33
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2SvgBase,e.ej2Data,e.ej2PdfExport)}(this,function(e,Y,k,C,_){"use strict";M=function(e,t){return(M=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var M,L=function(e,t){function i(){this.constructor=e}M(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},W=function(e,t){this.width=e,this.height=t};function P(e,t){return"string"!=typeof e?e:Y.isNullOrUndefined(e)?null:-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10)}function w(e){e.element.style.height=Y.isNullOrUndefined(e.height)?"auto":e.height,e.element.style.width=Y.isNullOrUndefined(e.width)?"auto":e.width,e.element.style.setProperty("display","block");var t=e.element.clientWidth,i=e.element.clientHeight,o="string"==typeof e.element.style.width?P(e.element.style.width,t):e.element.style.width,n="string"==typeof e.element.style.height?P(e.element.style.height,i):e.element.style.height;new W(0,0);return"0px"===e.width||"0%"===e.width||"0%"===e.height||"0px"===e.height?new W(0,0):new W(P(e.width,t)||t||o||600,P(e.height,i)||i||n||(e.isDevice?Math.min(window.innerWidth,window.innerHeight):450))}function N(e){e.renderer=new k.SvgRenderer(e.element.id),e.availableSize=w(e),e.svgObject=e.renderer.createSvg({id:e.element.id+"_svg",width:e.availableSize.width,height:e.availableSize.height}),"0px"!==e.width&&"0%"!==e.width&&"0%"!==e.height&&"0px"!==e.height||(e.svgObject.setAttribute("height","0"),e.svgObject.setAttribute("width","0"))}function F(e,t,i){var o=i.getBoundingClientRect(),n=i.ownerDocument.defaultView.pageXOffset,l=i.ownerDocument.defaultView.pageYOffset,a=i.ownerDocument.documentElement.clientTop,i=i.ownerDocument.documentElement.clientLeft,n=o.left+n-i,i=o.top+l-a;return new T(e-n,t-i)}function z(e){return e*(Math.PI/180)}function j(e){return e*(180/Math.PI)}function A(e,t,i,o,n){var l,a,r,s=new W(n.mapAreaRect.width,n.mapAreaRect.height),d=n.baseMapBounds.longitude,p=n.baseMapBounds.latitude,h=z(e),m=z(t),c=Y.isNullOrUndefined(n.projectionType)?"Mercator":n.projectionType,u=n.isTileMap?256*Math.pow(2,1):Y.isNullOrUndefined(i)?Math.min(s.width,s.height):Math.min(s.width,s.height)*i;if("Normal"===o.geometryType)y=Y.isNullOrUndefined(i)?t:Math.abs((t-d.min)*i),b=Y.isNullOrUndefined(i)?e:Math.abs((p.max-e)*i);else if("Geographic"===o.geometryType){switch(c){case"Mercator":var g=new J(u/2,u/2),y=g.x+t*(u/360),f=te(Math.sin(z(e)),-.9999,.9999),b=g.y+.5*Math.log((1+f)/(1-f))*-(u/(2*Math.PI));break;case"Winkel3":r=((l=H(m,h)).x+m/(Math.PI/2))/2,a=(l.y+h)/2;break;case"Miller":r=m,a=1.25*Math.log(Math.tan(Math.PI/4+.4*h));break;case"Eckert3":r=2/(S=Math.sqrt(Math.PI*(4+Math.PI)))*m*(1+Math.sqrt(1-4*h*h/(Math.PI*Math.PI))),a=4/S*h;break;case"AitOff":r=(l=H(m,h)).x,a=l.y;break;case"Eckert5":r=m*(1+Math.cos(h))/Math.sqrt(2+Math.PI),a=2*h/Math.sqrt(2+Math.PI);break;case"Equirectangular":r=m,a=h;break;case"Eckert6":for(var S=(1+Math.PI/2)*Math.sin(h),v=1/0,x=0;x<10&&1e-6<Math.abs(v);x++)h-=v=(h+Math.sin(h)-S)/(1+Math.cos(h));S=Math.sqrt(2+Math.PI),r=m*(1+Math.cos(h))/S,a=2*h/S}y="Mercator"===c?y:X(V(n,j(r)),3),b="Mercator"===c?b:-X(G(n,j(a)),3)}return new J(y,b)}function D(o,n,l,e){var a="";return!Y.isNullOrUndefined(e)&&1<e.length&&(Array.prototype.forEach.call(e,function(e,t){var i=e.latitude,e=e.longitude,i=o.isTileMap?R(new T(e,i),n,o.tileTranslatePoint,!0):A(i,e,n,l,o);a+=0===t?"M "+i.x+" "+i.y:" L "+i.x+" "+i.y}),a+=" z "),a}function R(e,t,i,o){var t=256*Math.pow(2,t),n=(e.x+180)/360,l=Math.sin(e.y*Math.PI/180),l=.5-Math.log((1+l)/(1-l))/(4*Math.PI),a=e.x,e=e.y;return o&&(a=n*t+.5+i.x,e=l*t+.5+i.y),{x:a,y:e}}function V(e,t){var i=e.baseMapBounds.longitude,e=Y.isNullOrUndefined(e.baseSize)?e.mapAreaRect.width:e.mapAreaRect.width+Math.abs(e.baseSize.width-e.mapAreaRect.width)/2;return Math.round(e*(t-i.min)/(i.max-i.min)*100)/100}function G(e,t){var i=e.baseMapBounds.latitude;return Math.round(e.mapAreaRect.height*(t-i.min)/(i.max-i.min)*100)/100}function H(e,t){var i=Math.cos(t),o=$(ee(i*Math.cos(e/=2)));return new J(2*i*Math.sin(e)*o,Math.sin(t)*o)}function X(e,t){t=Math.pow(10,t);return Math.round(e*t)/t}function $(e){return e/Math.sin(e)}function ee(e){return Math.acos(e)}function te(e,t,i){return Y.isNullOrUndefined(t)||(e=Math.max(e,t)),e=Y.isNullOrUndefined(i)?e:Math.min(e,i)}function ie(e,t,i,o){Y.createElement("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(o?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function oe(e,t){this.x=e,this.y=t}function ne(e,t){this.latitude=e,this.longitude=t}var J=function(e,t){this.x=e,this.y=t},le=function(e,t){this.min=e,this.max=t},ae=function(e,t){this.latitude=new le(e.min,e.max),this.longitude=new le(t.min,t.max)};function q(e,t){var i=document.getElementById("mapsmeasuretext");return null===i&&((i=document.createElement("text")).id="mapsmeasuretext",document.body.appendChild(i)),i.innerText=e,i.style.cssText="position: absolute; font-size: "+("number"==typeof t.size?t.size+"px":t.size)+"; font-weight: "+t.fontWeight+"; font-style: "+t.fontStyle+"; font-family: "+t.fontFamily+"; visibility: hidden; top: -100; left: 0; whiteSpace: nowrap; lineHeight: normal",new W(i.clientWidth,i.clientHeight)}function re(e,t){var i=document.createElement("canvas").getContext("2d");i.font=t.fontStyle+" "+t.fontWeight+" "+("number"==typeof t.size?t.size+"px":t.size)+" "+t.fontFamily;i=i.measureText(e).width,e=parseFloat(t.size)||16;return new W(i,e)}var se,de=function(e,t,i,o,n,l,a){void 0===l&&(l=""),this.transform="",this.baseLine="auto",this.id=e,this.text=n,this.transform=l,this.anchor=o,this.x=t,this.y=i,this.baseLine=a},B=function(e,t,i,o,n,l,a,r){this.id=e,this["fill-opacity"]=n,this["stroke-opacity"]=l,this.fill=t,this.stroke=o,this["stroke-width"]=i,this["stroke-dasharray"]=a,this.d=r},pe=function(e,t,i){this.r=e,this.g=t,this.b=i},Q=(L(he,se=B),he);function he(e,t,i,o,n,l,a,r,s){e=se.call(this,e,t,i.width,i.color,o,i.opacity)||this;return e.y=n.y,e.x=n.x,e.height=n.height,e.width=n.width,e.rx=l||0,e.ry=a||0,e.transform=r||"",e["stroke-dasharray"]=s,e["fill-opacity"]=o,e["stroke-opacity"]=i.opacity,e}L(ue,me=B);var me,ce=ue;function ue(e,t,i,o,n,l,a,r){e=me.call(this,e,t,i.width,i.color,o,i.opacity,r)||this;return e.cy=l,e.cx=n,e.r=a,e["stroke-dasharray"]=r,e["fill-opacity"]=o,e["stroke-opacity"]=i.opacity,e}L(fe,ge=B);var ge,ye=fe;function fe(e,t,i,o,n,l,a,r){e=ge.call(this,e,i,o,n,l=void 0===l?1:l,a=void 0===a?1:a,r=void 0===r?"":r)||this;return e.points=t,e}L(ve,be=ye);var be,Se=ve;function ve(e,t,i,o,n,l,a,r){return be.call(this,e,t,i,o,n,l=void 0===l?1:l,a=void 0===a?1:a,r=void 0===r?"":r)||this}L(Ce,xe=B);var xe,L=Ce;function Ce(e,t,i,o,n,l,a,r){e=xe.call(this,e,i,o,n,l=void 0===l?1:l,a=void 0===a?1:a,r=void 0===r?"":r)||this;return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}function Oe(e,t,i,o){this.x1=e,this.y1=t,this.x2=i,this.y2=o}function _e(e,t,i,o,n,l,a,r,s){void 0===l&&(l="userSpaceOnUse"),void 0===a&&(a="userSpaceOnUse"),void 0===r&&(r=""),void 0===s&&(s=""),this.id=e,this.x=t,this.y=i,this.width=o,this.height=n,this.patternUnits=l,this.patternContentUnits=a,this.patternTransform=r,this.href=s}var T=function(e,t){this.x=e,this.y=t},K=function(e,t,i,o){this.x=e,this.y=t,this.width=i,this.height=o};function Me(e,t,i,o,n){void 0===n&&(n=!1);var l,i={id:e.id,x:e.x,y:e.y,fill:i,"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine},a="string"==typeof e.text||"number"==typeof e.text?e.text:n?e.text[e.text.length-1]:e.text[0],r=new k.SvgRenderer(""),s=r.createText(i,a);if(s.style["user-select"]="none",s.style["font-family"]=t.fontFamily,s.style["font-size"]=t.size,s.style["font-weight"]=t.fontWeight,s.style["font-color"]=t.color,s.style["-moz-user-select"]="none",s.style["-webkit-touch-callout"]="none",s.style["-webkit-user-select"]="none",s.style["-khtml-user-select"]="none",s.style["-ms-user-select"]="none",s.style["-o-user-select"]="none","string"!=typeof e.text&&1<e.text.length)for(var d=1,p=e.text.length;d<p;d++)l=q(e.text[d],t).height,l=r.createTSpan({x:e.x,id:e.id,y:e.y+(n?-d*l:d*l)},n?e.text[e.text.length-(d+1)]:e.text[d]),s.appendChild(l);return o.appendChild(s),s}function Le(e,t,i,o,n,l){for(var a=Y.createElement("div",{id:t,className:n.element.id+"_marker_template_element"}),r=(a.style.cssText="position: absolute;pointer-events: auto;",e.length);0<r;)a.appendChild(e[0]),r--;if(!n.isReact||"function"!==l){for(var s=a.innerHTML,d=Object.keys(i),p=RegExp,h=0;h<d.length;h++)"object"==typeof i[d[h]]?s=we(s,"",i,n):"latitude"!==d[h].toLowerCase()&&"longitude"!==d[h].toLowerCase()&&(s=s.replace(new p("{{:"+d[h]+"}}","g"),i[d[h].toString()]));a.innerHTML=s}return a}function Pe(e,t){t=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e;return t}function we(e,t,i,o){for(var n=""===e?t:e,l=""===e?n.split("${"):n.split("{{:"),a=RegExp,r=0;r<l.length;r++)if(-1<l[r].indexOf("}}")&&-1<l[r].indexOf(".")||-1<l[r].indexOf("}")&&-1<l[r].search("."))for(var s,d=""===e?l[r].split("}"):l[r].split("}}"),p=0;p<d.length;p++)-1<d[p].indexOf(".")&&(s=U(i,d[p]).toString(),n=""===e?n.split("${"+d[p]+"}").join(Pe(s,o)):n.replace(new a("{{:"+d[p]+"}}","g"),s));return n}function Te(e,t,i){for(var o=(Y.isNullOrUndefined(e.childElementCount)?e[0]:e).outerHTML,n=Object.keys(i),l=RegExp,a=0;a<n.length;a++)o=o.replace(new l("{{:"+n[a]+"}}","g"),i[n[a].toString()]);e=Y.createElement("div",{id:t,innerHTML:o});return e.style.position="absolute",e}function Ie(e,t,i,o,n,l,a){var r,s,d=n.size,p=n.borderColor,h=parseFloat(n.borderWidth),m=parseFloat(n.borderOpacity),c=n.fill,u=n.dashArray,g={color:p,width:h,opacity:m},n=n.opacity,h=new B(o,c,h,p,n,m,u,"");return d.width="string"==typeof d.width?parseInt(d.width,10):d.width,d.height="string"==typeof d.height?parseInt(d.height,10):d.height,"Circle"===e?(p=(d.width+d.height)/4,m=new ce(o,c,g,n,i.x,i.y,p,u),a.renderer.drawCircle(m)):"Rectangle"===e?(r=i.x-d.width/2,s=i.y-d.height/2,p=new Q(o,c,g,n,new K(r,s,d.width,d.height),null,null,"",u),a.renderer.drawRectangle(p)):"Image"===e?(r=i.x-d.width/2,s=i.y-(-1<o.indexOf("cluster")?d.height/2:d.height),Y.merge(h,{href:t,height:d.height,width:d.width,x:r,y:s}),a.renderer.drawImage(h)):Xe(a,e,h,d,i,l)}function U(e,t){if(!Y.isNullOrUndefined(e)&&!Y.isNullOrUndefined(t)){var i=t.replace(/\[/g,".").replace(/\]/g,"").split(".");if(1===i.length)e=e[i[0]];else for(var o=0;o<i.length&&!Y.isNullOrUndefined(e);o++)e=e[i[o]]}return e}function ke(e,t){var i=!Y.isNullOrUndefined(e.colorValuePath)&&-1<e.colorValuePath.indexOf(".")?U(t,e.colorValuePath).toString():t[e.colorValuePath];return e.fill=Y.isNullOrUndefined(e.colorValuePath)||Y.isNullOrUndefined(i)?e.fill:-1<e.colorValuePath.indexOf(".")?U(t,e.colorValuePath).toString():t[e.colorValuePath],e}function Ne(e,t){return Y.isNullOrUndefined(e.shapeValuePath)||Y.isNullOrUndefined(t[e.shapeValuePath])?(Ee(e,t),ze(e,t)):(Ee(e,t),"Image"===t[e.shapeValuePath]&&ze(e,t)),e}function Fe(e,t){return-1<e.indexOf(".")?U(t,e).toString():t[e]}function Ee(e,t){Y.isNullOrUndefined(e.shapeValuePath)||(t=Fe(e.shapeValuePath,t),e.shape=Y.isNullOrUndefined(t)||""===t.toString()?e.shape:t)}function ze(e,t){Y.isNullOrUndefined(e.imageUrlValuePath)||(t=Fe(e.imageUrlValuePath,t),e.imageUrl=Y.isNullOrUndefined(t)?e.imageUrl:t)}function Be(s,d,p,h,m,c,n,l,a,u,r){var g,y,f,b,S,v,x,C=[],O=[],_=0,M=0,L=s.markerSettings[m],P=0,w=[],T=!r&&s.markerClusterSettings.allowClustering?s.markerClusterSettings:L.clusterSettings,I=T.labelStyle,k=p.renderer.createGroup({id:p.element.id+"_LayerIndex_"+h+"_markerCluster"}),N={cancel:!1,name:Ro,fill:T.fill,height:T.height,width:T.width,imageUrl:T.imageUrl,shape:T.shape,data:void 0,maps:p,cluster:T,border:T.border},F=p.element.getBoundingClientRect(),E=(p.isTileMap?new Object:lt(p,s,!1),p.isTileMap||(x=p.mapLayerPanel.calculateFactor(s)),!1),z=p.isTileMap?p.tileZoomLevel:p.mapScaleValue,B=L.clusterSettings.allowClustering||s.markerClusterSettings.allowClustering&&1<s.markerSettings.length?d.querySelectorAll("[id*='LayerIndex_"+h+"_MarkerIndex_"+m+"']:not([id*='_Group'])"):d.childNodes;return p.trigger("markerClusterRendering",N,function(e){for(Array.prototype.forEach.call(B,function(e,i){var t,o,n,l,a,r;w=[],"hidden"!==e.style.visibility?(g=(v=e).getBoundingClientRect(),w.push(i),Y.isNullOrUndefined(g)||(t=0<p.markerModule.zoomedMarkerCluster.length&&p.markerModule.zoomedMarkerCluster[h]&&p.markerModule.zoomedMarkerCluster[h][i]&&0<p.markerModule.zoomedMarkerCluster[h][i].length||0<p.markerModule.initialMarkerCluster.length&&p.markerModule.initialMarkerCluster[h]&&p.markerModule.initialMarkerCluster[h][i]&&0<p.markerModule.initialMarkerCluster[h][i].length?(p.previousScale<z?p.markerModule.zoomedMarkerCluster:p.markerModule.initialMarkerCluster)[h][i]:null,Y.isNullOrUndefined(t)||0===t.length||L.clusterSettings.allowClustering?Array.prototype.forEach.call(B,function(e,t){i+1<=t&&"hidden"!==e.style.visibility&&Ue(e,g,C,w,t)}):Array.prototype.forEach.call(t,function(e){var t;i!==e&&(t=document.getElementById(p.element.id+"_LayerIndex_"+h+"_MarkerIndex_"+m+"_dataIndex_"+e))&&"hidden"!==t.style.visibility&&Ue(t,g,C,w,e)}),Ae(p,z,h,i,w),_=g.left+g.width/2,M=g.top+g.height,0<C.length&&(w=w.filter(function(e,t,i){return i.indexOf(e)===t}),_-=F.left,M-=p.availableSize.height<=F.height?F.top:F.bottom-F.top,t=parseInt(e.id.split("_dataIndex_")[1].split("_")[0],10),o=parseInt(e.id.split("_MarkerIndex_")[1].split("_")[0],10),l=(n=s.markerSettings[o]).dataSource[t],a=Y.isNullOrUndefined(n.longitudeValuePath)?Y.isNullOrUndefined(l.longitude)?Y.isNullOrUndefined(l.Longitude)?0:parseFloat(l.Longitude):parseFloat(l.longitude):Number(U(l,n.longitudeValuePath)),l=Y.isNullOrUndefined(n.latitudeValuePath)?Y.isNullOrUndefined(l.latitude)?Y.isNullOrUndefined(l.Latitude)?0:parseFloat(l.Latitude):parseFloat(l.latitude):Number(U(l,n.latitudeValuePath)),p.isTileMap?p.isTileMap&&(r=R(new J(a,l),p.tileZoomLevel,p.tileTranslatePoint,!0)):r=A(l,a,x,s,p),e.style.visibility="hidden",N.cancel?(S={size:new W(T.width,T.height),fill:T.fill,borderColor:T.border.color,borderWidth:T.border.width,opacity:T.opacity,dashArray:T.dashArray,imageUrl:T.imageUrl,shape:T.shape}).borderOpacity=(Y.isNullOrUndefined(T.border.opacity)?T:T.border).opacity:(S={size:new W(N.width,N.height),fill:N.fill,borderColor:N.border.color,borderWidth:N.border.width,opacity:T.opacity,dashArray:T.dashArray,imageUrl:N.imageUrl,shape:N.shape}).borderOpacity=(Y.isNullOrUndefined(N.border.opacity)?T:N.border).opacity,_=p.isTileMap||-1<d.id.indexOf("_Markers_Group")?_:_+3.75-N.width/2,M=p.isTileMap||-1<d.id.indexOf("_Markers_Group")?M:M-N.height/2,M=p.isTileMap?(_=r.x,r.y):(_=(r.x+(Y.isNullOrUndefined(p.translatePoint)||0===p.translatePoint.x||p.isResize?u.location:p.translatePoint).x)*(Y.isNullOrUndefined(p.scale)?u:p).scale+n.offset.x,(r.y+(Y.isNullOrUndefined(p.translatePoint)||0===p.translatePoint.y||p.isResize?u.location:p.translatePoint).y)*(Y.isNullOrUndefined(p.scale)?u:p).scale+n.offset.y),l=p.element.id+"_LayerIndex_"+h+"_MarkerIndex_"+o+"_dataIndex_"+t+"_cluster_"+P,a=p.element.id+"_LayerIndex_"+h+"_MarkerIndex_"+o+"_dataIndex_"+t+"_cluster_"+P+"_datalabel_"+P,P++,(e=Ie(S.shape,S.imageUrl,{x:0,y:0},l,S,c,p)).setAttribute("transform","translate( "+_+" "+M+" )"),"Balloon"===N.shape?e.children[0].textContent=w.toString():e.textContent=w.toString(),f=new de(a,0,3.75,"middle",(C.length+1).toString(),"",""),(f=Me(f,I,I.color,c)).setAttribute("transform","translate( "+_+" "+M+" )"),r=parseFloat(e.id.split("_MarkerIndex_")[1]),n.clusterSettings.allowClustering&&r===o||s.markerClusterSettings.allowClustering&&1<s.markerSettings.length&&r===o?(k.appendChild(e),k.appendChild(f)):(k.appendChild(f),k.appendChild(e)))),C=[]):Ae(p,z,h,i,w),E=!0}),n.appendChild(k),p.svgObject.appendChild(n),p.element.appendChild(p.svgObject),T.allowDeepClustering&&!r&&Array.prototype.forEach.call(k.childNodes,function(e,t){if("hidden"!==e.style.visibility&&(g=(v=e).getBoundingClientRect(),!(Y.isNullOrUndefined(g)||-1<v.id.indexOf("_datalabel_")))){for(var i=t+1;i<k.childElementCount;i++)"hidden"!==k.childNodes[i].style.visibility&&(b=k.childNodes[i],y=b.getBoundingClientRect(),Y.isNullOrUndefined(y)||-1<b.id.indexOf("_datalabel_")||g.left>y.right||g.right<y.left||g.top>y.bottom||g.bottom<y.top||(O.push(b),O.push(k.childNodes[i-1]),k.childNodes[i].style.visibility="hidden",n=Y.isNullOrUndefined(k.childNodes[i+1])?null:parseFloat(k.childNodes[i+1].id.split("_MarkerIndex_")[1]),L.clusterSettings.allowClustering&&n===m||s.markerClusterSettings.allowClustering&&1<s.markerSettings.length&&n===m?k.childNodes[i+1].style.visibility="hidden":(n=parseFloat(k.childNodes[i-1].id.split("_MarkerIndex_")[1]),k.childNodes[i-1].style.visibility=n===m?"hidden":k.childNodes[i-1].style.visibility),w.push(i)));if(0<O.length){v=e;for(var o=0;o<O.length;o++){"g"===v.tagName?v.childNodes[0].textContent=v.childNodes[0].textContent+","+O[o].textContent:v.textContent=v.textContent+","+O[o].textContent;var n=parseFloat(k.childNodes[t+1].id.split("_MarkerIndex_")[1]);L.clusterSettings.allowClustering&&n===m||s.markerClusterSettings.allowClustering&&1<s.markerSettings.length&&n===m?k.childNodes[t+1].textContent=(+k.childNodes[t+1].textContent+ +O[o+1].textContent).toString():(n=parseFloat(k.childNodes[t-1].id.split("_MarkerIndex_")[1]),k.childNodes[t-1].textContent=n===m?(+k.childNodes[t-1].textContent+ +O[o+1].textContent).toString():k.childNodes[t-1].textContent),o++}}O=[]}});0<k.childNodes.length;){var t=parseFloat(k.childNodes[0].id.split("_MarkerIndex_")[1]);L.clusterSettings.allowClustering&&t===m||s.markerClusterSettings.allowClustering&&1<s.markerSettings.length&&t===m?c.insertBefore(k.childNodes[0],null):t===m&&c.insertBefore(k.childNodes[0],c.firstChild)}l||Z(p.element.id+"_Secondary_Element").appendChild(c);var i=document.getElementById(p.element.id+"_LayerIndex_"+h+"_Polygon_Group"),o=document.getElementById(p.element.id+"_LayerIndex_"+h+"_Polygons_Group"),i=(Y.isNullOrUndefined(i)&&!p.isTileMap?n.insertBefore(c,n.firstChild):p.isTileMap?Y.isNullOrUndefined(o)?Y.isNullOrUndefined(i)?n.insertBefore(c,n.firstChild):i.insertAdjacentElement("afterend",c):o.insertAdjacentElement("afterend",c):n.appendChild(c),document.getElementById(p.element.id+"_LayerIndex_"+h+"_markerCluster"));Y.isNullOrUndefined(i)||i.remove(),a&&(o=document.getElementById(p.element.id+"_Layer_Collections"),i=document.getElementById(p.element.id+"_LayerIndex_"+(h+1)),Y.isNullOrUndefined(o)||Y.isNullOrUndefined(i)?Y.isNullOrUndefined(o)||o.appendChild(n):o.insertBefore(n,i))}),E}function Ae(e,t,i,o,n){var l;1===t?(l=!Y.isNullOrUndefined(e.markerModule.initialMarkerCluster[i][o])&&1<n.length?n:[],e.markerModule.initialMarkerCluster[i][o]=l,l=!Y.isNullOrUndefined(e.markerModule.zoomedMarkerCluster[i][o])&&1<n.length?n:[],e.markerModule.zoomedMarkerCluster[i][o]=l):1<t&&(e.markerModule.zoomedMarkerCluster[i][o]=1<n.length?n:[])}function Ue(e,t,i,o,n){var l=e.getBoundingClientRect();Y.isNullOrUndefined(l)||t.left>l.right||t.right<l.left||t.top>l.bottom||t.bottom<l.top||(i.push(l),e.style.visibility="hidden",o.push(n))}function Ze(e,t){for(var i,o=e[0].layerIndex,n=e[0].targetClusterIndex,l=e[0].markerIndex,a=e[0].dataIndex,r=t.element.id+"_LayerIndex_"+o+"_MarkerIndex_"+l,a=r+"_dataIndex_"+a+"_cluster_"+n,s="Balloon"===t.layers[o].markerClusterSettings.shape?E(a+"_Group"):E(a),a=E(a+"_datalabel_"+n),d=(s.setAttribute("visibility","visible"),a.setAttribute("visibility","visible"),e[0].data.length),p=0;p<d;p++)(i=E(r+"_dataIndex_"+e[0].data[p].index+"_Group")?E(r+"_dataIndex_"+e[0].data[p].index+"_Group"):E(r+"_dataIndex_"+e[0].data[p].index)).style.visibility="hidden",-1<i.id.indexOf("Group")&&(E(r+"_dataIndex_"+e[0].data[p].index).style.visibility="hidden");I(t.element.id+"_LayerIndex_"+o+"_MarkerIndex_"+l+"_markerClusterConnectorLine")}function je(e,t,i,o){for(var n=e[0].layerIndex,l=e[0].markerIndex,a=e[0].targetClusterIndex,r=e[0].dataIndex,s=o?E:i.querySelector.bind(i),d=o?"":"#",p=t.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+l,h=t.layers[n],m=!t.markerModule.allowInnerClusterSetting(h)&&h.markerClusterSettings.allowClustering?h.markerClusterSettings:h.markerSettings[l].clusterSettings,h=h.markerSettings[l],c=p+"_dataIndex_"+r+"_cluster_"+a,u="Balloon"===m.shape?s(d+c+"_Group"):s(d+c),c=s(d+c+"_datalabel_"+a),g=(u.setAttribute("visibility","hidden"),c.setAttribute("visibility","hidden"),s(d+p+"_dataIndex_"+r+"_Group")?s(d+p+"_dataIndex_"+r+"_Group"):s(d+p+"_dataIndex_"+r)),y=(-1<g.parentElement.id.indexOf("Template_Group")?g.getBoundingClientRect():h).height,f=(-1<g.parentElement.id.indexOf("Template_Group")?g.getBoundingClientRect():h).width,b=+u.getAttribute("transform").split("translate(")[1].trim().split(" ")[0],S=+u.getAttribute("transform").split("translate(")[1].trim().split(" ")[1].split(")")[0].trim(),v=(f="string"==typeof f?parseFloat(f):f)+5,x=6.28*v,C=0,O=Math.round(x/f),_=(C+=O,e[0].data.length),M=Math.round(y/x*100),L=(_<O?100/_:M)/100*360,P=_<O?45:0,w=1,T="M "+b+" "+S+" ",I="",k=0;k<_;k++){if(C===k||360<=Math.round(P)){for(P=0,x=6.28*(v=(f+5)*++w),O=Math.round(x/y),M=Math.round(y/x*100);M*O<100;)O++;L=M/100*360,C+=O}var N=b+v*Math.sin(2*Math.PI*P/360),F=S+v*Math.cos(2*Math.PI*P/360);I+=T+"L "+N+" "+F+" ",-1<(g=s(d+p+"_dataIndex_"+e[0].data[k].index+"_Group")?s(d+p+"_dataIndex_"+e[0].data[k].index+"_Group"):s(d+p+"_dataIndex_"+e[0].data[k].index)).parentElement.id.indexOf("Template_Group")&&(g.style.transform="",g.style.left=t.isTileMap?N-f/2+"px":N-f/2-10+"px",g.style.top=t.isTileMap?F-y/2+"px":F-y/2-10+"px"),g.setAttribute("transform","translate( "+N+" "+F+")"),g.style.visibility="visible",-1<g.id.indexOf("Group")&&(s(d+p+"_dataIndex_"+e[0].data[k].index).style.visibility="visible"),P+=L}a=m.connectorLineSettings,c={d:I,id:t.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+l+"_dataIndex_"+r+"_markerClusterConnectorLine",stroke:a.color,"fill-opacity":a.opacity,"stroke-opacity":a.opacity,"stroke-width":a.width};i=o?s(t.element.id+"_Markers_Group"):i;i=s(t.element.id+"_LayerIndex_"+n).querySelector("#"+i.id);u=t.renderer.createGroup({id:t.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+l+"_markerClusterConnectorLine"});u.appendChild(t.renderer.drawPath(c)),"Balloon"===h.shape?i.insertBefore(u,i.querySelector("#"+p+"_dataIndex_0_Group")):i.insertBefore(u,i.querySelector("#"+p+"_dataIndex_0"))}function De(e,t,i,o,n,l,a,r,s,d,p){var h={size:new W(e.width,e.height),fill:e.fill,borderColor:e.border.color,borderWidth:e.border.width,opacity:t.opacity,dashArray:t.dashArray,borderOpacity:(Y.isNullOrUndefined(e.border.opacity)?t:e.border).opacity},e=(I(a),Ie(e.shape,e.imageUrl,{x:0,y:0},a,h,p,d)),a=(d.isTileMap?n.x:(n.x+l.x)*s)+(Y.isNullOrUndefined(r)||Y.isNullOrUndefined(r.x)?0:r.x),h=(d.isTileMap?n.y:(n.y+l.y)*s)+(Y.isNullOrUndefined(r)||Y.isNullOrUndefined(r.y)?0:r.y),l=(e.setAttribute("transform","translate( "+a+" "+h+" )"),Ve(d.selectedMarkerElementId,d.markerSelectionClass,e,"MarkerselectionMapStyle"),d.legendSettings.toggleLegendSettings.enable&&"Markers"===d.legendSettings.type&&(n=parseInt(e.id.split("_LayerIndex_")[1],10),Ge(d.toggledElementId,"g"===e.tagName?e.children[0]:e,d.legendSettings.toggleLegendSettings.applyShapeSettings?d.layers[n].shapeSettings:d.legendSettings.toggleLegendSettings)),p.appendChild(e),i.length-1===o?"marker":null),s=new J(a,h);return(0<t.animationDuration||"Enable"===Y.animationMode)&&bt(e,t.animationDelay,t.animationDuration,s,d,l),p}function Re(e,t,i,o,n,l,a,r,s,d,p){if((t=pt(e.template,p))&&t(o,p,e.template,p.element.id+"_MarkerTemplate"+n,!1).length){for(var h=Le(t(o,p,e.template,p.element.id+"_MarkerTemplate"+n,!1),i,o,0,p,typeof e.template),m=0;m<h.children.length;m++)h.children[m].style.pointerEvents="auto";h.style.left=(p.isTileMap?a.x:(a.x+r.x)*s)+d.x-(p.isTileMap?0:p.mapAreaRect.x)+"px",h.style.top=(p.isTileMap?a.y:(a.y+r.y)*s)+d.y-(p.isTileMap?0:p.mapAreaRect.y)+"px",h.style.transform="translate(-50%, -50%)",l.appendChild(h)}return l}function Ve(e,t,i,o){if(e)for(var n=0;n<e.length;n++)i.getAttribute("id")===e[n]&&(0!==n&&"g"!==i.tagName||(Y.isNullOrUndefined(t)||Y.isNullOrUndefined(t.id)||document.body.appendChild(t),-1<i.id.indexOf("_MarkerIndex_")&&0<i.childElementCount&&i.children[0].setAttribute("class",o)),i.setAttribute("class",o))}function Ge(e,t,i){if(!Y.isNullOrUndefined(e)&&0<e.length)for(var o=0;o<e.length;o++)e[o]===t.id&&(t.setAttribute("fill",i.fill),t.setAttribute("stroke",i.border.color),t.setAttribute("fill-opacity",i.opacity.toString()),t.setAttribute("stroke-opacity",(Y.isNullOrUndefined(i.border.opacity)?i:i.border).opacity.toString()),t.setAttribute("stroke-width",(Y.isNullOrUndefined(i.border.width)?0:i.border.width).toString()))}function He(e,t,i,o,n,l,a){E(e)||((e=Y.createElement("style",{id:e})).innerText="."+t+"{fill:"+i+";opacity:"+o+";stroke-width:"+l+";stroke:"+n+";}",a.shapeSelectionClass=e,document.body.appendChild(e))}function s(e,t){return t&&t.appendChild(e),e}function We(e,t,i){return s(e.renderer.drawCircle(t),i)}function qe(e,t,i){return s(e.renderer.drawRectangle(t),i)}function Xe(e,t,i,o,n,l){var a;switch(t){case"Balloon":a=Ye(e,i,o,n,"Marker",l);break;case"Cross":i.d="M "+n.x+" "+(n.y-o.height/2)+" L "+n.x+" "+(n.y+o.height/2)+" M "+(n.x-o.width/2)+" "+n.y+" L "+(n.x+o.width/2)+" "+n.y;break;case"Diamond":i.d="M "+n.x+" "+(n.y-o.height/2)+" L "+(n.x+o.width/2)+" "+n.y+" L "+n.x+" "+(n.y+o.height/2)+" L "+(n.x-o.width/2)+" "+n.y+" Z";break;case"Star":i.d="M "+(n.x+o.width/3)+" "+(n.y+o.height/2)+" L "+(n.x-o.width/2)+" "+(n.y-o.height/6)+" L "+(n.x+o.width/2)+" "+(n.y-o.height/6)+" L "+(n.x-o.width/3)+" "+(n.y+o.height/2)+" L "+n.x+" "+(n.y-o.height/2)+" L "+(n.x+o.width/3)+" "+(n.y+o.height/2)+" Z";break;case"Triangle":i.d="M "+n.x+" "+(n.y-o.height/2)+" L "+(n.x+o.width/2)+" "+(n.y+o.height/2)+" L "+(n.x-o.width/2)+" "+(n.y+o.height/2)+" Z";break;case"HorizontalLine":i.d=" M "+(n.x-o.width/2)+" "+n.y+" L "+(n.x+o.width/2)+" "+n.y;break;case"VerticalLine":i.d="M "+n.x+" "+(n.y-o.height/2)+" L "+n.x+" "+(n.y+o.height/2);break;case"InvertedTriangle":i.d="M "+(n.x-o.width/2)+" "+(n.y-o.height/2)+" L "+(n.x+o.width/2)+" "+(n.y-o.height/2)+" L "+n.x+" "+(n.y+o.height/2)+" Z";break;case"Pentagon":for(var r,s,d=0;d<5;d++)r=o.width/2*Math.cos(Math.PI/180*(72*d)),s=o.height/2*Math.sin(Math.PI/180*(72*d)),i.d+=(0===d?"M ":"L ")+(n.x+r)+" "+(n.y+s);i.d+=" Z"}return"Cross"!==t&&"HorizontalLine"!==t&&"VerticalLine"!==t||(i.stroke="transparent"===i.stroke?i.fill:i.stroke),"Balloon"===t?a:e.renderer.drawPath(i)}function Ye(e,t,i,o,n,l){var a=i.width,r=i.height,a=(o.x-=a/2,o.y-=-1<t.id.indexOf("cluster")?r/2:-1<t.id.indexOf("Legend")?r/1.25:r,t.d="M15,0C8.8,0,3.8,5,3.8,11.2C3.8,17.5,9.4,24.4,15,30c5.6-5.6,11.2-12.5,11.2-18.8C26.2,5,21.2,0,15,0z M15,16c-2.8,0-5-2.2-5-5s2.2-5,5-5s5,2.2,5,5S17.8,16,15,16z",e.renderer.drawPath(t)),r=i.width/30,i=i.height/30;return a.setAttribute("transform","translate("+o.x+", "+o.y+") scale("+r+", "+i+")"),"Marker"===n?(s(a,o=e.renderer.createGroup({id:t.id+"_Group"})),s(o,l)):a}function Je(e,t,i,o,n){if(!Y.isNullOrUndefined(t)&&!Y.isNullOrUndefined(e)&&!Y.isNullOrUndefined(i))for(var l=0;l<e.length;l++){var a=-1<i.indexOf(".")?U(e[l],i):e[l][i],r=Qe(a,o,t);if((!Y.isNullOrUndefined(a)&&isNaN(t[r])&&"string"==typeof a?a.toLowerCase():a)===(!Y.isNullOrUndefined(t[r])&&isNaN(t[r])?t[r].toLowerCase():t[r]))return l}return null}function Qe(e,t,i){if(!Y.isNullOrUndefined(e)&&!Y.isNullOrUndefined(i)&&!Y.isNullOrUndefined(t))for(var o="[object Array]"===Object.prototype.toString.call(t)?t:[t],n=0;n<o.length;n++)if((Y.isNullOrUndefined(e)||"string"!=typeof e?e:e.toLowerCase())===(!Y.isNullOrUndefined(i[o[n]])&&isNaN(i[o[n]])?i[o[n]].toLowerCase():i[o[n]]))return o[n];return null}function Ke(e,t,i){for(var o=[],n=0;n<e.length;n++){var l=e[n];t<=l.y&&i>=l.y&&o.push(l)}return o}function $e(e,t,i,o,n){return n===o?(t-e)/100+e:(t-e)/100*(100/(n-o)*(i-o))+e}function et(e,t,i){if(!e.length)return null;for(var o,n,l,a,r=e.length,s=0,d=0,p=0,h=0;h<=r-1;h++)o=e[h].x,n="Mercator"===t||"Normal"===i?e[h].y:-e[h].y,a=h===r-1?(l=e[0].x,"Mercator"===t||"Normal"===i?e[0].y:-e[0].y):(l=e[h+1].x,"Mercator"===t||"Normal"===i?e[h+1].y:-e[h+1].y),s+=Math.abs(o*a-l*n),d+=Math.abs((o+l)*(o*a-l*n)),p+=Math.abs((n+a)*(o*a-l*n));s*=.5;for(var m=e.some(function(e){return e.x<5&&e.y<5})&&"Normal"===i?6:4,d=0!==s?1/(m*s)*d:0,p=0!==s?1/(m*s)*p:0,c={x:0,y:0},u={x:0,y:0},g={x:0,y:0},y={x:0,y:0},f={x:0,y:0},b={x:0,y:0},S={x:0,y:0},v={x:0,y:0},x=0,h=0;h<=r-1;h++){var C=e[h];C.y="Mercator"===t||"Normal"===i?C.y:-C.y,C.y>p?C.x<d&&d-C.x<d-f.x?f={x:C.x,y:C.y}:C.x>d&&(0===b.x||C.x-d<b.x-d)&&(b={x:C.x,y:C.y}):C.x<d&&d-C.x<d-S.x?S={x:C.x,y:C.y}:C.x>d&&(0===v.x||C.x-d<v.x-d)&&(v={x:C.x,y:C.y}),x=b.y-v.y+(b.y-v.y)/4,C.x>d?C.y<p&&p-C.y<p-c.y?c={x:C.x,y:C.y}:C.y>p&&(0===u.y||C.y-p<u.y-p)&&(u={x:C.x,y:C.y}):C.y<p&&p-C.y<p-g.y?g={x:C.x,y:C.y}:C.y>p&&(0===y.y||C.y-p<y.y-p)&&(y={x:C.x,y:C.y})}return{x:d,y:p,rightMin:c,rightMax:u,leftMin:g,leftMax:y,points:e,topMax:v,topMin:S,bottomMax:b,bottomMin:f,height:x}}function tt(e){var t=!1;return"[object Array]"===Object.prototype.toString.call(e)&&Array.prototype.forEach.call(e,function(e){Y.isNullOrUndefined(e.geometry)||"Path"!==e.geometry.type||(t=!0)}),t}function it(e,t,i,o,n,l){var a=t;if(e<(o=Y.isNullOrUndefined(o)?(n?re:q)(t,i).width:o))for(var r=t.length-1;0<=r;--r)if((o=(n?re:q)(a=t.substring(0,r)+"...",i).width)<=e||a.length<4)return a.length<4&&(a=" "),Y.isNullOrUndefined(l)||l.push(o),a;return Y.isNullOrUndefined(l)||l.push(o),a}function ot(e,t,i,o){var n;switch(t){case"Near":n=e.x;break;case"Center":n="title"===o?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":n="title"===o?e.width-e.y-i.width:e.x+e.width-i.width}t="title"===o?e.y+i.height/2:e.y+e.height/2+i.height/2;return new J(n,t)}function I(e){e=document.getElementById(e);return e?Y.remove(e):null}function nt(e,t){var i=A(e.minLatOfGivenLocation,e.minLongOfGivenLocation,e.mapLayerPanel.calculateFactor(t),t,e),t=A(e.maxLatOfGivenLocation,e.maxLongOfGivenLocation,e.mapLayerPanel.calculateFactor(t),t,e),e=(i.x+t.x)/2,i=(i.y+t.y)/2;return new J(e,i)}function lt(e,t,i){var o,n,l,a,r=e.zoomSettings.zoomFactor,s=e.centerPosition,d=s.latitude,p=s.longitude,h=!Y.isNullOrUndefined(e.centerLatOfGivenLocation)&&!Y.isNullOrUndefined(e.centerLongOfGivenLocation)&&e.zoomNotApplied,m=(Y.isNullOrUndefined(e.mapScaleValue)&&(e.mapScaleValue=r),e.zoomSettings.shouldZoomInitially&&e.zoomSettings.enable&&(e.mapScaleValue=n=r=(e.zoomSettings.shouldZoomInitially||e.enablePersistence)&&1===e.scale?e.scale:Y.isNullOrUndefined(e.markerZoomFactor)?1:e.markerZoomedState?e.markerZoomFactor:parseInt(e.scale.toString()),e.markerZoomedState&&e.mapScaleValue!==e.markerZoomFactor&&!e.enablePersistence&&(e.mapScaleValue=r=e.markerZoomFactor),!e.markerZoomedState||Y.isNullOrUndefined(e.markerCenterLatitude)||Y.isNullOrUndefined(e.markerCenterLongitude)||(d=e.markerCenterLatitude,p=e.markerCenterLongitude)),h&&(e.mapScaleValue=n=r=e.scaleOfGivenLocation),Y.isNullOrUndefined(e.baseMapRectBounds)?null:e.baseMapRectBounds.min),c=Y.isNullOrUndefined(e.baseMapRectBounds)?null:e.baseMapRectBounds.max,u=i?1:e.mapScaleValue,g=(Y.isNullOrUndefined(e.currentShapeDataLength)&&!Y.isNullOrUndefined(t.shapeData)&&(e.currentShapeDataLength=Y.isNullOrUndefined(t.shapeData.features)?Y.isNullOrUndefined(t.shapeData.geometries)?0:t.shapeData.geometries.length:t.shapeData.features.length),e.totalRect&&e.legendSettings.visible?e.totalRect:e.mapAreaRect),y=e.availableSize;return Y.isNullOrUndefined(m)||Y.isNullOrUndefined(c)||(o=Math.abs(c.x-m.x),c=Math.abs(m.y-c.y),i=i?1:1===e.markerZoomFactor?e.mapScaleValue:r,s=e.zoomSettings.shouldZoomInitially&&e.markerZoomedState&&!e.zoomPersistence?e.markerZoomCenterPoint:e.centerPosition,!Y.isNullOrUndefined(p)&&0!==p&&!Y.isNullOrUndefined(d)&&0!==d||h?(r=((o+Math.abs(e.mapAreaRect.width-o))/2+e.mapAreaRect.x)/i,s=((c+Math.abs(e.mapAreaRect.height-c))/2+e.mapAreaRect.y)/i,i=h?nt(e,t):A(d,p,e.mapLayerPanel.calculateFactor(t),t,e),n=Y.isNullOrUndefined(e.previousProjection)||e.previousProjection!==e.projectionType||e.isMarkerZoomCompleted?(l=-i.x+r,a=-i.y+s,u):(1!==Math.floor(e.scale)&&e.zoomSettings.shouldZoomInitially||e.zoomNotApplied?(l=-i.x+r,a=-i.y+s):e.zoomSettings.shouldZoomInitially||e.zoomNotApplied?(l=-i.x+r,a=-i.y+s,n=u):(l=e.zoomTranslatePoint.x,a=e.zoomTranslatePoint.y),e.mapScaleValue)):Y.isNullOrUndefined(e.previousProjection)||e.previousProjection!==e.projectionType?(0!==c&&0!==o&&c!==o||(o=g.width/2,c=g.height),n=parseFloat(Math.min(g.width/o,g.height/c).toFixed(2)),h=0!==m.x&&"layers"===e.translateType?y.width-g.width:0,l=g.x+(-m.x+(g.width/2-(o*=n=1.05<n?1:n)/2))-h,a=g.y+(-m.y+(g.height/2-(c*=n)/2)),e.previousTranslate=new J(l,a)):e.zoomSettings.shouldZoomInitially||1!==e.markerZoomFactor||1!==e.mapScaleValue?(n=e.mapScaleValue<1?e.mapScaleValue+1:e.mapScaleValue,e.mapScaleValue=e.zoomSettings.enable&&1!==e.mapScaleValue?e.mapScaleValue:1,e.currentShapeDataLength!==(Y.isNullOrUndefined(t.shapeData.features)?t.shapeData.geometries:t.shapeData.features).length&&"SubLayer"!==t.type?(d=parseFloat(Math.min(g.height/c,g.width/o).toFixed(2)),a=g.y+(-m.y+(g.height/2-(c*=d)/2)),l=g.x+(-m.x+(g.width/2-(o*=n=d)/2))):e.availableSize.height===e.heightBeforeRefresh&&e.widthBeforeRefresh===e.availableSize.width||Y.isNullOrUndefined(e.translatePoint)||Y.isNullOrUndefined(e.previousTranslate)?Y.isNullOrUndefined(e.previousProjection)||!(1===e.mapScaleValue||e.mapScaleValue<=1.05)||e.zoomModule.isDragZoom?(l=e.zoomTranslatePoint.x,a=e.zoomTranslatePoint.y,n=e.scale):(n=parseFloat(Math.min(g.width/o,g.height/c).toFixed(2)),l=g.x+(-m.x+(g.width/2-(o*=n=1.05<n?1:n)/2)),a=g.y+(-m.y+(g.height/2-(c*=n)/2))):(p=parseFloat(Math.min(g.width/o,g.height/c).toFixed(2)),r=o,i=c,s=g.x+(-m.x+(g.width/2-(r*=p)/2)),u=g.y+(-m.y+(g.height/2-(i*=p)/2)),y=(e.translatePoint.x-e.previousTranslate.x)/e.widthBeforeRefresh,h=(e.translatePoint.y-e.previousTranslate.y)/e.heightBeforeRefresh,l=s+y*e.availableSize.width,a=u+h*e.availableSize.height,e.previousTranslate=new J(s,u),e.zoomTranslatePoint.x=l,e.zoomTranslatePoint.y=a)):(n=parseFloat(Math.min(g.width/o,g.height/c).toFixed(2)),a=g.y+(-m.y+(g.height/2-(c*=n)/2)),l=g.x+(-m.x+(g.width/2-(o*=n)/2))),Y.isNullOrUndefined(e.translatePoint))||(l=e.enablePersistence&&0!==e.translatePoint.x&&!e.zoomNotApplied?e.translatePoint.x:l,a=e.enablePersistence&&0!==e.translatePoint.y&&!e.zoomNotApplied?e.translatePoint.y:a),n=e.enablePersistence?1<=e.mapScaleValue?e.mapScaleValue:1:n,e.widthBeforeRefresh=e.availableSize.width,e.heightBeforeRefresh=e.availableSize.height,{scale:n,location:new J(l,a)}}function at(e,t,i){var o,n,l=e.zoomSettings.zoomFactor,a=e.centerPosition,r=a.latitude,a=a.longitude,s=!Y.isNullOrUndefined(e.centerLongOfGivenLocation)&&!Y.isNullOrUndefined(e.centerLatOfGivenLocation)&&e.zoomNotApplied,d=(Y.isNullOrUndefined(e.previousCenterLatitude)&&Y.isNullOrUndefined(e.previousCenterLongitude)?(e.previousCenterLatitude=e.centerPosition.latitude,e.previousCenterLongitude=e.centerPosition.longitude):e.previousCenterLatitude!==e.centerPosition.latitude&&e.previousCenterLongitude!==e.centerPosition.longitude?(e.centerPositionChanged=!0,e.previousCenterLatitude=e.centerPosition.latitude,e.previousCenterLongitude=e.centerPosition.longitude):e.centerPositionChanged=!1,(Y.isNullOrUndefined(e.mapScaleValue)||l>e.mapScaleValue)&&(e.isReset&&1===e.mapScaleValue?e.mapScaleValue=e.mapScaleValue:!Y.isNullOrUndefined(e.mapScaleValue)&&e.mapScaleValue<=e.scale?e.mapScaleValue=e.scale:e.mapScaleValue=l),e.mapScaleValue=1!==e.zoomSettings.zoomFactor&&e.zoomSettings.zoomFactor===e.mapScaleValue||e.zoomSettings.zoomFactor===e.mapScaleValue||e.centerPositionChanged?e.zoomSettings.zoomFactor:e.mapScaleValue,e.zoomSettings.shouldZoomInitially&&!e.isZoomByPosition&&(e.mapScaleValue=l=b=(e.enablePersistence||e.zoomSettings.shouldZoomInitially)&&1===e.scale?e.scale:Y.isNullOrUndefined(e.markerZoomFactor)?e.mapScaleValue:e.markerZoomFactor,l=e.mapScaleValue,Y.isNullOrUndefined(e.markerCenterLatitude)||Y.isNullOrUndefined(e.markerCenterLongitude)||(r=e.markerCenterLatitude,a=e.markerCenterLongitude)),s&&(e.mapScaleValue=b=l=e.scaleOfGivenLocation),i?1:e.mapScaleValue),p=e.mapAreaRect,h=e.baseMapRectBounds.min,m=e.baseMapRectBounds.max,c=i?1:e.mapScaleValue,u=Math.abs(m.x-h.x),m=Math.abs(h.y-m.y);if(!Y.isNullOrUndefined(a)&&0!==a&&!Y.isNullOrUndefined(r)&&0!==r||s){var g=(m+Math.abs(e.mapAreaRect.height-m))/2/c,y=(u+Math.abs(e.mapAreaRect.width-u))/2/c,c=s?nt(e,t):A(r,a,e.mapLayerPanel.calculateFactor(t),t,e);Y.isNullOrUndefined(e.zoomTranslatePoint)&&Y.isNullOrUndefined(e.previousProjection)||e.zoomNotApplied?(o=-c.x+y+e.mapAreaRect.x/d,n=-c.y+g+e.mapAreaRect.y/d):e.previousProjection!==e.projectionType?(o=-c.x+y,n=-c.y+g):(e.isZoomByPosition&&(e.zoomTranslatePoint.x=-c.x+y,e.zoomTranslatePoint.y=-c.y+g),o=e.zoomTranslatePoint.x,n=e.zoomTranslatePoint.y,l=d),Y.isNullOrUndefined(e.translatePoint)||(n=e.enablePersistence&&0!==e.translatePoint.y&&!e.zoomNotApplied?e.translatePoint.y:n,o=e.enablePersistence&&0!==e.translatePoint.x&&!e.zoomNotApplied?e.translatePoint.x:o),b=0!==l?l:1}else{var s=0===e.zoomSettings.zoomFactor?1:e.zoomSettings.zoomFactor,f=e.zoomSettings.maxZoom,b=s=f<s?f:s,r=0===e.mapScaleValue?1:e.mapScaleValue>f?f:e.mapScaleValue,y=p.x+(-h.x+(p.width/2-u/2)),g=p.y+(-h.y+(p.height/2-m/2));if(!Y.isNullOrUndefined(e.zoomTranslatePoint)||!Y.isNullOrUndefined(e.previousProjection))if(e.previousProjection!==e.projectionType){var S=[];S.push({x:y,y:g});for(var v=1;v<f;v++){var x=S[v-1].x-(p.width/v-p.width/(v+1))/2,C=S[v-1].y-(p.height/v-p.height/(v+1))/2;S.push({x:x,y:C})}y=S[s-1].x,g=S[s-1].y}else y=e.zoomTranslatePoint.x,g=e.zoomTranslatePoint.y,s!==r&&(b=r);Y.isNullOrUndefined(e.translatePoint)||(o=e.enablePersistence&&0!==e.translatePoint.x&&!e.zoomNotApplied?e.translatePoint.x:y,n=e.enablePersistence&&0!==e.translatePoint.y&&!e.zoomNotApplied?e.translatePoint.y:g)}return b=e.enablePersistence?0===e.mapScaleValue?1:e.mapScaleValue:b,e.widthBeforeRefresh=e.availableSize.width,e.heightBeforeRefresh=e.availableSize.height,{scale:i?1:b,location:new J(o,n)}}function rt(e){e.tileZoomScale=e.tileZoomLevel=Math.floor(e.availableSize.height/512)+1;var t=256*Math.pow(2,e.tileZoomLevel);e.tileTranslatePoint.x=e.availableSize.width/2-t/2,e.tileTranslatePoint.y=e.availableSize.height/2-t/2+20,e.previousTileWidth=e.availableSize.width,e.previousTileHeight=e.availableSize.height}function Z(e){return document.getElementById(e)}function st(e){return"string"==typeof e?parseFloat(e):e}function dt(e,t){return e.formatFunction=e.intl.getNumberFormat({format:e.format,useGrouping:e.useGroupingSeparator}),e.formatFunction(t)}function pt(t,e){var i=null;try{"function"!=typeof t&&document.querySelectorAll(t).length?i=Y.compile(document.querySelector(t).innerHTML.trim()):(e.isVue||e.isVue3||"function"==typeof t)&&(i=Y.compile(t))}catch(e){i=Y.compile(t)}return i}function E(e){return document.getElementById(e)}function ht(e,t){var i,o=parseInt(e.split("_LayerIndex_")[1].split("_")[0],10),e=parseInt(e.split("_shapeIndex_")[1].split("_")[0],10),t=t.layersCollection[o],o=t.layerData[e].property;return{shapeData:o,data:i=t.dataSource?t.dataSource[Je(t.dataSource,o,t.shapeDataPath,t.shapePropertyPath)]:i}}function mt(e,t,i,o){var n=ht(e,i),l={color:t.border.color,opacity:t.border.opacity,width:t.border.width},a=t.enableMultiSelect?{cancel:!1,name:o,fill:t.fill,opacity:t.opacity,border:l,shapeData:n.shapeData,data:n.data,target:e,maps:i,shapeDataCollection:i.shapeSelectionItem}:{cancel:!1,name:o,fill:t.fill,opacity:t.opacity,border:l,shapeData:n.shapeData,data:n.data,target:e,maps:i};return i.trigger(o,a,function(){a.border.opacity=(Y.isNullOrUndefined(a.border.opacity)?a:a.border).opacity}),a}function ct(e){return document.getElementsByClassName(e)}function O(e,t){var i=null;return i=document.getElementById(t)?document.getElementById(t).querySelector("#"+e):i}function ut(e,t,i,o){for(var n,l=o.layers[e].shapeData.features,a=0;a<l.length;a++)if(l[a].properties.name===t){n=o.element.id+"_LayerIndex_"+e+"_shapeIndex_"+a+"_dataIndex_undefined";break}return E(n)}function gt(e,t,i){e=Y.createElement("style",{id:e});return e.innerText="."+t+"{fill:"+i.fill+";fill-opacity:"+(Y.isNullOrUndefined(i.opacity)?"1":i.opacity.toString())+";stroke-opacity:"+(Y.isNullOrUndefined(i.border.opacity)?"1":i.border.opacity.toString())+";stroke-width:"+i.border.width.toString()+";stroke:"+i.border.color+";}",e}function yt(e,t,i){e=E(e);Y.isNullOrUndefined(e)||(e.innerText="."+t+"{fill:"+i.fill+";fill-opacity:"+(Y.isNullOrUndefined(i.opacity)?"1":i.opacity.toString())+";stroke-width:"+i.border.width.toString()+";stroke-opacity:"+(Y.isNullOrUndefined(i.border.opacity)?"1":i.border.opacity.toString())+";stroke:"+i.border.color+"}")}function ft(t,i,e,o,n){var l={color:t.border.color,width:t.border.width/i.scale,opacity:t.border.opacity},a={opacity:t.opacity,fill:t.fill,border:l,name:on,target:e.id,cancel:!1,shapeData:o,data:n,maps:i};i.trigger("itemSelection",a,function(e){a.border.opacity=(Y.isNullOrUndefined(t.border.opacity)?t:t.border).opacity,i.shapeSelectionItem.push(a.shapeData),E("ShapeselectionMap")?yt("ShapeselectionMap","ShapeselectionMapStyle",a):document.body.appendChild(gt("ShapeselectionMap","ShapeselectionMapStyle",a))})}function x(e){e.removeAttribute("class")}function bt(i,e,t,o,n,l,a){void 0===a&&(a=0);var r=o.x,s=o.y,d=0,p=i.getAttribute("transform")||"";new Y.Animation({}).animate(i,{duration:0===t&&"Enable"===Y.animationMode?1e3:t,delay:e,progress:function(e){var t;e.timeStamp>e.delay&&!n.zoomModule.isPanningInProgress?(n.isTileMap&&0===d&&(t=document.querySelector(".GroupElement"),Y.isNullOrUndefined(t)||(t.style.display="block")),d=(e.timeStamp-e.delay)/e.duration,i.setAttribute("transform","translate( "+(r-a*d)+" "+(s-a*d)+" ) scale("+d+")")):n.zoomModule.isPanningInProgress&&(p=i.getAttribute("transform"))},end:function(e){n.zoomModule.isPanningInProgress||i.setAttribute("transform",p),n.zoomModule.isPanningInProgress=!1,l&&n.trigger($o,{cancel:!1,name:$o,element:l,maps:n})}})}function St(e){I(e)}function vt(e,t,i,o,n,l,a,r,s){for(var d=F(i,o,r),d=(Y.isNullOrUndefined(d)||(i=d.x,o=d.y),document.getElementById(a)),p=q(e,{fontFamily:"Segoe UI",size:"8px",fontStyle:"Normal",fontWeight:"Regular"}).width,h=e.split(" "),m=h[0].length,c=1;c<h.length;c++)m<h[c].length&&(m=h[c].length);d||((d=Y.createElement("div",{id:a})).style.cssText='background-color: rgb(255, 255, 255) !important; color:black !important; position:absolute;border:1px solid rgb(0, 0, 0); padding-left:5px;font-size:12px; font-family: "Segoe UI"; text-align:center'),i<n-p||(n-p<i&&i<n-8*m?p=n-i:n-8*m<=i&&(p<i?i-=p:(p=i,i=0)));t=t.split("px");xt(d,e,i,o,t,p,n,r),d.clientHeight+2*parseInt(t[0],10)>l&&(p=i,i=0),xt(d,e,i,o,t,p,n,r),s&&setTimeout(St,5e3,a)}function xt(e,t,i,o,n,l,a,r){e.innerText=t,e.style.top=-1!==e.id.indexOf("_Legend")?(parseInt(n[0],10)+o).toString()+"px":(2*parseInt(n[0],10)).toString()+"px",e.style.left=i.toString()+"px",e.style.width=l.toString()+"px",e.style.maxWidth=a.toString()+"px",e.style.wordWrap="break-word",r.appendChild(e)}function Ct(e,t,i,o,n){var l=E(e),a=Ot(n.borderColor),r=Ot(n.fontColor),i="top:"+i.toString()+"px;left:"+o.toString()+"px;color:"+(r?"rgba("+r.r+","+r.g+","+r.b+","+n.fontOpacity+")":n.fontColor)+";background:"+n.fill+";z-index: 2;position:absolute;border:"+n.borderWidth+"px solid "+(a?"rgba("+a.r+","+a.g+","+a.b+","+n.borderOpacity+")":n.borderColor)+";font-family:"+n.fontFamily+";font-style:"+n.fontStyle+";font-weight:"+n.fontWeight+";font-size:"+n.fontSize+";border-radius:"+n.borderWidth+"px;";!l&&n.visible?((l=Y.createElement("div",{id:e})).innerHTML=Y.SanitizeHtmlHelper.sanitize(" "+t+" "),l.style.cssText=i,document.body.appendChild(l)):n.visible&&(l.innerHTML=Y.SanitizeHtmlHelper.sanitize(" "+t+" "),l.style.cssText=i)}function Ot(e){var t,i;return-1!==e.indexOf("#")&&-1===e.toLowerCase().indexOf("rgb")?(i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16)}:null:-1!==e.toLowerCase().indexOf("rgb")?(i=e.match(/\d+/g).map(function(e){return parseInt(e,10)}))?{r:i[0],g:i[1],b:i[2]}:null:((t=document.createElement("div")).style.color=e,i=window.getComputedStyle(document.body.appendChild(t)).color.match(/\d+/g).map(function(e){return parseInt(e,10)}),document.body.removeChild(t),i?{r:i[0],g:i[1],b:i[2]}:null)}function _t(e,t,i,o,n){var l=new k.SvgRenderer(""),e=Mt(e,i,t,n,o);return l["draw"+e.functionName](e.renderOption)}function Mt(e,t,i,o,n){var l,a="Path",r=t.width,s=t.height,d=e.x,p=e.y,h=e.x+-r/2,m=e.y+-s/2;switch(o.stroke="HorizontalLine"===i||"VerticalLine"===i||"Cross"===i?o.fill:o.stroke,o["stroke-width"]=0!==o["stroke-width"]||"HorizontalLine"!==i&&"VerticalLine"!==i&&"Cross"!==i?o["stroke-width"]:1,i){case"Circle":case"Bubble":a="Ellipse",Y.merge(o,{rx:r/2,ry:s/2,cx:d,cy:p});break;case"VerticalLine":Y.merge(o,{d:l="M "+d+" "+(p+s/2)+" L "+d+" "+(p+-s/2)});break;case"HorizontalLine":Y.merge(o,{d:l="M "+d+" "+p+" L "+(d+r/2)+" "+p});break;case"Diamond":Y.merge(o,{d:l="M "+h+" "+p+" L "+d+" "+(p+-s/2)+" L "+(d+r/2)+" "+p+" L "+d+" "+(p+s/2)+" L "+h+" "+p+" z"});break;case"Rectangle":Y.merge(o,{d:l="M "+h+" "+(p+-s/2)+" L "+(d+r/2)+" "+(p+-s/2)+" L "+(d+r/2)+" "+(p+s/2)+" L "+h+" "+(p+s/2)+" L "+h+" "+(p+-s/2)+" z"});break;case"Triangle":Y.merge(o,{d:l="M "+h+" "+(p+s/2)+" L "+d+" "+(p+-s/2)+" L "+(d+r/2)+" "+(p+s/2)+" L "+h+" "+(p+s/2)+" z"});break;case"InvertedTriangle":Y.merge(o,{d:l="M "+(d+r/2)+" "+(p-s/2)+" L "+d+" "+(p+s/2)+" L "+(d-r/2)+" "+(p-s/2)+" L "+(d+r/2)+" "+(p-s/2)+" z"});break;case"Pentagon":for(var c,u,g=0;g<=5;g++)c=r/2*Math.cos(Math.PI/180*(72*g)),u=r/2*Math.sin(Math.PI/180*(72*g)),l=0===g?"M "+(d+c)+" "+(p+u)+" ":l.concat("L "+(d+c)+" "+(p+u)+" ");l=l.concat("Z"),Y.merge(o,{d:l});break;case"Star":l="M "+(e.x+t.width/3)+" "+(e.y+t.height/2)+" L "+(e.x-t.width/2)+" "+(e.y-t.height/6)+" L "+(e.x+t.width/2)+" "+(e.y-t.height/6)+" L "+(e.x-t.width/3)+" "+(e.y+t.height/2)+" L "+e.x+" "+(e.y-t.height/2)+" L "+(e.x+t.width/3)+" "+(e.y+t.height/2)+" Z",Y.merge(o,{d:l});break;case"Cross":Y.merge(o,{d:l="M "+h+" "+p+" L "+(d+r/2)+" "+p+" M "+d+" "+(p+s/2)+" L "+d+" "+(p+-s/2)});break;case"Image":a="Image",Y.merge(o,{href:n,height:s,width:r,x:h,y:m})}return{renderOption:o,functionName:a}}function Lt(e,t){t.appendChild(e);var i=e.offsetWidth,o=e.offsetHeight;return t.removeChild(e),new W(i,o)}function Pt(e,t,i,o){for(var n,l=0;l<e.childElementCount;l++)if(-1<(n=e.childNodes[l]).id.indexOf("_NavigationGroup"))wt(n,t,i,o);else if(-1<n.id.indexOf("_Polygons_Group"))for(var a=0;a<n.childElementCount;a++){var r=o.layersCollection[t].polygonSettings.polygons[parseInt(n.children[a].id.split("_PolygonIndex_")[1])].borderWidth;n.children[a].setAttribute("stroke-width",(r/i).toString())}else{var s,d=void 0,p=o.layersCollection[t].shapeSettings.borderWidthValuePath,h=o.layersCollection[t].shapeSettings.border.width,m=o.layersCollection[t].shapeSettings.circleRadius,d=o.layersCollection[t].shapeSettings.borderWidthValuePath&&null!==(s=Je(o.layersCollection[t].dataSource,o.layersCollection[t].layerData[l].property,o.layersCollection[t].shapeDataPath,o.layersCollection[t].shapePropertyPath,o.layersCollection[t]))&&o.layersCollection[t].dataSource[s][p]||(Y.isNullOrUndefined(h)?0:h);n.setAttribute("stroke-width",(d/i).toString()),(-1<e.id.indexOf("_Point")||-1<e.id.indexOf("_MultiPoint"))&&n.setAttribute("r",(m/i).toString())}}function wt(e,t,i,o){for(var n,l,a=0;a<e.childElementCount;a++)"path"===(l=e.childNodes[a]).tagName&&(n=o.layersCollection[t].navigationLineSettings[parseFloat(l.id.split("_NavigationIndex_")[1].split("_")[0])].width,l.setAttribute("stroke-width",(n/i).toString()))}function Tt(e){for(var t=[],i=e.touches,o=0;o<i.length;o++)t.push({pageX:i[o].pageX,pageY:i[o].pageY});return t}function It(e,t){e=kt(e[0],e[1]);return kt(t[0],t[1])/e}function kt(e,t){var i=e.pageX-t.pageX,e=e.pageY-t.pageY;return Math.sqrt(i*i+e*e)}function Nt(e,t){var t=t.element.getBoundingClientRect(),i=t.top+document.defaultView.pageXOffset,o=t.left+document.defaultView.pageYOffset;return Array.prototype.slice.call(e).map(function(e){return{x:e.pageX-o,y:e.pageY-i}})}function Ft(e){return{x:e.map(function(e){return e.x}).reduce(Et)/e.length,y:e.map(function(e){return e.y}).reduce(Et)/e.length}}function Et(e,t){return e+t}function zt(e,t,i,o,n,l,a){var r,s,d,p,h,m,c,u,g=a.previousPoint,y=a.previousScale,f=n-y,b=new T(0,0);n===y?e.setAttribute("transform","scale( "+n+" ) translate( "+o.x+" "+o.y+" )"):(h=o,d=(m=g).x===h.x?null:(h.y-m.y)/(h.x-m.x),h=g,p=null===(m=d)?h.x:h.y-m*h.x,c=o.x-g.x,u=o.y-g.y,Bt(e,0,i,function(e){e.timeStamp>e.delay&&(r=(e.timeStamp-e.delay)/e.duration,s=y+r*f,b.x=g.x+r*c/(s/n),b.y=null==d?g.y+r*u:d*b.x+p,e.element.setAttribute("transform","scale( "+s+" ) translate( "+b.x+" "+b.y+" )"),a.translatePoint=b,a.scale=s,a.zoomMo