UNPKG

@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 405 kB
/*! * filename: ej2-maps.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. */ this.ej=this.ej||{},this.ej.maps=function(e,t,i,o,n){"use strict";function a(e,i){return"string"!=typeof e?e:t.isNullOrUndefined(e)?null:-1!==e.indexOf("%")?i/100*parseInt(e,10):parseInt(e,10)}function l(e){e.element.style.height=t.isNullOrUndefined(e.height)?"auto":e.height,e.element.style.width=t.isNullOrUndefined(e.width)?"auto":e.width,e.element.style.setProperty("display","block");var i=e.element.clientWidth,o=e.element.clientHeight,n="string"==typeof e.element.style.width?a(e.element.style.width,i):e.element.style.width,l="string"==typeof e.element.style.height?a(e.element.style.height,o):e.element.style.height;new dt(0,0);return"0px"===e.width||"0%"===e.width||"0%"===e.height||"0px"===e.height?new dt(0,0):new dt(a(e.width,i)||i||n||600,a(e.height,o)||o||l||(e.isDevice?Math.min(window.innerWidth,window.innerHeight):450))}function r(e){e.renderer=new i.SvgRenderer(e.element.id),e.availableSize=l(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 s(e,t,i){var o=i.getBoundingClientRect(),n=i.ownerDocument.defaultView.pageXOffset,a=i.ownerDocument.defaultView.pageYOffset,l=i.ownerDocument.documentElement.clientTop,r=i.ownerDocument.documentElement.clientLeft,s=o.left+n-r,d=o.top+a-l;return new _t(e-s,t-d)}function d(e){return e*(Math.PI/180)}function p(e){return e*(180/Math.PI)}function h(e,i,o,n,a){var l,r,s,h,m,c,b=new dt(a.mapAreaRect.width,a.mapAreaRect.height),v=a.baseMapBounds.longitude,x=a.baseMapBounds.latitude,C=d(e),O=d(i),_=t.isNullOrUndefined(a.projectionType)?"Mercator":a.projectionType,M=a.isTileMap?256*Math.pow(2,1):t.isNullOrUndefined(o)?Math.min(b.width,b.height):Math.min(b.width,b.height)*o;if("Normal"===n.geometryType)l=t.isNullOrUndefined(o)?i:Math.abs((i-v.min)*o),r=t.isNullOrUndefined(o)?e:Math.abs((x.max-e)*o);else if("Geographic"===n.geometryType){switch(_){case"Mercator":var L=new pt(M/2,M/2);l=L.x+i*(M/360);var P=S(Math.sin(d(e)),-.9999,.9999);r=L.y+.5*Math.log((1+P)/(1-P))*(-M/(2*Math.PI));break;case"Winkel3":m=((s=y(O,C)).x+O/(Math.PI/2))/2,h=(s.y+C)/2;break;case"Miller":m=O,h=1.25*Math.log(Math.tan(Math.PI/4+.4*C));break;case"Eckert3":m=2/(c=Math.sqrt(Math.PI*(4+Math.PI)))*O*(1+Math.sqrt(1-4*C*C/(Math.PI*Math.PI))),h=4/c*C;break;case"AitOff":m=(s=y(O,C)).x,h=s.y;break;case"Eckert5":m=O*(1+Math.cos(C))/Math.sqrt(2+Math.PI),h=2*C/Math.sqrt(2+Math.PI);break;case"Equirectangular":m=O,h=C;break;case"Eckert6":c=(1+Math.PI/2)*Math.sin(C);for(var w=1/0,T=0;T<10&&Math.abs(w)>1e-6;T++)C-=w=(C+Math.sin(C)-c)/(1+Math.cos(C));c=Math.sqrt(2+Math.PI),m=O*(1+Math.cos(C))/c,h=2*C/c}l="Mercator"===_?l:f(u(a,p(m)),3),r="Mercator"===_?r:-f(g(a,p(h)),3)}return new pt(l,r)}function m(e,i,o,n){var a="";return!t.isNullOrUndefined(n)&&n.length>1&&(Array.prototype.forEach.call(n,function(t,n){var l=t.latitude,r=t.longitude,s=e.isTileMap?c(new _t(r,l),i,e.tileTranslatePoint,!0):h(l,r,i,o,e);a+=0===n?"M "+s.x+" "+s.y:" L "+s.x+" "+s.y}),a+=" z "),a}function c(e,t,i,o){var n=256*Math.pow(2,t),a=(e.x+180)/360,l=Math.sin(e.y*Math.PI/180),r=.5-Math.log((1+l)/(1-l))/(4*Math.PI),s=e.x,d=e.y;return o&&(s=a*n+.5+i.x,d=r*n+.5+i.y),{x:s,y:d}}function u(e,i){var o=e.baseMapBounds.longitude,n=t.isNullOrUndefined(e.baseSize)?e.mapAreaRect.width:e.mapAreaRect.width+Math.abs(e.baseSize.width-e.mapAreaRect.width)/2;return Math.round(n*(i-o.min)/(o.max-o.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 y(e,t){var i=Math.cos(t),o=b(v(i*Math.cos(e/=2)));return new pt(2*i*Math.sin(e)*o,Math.sin(t)*o)}function f(e,t){var i=Math.pow(10,t);return Math.round(e*i)/i}function b(e){return e/Math.sin(e)}function v(e){return Math.acos(e)}function S(e,i,o){return t.isNullOrUndefined(i)||(e=Math.max(e,i)),t.isNullOrUndefined(o)||(e=Math.min(e,o)),e}function x(e,i,o,n){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:o}}).dispatchEvent(new MouseEvent(n?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function C(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 dt(i.clientWidth,i.clientHeight)}function O(e,t){var i=document.createElement("canvas"),o=i.getContext("2d");o.font=t.fontStyle+" "+t.fontWeight+" "+("number"==typeof t.size?t.size+"px":t.size)+" "+t.fontFamily;var n=o.measureText(e).width,a=parseFloat(t.size)||16;return i=null,new dt(n,a)}function _(e,t,o,n,a){void 0===a&&(a=!1);var l,r,s={id:e.id,x:e.x,y:e.y,fill:o,"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},d="string"==typeof e.text||"number"==typeof e.text?e.text:a?e.text[e.text.length-1]:e.text[0],p=new i.SvgRenderer(""),h=p.createText(s,d);if(h.style["user-select"]="none",h.style["font-family"]=t.fontFamily,h.style["font-size"]=t.size,h.style["font-weight"]=t.fontWeight,h.style["font-color"]=t.color,h.style["-moz-user-select"]="none",h.style["-webkit-touch-callout"]="none",h.style["-webkit-user-select"]="none",h.style["-khtml-user-select"]="none",h.style["-ms-user-select"]="none",h.style["-o-user-select"]="none","string"!=typeof e.text&&e.text.length>1)for(var m=1,c=e.text.length;m<c;m++)r=C(e.text[m],t).height,l=p.createTSpan({x:e.x,id:e.id,y:e.y+(a?-m*r:m*r)},a?e.text[e.text.length-(m+1)]:e.text[m]),h.appendChild(l);return n.appendChild(h),h}function M(e,i,o,n,a,l){var r=t.createElement("div",{id:i,className:a.element.id+"_marker_template_element"});r.style.cssText="position: absolute;pointer-events: auto;";for(var s=e.length;s>0;)r.appendChild(e[0]),s--;if(!a.isReact||"function"!==l){for(var d=r.innerHTML,p=Object.keys(o),h=RegExp,m=0;m<p.length;m++)"object"==typeof o[p[m]]?d=P(d,"",o,a):"latitude"!==p[m].toLowerCase()&&"longitude"!==p[m].toLowerCase()&&(d=d.replace(new h("{{:"+p[m]+"}}","g"),o[p[m].toString()]));r.innerHTML=d}return r}function L(e,t){return t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e}function P(e,t,i,o){for(var n=""===e?t:e,a=""===e?n.split("${"):n.split("{{:"),l=RegExp,r=0;r<a.length;r++)if(a[r].indexOf("}}")>-1&&a[r].indexOf(".")>-1||a[r].indexOf("}")>-1&&a[r].search(".")>-1)for(var s=""===e?a[r].split("}"):a[r].split("}}"),d=0;d<s.length;d++)if(s[d].indexOf(".")>-1){var p=I(i,s[d]).toString();n=""===e?n.split("${"+s[d]+"}").join(L(p,o)):n.replace(new l("{{:"+s[d]+"}}","g"),p)}return n}function w(e,i,o){for(var n=(t.isNullOrUndefined(e.childElementCount)?e[0]:e).outerHTML,a=Object.keys(o),l=RegExp,r=0;r<a.length;r++)n=n.replace(new l("{{:"+a[r]+"}}","g"),o[a[r].toString()]);var s=t.createElement("div",{id:i,innerHTML:n});return s.style.position="absolute",s}function T(e,i,o,n,a,l,r){var s,d,p,h,m=a.size,c=a.borderColor,u=parseFloat(a.borderWidth),g=parseFloat(a.borderOpacity),y=a.fill,f=a.dashArray,b={color:c,width:u,opacity:g},v=a.opacity,S=new yt(n,y,u,c,v,g,f,"");if(m.width="string"==typeof m.width?parseInt(m.width,10):m.width,m.height="string"==typeof m.height?parseInt(m.height,10):m.height,"Circle"===e){var x=(m.width+m.height)/4,C=new vt(n,y,b,v,o.x,o.y,x,f);s=r.renderer.drawCircle(C)}else"Rectangle"===e?(d=o.x-m.width/2,p=o.y-m.height/2,h=new bt(n,y,b,v,new Mt(d,p,m.width,m.height),null,null,"",f),s=r.renderer.drawRectangle(h)):"Image"===e?(d=o.x-m.width/2,p=o.y-(n.indexOf("cluster")>-1?m.height/2:m.height),t.merge(S,{href:i,height:m.height,width:m.width,x:d,y:p}),s=r.renderer.drawImage(S)):s=$(r,e,S,m,o,l);return s}function I(e,i){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)){var o=i.replace(/\[/g,".").replace(/\]/g,"").split(".");if(1===o.length)e=e[o[0]];else for(var n=0;n<o.length&&!t.isNullOrUndefined(e);n++)e=e[o[n]]}return e}function F(e,i){var o=t.isNullOrUndefined(e.colorValuePath)?i[e.colorValuePath]:e.colorValuePath.indexOf(".")>-1?I(i,e.colorValuePath).toString():i[e.colorValuePath];return e.fill=t.isNullOrUndefined(e.colorValuePath)||t.isNullOrUndefined(o)?e.fill:e.colorValuePath.indexOf(".")>-1?I(i,e.colorValuePath).toString():i[e.colorValuePath],e}function k(e,i){return t.isNullOrUndefined(e.shapeValuePath)||t.isNullOrUndefined(i[e.shapeValuePath])?(E(e,i),z(e,i)):(E(e,i),"Image"===i[e.shapeValuePath]&&z(e,i)),e}function N(e,t){return e.indexOf(".")>-1?I(t,e).toString():t[e]}function E(e,i){if(!t.isNullOrUndefined(e.shapeValuePath)){var o=N(e.shapeValuePath,i);e.shape=t.isNullOrUndefined(o)||""===o.toString()?e.shape:o}}function z(e,i){if(!t.isNullOrUndefined(e.imageUrlValuePath)){var o=N(e.imageUrlValuePath,i);e.imageUrl=t.isNullOrUndefined(o)?e.imageUrl:o}}function B(e,i,o,n,a,l,r,s,d,p,m){var u,g,y,f,b,v,S,x=[],C=[],O=0,M=0,L=e.markerSettings[a],P=0,w=[],F=!m&&e.markerClusterSettings.allowClustering?e.markerClusterSettings:L.clusterSettings,k=F.labelStyle,N=o.renderer.createGroup({id:o.element.id+"_LayerIndex_"+n+"_markerCluster"}),E={cancel:!1,name:yi,fill:F.fill,height:F.height,width:F.width,imageUrl:F.imageUrl,shape:F.shape,data:void 0,maps:o,cluster:F,border:F.border},z=o.element.getBoundingClientRect();o.isTileMap?new Object:ve(o,e,!1);var B;o.isTileMap||(B=o.mapLayerPanel.calculateFactor(e));var Z=!1,j=o.isTileMap?o.tileZoomLevel:o.mapScaleValue,R=L.clusterSettings.allowClustering||e.markerClusterSettings.allowClustering&&e.markerSettings.length>1?i.querySelectorAll("[id*='LayerIndex_"+n+"_MarkerIndex_"+a+"']:not([id*='_Group'])"):i.childNodes;return o.trigger("markerClusterRendering",E,function(D){for(Array.prototype.forEach.call(R,function(r,s){if(w=[],"hidden"!==r.style.visibility){if(S=r,u=S.getBoundingClientRect(),w.push(s),!t.isNullOrUndefined(u)){var d=o.markerModule.zoomedMarkerCluster.length>0&&o.markerModule.zoomedMarkerCluster[n]&&o.markerModule.zoomedMarkerCluster[n][s]&&o.markerModule.zoomedMarkerCluster[n][s].length>0||o.markerModule.initialMarkerCluster.length>0&&o.markerModule.initialMarkerCluster[n]&&o.markerModule.initialMarkerCluster[n][s]&&o.markerModule.initialMarkerCluster[n][s].length>0?o.previousScale<j?o.markerModule.zoomedMarkerCluster[n][s]:o.markerModule.initialMarkerCluster[n][s]:null;if(t.isNullOrUndefined(d)||0===d.length||L.clusterSettings.allowClustering?Array.prototype.forEach.call(R,function(e,t){t>=s+1&&"hidden"!==e.style.visibility&&U(e,u,x,w,t)}):Array.prototype.forEach.call(d,function(e){if(s!==e){var t=document.getElementById(o.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+a+"_dataIndex_"+e);t&&"hidden"!==t.style.visibility&&U(t,u,x,w,e)}}),A(o,j,n,s,w),O=u.left+u.width/2,M=u.top+u.height,x.length>0){w=w.filter(function(e,t,i){return i.indexOf(e)===t}),O-=z.left,M-=o.availableSize.height<=z.height?z.top:z.bottom-z.top;var m,g=parseInt(r.id.split("_dataIndex_")[1].split("_")[0],10),b=parseInt(r.id.split("_MarkerIndex_")[1].split("_")[0],10),C=e.markerSettings[b],D=C.dataSource[g],V=t.isNullOrUndefined(C.longitudeValuePath)?t.isNullOrUndefined(D.longitude)?t.isNullOrUndefined(D.Longitude)?0:parseFloat(D.Longitude):parseFloat(D.longitude):Number(I(D,C.longitudeValuePath)),H=t.isNullOrUndefined(C.latitudeValuePath)?t.isNullOrUndefined(D.latitude)?t.isNullOrUndefined(D.Latitude)?0:parseFloat(D.Latitude):parseFloat(D.latitude):Number(I(D,C.latitudeValuePath));o.isTileMap?o.isTileMap&&(m=c(new pt(V,H),o.tileZoomLevel,o.tileTranslatePoint,!0)):m=h(H,V,B,e,o),r.style.visibility="hidden",E.cancel?(v={size:new dt(F.width,F.height),fill:F.fill,borderColor:F.border.color,borderWidth:F.border.width,opacity:F.opacity,dashArray:F.dashArray,imageUrl:F.imageUrl,shape:F.shape}).borderOpacity=t.isNullOrUndefined(F.border.opacity)?F.opacity:F.border.opacity:(v={size:new dt(E.width,E.height),fill:E.fill,borderColor:E.border.color,borderWidth:E.border.width,opacity:F.opacity,dashArray:F.dashArray,imageUrl:E.imageUrl,shape:E.shape}).borderOpacity=t.isNullOrUndefined(E.border.opacity)?F.opacity:E.border.opacity,O=o.isTileMap?O:i.id.indexOf("_Markers_Group")>-1?O:O+3.75-E.width/2,M=o.isTileMap?M:i.id.indexOf("_Markers_Group")>-1?M:M-E.height/2,o.isTileMap?(O=m.x,M=m.y):(O=(m.x+(t.isNullOrUndefined(o.translatePoint)||0===o.translatePoint.x||o.isResize?p.location.x:o.translatePoint.x))*(t.isNullOrUndefined(o.scale)?p.scale:o.scale)+C.offset.x,M=(m.y+(t.isNullOrUndefined(o.translatePoint)||0===o.translatePoint.y||o.isResize?p.location.y:o.translatePoint.y))*(t.isNullOrUndefined(o.scale)?p.scale:o.scale)+C.offset.y);var G=o.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+b+"_dataIndex_"+g+"_cluster_"+P,W=o.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+b+"_dataIndex_"+g+"_cluster_"+P+"_datalabel_"+P;P++;var X=T(v.shape,v.imageUrl,{x:0,y:0},G,v,l,o);X.setAttribute("transform","translate( "+O+" "+M+" )"),"Balloon"===E.shape?X.children[0].textContent=w.toString():X.textContent=w.toString(),y=new gt(W,0,3.75,"middle",(x.length+1).toString(),"",""),(f=_(y,k,k.color,l)).setAttribute("transform","translate( "+O+" "+M+" )");var q=parseFloat(X.id.split("_MarkerIndex_")[1]);C.clusterSettings.allowClustering&&q===b||e.markerClusterSettings.allowClustering&&e.markerSettings.length>1&&q===b?(N.appendChild(X),N.appendChild(f)):(N.appendChild(f),N.appendChild(X))}}x=[]}else A(o,j,n,s,w);Z=!0}),r.appendChild(N),o.svgObject.appendChild(r),o.element.appendChild(o.svgObject),F.allowDeepClustering&&!m&&Array.prototype.forEach.call(N.childNodes,function(i,o){if("hidden"!==i.style.visibility&&(S=i,u=S.getBoundingClientRect(),!(t.isNullOrUndefined(u)||S.id.indexOf("_datalabel_")>-1))){for(var n=o+1;n<N.childElementCount;n++)if("hidden"!==N.childNodes[n].style.visibility&&(b=N.childNodes[n],g=b.getBoundingClientRect(),!(t.isNullOrUndefined(g)||b.id.indexOf("_datalabel_")>-1||u.left>g.right||u.right<g.left||u.top>g.bottom||u.bottom<g.top))){C.push(b),C.push(N.childNodes[n-1]),N.childNodes[n].style.visibility="hidden";r=t.isNullOrUndefined(N.childNodes[n+1])?null:parseFloat(N.childNodes[n+1].id.split("_MarkerIndex_")[1]);L.clusterSettings.allowClustering&&r===a||e.markerClusterSettings.allowClustering&&e.markerSettings.length>1&&r===a?N.childNodes[n+1].style.visibility="hidden":(r=parseFloat(N.childNodes[n-1].id.split("_MarkerIndex_")[1]),N.childNodes[n-1].style.visibility=r===a?"hidden":N.childNodes[n-1].style.visibility),w.push(n)}if(C.length>0){S=i;for(var l=0;l<C.length;l++){"g"===S.tagName?S.childNodes[0].textContent=S.childNodes[0].textContent+","+C[l].textContent:S.textContent=S.textContent+","+C[l].textContent;var r=parseFloat(N.childNodes[o+1].id.split("_MarkerIndex_")[1]);L.clusterSettings.allowClustering&&r===a||e.markerClusterSettings.allowClustering&&e.markerSettings.length>1&&r===a?N.childNodes[o+1].textContent=(+N.childNodes[o+1].textContent+ +C[l+1].textContent).toString():(r=parseFloat(N.childNodes[o-1].id.split("_MarkerIndex_")[1]),N.childNodes[o-1].textContent=r===a?(+N.childNodes[o-1].textContent+ +C[l+1].textContent).toString():N.childNodes[o-1].textContent),l++}}C=[]}});0<N.childNodes.length;){var V=parseFloat(N.childNodes[0].id.split("_MarkerIndex_")[1]);L.clusterSettings.allowClustering&&V===a||e.markerClusterSettings.allowClustering&&e.markerSettings.length>1&&V===a?l.insertBefore(N.childNodes[0],null):V===a&&l.insertBefore(N.childNodes[0],l.firstChild)}s||Ce(o.element.id+"_Secondary_Element").appendChild(l);var H=document.getElementById(o.element.id+"_LayerIndex_"+n+"_Polygon_Group"),G=document.getElementById(o.element.id+"_LayerIndex_"+n+"_Polygons_Group");t.isNullOrUndefined(H)&&!o.isTileMap?r.insertBefore(l,r.firstChild):o.isTileMap?t.isNullOrUndefined(G)?t.isNullOrUndefined(H)?r.insertBefore(l,r.firstChild):H.insertAdjacentElement("afterend",l):G.insertAdjacentElement("afterend",l):r.appendChild(l);var W=document.getElementById(o.element.id+"_LayerIndex_"+n+"_markerCluster");if(t.isNullOrUndefined(W)||W.remove(),d){var X=document.getElementById(o.element.id+"_Layer_Collections"),q=document.getElementById(o.element.id+"_LayerIndex_"+(n+1));t.isNullOrUndefined(X)||t.isNullOrUndefined(q)?t.isNullOrUndefined(X)||X.appendChild(r):X.insertBefore(r,q)}}),Z}function A(e,i,o,n,a){if(1===i){var l=t.isNullOrUndefined(e.markerModule.initialMarkerCluster[o][n])?[]:a.length>1?a:[];e.markerModule.initialMarkerCluster[o][n]=l;var r=t.isNullOrUndefined(e.markerModule.zoomedMarkerCluster[o][n])?[]:a.length>1?a:[];e.markerModule.zoomedMarkerCluster[o][n]=r}else i>1&&(e.markerModule.zoomedMarkerCluster[o][n]=a.length>1?a:[])}function U(e,i,o,n,a){var l=e.getBoundingClientRect();t.isNullOrUndefined(l)||i.left>l.right||i.right<l.left||i.top>l.bottom||i.bottom<l.top||(o.push(l),e.style.visibility="hidden",n.push(a))}function Z(e,t){var i=e[0].layerIndex,o=e[0].targetClusterIndex,n=e[0].markerIndex,a=e[0].dataIndex,l=t.element.id+"_LayerIndex_"+i+"_MarkerIndex_"+n,r=l+"_dataIndex_"+a+"_cluster_"+o,s=Le("Balloon"===t.layers[i].markerClusterSettings.shape?r+"_Group":r),d=Le(r+"_datalabel_"+o);s.setAttribute("visibility","visible"),d.setAttribute("visibility","visible");for(var p,h=e[0].data.length,m=0;m<h;m++)(p=Le(Le(l+"_dataIndex_"+e[0].data[m].index+"_Group")?l+"_dataIndex_"+e[0].data[m].index+"_Group":l+"_dataIndex_"+e[0].data[m].index)).style.visibility="hidden",p.id.indexOf("Group")>-1&&(Le(l+"_dataIndex_"+e[0].data[m].index).style.visibility="hidden");fe(t.element.id+"_LayerIndex_"+i+"_MarkerIndex_"+n+"_markerClusterConnectorLine")}function j(e,t,i,o){var n=e[0].layerIndex,a=e[0].markerIndex,l=e[0].targetClusterIndex,r=e[0].dataIndex,s=o?Le:i.querySelector.bind(i),d=o?"":"#",p=t.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+a,h=t.layers[n],m=!t.markerModule.allowInnerClusterSetting(h)&&h.markerClusterSettings.allowClustering?h.markerClusterSettings:h.markerSettings[a].clusterSettings,c=h.markerSettings[a],u=p+"_dataIndex_"+r+"_cluster_"+l,g=s("Balloon"===m.shape?d+""+u+"_Group":d+""+u),y=s(d+""+u+"_datalabel_"+l);g.setAttribute("visibility","hidden"),y.setAttribute("visibility","hidden");var f=s(s(d+""+p+"_dataIndex_"+r+"_Group")?d+""+p+"_dataIndex_"+r+"_Group":d+""+p+"_dataIndex_"+r),b=f.parentElement.id.indexOf("Template_Group")>-1?f.getBoundingClientRect().height:c.height,v=f.parentElement.id.indexOf("Template_Group")>-1?f.getBoundingClientRect().width:c.width,S=+g.getAttribute("transform").split("translate(")[1].trim().split(" ")[0],x=+g.getAttribute("transform").split("translate(")[1].trim().split(" ")[1].split(")")[0].trim(),C=(v="string"==typeof v?parseFloat(v):v)+5,O=6.28*C,_=0,M=Math.round(O/v);_+=M;for(var L=e[0].data.length,P=Math.round(b/O*100),w=(P=L<M?100/L:P)/100*360,T=L<M?45:0,I=1,F="M "+S+" "+x+" ",k="",N=0;N<L;N++){if(_===N||Math.round(T)>=360){for(T=0,O=6.28*(C=(v+5)*++I),M=Math.round(O/b),P=Math.round(b/O*100);P*M<100;)M++;w=P/100*360,_+=M}var E=S+C*Math.sin(2*Math.PI*T/360),z=x+C*Math.cos(2*Math.PI*T/360);k+=F+"L "+E+" "+z+" ",(f=s(s(d+""+p+"_dataIndex_"+e[0].data[N].index+"_Group")?d+""+p+"_dataIndex_"+e[0].data[N].index+"_Group":d+""+p+"_dataIndex_"+e[0].data[N].index)).parentElement.id.indexOf("Template_Group")>-1?(f.style.transform="",f.style.left=t.isTileMap?E-v/2+"px":E-v/2-10+"px",f.style.top=t.isTileMap?z-b/2+"px":z-b/2-10+"px",f.setAttribute("transform","translate( "+E+" "+z+")")):f.setAttribute("transform","translate( "+E+" "+z+")"),f.style.visibility="visible",f.id.indexOf("Group")>-1&&(s(d+""+p+"_dataIndex_"+e[0].data[N].index).style.visibility="visible"),T+=w}var B=m.connectorLineSettings,A={d:k,id:t.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+a+"_dataIndex_"+r+"_markerClusterConnectorLine",stroke:B.color,"fill-opacity":B.opacity,"stroke-opacity":B.opacity,"stroke-width":B.width};i=o?s(t.element.id+"_Markers_Group"):i,i=s(t.element.id+"_LayerIndex_"+n).querySelector("#"+i.id);var U=t.renderer.createGroup({id:t.element.id+"_LayerIndex_"+n+"_MarkerIndex_"+a+"_markerClusterConnectorLine"});U.appendChild(t.renderer.drawPath(A)),"Balloon"===c.shape?i.insertBefore(U,i.querySelector("#"+p+"_dataIndex_0_Group")):i.insertBefore(U,i.querySelector("#"+p+"_dataIndex_0"))}function R(e,i,o,n,a,l,r,s,d,p,h){var m={size:new dt(e.width,e.height),fill:e.fill,borderColor:e.border.color,borderWidth:e.border.width,opacity:i.opacity,dashArray:i.dashArray,borderOpacity:t.isNullOrUndefined(e.border.opacity)?i.opacity:e.border.opacity};fe(r);var c=T(e.shape,e.imageUrl,{x:0,y:0},r,m,h,p),u=(p.isTileMap?a.x:(a.x+l.x)*d)+(t.isNullOrUndefined(s)||t.isNullOrUndefined(s.x)?0:s.x),g=(p.isTileMap?a.y:(a.y+l.y)*d)+(t.isNullOrUndefined(s)||t.isNullOrUndefined(s.y)?0:s.y);if(c.setAttribute("transform","translate( "+u+" "+g+" )"),V(p.selectedMarkerElementId,p.markerSelectionClass,c,"MarkerselectionMapStyle"),p.legendSettings.toggleLegendSettings.enable&&"Markers"===p.legendSettings.type){var y=parseInt(c.id.split("_LayerIndex_")[1],10);H(p.toggledElementId,"g"===c.tagName?c.children[0]:c,p.legendSettings.toggleLegendSettings.applyShapeSettings?p.layers[y].shapeSettings:p.legendSettings.toggleLegendSettings)}h.appendChild(c);var f=o.length-1===n?"marker":null,b=new pt(u,g);return(i.animationDuration>0||"Enable"===t.animationMode)&&Be(c,i.animationDelay,i.animationDuration,b,p,f),h}function D(e,t,i,o,n,a,l,r,s,d,p){if((t=Me(e.template,p))&&t(o,p,e.template,p.element.id+"_MarkerTemplate"+n,!1).length){for(var h=M(t(o,p,e.template,p.element.id+"_MarkerTemplate"+n,!1),i,o,n,p,typeof e.template),m=0;m<h.children.length;m++)h.children[m].style.pointerEvents="auto";h.style.left=(p.isTileMap?l.x:(l.x+r.x)*s)+d.x-(p.isTileMap?0:p.mapAreaRect.x)+"px",h.style.top=(p.isTileMap?l.y:(l.y+r.y)*s)+d.y-(p.isTileMap?0:p.mapAreaRect.y)+"px",h.style.transform="translate(-50%, -50%)",a.appendChild(h)}return a}function V(e,i,o,n){if(e)for(var a=0;a<e.length;a++)o.getAttribute("id")===e[a]&&(0!==a&&"g"!==o.tagName||(t.isNullOrUndefined(i)||t.isNullOrUndefined(i.id)||document.body.appendChild(i),o.id.indexOf("_MarkerIndex_")>-1&&o.childElementCount>0&&o.children[0].setAttribute("class",n)),o.setAttribute("class",n))}function H(e,i,o){if(!t.isNullOrUndefined(e)&&e.length>0)for(var n=0;n<e.length;n++)e[n]===i.id&&(i.setAttribute("fill",o.fill),i.setAttribute("stroke",o.border.color),i.setAttribute("fill-opacity",o.opacity.toString()),i.setAttribute("stroke-opacity",(t.isNullOrUndefined(o.border.opacity)?o.opacity:o.border.opacity).toString()),i.setAttribute("stroke-width",(t.isNullOrUndefined(o.border.width)?0:o.border.width).toString()))}function G(e,i,o,n,a,l,r){if(!Le(e)){var s=t.createElement("style",{id:e});s.innerText="."+i+"{fill:"+o+";opacity:"+n+";stroke-width:"+l+";stroke:"+a+";}",r.shapeSelectionClass=s,document.body.appendChild(s)}}function W(e,t){return t&&t.appendChild(e),e}function X(e,t,i){return W(e.renderer.drawCircle(t),i)}function q(e,t,i){return W(e.renderer.drawRectangle(t),i)}function Y(e,t,i){return W(e.renderer.drawPath(t),i)}function J(e,t,i){return W(e.renderer.drawPolygon(t),i)}function Q(e,t,i){return W(e.renderer.drawPolyline(t),i)}function K(e,t,i){return W(e.renderer.drawLine(t),i)}function $(e,t,i,o,n,a){var l;switch(t){case"Balloon":l=le(e,i,o,n,"Marker",a);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=void 0,s=void 0,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?l:e.renderer.drawPath(i)}function ee(e,t,i,o,n){return t.d="M "+o.x+" "+(o.y-i.height/2)+" L "+(o.x+i.width/2)+" "+o.y+" L "+o.x+" "+(o.y+i.height/2)+" L "+(o.x-i.width/2)+" "+o.y+" Z",W(e.renderer.drawPath(t),n)}function te(e,t,i,o,n){return t.d="M "+o.x+" "+(o.y-i.height/2)+" L "+(o.x+i.width/2)+" "+(o.y+i.height/2)+" L "+(o.x-i.width/2)+" "+(o.y+i.height/2)+" Z",W(e.renderer.drawPath(t),n)}function ie(e,t,i,o,n){return t.d="M "+o.x+" "+(o.y-i.height/2)+" L "+o.x+" "+(o.y+i.height/2)+" M "+(o.x-i.width/2)+" "+o.y+" L "+(o.x+i.width/2)+" "+o.y,W(e.renderer.drawPath(t),n)}function oe(e,t,i,o,n){return t.d=" M "+(o.x-i.width/2)+" "+o.y+" L "+(o.x+i.width/2)+" "+o.y,W(e.renderer.drawPath(t),n)}function ne(e,t,i,o,n){return t.d="M "+o.x+" "+(o.y-i.height/2)+" L "+o.x+" "+(o.y+i.height/2),W(e.renderer.drawPath(t),n)}function ae(e,t,i,o,n){return t.d="M "+(o.x+i.width/3)+" "+(o.y+i.height/2)+" L "+(o.x-i.width/2)+" "+(o.y-i.height/6)+" L "+(o.x+i.width/2)+" "+(o.y-i.height/6)+" L "+(o.x-i.width/3)+" "+(o.y+i.height/2)+" L "+o.x+" "+(o.y-i.height/2)+" L "+(o.x+i.width/3)+" "+(o.y+i.height/2)+" Z",W(e.renderer.drawPath(t),n)}function le(e,t,i,o,n,a){var l,r=i.width,s=i.height;o.x-=r/2,o.y-=t.id.indexOf("cluster")>-1?s/2:t.id.indexOf("Legend")>-1?s/1.25:s,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";var d=e.renderer.drawPath(t),p=i.width/30,h=i.height/30;if(d.setAttribute("transform","translate("+o.x+", "+o.y+") scale("+p+", "+h+")"),"Marker"===n){var m=e.renderer.createGroup({id:t.id+"_Group"});W(d,m),l=W(m,a)}else l=d;return l}function re(e,t,i,o){for(var n=e.renderer.createPattern(t,"pattern"),a=0,l=i;a<l.length;a++)W(l[a],n);return W(n,o)}function se(e,t){for(var i,o=[],n=0,a=e;n<a.length;n++){var l=a[n];i={};for(var r=0,s=t;r<s.length;r++){var d=s[r];l[d]&&(i[d]=l[d])}o.push(i)}return o}function de(e,i,o,n,a){if(!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(o))for(var l=0;l<e.length;l++){var r=o.indexOf(".")>-1?I(e[l],o):e[l][o],s=pe(r,n,i);if((!t.isNullOrUndefined(r)&&isNaN(i[s])&&"string"==typeof r?r.toLowerCase():r)===(!t.isNullOrUndefined(i[s])&&isNaN(i[s])?i[s].toLowerCase():i[s]))return l}return null}function pe(e,i,o){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(o)&&!t.isNullOrUndefined(i))for(var n="[object Array]"===Object.prototype.toString.call(i)?i:[i],a=0;a<n.length;a++)if((t.isNullOrUndefined(e)||"string"!=typeof e?e:e.toLowerCase())===(!t.isNullOrUndefined(o[n[a]])&&isNaN(o[n[a]])?o[n[a]].toLowerCase():o[n[a]]))return n[a];return null}function he(e,t,i){for(var o=[],n=0;n<e.length;n++){var a=e[n];t<=a.y&&i>=a.y&&o.push(a)}return o}function me(e,t,i,o,n){var a=(t-e)/100*(100/(n-o)*(i-o))+e;return n===o&&(a=(t-e)/100+e),a}function ce(e,t,i){if(!e.length)return null;for(var o,n,a,l,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,h===r-1?(a=e[0].x,l="Mercator"===t||"Normal"===i?e[0].y:-e[0].y):(a=e[h+1].x,l="Mercator"===t||"Normal"===i?e[h+1].y:-e[h+1].y),s+=Math.abs(o*l-a*n),d+=Math.abs((o+a)*(o*l-a*n)),p+=Math.abs((n+l)*(o*l-a*n));s*=.5;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;for(var 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},v={x:0,y:0},S={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-v.x?v={x:C.x,y:C.y}:C.x>d&&(0===S.x||C.x-d<S.x-d)&&(S={x:C.x,y:C.y}),x=b.y-S.y+(b.y-S.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:S,topMin:v,bottomMax:b,bottomMin:f,height:x}}function ue(e){var i=!1;return"[object Array]"===Object.prototype.toString.call(e)&&Array.prototype.forEach.call(e,function(e){t.isNullOrUndefined(e.geometry)||"Path"!==e.geometry.type||(i=!0)}),i}function ge(e,i,o,n,a,l){var r=i;if(t.isNullOrUndefined(n)&&(n=a?O(i,o).width:C(i,o).width),n>e)for(var s=i.length-1;s>=0;--s)if(r=i.substring(0,s)+"...",(n=a?O(r,o).width:C(r,o).width)<=e||r.length<4)return r.length<4&&(r=" "),t.isNullOrUndefined(l)||l.push(n),r;return t.isNullOrUndefined(l)||l.push(n),r}function ye(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}var a="title"===o?e.y+i.height/2:e.y+e.height/2+i.height/2;return new pt(n,a)}function fe(e){var i=document.getElementById(e);return i?t.remove(i):null}function be(e,t){var i=h(e.minLatOfGivenLocation,e.minLongOfGivenLocation,e.mapLayerPanel.calculateFactor(t),t,e),o=h(e.maxLatOfGivenLocation,e.maxLongOfGivenLocation,e.mapLayerPanel.calculateFactor(t),t,e),n=(i.x+o.x)/2,a=(i.y+o.y)/2;return new pt(n,a)}function ve(e,i,o){var n,a=e.zoomSettings.zoomFactor,l=e.centerPosition,r=l.latitude,s=l.longitude,d=!t.isNullOrUndefined(e.centerLatOfGivenLocation)&&!t.isNullOrUndefined(e.centerLongOfGivenLocation)&&e.zoomNotApplied;t.isNullOrUndefined(e.mapScaleValue)&&(e.mapScaleValue=a),e.zoomSettings.shouldZoomInitially&&e.zoomSettings.enable&&(e.mapScaleValue=n=a=(e.zoomSettings.shouldZoomInitially||e.enablePersistence)&&1===e.scale?e.scale:t.isNullOrUndefined(e.markerZoomFactor)?1:e.markerZoomedState?e.markerZoomFactor:parseInt(e.scale.toString()),e.markerZoomedState&&e.mapScaleValue!==e.markerZoomFactor&&!e.enablePersistence&&(e.mapScaleValue=a=e.markerZoomFactor),!e.markerZoomedState||t.isNullOrUndefined(e.markerCenterLatitude)||t.isNullOrUndefined(e.markerCenterLongitude)||(r=e.markerCenterLatitude,s=e.markerCenterLongitude)),d&&(e.mapScaleValue=n=a=e.scaleOfGivenLocation);var p=t.isNullOrUndefined(e.baseMapRectBounds)?null:e.baseMapRectBounds.min,m=t.isNullOrUndefined(e.baseMapRectBounds)?null:e.baseMapRectBounds.max,c=o?1:e.mapScaleValue;t.isNullOrUndefined(e.currentShapeDataLength)&&!t.isNullOrUndefined(i.shapeData)&&(e.currentShapeDataLength=t.isNullOrUndefined(i.shapeData.features)?t.isNullOrUndefined(i.shapeData.geometries)?0:i.shapeData.geometries.length:i.shapeData.features.length);var u,g,y=e.totalRect&&e.legendSettings.visible?e.totalRect:e.mapAreaRect,f=e.availableSize;if(!t.isNullOrUndefined(p)&&!t.isNullOrUndefined(m)){var b=Math.abs(m.x-p.x),v=Math.abs(p.y-m.y),S=o?1:1===e.markerZoomFactor?e.mapScaleValue:a;if(l=e.zoomSettings.shouldZoomInitially&&e.markerZoomedState&&!e.zoomPersistence?e.markerZoomCenterPoint:e.centerPosition,!t.isNullOrUndefined(s)&&0!==s&&!t.isNullOrUndefined(r)&&0!==r||d){var x=((b+Math.abs(e.mapAreaRect.width-b))/2+e.mapAreaRect.x)/S,C=((v+Math.abs(e.mapAreaRect.height-v))/2+e.mapAreaRect.y)/S,O=d?be(e,i):h(r,s,e.mapLayerPanel.calculateFactor(i),i,e);t.isNullOrUndefined(e.previousProjection)||e.previousProjection!==e.projectionType||e.isMarkerZoomCompleted?(u=-O.x+x,g=-O.y+C,n=c):(1!==Math.floor(e.scale)&&e.zoomSettings.shouldZoomInitially||e.zoomNotApplied?(u=-O.x+x,g=-O.y+C):e.zoomSettings.shouldZoomInitially||e.zoomNotApplied?(u=-O.x+x,g=-O.y+C,n=c):(u=e.zoomTranslatePoint.x,g=e.zoomTranslatePoint.y),n=e.mapScaleValue)}else if(t.isNullOrUndefined(e.previousProjection)||e.previousProjection!==e.projectionType){0!==v&&0!==b&&v!==b||(b=y.width/2,v=y.height),b*=n=(n=parseFloat(Math.min(y.width/b,y.height/v).toFixed(2)))>1.05?1:n,v*=n;var _=0!==p.x&&"layers"===e.translateType?f.width-y.width:0;u=y.x+(-p.x+(y.width/2-b/2))-_,g=y.y+(-p.y+(y.height/2-v/2)),e.previousTranslate=new pt(u,g)}else if(e.zoomSettings.shouldZoomInitially||1!==e.markerZoomFactor||1!==e.mapScaleValue)if(n=e.mapScaleValue<1?e.mapScaleValue+1:e.mapScaleValue,e.mapScaleValue=e.zoomSettings.enable&&1!==e.mapScaleValue?e.mapScaleValue:1,e.currentShapeDataLength!==(t.isNullOrUndefined(i.shapeData.features)?i.shapeData.geometries.length:i.shapeData.features.length)&&"SubLayer"!==i.type){var M=parseFloat(Math.min(y.height/v,y.width/b).toFixed(2));v*=M,b*=M,g=y.y+(-p.y+(y.height/2-v/2)),n=M,u=y.x+(-p.x+(y.width/2-b/2))}else if(e.availableSize.height===e.heightBeforeRefresh&&e.widthBeforeRefresh===e.availableSize.width||t.isNullOrUndefined(e.translatePoint)||t.isNullOrUndefined(e.previousTranslate))t.isNullOrUndefined(e.previousProjection)||!(1===e.mapScaleValue||e.mapScaleValue<=1.05)||e.zoomModule.isDragZoom?(u=e.zoomTranslatePoint.x,g=e.zoomTranslatePoint.y,n=e.scale):(b*=n=(n=parseFloat(Math.min(y.width/b,y.height/v).toFixed(2)))>1.05?1:n,u=y.x+(-p.x+(y.width/2-b/2)),v*=n,g=y.y+(-p.y+(y.height/2-v/2)));else{var L=parseFloat(Math.min(y.width/b,y.height/v).toFixed(2)),P=b;P*=L;var w=v;w*=L;var T=y.x+(-p.x+(y.width/2-P/2)),I=y.y+(-p.y+(y.height/2-w/2)),F=(e.translatePoint.x-e.previousTranslate.x)/e.widthBeforeRefresh,k=(e.translatePoint.y-e.previousTranslate.y)/e.heightBeforeRefresh;u=T+F*e.availableSize.width,g=I+k*e.availableSize.height,e.previousTranslate=new pt(T,I),e.zoomTranslatePoint.x=u,e.zoomTranslatePoint.y=g}else v*=n=parseFloat(Math.min(y.width/b,y.height/v).toFixed(2)),b*=n,g=y.y+(-p.y+(y.height/2-v/2)),u=y.x+(-p.x+(y.width/2-b/2));t.isNullOrUndefined(e.translatePoint)||(u=e.enablePersistence&&0!==e.translatePoint.x&&!e.zoomNotApplied?e.translatePoint.x:u,g=e.enablePersistence&&0!==e.translatePoint.y&&!e.zoomNotApplied?e.translatePoint.y:g)}return n=e.enablePersistence?e.mapScaleValue>=1?e.mapScaleValue:1:n,e.widthBeforeRefresh=e.availableSize.width,e.heightBeforeRefresh=e.availableSize.height,{scale:n,location:new pt(u,g)}}function Se(e,i,o){var n,a=e.zoomSettings.zoomFactor,l=e.centerPosition,r=l.latitude,s=l.longitude,d=!t.isNullOrUndefined(e.centerLongOfGivenLocation)&&!t.isNullOrUndefined(e.centerLatOfGivenLocation)&&e.zoomNotApplied;t.isNullOrUndefined(e.previousCenterLatitude)&&t.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,(t.isNullOrUndefined(e.mapScaleValue)||a>e.mapScaleValue)&&(e.isReset&&1===e.mapScaleValue?e.mapScaleValue=e.mapScaleValue:!t.isNullOrUndefined(e.mapScaleValue)&&e.mapScaleValue<=e.scale?e.mapScaleValue=e.scale:e.mapScaleValue=a),e.mapScaleValue=1!==e.zoomSettings.zoomFactor&&e.zoomSettings.zoomFactor===e.mapScaleValue?e.zoomSettings.zoomFactor:e.zoomSettings.zoomFactor===e.mapScaleValue||e.centerPositionChanged?e.zoomSettings.zoomFactor:e.mapScaleValue,e.zoomSettings.shouldZoomInitially&&!e.isZoomByPosition&&(e.mapScaleValue=a=n=(e.enablePersistence||e.zoomSettings.shouldZoomInitially)&&1===e.scale?e.scale:t.isNullOrUndefined(e.markerZoomFactor)?e.mapScaleValue:e.markerZoomFactor,a=e.mapScaleValue,t.isNullOrUndefined(e.markerCenterLatitude)||t.isNullOrUndefined(e.markerCenterLongitude)||(r=e.markerCenterLatitude,s=e.markerCenterLongitude)),d&&(e.mapScaleValue=n=a=e.scaleOfGivenLocation);var p,m,c=o?1:e.mapScaleValue,u=e.mapAreaRect,g=e.baseMapRectBounds.min,y=e.baseMapRectBounds.max,f=o?1:e.mapScaleValue,b=Math.abs(y.x-g.x),v=Math.abs(g.y-y.y);if(!t.isNullOrUndefined(s)&&0!==s&&!t.isNullOrUndefined(r)&&0!==r||d){var S=(v+Math.abs(e.mapAreaRect.height-v))/2/f,x=(b+Math.abs(e.mapAreaRect.width-b))/2/f,C=d?be(e,i):h(r,s,e.mapLayerPanel.calculateFactor(i),i,e);t.isNullOrUndefined(e.zoomTranslatePoint)&&t.isNullOrUndefined(e.previousProjection)||e.zoomNotApplied?(p=-C.x+x+e.mapAreaRect.x/c,m=-C.y+S+e.mapAreaRect.y/c):e.previousProjection!==e.projectionType?(p=-C.x+x,m=-C.y+S):(e.isZoomByPosition&&(e.zoomTranslatePoint.x=-C.x+x,e.zoomTranslatePoint.y=-C.y+S),p=e.zoomTranslatePoint.x,m=e.zoomTranslatePoint.y,a=c),t.isNullOrUndefined(e.translatePoint)||(m=e.enablePersistence&&0!==e.translatePoint.y&&!e.zoomNotApplied?e.translatePoint.y:m,p=e.enablePersistence&&0!==e.translatePoint.x&&!e.zoomNotApplied?e.translatePoint.x:p),n=0!==a?a:1}else{var O=0===e.zoomSettings.zoomFactor?1:e.zoomSettings.zoomFactor,_=e.zoomSettings.maxZoom;n=O=O>_?_:O;var M=0===e.mapScaleValue?1:e.mapScaleValue>_?_:e.mapScaleValue,x=u.x+(-g.x+(u.width/2-b/2)),S=u.y+(-g.y+(u.height/2-v/2));if(!t.isNullOrUndefined(e.zoomTranslatePoint)||!t.isNullOrUndefined(e.previousProjection))if(e.previousProjection!==e.projectionType){var L=[],P={x:x,y:S};L.push(P);for(var w=1;w<_;w++)P={x:L[w-1].x-(u.width/w-u.width/(w+1))/2,y:L[w-1].y-(u.height/w-u.height/(w+1))/2},L.push(P);x=L[O-1].x,S=L[O-1].y}else x=e.zoomTranslatePoint.x,S=e.zoomTranslatePoint.y,O!==M&&(n=M);t.isNullOrUndefined(e.translatePoint)||(p=e.enablePersistence&&0!==e.translatePoint.x&&!e.zoomNotApplied?e.translatePoint.x:x,m=e.enablePersistence&&0!==e.translatePoint.y&&!e.zoomNotApplied?e.translatePoint.y:S)}return n=e.enablePersistence?0===e.mapScaleValue?1:e.mapScaleValue:n,e.widthBeforeRefresh=e.availableSize.width,e.heightBeforeRefresh=e.availableSize.height,{scale:o?1:n,location:new pt(p,m)}}function xe(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 Ce(e){return document.getElementById(e)}function Oe(e){return"string"==typeof e?parseFloat(e):e}function _e(e,t){return e.formatFunction=e.intl.getNumberFormat({format:e.format,useGrouping:e.useGroupingSeparator}),e.formatFunction(t)}function Me(e,i){var o=null;try{"function"!=typeof e&&document.querySelectorAll(e).length?o=t.compile(document.querySelector(e).innerHTML.trim()):i.isVue||i.isVue3?o=t.compile(e):"function"==typeof e&&(o=t.compile(e))}catch(i){o=t.compile(e)}return o}function Le(e){return document.getElementById(e)}function Pe(e,t){var i,o=parseInt(e.split("_LayerIndex_")[1].split("_")[0],10),n=parseInt(e.split("_shapeIndex_")[1].split("_")[0],10),a=t.layersCollection[o],l=a.layerData[n].property;return a.dataSource&&(i=a.dataSource[de(a.dataSource,l,a.shapeDataPath,a.shapePropertyPath)]),{shapeData:l,data:i}}function we(e,i,o,n){var a=Pe(e,o),l={color:i.border.color,opacity:i.border.opacity,width:i.border.width},r=i.enableMultiSelect?{cancel:!1,name:n,fill:i.fill,opacity:i.opacity,border:l,shapeData:a.shapeData,data:a.data,target:e,maps:o,shapeDataCollection:o.shapeSelectionItem}:{cancel:!1,name:n,fill:i.fill,opacity:i.opacity,border:l,shapeData:a.shapeData,data:a.data,target:e,maps:o};return o.trigger(n,r,function(){r.border.opacity=t.isNullOrUndefined(r.border.opacity)?r.opacity:r.border.opacity}),r}function Te(e){return document.getElementsByClassName(e)}function Ie(e,t){var i=null;return document.getElementById(t)&&(i=document.getElementById(t).querySelector("#"+e)),i}function Fe(e,t,i,o){for(var n,a=o.layers[e].shapeData.features,l=0;l<a.length;l++)if(a[l].properties.name===t){n=o.element.id+"_LayerIndex_"+e+"_shapeIndex_"+l+"_dataIndex_undefined";break}return Le(n)}function ke(e,i,o){var n=t.createElement("style",{id:e});return n.innerText="."+i+"{fill:"+o.fill+";fill-opacity:"+(t.isNullOrUndefined(o.opacity)?"1":o.opacity.toString())+";stroke-opacity:"+(t.isNullOrUndefined(o.border.opacity)?"1":o.border.opacity.toString())+";stroke-width:"+o.border.width.toString()+";stroke:"+o.border.color+";}",n}function Ne(e,i,o){var n=Le(e);t.isNullOrUndefined(n)||(n.innerText="."+i+"{fill:"+o.fill+";fill-opacity:"+(t.isNullOrUndefined(o.opacity)?"1":o.opacity.toString())+";stroke-width:"+o.border.width.toString()+";stroke-opacity:"+(t.isNullOrUndefined(o.border.opacity)?"1":o.border.opacity.toString())+";stroke:"+o.border.color+"}")}function Ee(e,i,o,n,a){var l={color:e.border.color,width:e.border.width/i.scale,opacity:e.border.opacity},r={opacity:e.opacity,fill:e.fill,border:l,name:bi,target:o.id,cancel:!1,shapeData:n,data:a,maps:i};i.trigger("itemSelection",r,function(o){r.border.opacity=t.isNullOrUndefined(e.border.opacity)?e.opacity:e.border.opacity,i.shapeSelectionItem.push(r.shapeData),Le("ShapeselectionMap")?Ne("ShapeselectionMap","ShapeselectionMapStyle",r):document.body.appendChild(ke("ShapeselectionMap","ShapeselectionMapStyle",r))})}function ze(e){e.removeAttribute("class")}function Be(e,i,o,n,a,l,r){void 0===r&&(r=0);var s=n.x,d=n.y,p=0,h=e.getAttribute("transform")||"";new t.Animation({}).animate(e,{duration:0===o&&"Enable"===t.animationMode?1e3:o,delay:i,progress:function(i){if(i.timeStamp>i.delay&&!a.zoomModule.isPanningInProgress){if(a.isTileMap&&0===p){var o=document.querySelector(".GroupElement");t.isNullOrUndefined(o)||(o.style.display="block")}p=(i.timeStamp-i.delay)/i.duration,e.setAttribute("transform","translate( "+(s-r*p)+" "+(d-r*p)+" ) scale("+p+")")}else a.zoomModule.isPanningInProgress&&(h=e.getAttribute("transform"))},end:function(t){if(a.zoomModule.isPanningInProgress||e.setAttribute("transform",h),a.zoomModule.isPanningInProgress=!1,l){var i={cancel:!1,name:fi,element:l,maps:a};a.trigger(fi,i)}}})}function Ae(e){fe(e)}function Ue(e,i,o,n,a,l,r,d,p){var h=s(o,n,d);t.isNullOrUndefined(h)||(o=h.x,n=h.y);for(var m=document.getElementById(r),c=C(e,{fontFamily:"Segoe UI",size:"8px",fontStyle:"Normal",fontWeight:"Regular"}).width,u=e.split(" "),g=u[0].length,y=1;y<u.length;y++)g<u[y].length&&(g=u[y].length);m||((m=t.createElement("div",{id:r})).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'),o<a-c?o=o:o>a-c&&o<a-8*g?c=a-o:o>=a-8*g&&(o>c?o-=c:(c=o,o=0));var f=i.split("px");Ze(m,e,o,n,f,c,a,d),m.clientHeight+2*parseInt(f[0],10)>l&&(c=o,o=0),Ze(m,e,o,n,f,c,a,d),p&&setTimeout(Ae,5e3,r)}function Ze(e,t,i,o,n,a,l,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=a.toString()+"px",e.style.maxWidth=l.toString()+"px",e.style.wordWrap="break-word",r.appendChild(e)}function je(e,i,o,n,a){var l=Le(e),r=Re(a.borderColor),s=Re(a.fontColor),d="top:"+o.toString()+"px;left:"+n.toString()+"px;color:"+(s?"rgba("+s.r+","+s.g+","+s.b+","+a.fontOpacity+")":a.fontColor)+";background:"+a.fill+";z-index: 2;position:absolute;border:"+a.borderWidth+"px solid "+(r?"rgba("+r.r+","+r.g+","+r.b+","+a.borderOpacity+")":a.borderColor)+";font-family:"+a.fontFamily+";font-style:"+a.fontStyle+";font-weight:"+a.fontWeight+";font-size:"+a.fontSize+";border-radius:"+a.borderWidth+"px;";!l&&a.visible?((l=t.createElement("div",{id:e})).innerHTML=t.SanitizeHtmlHelper.sanitize("&nbsp;"+i+"&nbsp;"),l.style.cssText=d,document.body.appendChild(l)):a.visible&&(l.innerHTML=t.SanitizeHtmlHelper.sanitize("&nbsp;"+i+"&nbsp;"),l.style.cssText=d)}function Re(e){if(-1!==e.indexOf("#")&&-1===e.toLowerCase().indexOf("rgb"))return(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;if(-1!==e.toLowerCase().indexOf("rgb"))return(i=e.match(/\d+/g).map(function(e){return parseInt(e,10)}))?{r:i[0],g:i[1],b:i[2]}:null;var t=document.createElement("div");t.style.color=e;var i=window.getComputedStyle(document.body.appendChild(t)).color.match(/\d+/g).map(function(e){return parseInt(e,10)});return document.body.removeChild(t),i?{r:i[0],g:i[1],b:i[2]}:null}function De(e,t,o,n,a){var l=new i.SvgRenderer(""),r=Ve(e,o,t,a,n);return l["draw"+r.functionName](r.renderOption)}function Ve(e,i,o,n,a){var l,r="Path",s=i.width,d=i.height,p=e.x,h=e.y,m=e.x+-s/2,c=e.y+-d/2;switch(n.stroke="HorizontalLine"===o||"VerticalLine"===o||"Cross"===o?n.fill:n.stroke,n["stroke-width"]=0!==n["stroke-width"]||"HorizontalLine"!==o&&"VerticalLine"!==o&&"Cross"!==o?n["stroke-width"]:1,o){case"Circle":case"Bubble":r="Ellipse",t.merge(n,{rx:s/2,ry:d/2,cx:p,cy:h});break;case"VerticalLine":l="M "+p+" "+(h+d/2)+" L "+p+" "+(h+-d/2),t.merge(n,{d:l});break;case"HorizontalLine":l="M "+p+" "+h+" L "+(p+s/2)+" "+h,t.merge(n,{d:l});break;case"Diamond":l="M "+m+" "+h+" L "+p+" "+(h+-d/2)+" L "+(p+s/2)+" "+h+" L "+p+" "+(h+d/2)+" L "+m+" "+h+" z",t.merge(n,{d:l});break;case"Rectangle":l="M "+m+" "+(h+-d/2)+" L "+(p+s/2)+" "+(h+-d/2)+" L "+(p+s/2)+" "+(h+d/2)+" L "+m+" "+(h+d/2)+" L "+m+" "+(h+-d/2)+" z",t.merge(n,{d:l});break;case"Triangle":l="M "+m+" "+(h+d/2)+" L "+p+" "+(h+-d/2)+" L "+(p+s/2)+" "+(h+d/2)+" L "+m+" "+(h+d/2)+" z",t.merge(n,{d:l});break;case"InvertedTriangle":l="M "+(p+s/2)+" "+(h-d/2)+" L "+p+" "+(h+d/2)+" L "+(p-s/2)+" "+(h-d/2)+" L "+(p+s/2)+" "+(h-d/2)+" z",t.merge(n,{d:l});break;case"Pentagon":for(var u=void 0,g=void 0,y=0;y<=5;y++)u=s/2*Math.cos(Math.PI/180*(72*y)),g=s/2*Math.sin(Math.PI/180*(72*y)),l=0===y?"M "+(p+u)+" "+(h+g)+" ":l.concat("L "+(p+u)+" "+(h+g)+" ");l=l.concat("Z"),t.merge(n,{d:l});break;case"Star":l="M "+(e.x+i.width/3)+" "+(e.y+i.height/2)+" L "+(e.x-i.width/2)+" "+(e.y-i.height/6)+" L "+(e.x+i.width/2)+" "+(e.y-i.height/6)+" L "+(e.x-i.width/3)+" "+(e.y+i.height/2)+" L "+e.x+" "+(e.y-i.height/2)+" L "+(e.x+i.width/3)+" "+(e.y+i.height/2)+" Z",t.merge(n,{d:l});break;case"Cross":l="M "+m+" "+h+" L "+(p+s/2)+" "+h+" M "+p+" "+(h+d/2)+" L "+p+" "+(h+-d/2),t.merge(n,{d:l});break;case"Image":r="Image",t.merge(n,{href:a,height:d,width:s,x:m,y:c})}return{renderOption:n,functionName:r}}function He(e,t){t.appendChild(e);var i=e.offsetWidth,o=e.offsetHeight;return t.removeChild(e),new dt(i,o)}function Ge(e,i,o,n){for(var a,l=0;l<e.childElementCount;l++)if((a=e.childNodes[l]).id.indexOf("_NavigationGroup")>-1)We(a,i,o,n);else if(a.id.indexOf("_Polygons_Group")>-1)for(var r=0;r<a.childElementCount;r++){var s=n.layersCollection[i].polygonSettings.polygons[parseInt(a.children[r].id.split("_PolygonIndex_")[1])].borderWidth;a.children[r].setAttribute("stroke-width",(s/o).toString())}else{var d=void 0,p=0,h=n.layersCollection[i].shapeSettings.borderWidthValuePath,m=n.layersCollection[i].shapeSettings.border.width,c=n.layersCollection[i].shapeSettings.circleRadius;d=n.layersCollection[i].shapeSettings.borderWidthValuePath&&null!==(p=de(n.layersCollection[i].dataSource,n.layersCollection[i].layerData[l].property,n.layersCollection[i].shapeDataPath,n.layersCollection[i].shapePropertyPath,n.layersCollection[i]))&&n.layersCollection[i].dataSource[p][h]?n.layersCollection[i].dataSource[p][h]:t.isNullOrUndefined(m)?0:m,a.setAttribute("stroke-width",(d/o).toString()),(e.id.indexOf("_Point")>-1||e.id.indexOf("_MultiPoint")>-1)&&a.setAttribute("r",(c/o).toString())}}function We(e,t,i,o){for(var n,a=0;a<e.childElementCount;a++)if("path"===(n=e.childNodes[a]).tagName){var l=o.layersCollection[t].navigationLineSettings[parseFloat(n.id.split("_NavigationIndex_")[1].split("_")[0])].width;n.setAttribute("stroke-width",(l/i).toString())}}function Xe(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 qe(e,t){var i=Ye(e[0],e[1]);return Ye(t[0],t[1])/i}function Ye(e,t){var i=e.pageX-t.pageX,o=e.pageY-t.pageY;return Math.sqrt(i*i+o*o)}function Je(e,t){var i=t.element.getBoundingClientRect(),o=i.top+document.defaultView.pageXOffset,n=i.left+document.defaultView.pageYOffset;return Array.prototype.slice.call(e).map(function(e){return{x:e.pageX-n,y:e.pageY-o}})}function Qe(e){return{x:e.map(function(e){return e.x}).reduce(Ke)/e.length,y:e.map(function(e){return e.y}).reduce(Ke)/e.length}}function Ke(e,t){return e+t}function $e(e,t,i,o,n,a,l){var r=0,s=l.previousPoint,d=l.previousScale,p=n-d,h=new _t(0,0),m=1;if(n===d)return void e.setAttribute("transform","scale( "+n+" ) translate( "+o.x+" "+o.y+" )");var c=function(e,t){return e.x===t.x?null:(t.y-e.y)/(t.x-e.x)}(s,o),u=function(e,t){return null===t?e.x:e.y-t*e.x}(s,c),g=o.x-s.x,y=o.y-s.y;et(e,t,i,function(e){e.timeStamp>e.delay&&(r=(e.timeStamp-e.delay)/e.duration,m=d+r*p,h.x=s.x+r*g/(m/n),h.y=null==c?s.y+r*y:c*h.x+u,e.element.setAttribute("transform","scale( "+m+" ) translate( "+h.x+" "+h.y+" )"),l.translatePoint=h,l.scale=m,l.zoomModule.processTemplate(o.x,o.y,m,l))},function(){l.translatePoint=o,l.scale=n,e.setAttribute("transform","scale( "+n+" ) translate( "+o.x+" "+o.y+" )"),l.zoomModule.processTemplate(o.x,o.y,n,l)})}function et(e,i,o,n,a){var l,r=this,s=null;o="Disable"===t.animationMode?0:o;var d=function(t){s||(s=t);var i=t-s;i<o?(n.call(r,{element:e,delay:0,timeStamp:i,duration:o}),window.requestAnimationFrame(d)):(window.cancelAnimationFrame(l),a.call(r,{element:e}),e.id.indexOf("Marker")>-1&&(Ce(e.id.split("_Layer")[0]+"_Markers_Group").style.cssText="visibili