/* @source http://purl.eligrey.com/github/color.js/blob/master/color.js Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh) Licensed under the MIT License (LICENSE.txt). Version: 3.1.9 Requires: jQuery 1.2.2+ Hammer.JS - v1.0.5 - 2013-04-07 http://eightmedia.github.com/hammer.js Copyright (c) 2013 Jorik Tangelder ; Licensed under the MIT license */ function getcmapscssroot_lf5x2(){return"com_cmapsanalytics_"}var centigonNameSpaceUtil=new CentigonNameSpaceUtil;function createNamespaceUnderCentigon(b){centigonNameSpaceUtil.createNamespaceUnderCentigon(b)}function CentigonNameSpaceUtil(){}var centigon;CentigonNameSpaceUtil.getCentigonNamespace=function(b){return centigon=window?window.centigon||{}:centigon||{}}; CentigonNameSpaceUtil.prototype.createNamespaceUnderCentigon=function(b){b=b.split(".");for(var a=CentigonNameSpaceUtil.getCentigonNamespace(),c=0;cb&&(b+=4294967296);this._position+=centigon.util.ByteArray.INT_LEN;return 2147483647c&&(c+=4294967296);return c};centigon.util.ByteArray.prototype.getIntBasedOnEndian=function(b,a){return a===centigon.util.ByteArray.ENDIANTYPE.BIG_ENDIAN?(((b[0]<<8)+b[1]<<8)+ b[2]<<8)+b[3]:(((b[3]<<8)+b[2]<<8)+b[1]<<8)+b[0]};centigon.util.ByteArray.prototype.readDouble=function(){var b=this.readIntAt(this._position+4,centigon.util.ByteArray.ENDIANTYPE.LITTLE_ENDIAN);var a=this.readIntAt(this._position,centigon.util.ByteArray.ENDIANTYPE.LITTLE_ENDIAN),c=(b>>20&2047)-1023;b=(b>>31?-1:1)*(b&1048575|1048576)/Math.pow(2,20)*Math.pow(2,c)+1*a/Math.pow(2,52)*Math.pow(2,c);this._position+=centigon.util.ByteArray.DOUBLE_LEN;return b};centigon.util.ByteArray.INT_LEN=4;centigon.util.ByteArray.DOUBLE_LEN= 8;centigon.util.ByteArray.ENDIANTYPE={BIG_ENDIAN:"bigendian",LITTLE_ENDIAN:"littleendian"}})(); (function(){createNamespaceUnderCentigon("util.CollectionIterator");centigon.util.CollectionIterator=function(b){this.array=[];this.utilFactory=new centigon.util.UtilityFactory;this._stringUtil=this.utilFactory.getStringUtil();var a=[];if(b instanceof centigon.util.CollectionIterator)a=this.cloneArray(b.array);else if(b instanceof Array)a=this.cloneArray(b);else if(b)for(var c in b){var f={};f[c]=b[c];a.push(f)}else a=[];this.array=a;this.position=0};centigon.util.CollectionIterator.prototype.hasNext= function(){return this.positionc[b]?1:0}))};centigon.util.CollectionIterator.prototype.getSortedArrayObjsByFieldDescending=function(b){return this.cloneArray(this.array.sort(function(a,c){return a[b]c[b]?-1:0}))};centigon.util.CollectionIterator.prototype.getNumericSortedArrayObjsByFieldAscending=function(b){return this.cloneArray(this.array.sort(function(a, c){return Number(a[b])Number(c[b])?1:0}))};centigon.util.CollectionIterator.prototype.getNumericSortedArrayObjsByFieldDescending=function(b){return this.cloneArray(this.array.sort(function(a,c){return Number(a[b])Number(c[b])?-1:0}))};centigon.util.CollectionIterator.prototype.getColumnFromObjsByField=function(b){for(var a=[],c,f=0;fb?!0:!1};centigon.util.CollectionIterator.prototype.doesntHaveItemAt=function(b){var a= !1;!1===this.hasItemAt(b)&&(a=!0);return a};centigon.util.CollectionIterator.prototype.getItemAt=function(b){return this.hasItemAt(b)?this.array[b]:null};centigon.util.CollectionIterator.prototype.resetPosition=function(){this.position=0};centigon.util.CollectionIterator.prototype.getPosition=function(){return this.position};centigon.util.CollectionIterator.prototype.getPreviousPosition=function(){return this.position-1};centigon.util.CollectionIterator.prototype.getMin=function(){return Math.min.apply(null, this.array)};centigon.util.CollectionIterator.prototype.getSum=function(){for(var b=0,a=new centigon.util.CollectionIterator(this.cloneSourceArray());a.hasNext();)b+=a.next();return b};centigon.util.CollectionIterator.prototype.getMed=function(){var b=new centigon.util.CollectionIterator(this.cloneSourceArray());b.sortAscending();b=b.cloneSourceArray();return b[Math.floor((b.length-1)/2)]};centigon.util.CollectionIterator.prototype.getMedIx=function(){return this.array.indexOf(this.getMed())};centigon.util.CollectionIterator.prototype.getMax= function(){return Math.max.apply(null,this.array)};centigon.util.CollectionIterator.prototype.getLength=function(){return this.array.length};centigon.util.CollectionIterator.prototype.getLast=function(){return this.array[this.getLength()-1]};centigon.util.CollectionIterator.prototype.getFirstIndexWhereAnyOfTheValuesFound=function(b){var a=-1;for(b=new centigon.util.CollectionIterator(b);b.hasNext();){var c=b.next();c=this.getFirstIndexWhereValueFound(c);if(-1"+b.key+""+ a.mapVersion+""+c+""+this.transactionType+"19EE7B71F-25BE-4E85-845F-DC6F9F3D5342",success:function(a){if(f.onSuccessCallback)f.onSuccessCallback(a)},error:function(a,b,c){if(f.onFailureCallback)f.onFailureCallback(c)}})};centigon.licensing.LicenseService.LICENSE_TYPES={LICENSE_TYPE_STANDARD_TRIAL:"1",LICENSE_TYPE_ENTERPRISE_TRIAL:"2",LICENSE_TYPE_FULL_DEVELOPER:"3", LICENSE_TYPE_FULL_ENTERPRISE:"4",LICENSE_TYPE_NFR:"5",LICENSE_TYPE_FULL_DEVELOPER_GOVERNOR:"6",LICENSE_TYPE_MOBILE_TRIAL:"7",LICENSE_TYPE_MOBILE_FULL:"8",LICENSE_TYPE_DESIGNER:"9"}})(); (function(){var b=[];createNamespaceUnderCentigon("mapping.APICentral");centigon.mapping.APICentral=function(){};centigon.mapping.APICentral.getMapAPIWrapper=function(a){b[a]||(mapapiLoadedlds5c115f41dfb12bfdf=mapapiRequestedlds5c115f41dfb12bfdf=!1);switch(a){case centigon.mapping.APICentral.MAP_TYPES.GOOG:var c=new centigon.mapping.GoogleMapAPIWrapper;break;case centigon.mapping.APICentral.MAP_TYPES.LEAF:c=new centigon.mapping.LeafletMapApiWrapper(a);break;case centigon.mapping.APICentral.MAP_TYPES.CARTO:c= new centigon.mapping.LeafletMapApiWrapper(a);break;case centigon.mapping.APICentral.MAP_TYPES.HERE:c=new centigon.mapping.LeafletMapApiWrapper(a);break;case centigon.mapping.APICentral.MAP_TYPES.ESRI:c=new centigon.mapping.LeafletEsriMapApiWrapper;break;case centigon.mapping.APICentral.MAP_TYPES.MAPBOX:c=new centigon.mapping.LeafletMapApiWrapper(a)}b[a]=!0;return c};centigon.mapping.APICentral.getCanvasOverlayPrototype=function(a){switch(a){case centigon.mapping.APICentral.MAP_TYPES.GOOG:var b=new google.maps.OverlayView; b.onAdd=function(){this.centigonActualOnAdd()};break;case centigon.mapping.APICentral.MAP_TYPES.LEAF:b=new L.CanvasOverlay;break;case centigon.mapping.APICentral.MAP_TYPES.ESRI:b=new L.CanvasOverlay;break;case centigon.mapping.APICentral.MAP_TYPES.MAPBOX:b=new L.CanvasOverlay;break;case centigon.mapping.APICentral.MAP_TYPES.CARTO:b=new L.CanvasOverlay;break;case centigon.mapping.APICentral.MAP_TYPES.HERE:b=new L.CanvasOverlay}return b};centigon.mapping.APICentral.MAP_TYPES={GOOG:"google",LEAF:"leaflet", ESRI:"esri",MAPBOX:"mapbox",CARTO:"carto",HERE:"here"}})(); (function(){createNamespaceUnderCentigon("mapping.CMap");centigon.mapping.CMap=function(b){this._utilFactory=new centigon.util.UtilityFactory;this._stringUtil=this._utilFactory.getStringUtil();this._objectUtil=this._utilFactory.getObjectUtil();this._logger=this._utilFactory.getLoggerUtil();this._markerSizeMin;this._markerSizeMax;this._mapParentDivId="";this.batchGeocoder;this.legend;this.drawingProgDisp;this.infoWindowContentGenerator;this.layerSelectionGlowAlpha=75;this.layerSelectionGlowColor=255; this.useGlowEffectOnLayerSelections=!1;this.showInfoWindows=!0;this.isDragging=!1;this.useDynamicZoom=!0;this._showAdhocPanel=!1;this.infoWindowSelectionMode=centigon.mapping.CMap.INFO_WINDOW_SELECTION_MODES.SHOW_WINDOWS_ON_MOUSE_CLICK;this.mapAPIKey="";this.onMapCenterChangedCallback;this._mapAPIAdapter=centigon.mapping.APICentral.getMapAPIWrapper(b.apiToUse);this._mapAPIAdapter.baseTileUrl=b.baseTileUrl;this._mapAPIAdapter.baseMapTileCfg=b.baseMapTileCfg;this._mapAPIAdapter.cMap=this;this._mapAPIAdapter.setAllowMultipleSelection(!1); this._mapLayerProvider=new centigon.mapping.MapLayerProvider;this._lastMapLayers=this._utilFactory.getCollectionIterator();this._logger=this._utilFactory.getLoggerUtil();this.allOpenInfowindows=this._utilFactory.getCollectionIterator()};centigon.mapping.CMap.prototype.sqMetersToMiles=function(b){return 3.86102159E-7*b};centigon.mapping.CMap.prototype.sqMetersToKm=function(b){return 1E-6*b};centigon.mapping.CMap.prototype.metersToMiles=function(b){return b/1609.34};centigon.mapping.CMap.prototype.metersToKm= function(b){return b/1E3};centigon.mapping.CMap.prototype.getDirectionsUrl=function(b){return this._mapAPIAdapter.getDirectionsUrl(b)};centigon.mapping.CMap.prototype.getDirectionsRenderer=function(){return this._mapAPIAdapter.getDirectionsRenderer()};centigon.mapping.CMap.prototype.getDistBetweenLocationsInMeters=function(b){return this._mapAPIAdapter.getDistBetweenLocations(b)};centigon.mapping.CMap.prototype.getAreaOfViewportInMeters=function(){return this._mapAPIAdapter.getAreaOfViewportInMeters()}; centigon.mapping.CMap.prototype.getAreaOfPolyInMeters=function(b){return this._mapAPIAdapter.getAreaOfPolyInMeters(b)};centigon.mapping.CMap.prototype.boundsContain=function(b,a){return this._mapAPIAdapter.boundsContain(b,a)};centigon.mapping.CMap.prototype.shapeContains=function(b,a){return this._mapAPIAdapter.shapeContains(b,a)};centigon.mapping.CMap.prototype.circleContains=function(b,a){return this._mapAPIAdapter.circleContains(b,a)};centigon.mapping.CMap.prototype.getBaseMapProviderMap=function(){return this._mapAPIAdapter.map}; centigon.mapping.CMap.prototype.triggerMapResize=function(){this._mapAPIAdapter.forceRefresh()};centigon.mapping.CMap.prototype.triggerLayerChildClick=function(b,a){this._mapAPIAdapter.handleLayerSelected(b,a,"click")};centigon.mapping.CMap.prototype.toggleSpecialApiLayer=function(b,a){this._mapAPIAdapter.toggleSpecialApiLayer(b,a)};centigon.mapping.CMap.prototype.getBaseMap=function(){return this._mapAPIAdapter.map};centigon.mapping.CMap.prototype.getTravelTimesFromOrigin=function(b){this._mapAPIAdapter.getTravelTimesFromOrigin(b, b.callback)};centigon.mapping.CMap.prototype.getPlacesFromOrigin=function(b){this._mapAPIAdapter.getPlacesFromOrigin(b,b.callback)};centigon.mapping.CMap.prototype.closeAllInfoWindows=function(){this._mapAPIAdapter.closeAllInfoWindows()};centigon.mapping.CMap.prototype.setLayerSelectionGlowColor=function(b){this.layerSelectionGlowColor=b;this._mapAPIAdapter.layerSelectionGlowColor=this.layerSelectionGlowColor};centigon.mapping.CMap.prototype.setUseGlowEffectOnLayerSelections=function(b){this.useGlowEffectOnLayerSelections= b;this._mapAPIAdapter.useGlowEffectOnLayerSelections=this.useGlowEffectOnLayerSelections};centigon.mapping.CMap.prototype.getCurrentLocation=function(b){return this._mapAPIAdapter.getCurrentLocation(b)};centigon.mapping.CMap.prototype.getDirections=function(b,a){var c=b.csvLatLngs,f=b.callback;if(!(2>c.length)){for(var g=[],h,k=0;kp.length)){for(var v=1;vb?a=1:23=a&&-180<=b&&180>=b&&(c=!0);return c};centigon.mapping.CMap.prototype.seedMarkerSizeCalcVariables= function(b){try{b.sort(function(a,b){return b-a}),this._markerSizeMin=Number(b[b.length-1]),this._markerSizeMax=Number(b[0])}catch(a){this._logger.logError(a)}return{min:this._markerSizeMin,max:this._markerSizeMax}};centigon.mapping.CMap.prototype.getMarkerSize=function(b,a,c,f){if(isNaN(c)||isNaN(this._markerSizeMin)||isNaN(this._markerSizeMax))return a;try{if(f){var g=10*Math.log(c);60=g&&(g=1);return g}g=(this._markerSizeMin/10+c)/this._markerSizeMax*a;250=g&&(g=1)}catch(h){g= a,this._logger.logError(h)}return isNaN(g)?a:g};centigon.mapping.CMap.INFO_WINDOW_SELECTION_MODES={SHOW_WINDOWS_ON_MOUSE_CLICK:"showWindowsOnMouseClick",SHOW_WINDOWS_ON_MOUSE_OVER:"showWindowsOnMouseOver",SHOW_WINDOWS_ON_CLICK_AND_MOUSE_OVER:"showWindowsOnBoth"};centigon.mapping.CMap.SPECIAL_LAYER_TYPES={BIKE:"bike",TRAFFIC:"traffic",TRANSIT:"transit"}})(); (function(){createNamespaceUnderCentigon("mapping.CMapLegend");centigon.mapping.CMapLegend=function(b,a){this.cMap=b;this.cMapAnalytics=a.cMapAnalytics;this._parentDivId=a.mapParentDivId;this._utilFactory=new centigon.util.UtilityFactory;this._strUtil=this._utilFactory.getStringUtil();this._domUtil=this._utilFactory.getDomUtil();this._logger=this._utilFactory.getLoggerUtil();this._divId=this._domUtil.getRandomDivId();this._legendBgDivId=this._domUtil.getRandomDivId();this._visible=!1;this._legendExpandedState= [];this._cssToLayerInjectected={};this._layerToCtrlIds={};this._currentLayerForHtmlRendering;this._currentLgndItmCtrlIds;this._refreshMetricsTimer;this._drivePolyLayerIx=-1;this._cssInjectected=!1};centigon.mapping.CMapLegend.prototype.getBaseAssetUrl=function(){return this.cMapAnalytics.getBaseAssetUrl()+"v4/legend/"};centigon.mapping.CMapLegend.prototype.createLegend=function(){try{this._legendItemXOffset=0,this._cssInjectected||(this.injectMainCss(),this._cssInjectected=!0),this.clearLegendContents(), this.buildLegendContent(),!0===this._visible?this.showLegend():this.hideLegend()}catch(b){this._logger.logError(b)}};centigon.mapping.CMapLegend.prototype.buildLegendContent=function(){var b=this.domObj(this._parentDivId).parent().width();this._layerToCtrlIds={};this._domUtil.appendHtmlToDomObject(this._parentDivId,'');this.injectLayersCss(); b=this.cMap.getAllLayers();for(var a,c;b.hasNext();)a=b.next(),a.positionInMapDataProvider!==this._drivePolyLayerIx&&!1!==this.layerCanSupportLegend(a)&&(this._currentLayerForHtmlRendering=a,this._currentLgndItmCtrlIds=c=this.getCtrlIdsForLayer(a.positionInMapDataProvider),this._layerToCtrlIds[a.positionInMapDataProvider]=c,this.appendLegendItemToLegend(),this._legendItemXOffset+=127)};centigon.mapping.CMapLegend.prototype.injectLayersCss=function(){for(var b=this.cMap.getAllLayers(),a,c="";b.hasNext();)a= b.next(),c+=this.getLayerSpecificCss(a),this._cssToLayerInjectected[a.type]=!0;""!==c&&this._domUtil.addCssToDom(c)};centigon.mapping.CMapLegend.prototype.appendLegendItemToLegend=function(){this._domUtil.appendHtmlToDomObject(this._divId,this.getLegendItemHtml());this.addLegendItemEventListeners()};centigon.mapping.CMapLegend.prototype.getLegendItemHtml=function(){var b='
';this.layerCanSupportDetails(this._currentLayerForHtmlRendering.type)? (b+="
',b+=this.getLegendItemSizeChartHtml()):b+="
'; b+=this.getColorBannerHtml();b+=this.getCbAndBottomCtrlBarHtml();b=b+'
');b+=this.getDrivetimePolysHtml();b+=this.getMeasuresHtml();return b+"
"};centigon.mapping.CMapLegend.prototype.layerCanSupportDetails=function(){var b=!1;this.cMapAnalytics.layerTypeIsMarkerOrHeat(this._currentLayerForHtmlRendering.type)&& this._currentLayerForHtmlRendering.type!==centigon.mapping.Layer.TYPE.CUSTOM&&(b=!0);return b};centigon.mapping.CMapLegend.prototype.layerCanSupportLegend=function(b){var a=!0;b.type===centigon.mapping.Layer.TYPE.INDOOR&&(a=!1);return a};centigon.mapping.CMapLegend.prototype.layerVisChecboxChecked=function(b){b=this.getCtrlIdsForLayer(b.positionInMapDataProvider);return this._domUtil.getDomObjectById(b.layerNameCb+"Actual").prop("checked")?!0:!1};centigon.mapping.CMapLegend.prototype.legendVisible= function(){return this._domUtil.isVisible(this._divId)};centigon.mapping.CMapLegend.prototype.getLegendItemSizeChartHtml=function(){var b='
';b=b+'\t\t\t
\t\t\t\t
');b=b+'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t
');b=b+'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t
');return b+'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t
\t\t
'};centigon.mapping.CMapLegend.prototype.getColorBannerHtml=function(){if(this._currentLayerForHtmlRendering.type===centigon.mapping.Layer.TYPE.WMS)return""; var b=this.cMapAnalytics.values()[this._currentLayerForHtmlRendering.positionInMapDataProvider]||[],a=this._utilFactory.getCollectionIterator(b.slice());a.sortAscending();b=[this._currentLayerForHtmlRendering.defaultDisplayObjectColor,this._currentLayerForHtmlRendering.defaultDisplayObjectColor];if(this.cMapAnalytics.layerAlertsEnabled(this._currentLayerForHtmlRendering.positionInMapDataProvider)){b=this.cMapAnalytics.getLayerAlertColors(this._currentLayerForHtmlRendering.positionInMapDataProvider, a);var c=[];for(var f="",g=0;g';g=g+'\t\t\t
\t\t\t\t
'+ (c+'
\t\t\t\t
')+(f+'
\t\t\t\t
')+(a+"
");g+="\t\t\t
";return g+="\t\t
"};centigon.mapping.CMapLegend.prototype.getCbAndBottomCtrlBarHtml=function(){var b="",a=getcmapscssroot_lf5x2()+"regular-checkbox ";a+=getcmapscssroot_lf5x2()+"large-checkbox ";a+=getcmapscssroot_lf5x2()+"large-checkbox-"+ this._currentLayerForHtmlRendering.type;var c="checked";!1===this._currentLayerForHtmlRendering.visible&&(c="");b=b+'
'+this.getBottomControlBarHtml();b+='\t\t\t
"};centigon.mapping.CMapLegend.prototype.getBottomControlBarHtml=function(){var b='
';b+='\t\t\t
';b+='\t\t\t\t';b=b+'\t\t\t
\t\t\t
');b+='\t\t\t\t';b=b+'\t\t\t
\t\t\t
');b+='\t\t\t\t';b+="\t\t\t
\t\t
";var a='
';a+='\t\t\t
';a+='\t\t\t\t';a=a+'\t\t\t
\t\t\t
\t\t\t\t');a=a+'\t\t\t
\t\t\t
\t\t\t\t');a+="\t\t\t
\t\t
";return this.layerCanSupportDetails(this._currentLayerForHtmlRendering.type)?b:a};centigon.mapping.CMapLegend.prototype.getMeasuresHtml=function(){var b='
';b=b+'\t\t\t
\t\t\t\t
Count:
');b+='\t\t\t\t
Sum:
';b+='\t\t\t\t
Avg:
';b+='\t\t\t\t
Min:
'; b+='\t\t\t\t
Max:
';b+='\t\t\t\t
';b+='\t\t\t\t';b=b+'\t\t\t
\t\t\t
'); b+='\t\t\t\t';return b+"\t\t\t
\t\t
"};centigon.mapping.CMapLegend.prototype.getDrivetimePolysHtml=function(){var b='
'; b=b+'\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t');b+='\t\t\t\t'; b+='\t\t\t\t';b=b+'\t\t\t
\t\t\t
'); b+='\t\t\t\t';return b+"\t\t\t
\t\t
"};centigon.mapping.CMapLegend.prototype.refreshMeasuresHtml=function(){var b=this;this._refreshMetricsTimer&&clearTimeout(this._refreshMetricsTimer);this._refreshMetricsTimer=setTimeout(function(){var a;for(a in b._layerToCtrlIds){var c=b._layerToCtrlIds[a];var f=b.cMapAnalytics.getLayerAt(c.lyrIx);b.domObj(c.measuresLegendViewState+"Count").html("Count: "+b.getNumericDisplayValue(f.getCount())); b.domObj(c.measuresLegendViewState+"Sum").html("Sum: "+b.getNumericDisplayValue(f.getSum()));b.domObj(c.measuresLegendViewState+"Avg").html("Avg: "+b.getNumericDisplayValue(f.getAvg()));b.domObj(c.measuresLegendViewState+"Min").html("Min: "+b.getNumericDisplayValue(f.getMin()));b.domObj(c.measuresLegendViewState+"Max").html("Max: "+b.getNumericDisplayValue(f.getMax()));var g=b.cMapAnalytics.getAreaOfViewportInMeters(),h=b.getNumericDisplayValue(b.cMapAnalytics.sqMetersToMiles(g));g=b.getNumericDisplayValue(b.cMapAnalytics.sqMetersToKm(g)); h="[mi]"+h+"[km]"+g;b.domObj(c.measuresLegendViewState+"Area").html(h);b.domObj(c.measuresLegendViewState+"Measures").html(b.getMeasuresList(f,c.measuresLegendViewState+"Measures"));f.restrictCalcsToVisible=!0;f.restrictCalcsToViewport=!0;f.restrictCalcsToSelected=!1}},200)};centigon.mapping.CMapLegend.prototype.refreshLegend=function(){!0===this._visible&&this.refreshMeasuresHtml()};centigon.mapping.CMapLegend.prototype.getMeasuresList=function(b,a){for(var c="",f=b.getMeasureIx(),g,h=this._utilFactory.getCollectionIterator(b.measureNames());h.hasNext();)g= f===h.getPosition()?"selected":"",c+='";0===h.getLength()?this.domObj(a).hide():this.domObj(a).show();return c};centigon.mapping.CMapLegend.prototype.getNumericDisplayValue=function(b){return!0===isNaN(b)||!1===isFinite(b)?"[No Data]":this._strUtil.getFormattedAbbreviatedDisplayValue(b)};centigon.mapping.CMapLegend.prototype.plotDrivetimeLayer=function(b,a){var c=this.cMapAnalytics.getLayerAt(a.lyrIx),f={};f.markerlayerbindings=[a.lyrIx]; -1===this._drivePolyLayerIx&&(this._drivePolyLayerIx=this.cMapAnalytics.locations().length);var g=this.cMapAnalytics.layerAppearanceOptions(),h=this.cMapAnalytics.overlayTypes(),k=this.cMapAnalytics.layerNames(),l=this.cMapAnalytics.locations(),m=this.cMapAnalytics.labels(),n=this.cMapAnalytics.values(),p=this.cMapAnalytics.layersTransparency();h[this._drivePolyLayerIx]=centigon.mapping.Layer.TYPE.RADIUS;k[this._drivePolyLayerIx]="Radius";p[this._drivePolyLayerIx]=50;var q=[];c=(c=c.getSelectedLocation())? c.toCsvLatLon():this.cMapAnalytics.currentMapCenterLatitude()+","+this.cMapAnalytics.currentMapCenterLongitude();var u=[];g[this._drivePolyLayerIx]=f;f=this.cMapAnalytics.cMap;for(var v=this.domObj(a.selDriveTimePolygonsMeasure).val(),r=[],w=this.domObj(a.txtTimePolygonsDistances).val().split(","),t,x=0;x';a+='\t\t\t\t
'; a+='\t\t\t\t\t';a=a+'\t\t\t\t
\t\t\t\t
');c._domUtil.appendHtmlToDomObject(c._parentDivId,a+"\t\t");c.domObj(b.btnCloseStreetView).click(function(a){c.domObj(b.divStreetView).remove()});var g=c.cMapAnalytics.cMap.getMapApiAdapter();setTimeout(function(){g.createStreetViewMap(f)},200)}else alert("Please select a marker to see the street view.")}); c.domObj(b.myExpandedControlsClass).hide();this.changeViewState("collapsed",b)};centigon.mapping.CMapLegend.prototype.changeViewState=function(b,a){this.domObj(a.driveTimePolygonsLegendViewState).hide();this.domObj(a.measuresLegendViewState).hide();"drivetime"===b?this.domObj(a.driveTimePolygonsLegendViewState).show():"metrics"===b?(this.domObj(a.measuresLegendViewState).show(),this.refreshMeasuresHtml()):"collapsed"===b?(this.domObj(a.btnExpand).css("bottom","19px"),this.domObj(a.btnExpand).css("left", "110px"),this._domUtil.getDomObjectByClassId("."+a.myExpandedControlsClass).hide(),this.domObj(a.legendItem).css("height","35px"),this.domObj(a.layerNameLabel).css("bottom","4px"),this.domObj(a.layerNameCb).css("bottom","0px")):"expanded"===b&&(this.domObj(a.btnExpand).css("bottom","117px"),this.domObj(a.btnExpand).css("left","0px"),this._domUtil.getDomObjectByClassId("."+a.myExpandedControlsClass).show(),this.domObj(a.legendItem).css("height","133px"),this.domObj(a.layerNameLabel).css("bottom","39px"), this.domObj(a.layerNameCb).css("bottom","32px"))};centigon.mapping.CMapLegend.prototype.clearLegendContents=function(){this.domObj(this._divId).remove();this.domObj(this._legendBgDivId).remove()};centigon.mapping.CMapLegend.prototype.hideLegend=function(){this._visible=!1;this._domUtil.hideDomObjectById(this._divId);this._domUtil.hideDomObjectById(this._legendBgDivId)};centigon.mapping.CMapLegend.prototype.domObj=function(b){return this._domUtil.getDomObjectById(b)};centigon.mapping.CMapLegend.prototype.showLegend= function(){this._visible=!0;this._domUtil.showDomObjectById(this._divId);this._domUtil.showDomObjectById(this._legendBgDivId)};centigon.mapping.CMapLegend.prototype.getLayerSpecificCss=function(b){var a="."+getcmapscssroot_lf5x2()+"large-checkbox-"+b.type+":checked + label:after {";a+='\tbackground: url("'+b.getLegendIconUrl()+'");';return a+'\tcontent: ".";\tbackground-size: 16px 16px;\tposition: absolute;\tbackground-repeat: no-repeat;\tbackground-position: -1px 0px;}'};centigon.mapping.CMapLegend.prototype.injectMainCss= function(){var b="."+getcmapscssroot_lf5x2()+"regular-checkbox",a="."+getcmapscssroot_lf5x2()+"large-checkbox";var c=b+"{\tdisplay: none;}";c+=b+" + label {\tbackground-color: #FFFFFF;\tborder: 1px solid #cacece;";c+="\tbox-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05);";c+="\tpadding: 9px;";c+="\tborder-radius: 3px;";c+="\tdisplay: inline-block;";c+="\tposition: relative;";c+="}";c+=b+" + label:active, .regular-checkbox:checked + label:active {\tbox-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px 1px 3px rgba(0,0,0,0.1);}"; c+=b+":checked + label {\tbackground-color: #FFFFFF;\tborder: 1px solid #adb8c0;";c+="\tbox-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05), inset 15px 10px -12px rgba(255,255,255,0.1);";c+="\tcolor: #848493;";c+="}";c=c+(b+':checked + label:after {\tbackground: url("')+(this.getBaseAssetUrl()+'layer_points.png");');c+='\tcontent: ".";';c+="\tfont-size: 14px;";c+="\tbackground-size: 16px 16px;";c+="\tposition: absolute;";c+="\tbackground-repeat: no-repeat;";c+="\tbackground-position: -1px 0px;"; c+="\ttop: 2px;";c+="\tleft: 3px;";c+="\twidth: 17px;";c+="\theight: 18px;";c+="\tcolor: rgba(132, 132, 147, 0);";c+="}";c+=a+" + label {";c+="\tpadding: 10px;";c+="}";c+=a+":checked + label:after {";c+="\tfont-size: 20px;";c+="\tleft: 2x;";c+="}";c+="#"+this._divId+"::-webkit-scrollbar {";c+="\t height: 5px";c+="}";c+="#"+this._divId+"::-webkit-scrollbar-track {";c+="\t-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);";c+="}";c+="#"+this._divId+"::-webkit-scrollbar-thumb {";c+=" background-color: rgb(90, 90, 90);"; c+=" outline: 1px solid #606060;";c+="}";b=document.createElement("style");b.innerHTML=c;document.body.appendChild(b)}})(); (function(){createNamespaceUnderCentigon("mapping.CommonMappingFunctions");centigon.mapping.CommonMappingFunctions=function(){this._commonUtils=new centigon.util.UtilityFactory;this.rawLocationData=this._commonUtils.getCollIterator();this._updateDisplay=!1};var b=centigon.mapping.CommonMappingFunctions.prototype;b.locationHasValidLonLat=function(a){return this.areLonLatValuesValid(a.lon,a.lat)};b.areLonLatValuesValid=function(a,b){var c=!1;isNaN(b)||isNaN(a)||-90<=b&&90>=b&&-180<=a&&180>=a&&(c=!0); return c}})(); (function(){createNamespaceUnderCentigon("mapping.Clusterer");centigon.mapping.Clusterer=function(b){this._utilFactory=new centigon.util.UtilityFactory;this.CLUSTER_ICON_WIDTH=25;this._clusters=[];this.apiWrapper=b;this.arrAllMarkerOptions};centigon.mapping.Clusterer.prototype.calculateClusters=function(b){this.arrAllMarkerOptions=b;this.apiWrapper.getBounds();var a=0f?(c.iconType=centigon.mapping.MarkerIconFactory.ICONS.CLUSTER_SMALL,c.width=this.CLUSTER_ICON_WIDTH):20>f?(c.iconType=centigon.mapping.MarkerIconFactory.ICONS.CLUSTER_MEDIUM,c.width=1.2*this.CLUSTER_ICON_WIDTH):(c.iconType=centigon.mapping.MarkerIconFactory.ICONS.CLUSTER_LARGE,c.width=1.5*this.CLUSTER_ICON_WIDTH)):(f=this.getMarkerOptionWhereApiSpecificLocationEquals(this._clusters[h][0]))&& (c=f.clone()),c&&a.push(c);return a};centigon.mapping.Clusterer.prototype.getMarkerOptionWhereApiSpecificLocationEquals=function(b){for(var a=this._utilFactory.getCollectionIterator(this.arrAllMarkerOptions),c,f,g;a.hasNext();)if(c=a.next(),f=this.apiWrapper.locationToApiSpecificLocationObject(c.location),this.apiWrapper.getLonFromApiSpecificLoc(f)===this.apiWrapper.getLonFromApiSpecificLoc(b)&&this.apiWrapper.getLatFromApiSpecificLoc(f)===this.apiWrapper.getLatFromApiSpecificLoc(b)){g=c;break}return g}; centigon.mapping.Clusterer.prototype.getOptionPropsInCluster=function(b){var a=this._utilFactory.getCollectionIterator(this.arrAllMarkerOptions),c=0,f=!1,g=[],h=[];var k=this._utilFactory.getCollectionIterator(b);for(var l,m={};k.hasNext();)l=k.next(),m[this.apiWrapper.getLatFromApiSpecificLoc(l)+","+this.apiWrapper.getLonFromApiSpecificLoc(l)]=this.apiWrapper.getLatFromApiSpecificLoc(l)+","+this.apiWrapper.getLonFromApiSpecificLoc(l);l=b.length;for(var n=0,p=!1,q=0,u=[];a.hasNext()&&!(b=a.next(), k=this.apiWrapper.locationToApiSpecificLocationObject(b.location),!0===b.visible&&m[this.apiWrapper.getLatFromApiSpecificLoc(k)+","+this.apiWrapper.getLonFromApiSpecificLoc(k)]&&(p=!0,q++,c+=parseInt(b.dataValue),u.push(b),b.category&&(f=!0),g.push(b.category),h.push(b.dataValue),n++),n>=l););return{options:u,numOpts:q,visible:p,sum:c,avg:c/q,categories:g,dataVals:h,hasValidCategories:f}};centigon.mapping.Clusterer.prototype.getSameLocationClusters=function(b){var a=[];for(opts=this._utilFactory.getCollectionIterator(b);opts.hasNext();)!0=== mapBounds.contains(this.apiWrapper.locationToApiSpecificLocationObject(opts.next().location))&&a.push(opts.previous().location);b=[];for(var c={},f,g,h,k=0;k=this.layer.numObjectsToProcess&&(this.layer.setStatusMessage(centigon.mapping.DrawingProgressDisplay.STATUSES.DONE), this.layer.numObjectsToProcess=0)}}$("#"+this.canvas.id).show();!0===this.layer.timeAnalysisOptions.animateWhilePlaying&&!1===this.apiWrapper.isMoving&&this._lastClonedCanvasesForAnimation.push(this.cloneCanvas(this.canvas));this.layer.setStatusMessage(centigon.mapping.DrawingProgressDisplay.STATUSES.DONE)}else this.myVar=setTimeout(function(){clearTimeout(c.myVar);c.draw(!1,!0)},100)}}catch(n){this._logger.logError(n)}finally{this._lastDrawRequestTime=new Date}};centigon.mapping.MarkerCanvasOverlay.prototype.fadeOutPriorCanvases= function(b){if(!0===this.layer.timeAnalysisOptions.animateWhilePlaying&&!1===this.apiWrapper.isMoving&&0=c&&(console.log("fadeAndRemoveClonedCanvas"),clearInterval(k),g.parentElement.removeChild(g))};var g=this.getNewCanvas();var h=g.getContext("2d");h.drawImage(b,0,0);this.apiWrapper.getCanvasOverlayTarget().appendChild(g);this.repositionOverlay(g);f();var k=setInterval(f,this.layer.timeAnalysisOptions.fadeInterval)};centigon.mapping.MarkerCanvasOverlay.prototype.seedPieChartSums=function(b){this.pieSums= [];for(var a=[];b.hasNext();)opts=b.next(),!1!==opts.visible&&-1===a.indexOf(opts.location.lat+","+opts.location.lon)&&"pie"===opts.iconType&&!1===this.layer.clusteringEnabled&&opts.category&&(a.push(opts.location.lat+","+opts.location.lon),this.pieSums.push(this.getPieChartMarkerOptions(opts).dataSum));opts&&opts.metadata.layer.cMap.seedMarkerSizeCalcVariables(this.pieSums)};centigon.mapping.MarkerCanvasOverlay.prototype.getPieChartMarkerOptions=function(b){for(var a=this._utilFactory.getCollectionIterator(this.arrMarkerOptions), c,f=[],g=[],h=0,k=b.clone();a.hasNext();)c=a.next(),b.location.locationHasSameCoordinates(c.location)&&(f.push(c.category),g.push(c.dataValue),h+=parseFloat(c.dataValue));k.iconType=centigon.mapping.MarkerIconFactory.ICONS.PIE_CHART;k.categories=f;k.dataVals=g;k.dataSum=h;return k};centigon.mapping.MarkerCanvasOverlay.prototype.getObjectWhereMouseClicked=function(b){this._domUtil.getDomObjectById(this.apiWrapper.mapParentDivId);try{var a=this.canvas.getBoundingClientRect()}catch(q){return}var c=b.clientX- a.left;b=b.clientY-a.top;this.repositionTestSelected();this.ctxTestSelected.clearRect(0,0,this.mapWidth,this.mapHeight);a={strokeColor:"#FF0000",strokeOpacity:.8,strokeWeight:2,fillColor:"#FF0000",fillAlpha:0,fillOpacity:0,center:this.apiWrapper.fromContainerPixelToApiSpecificLocationObject(this.apiWrapper.getPoint(c,b)),radius:this.getSelectionSearchRadius()};var f=this.apiWrapper.getNewCircleWithOpts(a);a=f.getBounds();this.apiWrapper.setNullMapForOverlay(f);f=this.map.getBounds();if(!0===this.layer.clusteringEnabled){var g= this._utilFactory.getCollectionIterator(this.arrClusterOptions);a=this.apiWrapper.getBounds()}else g=this._utilFactory.getCollectionIterator(this.arrMarkerOptions),g=this._utilFactory.getCollectionIterator(g.getSortedArrayObjsByFieldDescending("displayIndex"));for(var h,k,l,m=[],n;g.hasNext();){n=g.getPosition();h=g.next();k=this.apiWrapper.locationToApiSpecificLocationObject(h.location);var p=this._hitBoxes[h.displayIndex];!0===this.layer.clusteringEnabled&&(p=this._hitBoxes[n]);p&&f.contains(k)&& a.contains(k)&&this.hitBoxContainsCoords(p,c,b)&&!0===h.visible&&m.push({opts:h,clickBoxCenterDiff:Math.abs(c-(p.x+p.size/2))+Math.abs(b-(p.y+p.size/2)),hitBox:p})}for(a=this._utilFactory.getCollectionIterator(m);a.hasNext();){f=a.next();this.drawSelectedObject(f.opts,this.ctxTestSelected);g=this.ctxTestSelected.getImageData(c-5,b-5,10,10);h=!1;for(k=0;k=b.x&&a<=h&&c>=f&&c<=g?!0:!1};centigon.mapping.MarkerCanvasOverlay.prototype.getSelectionSearchRadius=function(){var b=this.apiWrapper.getZoom(),a=[195E4,165E4,125E4,105E4,85E4,65E4,45E4,25E4,15E4,75E3];return a[b]?a[b]:5E4};centigon.mapping.MarkerCanvasOverlay.prototype.drawText=function(b,a,c,f,g){var h=a.opts;a=a.point;f.save();f.translate(a.x, a.y);f.scale(1,1);f.lineWidth=1;f.fillStyle=h.textColor?h.textColor:h.color;f.lineStyle=h.textColor?h.textColor:h.color;f.textAlign="center";f.font=c?c+"px sans-serif":"12px sans-serif";g||(g=0);f.fillText(b,0,g);f.restore()};centigon.mapping.MarkerCanvasOverlay.prototype.getColorFromOpts=function(b){var a=b.color;b.clusterObj&&(a=b.metadata.layer.defaultDisplayObjectColor);return a};centigon.mapping.MarkerCanvasOverlay.prototype.getWidthFromOpts=function(b){var a=b.width;b.clusterObj&&(a=this._clusterer.CLUSTER_ICON_WIDTH); return a};centigon.mapping.MarkerCanvasOverlay.prototype.clearLayer=function(){try{this.ctx&&(this.ctx.clearRect(0,0,this.mapWidth,this.mapHeight),this.ctxSelectedState.clearRect(0,0,this.mapWidth,this.mapHeight),this.ctxTestSelected.clearRect(0,0,this.mapWidth,this.mapHeight))}catch(b){}};centigon.mapping.MarkerCanvasOverlay.prototype.drawImage=function(b,a,c){c.x-=b.opts.width/2;c.y-=b.opts.width/2;var f=new Image;f.crossOrigin="anonymous";f.onload=function(b,c){return function(){a.save();a.scale(1, 1);a.translate(b.x-c.width/2,b.y-c.height/2);a.drawImage(c,0,0);a.restore()}}(c,f);f.src=b.opts.imgUrl};centigon.mapping.MarkerCanvasOverlay.prototype.drawSelectedObject=function(b,a){try{var c={x:200,y:200},f={};f.opts=b;f.point=c;var g=this.apiWrapper.fromApiSpecificLocToContainerPx(this.apiWrapper.locationToApiSpecificLocationObject(b.location)),h=centigon.mapping.MarkerIconFactory.ICONS.CANVAS_IMAGE.toLowerCase(),k=centigon.mapping.MarkerIconFactory.ICONS.CANVAS_VALUE_LABEL.toLowerCase(),l=centigon.mapping.MarkerIconFactory.ICONS.CANVAS_LABEL_LABEL.toLowerCase(), m=centigon.mapping.MarkerIconFactory.ICONS.HIGH_PERFORMANCE_SQUARE.toLowerCase(),n=b.iconType.toLowerCase(),p=this.markerIconFactory.getRenderObj(b,b.width,g.x,g.y);if(this.layer.defaultDisplayObjectIconType!==m&&!1===centigon.mapping.MarkerIconFactory.isIconTypeSupportedByMarkerIconFactory(b.iconType))a.save(),a.globalAlpha=.01,a.scale(1,1),a.translate(c.x,c.y),a.rect(0,0,f.opts.width,f.opts.width),a.fillStyle="yellow",a.fill(),a.restore(),this.drawImage(f,a,g);else switch(n){case h:this.drawImage(f, a,g);break;case k:f.point.x=p.originXY.x;f.point.y=p.originXY.y;this.drawText(this._stringUtil.addCommasToNumericString(b.dataValue),f,b.width,a);break;case l:f.point.x=p.originXY.x;f.point.y=p.originXY.y;this.drawText(b.label,f,b.width,a);break;default:this.markerIconFactory.renderIcon(b,p.originXY.x,p.originXY.y,b.width,a,!0)}b.clusterObj&&b.iconType!==centigon.mapping.MarkerIconFactory.ICONS.PIE_CHART&&this.drawClusterText({opts:b,objToDraw:f,myCtx:a,renderObj:p})}catch(q){this._logger.logError(q)}}; centigon.mapping.MarkerCanvasOverlay.prototype.drawObject=function(b,a){try{var c={x:200,y:200},f={};f.opts=b;f.point=c;var g=this.apiWrapper.fromApiSpecificLocToContainerPx(this.apiWrapper.locationToApiSpecificLocationObject(b.location)),h=this.markerIconFactory.getRenderObj(b,b.width,g.x,g.y),k=this.ctx,l=6*parseInt(h.numSize),m=Math.abs(h.originXY.x-l/2),n=Math.abs(h.originXY.y-l/2);!0===this.layer.clusteringEnabled?this._hitBoxes[a]={x:m,y:n,size:l}:this._hitBoxes[b.displayIndex]={x:m,y:n,size:l}; var p=this.ctx;l=!1;var q=centigon.mapping.MarkerIconFactory.ICONS.CANVAS_IMAGE.toLowerCase(),u=centigon.mapping.MarkerIconFactory.ICONS.CANVAS_VALUE_LABEL.toLowerCase(),v=centigon.mapping.MarkerIconFactory.ICONS.CANVAS_LABEL_LABEL.toLowerCase(),r=centigon.mapping.MarkerIconFactory.ICONS.HIGH_PERFORMANCE_SQUARE.toLowerCase(),w=b.iconType.toLowerCase();w!==q&&w!==u&&w!==v&&(l=!0,p=this.ctxIconStrip);if(!0===l&&this.iconExactHasBeenRenderedBefore(b))this.drawObjectActual(b);else{p.globalAlpha=this.layer.layerTransparency; if(this.layer.defaultDisplayObjectIconType!==r&&!1===centigon.mapping.MarkerIconFactory.isIconTypeSupportedByMarkerIconFactory(b.iconType))p.save(),p.globalAlpha=.01,p.scale(1,1),p.translate(c.x,c.y),p.rect(0,0,f.opts.width,f.opts.width),p.fillStyle="yellow",p.fill(),p.restore(),this.drawImage(f,p,g);else switch(w){case q:this.drawImage(f,p,g);break;case u:f.point.x=h.originXY.x;f.point.y=h.originXY.y;this.drawText(this._stringUtil.addCommasToNumericString(b.dataValue),f,b.width,k);break;case v:f.point.x= h.originXY.x,f.point.y=h.originXY.y,this.drawText(b.label,f,b.width,k)}w===centigon.mapping.MarkerIconFactory.ICONS.PIE_CHART.toLowerCase()?this.drawPieActual(b,h):!0===l&&(this.createCachedIconAtSize(b,c,b.width,this.getOptsCacheKey(h)),this.drawObjectActual(b))}}catch(t){this._logger.logError(t)}};centigon.mapping.MarkerCanvasOverlay.prototype.createCachedIconAtSize=function(b,a,c,f){var g=c/this.layer.defaultDisplayObjectPixelSize,h=this.createIconCacheCanvas(),k=h.getContext("2d");this.markerIconFactory.renderIcon(b, a.x,a.y,c,k,!0);this._iconObjectListWithSizes[f]=this.getIconCacheCanvasAndOffset(g,h)};centigon.mapping.MarkerCanvasOverlay.prototype.drawObjectActual=function(b){var a={};a.opts=b;a.point={x:200,y:200};var c=this.apiWrapper.fromApiSpecificLocToContainerPx(this.apiWrapper.locationToApiSpecificLocationObject(b.location));c=this.markerIconFactory.getRenderObj(b,b.width,c.x,c.y);var f=this.getOptsCacheKey(c);parseInt(b.width);var g=this.ctx;f=this._iconObjectListWithSizes[f];var h=f.offset;g.globalAlpha= this.layer.layerTransparency;g.drawImage(f.canvImgSrc,c.originXY.x-h,c.originXY.y-h);b.clusterObj&&b.iconType!==centigon.mapping.MarkerIconFactory.ICONS.PIE_CHART&&this.drawClusterText({opts:b,objToDraw:a,myCtx:g,renderObj:c})};centigon.mapping.MarkerCanvasOverlay.prototype.drawPieActual=function(b,a){this.markerIconFactory.renderIcon(b,a.originXY.x,a.originXY.y,b.width,this.ctx,!1)};centigon.mapping.MarkerCanvasOverlay.prototype.drawClusterText=function(b){var a=b.opts,c=b.objToDraw,f=b.myCtx;b= b.renderObj;if(a.clusterObj&&a.iconType!==centigon.mapping.MarkerIconFactory.ICONS.PIE_CHART)if(c.point.x=b.originXY.x,c.point.y=b.originXY.y,b=this.layer.clusterStyle,"sum"===b||"samelocationsum"===b){b=String(this._stringUtil.getFormattedAbbreviatedDisplayValue(a.clusterDataValueSum));if("nan"===b.toLowerCase()||"undefined"===b.toLowerCase())b="";this.drawText(b,c,16,f);this.drawText("ct "+this._stringUtil.addCommasToNumericString(a.clusterObj.numOpts),c,16,f,15)}else if("average"===b||"samelocationaverage"=== b){b=String(this._stringUtil.getFormattedAbbreviatedDisplayValue(a.clusterDataValueAvg));if("nan"===b.toLowerCase()||"undefined"===b.toLowerCase())b="";this.drawText(b,c,16,f);this.drawText("ct "+this._stringUtil.addCommasToNumericString(a.clusterObj.numOpts),c,16,f,15)}else this.drawText(this._stringUtil.addCommasToNumericString(a.clusterObj.numOpts),c,16,f)};centigon.mapping.MarkerCanvasOverlay.prototype.getIconCacheCanvasAndOffset=function(b,a){return{canv:this.createIconCacheCanvas(),offset:200, canvImgSrc:a}};centigon.mapping.MarkerCanvasOverlay.prototype.iconExactHasBeenRenderedBefore=function(b){b=this.markerIconFactory.getRenderObj(b,b.width,0,0);var a=!1;this._iconObjectListWithSizes[this.getOptsCacheKey(b)]&&(a=!0);return a};centigon.mapping.MarkerCanvasOverlay.prototype.getOptsCacheKey=function(b){return b.iconName+"|"+b.strokeStyle+"|"+b.fillStyle+"|"+b.numSize};centigon.mapping.MarkerCanvasOverlay.prototype.repositionOverlay=function(b){try{this.mapWidth=this.apiWrapper.getDiv().offsetWidth; this.mapHeight=this.apiWrapper.getDiv().offsetHeight;b.setAttribute("width",this.mapWidth+"px");b.setAttribute("height",this.mapHeight+"px");b.style.width=this.mapWidth+"px";b.style.height=this.mapHeight+"px";var a=this.apiWrapper.getBounds(),c=this.apiWrapper.fromApiSpecificLocToDivPx(a.getSouthWest()),f=c.y-this.mapHeight;b.style.left=c.x+"px";b.style.top=f+"px"}catch(g){this._logger.logError(g)}};centigon.mapping.MarkerCanvasOverlay.prototype.reposition=function(){try{this.mapWidth=this.apiWrapper.getDiv().offsetWidth; this.mapHeight=this.apiWrapper.getDiv().offsetHeight;this.canvas.setAttribute("width",this.mapWidth+"px");this.canvas.setAttribute("height",this.mapHeight+"px");this.canvas.style.width=this.mapWidth+"px";this.canvas.style.height=this.mapHeight+"px";var b=this.apiWrapper.getBounds(),a=this.apiWrapper.fromApiSpecificLocToDivPx(b.getSouthWest()),c=a.y-this.mapHeight;this.canvas.style.left=a.x+"px";this.canvas.style.top=c+"px";this.canvasSelectedState.style.left=a.x+"px";this.canvasSelectedState.style.top= c+"px"}catch(f){this._logger.logError(f)}};centigon.mapping.MarkerCanvasOverlay.prototype.repositionSelected=function(){try{this.mapWidth=this.apiWrapper.getDiv().offsetWidth;this.mapHeight=this.apiWrapper.getDiv().offsetHeight;this.canvasSelectedState.setAttribute("width",this.mapWidth+"px");this.canvasSelectedState.setAttribute("height",this.mapHeight+"px");this.canvasSelectedState.style.width=this.mapWidth+"px";this.canvasSelectedState.style.height=this.mapHeight+"px";var b=this.apiWrapper.getBounds(), a=this.apiWrapper.fromApiSpecificLocToDivPx(b.getSouthWest()),c=a.y-this.mapHeight;this.canvasSelectedState.style.left=a.x+"px";this.canvasSelectedState.style.top=c+"px"}catch(f){this._logger.logError(f)}};centigon.mapping.MarkerCanvasOverlay.prototype.repositionTestSelected=function(){try{var b=this.apiWrapper.getBounds(),a=this.apiWrapper.fromApiSpecificLocToDivPx(b.getSouthWest()),c=a.y-this.mapHeight;this.canvasTestSelected.style.left=a.x+"px";this.canvasTestSelected.style.top=c+"px"}catch(f){this._logger.logError(f)}}; centigon.mapping.MarkerCanvasOverlay.prototype.getPosition=function(){return this.position};centigon.mapping.MarkerCanvasOverlay.prototype.getMarkerOptionWhereLocationEquals=function(b){for(var a=this._utilFactory.getCollectionIterator(this.arrMarkerOptions),c,f,g;a.hasNext();)if(c=a.next(),f=c.location,!0===f.locationHasSameCoordinates(b)){g=c;break}return g}})(); function createCentigonMappingGoogleMarkerCanvasOverlayClassInterface(){createNamespaceUnderCentigon("mapping.GoogleMarkerCanvasOverlay");centigon.mapping.GoogleMarkerCanvasOverlay=function(b,a,c){b=new centigon.mapping.MarkerCanvasOverlay(b,a,c);for(var f in b)this[f]=b[f];this.apiWrapper.setMapForCanvasLayer(this)};centigon.mapping.GoogleMarkerCanvasOverlay.prototype=centigon.mapping.APICentral.getCanvasOverlayPrototype(centigon.mapping.APICentral.MAP_TYPES.GOOG)} function createCentigonMappingLeafletMarkerCanvasOverlayClassInterface(){createNamespaceUnderCentigon("mapping.LeafletMarkerCanvasOverlay");centigon.mapping.LeafletMarkerCanvasOverlay=function(b,a,c){b=new centigon.mapping.MarkerCanvasOverlay(b,a,c);for(var f in b)this[f]=b[f];this.apiWrapper.setMapForCanvasLayer(this)};centigon.mapping.LeafletMarkerCanvasOverlay.prototype=centigon.mapping.APICentral.getCanvasOverlayPrototype(centigon.mapping.APICentral.MAP_TYPES.LEAF);centigon.mapping.LeafletMarkerCanvasOverlay.prototype.setMap= function(b){}} function createCentigonMappingDivImageOverlayClassInterface(){createNamespaceUnderCentigon("mapping.DivImageOverlay");centigon.mapping.DivImageOverlay=function(b){centigon.mapping.DivOverlay.call(this);this.cMapAnalytics=b;this.apiWrapper=this.cMapAnalytics.cMap.getMapApiAdapter();this._lastBoundsRequested="";this.getImageSourceUrlCallback=function(){}};centigon.mapping.DivImageOverlay.prototype=new centigon.mapping.DivOverlay;centigon.mapping.DivImageOverlay.constructor=centigon.mapping.DivOverlay;centigon.mapping.DivImageOverlay.prototype.setImageSourceUrl= function(b){var a=this.getCurrentBounds();a&&(a.toString()!==this._lastBoundsRequested?(this._lastBoundsRequested=a.toString(),this.render()):(this.div.style.backgroundImage="url("+b+")",this.reposition()))};centigon.mapping.DivImageOverlay.prototype.render=function(){this.div.style.backgroundImage="url()";this.getImageSourceUrlCallback()};centigon.mapping.DivImageOverlay.prototype.getCurrentBounds=function(){return this.apiWrapper.getBounds()}} function createCentigonMappingDivOverlayClassInterface(){createNamespaceUnderCentigon("mapping.DivOverlay");centigon.mapping.DivOverlay=function(){this._utilFactory=new centigon.util.UtilityFactory;this._domUtil=this._utilFactory.getDomUtil();this._stringUtil=this._utilFactory.getStringUtil();this._logger=this._utilFactory.getLoggerUtil();this.initComplete=!1;this.cMapAnalytics;this.apiWrapper;this._overlay;this.div};centigon.mapping.DivOverlay.prototype.init=function(){if(!this._overlay){this.div= this.getNewDiv();var b=this;this._overlay=this.cMapAnalytics.getCustomBaseMapOverlay();this._overlay.centigonActualOnAdd=function(){b.apiWrapper.getCanvasOverlayTarget().appendChild(b.div);b.initComplete=!0;b.render()};this._overlay.draw=function(){b.render()};this.cMapAnalytics.registerCustomLayer(this._overlay)}};centigon.mapping.DivOverlay.prototype.render=function(){this._logger.trace("override render as needed")};centigon.mapping.DivOverlay.prototype.setTransparency=function(b){$("#"+this.div.id).css("opacity", b)};centigon.mapping.DivOverlay.prototype.onRemove=function(){this.div.parentNode.removeChild(this.div)};centigon.mapping.DivOverlay.prototype.getBaseOverlay=function(){return this._overlay};centigon.mapping.DivOverlay.prototype.getNewDiv=function(){var b=this.apiWrapper.getDiv().offsetWidth,a=this.apiWrapper.getDiv().offsetHeight,c=document.createElement("DIV");c.id=this._domUtil.getRandomDivId();c.setAttribute("width",b+"px");c.setAttribute("height",a+"px");c.style.position="absolute";c.style.width= b+"px";c.style.height=a+"px";return c};centigon.mapping.DivOverlay.prototype.reposition=function(){this.apiWrapper.alignDomElemToOverlay(this._domUtil.castAsDomObject(this.div))}} (function(){createNamespaceUnderCentigon("mapping.GeocodeResponse");centigon.mapping.GeocodeResponse=function(){this.locationFromAddress=this.locationForReverseGeocoding=this.adddressForGeocoding=this.responseStatus="";this.reverseGeocodeAddressParts=[];this.positionInDataProvider=0};centigon.mapping.GeocodeResponse.prototype.clone=function(){var b=new centigon.mapping.GeocodeResponse;b.responseStatus=this.responseStatus;b.adddressForGeocoding=this.adddressForGeocoding;b.locationForReverseGeocoding= this.locationForReverseGeocoding;b.locationFromAddress=this.locationFromAddress;b.reverseGeocodeAddressParts=this.reverseGeocodeAddressParts;b.positionInDataProvider=this.positionInDataProvider;return b};centigon.mapping.GeocodeResponse.prototype.lastGeocodeRequestWasSuccessful=function(){var b=!1;this.responseStatus===centigon.mapping.GeocodeResponse.RESPONSE_STATUS_CODES.SUCCESS&&(b=!0);return b};centigon.mapping.GeocodeResponse.prototype.lastGeocodeRequestWasFailure=function(){var b=!0;this.responseStatus=== centigon.mapping.GeocodeResponse.RESPONSE_STATUS_CODES.FAILURE&&(b=!1);return b};centigon.mapping.GeocodeResponse.RESPONSE_STATUS_CODES={SUCCESS:"success",FAILURE:"failure"}})(); (function(){createNamespaceUnderCentigon("mapping.MapApiAdapter");centigon.mapping.MapApiAdapter=function(){this.streetViewMap;this.baseMapTileCfg;this.baseTileUrl;this.cMap;var b=centigon.mapping.MapApiAdapter.CAPABILITY_NAMES;this._capabilities={};this._capabilities[b.STREET_VIEW]=!1;this._capabilities[b.DIRECTIONS]=!1;this._capabilities[b.GEOCODING]=!1;this.customMarkerRenderers={};this._lastSelectedMarkerIx="";this.numPointsCoded=this.numPointsToCode=0;this.geocodedAddressToLatLngMap=[];this._GEOCODING_MESSAGE= "Geocoding...";this._GEOCODING_A_LOT_MESSAGE='Batch Geocoding... This will take a few moments Learn more';this.seriesIdToShapesMap=[];this.streetMapDivId="";this.divId;this._utilFactory=new centigon.util.UtilityFactory;this._stringUtil=this._utilFactory.getStringUtil();this.logger=this._utilFactory.getLoggerUtil();this._domUtil=this._utilFactory.getDomUtil()};centigon.mapping.MapApiAdapter.prototype.hasCapability=function(b){return Object.prototype.hasOwnProperty.call(this._capabilities, b)?this._capabilities[b]:!1};centigon.mapping.MapApiAdapter.prototype.registerMarkerRenderer=function(b){this.customMarkerRenderers[b.name]=b};centigon.mapping.MapApiAdapter.prototype.getMarkerRenderer=function(b){return this.customMarkerRenderers[b]};centigon.mapping.MapApiAdapter.prototype.getBaseMapProviderMap=function(){return this.map};centigon.mapping.MapApiAdapter.prototype.destroyMap=function(){this.divId&&this._domUtil.getDomObjectById(this.divId).remove()};centigon.mapping.MapApiAdapter.prototype.setMapVisibility= function(b){b?this.showMap():this.hideMap()};centigon.mapping.MapApiAdapter.prototype.setZoomingEnabled=function(b){b?this.enableZooming():this.disableZooming()};centigon.mapping.MapApiAdapter.prototype.setPanningEnabled=function(b){b?this.enablePanning():this.disablePanning()};centigon.mapping.MapApiAdapter.prototype.showGeocodingStatusMessage=function(){this.showTempMessagePopup(this._GEOCODING_MESSAGE)};centigon.mapping.MapApiAdapter.prototype.showBulkGeocodingStatusMessage=function(){this.showMessagePopup(this._GEOCODING_A_LOT_MESSAGE)}; centigon.mapping.MapApiAdapter.prototype.hideBulkGeocodingStatusMessage=function(){this.hideMessagePopup()};centigon.mapping.MapApiAdapter.prototype.isPointsLayer=function(b){return this._stringUtil.valueMatchesCaseInsensitiveComparisonInCollection(b.type,[centigon.mapping.Layer.TYPE.SHAPE,centigon.mapping.Layer.TYPE.LINE,centigon.mapping.Layer.TYPE.AFFINITY_LINE])};centigon.mapping.MapApiAdapter.prototype.isShapeLayer=function(b){return this._stringUtil.stringsMatchInLowercase(b.type,centigon.mapping.Layer.TYPE.SHAPE)}; centigon.mapping.MapApiAdapter.prototype.showAllDisplayObjectsInLayer=function(b){this.setAllDisplayObjectsVisibilityInLayer(b,!0)};centigon.mapping.MapApiAdapter.prototype.hideAllDisplayObjectsInLayer=function(b){this.setAllDisplayObjectsVisibilityInLayer(b,!1)};centigon.mapping.MapApiAdapter.prototype.setAllDisplayObjectsVisibilityInLayer=function(b,a){for(var c=b.getAllDisplayObjectsAsCollection(),f;c.hasNext();){f=c.next();var g=!0;f&&Object.prototype.hasOwnProperty.call(f,"actualApiDisplayObject")&& f.actualApiDisplayObject&&(g=!1);var h=f.displayObject.options.visible;!1===g&&(!0===a&&!0===h?(f.visible=!0,this.showLayerDisplayObjectOnMap(f)):(f.visible=!1,this.hideLayerDisplayObjectOnMap(f)))}};centigon.mapping.MapApiAdapter.prototype.showAllMarkerLayers=function(){for(var b=this._utilFactory.getCollIterator(this._layers),a;b.hasNext();)a=b.next(),this.isPointsLayer(a)&&(a.visible=!0,this.showAllDisplayObjectsInLayer(a))};centigon.mapping.MapApiAdapter.prototype.getAllMarkerLayers=function(){for(var b= this._utilFactory.getCollIterator(this._layers),a=this._utilFactory.getCollIterator(),c;b.hasNext();)c=b.next(),this.isPointsLayer(c)&&a.addItem(c);return a};centigon.mapping.MapApiAdapter.prototype.getAllShapeLayers=function(){for(var b=this._utilFactory.getCollIterator(this._layers),a=this._utilFactory.getCollIterator(),c;b.hasNext();)c=b.next(),this.isShapeLayer(c)&&a.addItem(c);return a};centigon.mapping.MapApiAdapter.prototype.selectAllDisplayObjectsInLayer=function(b){this.setAllDisplayObjectsSelectedStateInLayer(b, !0)};centigon.mapping.MapApiAdapter.prototype.deSelectAllDisplayObjectsInLayer=function(b){this.setAllDisplayObjectsSelectedStateInLayer(b,!1)};centigon.mapping.MapApiAdapter.prototype.setAllDisplayObjectsSelectedStateInLayer=function(b,a){for(var c=b.getAllDisplayObjectsAsCollection();c.hasNext();)!0===a?this.selectLayerDisplayObjectOnMap(c.next()):this.deSelectLayerDisplayObjectOnMap(c.next())};centigon.mapping.MapApiAdapter.prototype.setMapLayerProvider=function(b){this._layers=b.getLayers()}; centigon.mapping.MapApiAdapter.prototype.getLayerById=function(b){for(var a=this._utilFactory.getCollIterator(this._layers),c;a.hasNext()&&(c=a.next(),c.id!==b););return c};centigon.mapping.MapApiAdapter.prototype.hideAllLayers=function(){for(var b=this._utilFactory.getCollIterator(this._layers);b.hasNext();)this.hideAllDisplayObjectsInLayer(b.next())};centigon.mapping.MapApiAdapter.prototype.showAllLayers=function(){for(var b=this._utilFactory.getCollIterator(this._layers);b.hasNext();)this.showAllDisplayObjectsInLayer(b.next())}; centigon.mapping.MapApiAdapter.prototype.hideLayer=function(b){b=this.getLayerById(b);b.visible=!1;this.hideAllDisplayObjectsInLayer(b)};centigon.mapping.MapApiAdapter.prototype.showLayer=function(b){b=this.getLayerById(b);b.visible=!0;this.showAllDisplayObjectsInLayer(b)};centigon.mapping.MapApiAdapter.prototype.getAllLayers=function(){return this._utilFactory.getCollIterator(this._layers)};centigon.mapping.MapApiAdapter.prototype.hasPointsLayer=function(){for(var b=!1,a=this._utilFactory.getCollIterator(this._layers), c;a.hasNext();)if(c=a.next(),this.isPointsLayer(c)){b=!0;break}return b};centigon.mapping.MapApiAdapter.prototype.convertDistanceToMeters=function(b,a){var c=0;"mi"==a?c=1609.34*b:"km"==a?c=1E3*b:"yards"==a?c=.9144*b:"meters"==a?c=b:this._logger.trace("unsupported conversion of distance to: "+a);return c};centigon.mapping.MapApiAdapter.prototype.translateDistanceByMeasureType=function(b,a,c){var f=0;null==c&&(c=a);"km"==c?f=b/1.60934:"mi"==c&&(f=b);"mi"==c?f=1.60934*b:"km"==c&&(f=b);return f};centigon.mapping.MapApiAdapter.prototype.getCachedLatLngFromPostalAddress= function(b){for(var a=this._utilFactory.getCollIterator(that.geocodedAddressToLatLngMap),c,f=null;a.hasNext();)if(c=a.next(),this._stringUtil.stringsMatchInLowercase(b,c.postalAddress)){f=obj.latLng;break}return f};centigon.mapping.MapApiAdapter.prototype.geocodeAddressData=function(b,a){null!=b&&0!=b.length||a([]);var c=450;10>b.length?c=450:20>b.length?c=500:50>b.length?c=550:100>b.length&&(c=650);that.numPointsToCode=b.length;that.numPointsCoded=0;for(var f=[],g=0;g=a&&-180<=b&&180>=b&&(c=!0);return c};centigon.mapping.MapApiAdapter.prototype.getAllLocationsFromAllMarkerLayers=function(){for(var b=this._utilFactory.getCollIterator(),a=this.getAllMarkerLayers(),c;a.hasNext();){c=a.next();for(var f=c.getAllDisplayObjectsAsCollection();f.hasNext();)c=f.next(),b.addItem(c.location)}return b};centigon.mapping.MapApiAdapter.prototype.getRawLocationDataFromAllMarkerLayers=function(){for(var b=this._utilFactory.getCollIterator(), a=this.getAllMarkerLayers(),c;a.hasNext();){c=a.next();for(var f=c.getAllRawLayerLocations();f.hasNext();)c=f.next(),b.addItem(c)}return b};centigon.mapping.MapApiAdapter.prototype.csvLatLngIsValid=function(b){b=String(b);if(!b||""===b||null===b||-1==b.indexOf(",")||","===b)return!1;var a=b.substr(0,b.indexOf(","));b=b.substr(b.indexOf(",")+1,b.length);return this.areLonLatValuesValid(b,a)};centigon.mapping.MapApiAdapter.prototype.layerHasGeocodableData=function(b){var a=!1;b=b.getAllRawLayerLocations(); for(var c;b.hasNext();)if((c=b.next())&&(c=String(c).trim()),c&&""!=c&&","!=c&&!1===this.csvLatLngIsValid(c)){a=!0;break}return a};centigon.mapping.MapApiAdapter.prototype.deselectAllShapes=function(){this.deselectLayerDisplayObjectsInAllOfLayerType(centigon.mapping.Layer.TYPE.SHAPE)};centigon.mapping.MapApiAdapter.prototype.deselectLayerDisplayObjectsInAllOfLayerType=function(b){if(this._stringUtil.stringsMatchInLowercase(b,centigon.mapping.Layer.TYPE.MARKER))b=this.getAllMarkerLayers();else if(this._stringUtil.stringsMatchInLowercase(b, centigon.mapping.Layer.TYPE.SHAPE))b=this.getAllShapeLayers();else{this.logger.trace("deselectLayerDisplayObjectsInAllOfLayerType failed for type: "+b);return}for(var a;b.hasNext();)a=b.next(),this.deSelectAllDisplayObjectsInLayer(a)};centigon.mapping.MapApiAdapter.prototype.deselectAllLayers=function(){for(var b=this.getAllLayers(),a;b.hasNext();)a=b.next(),a.deselectAllChildDisplayObjects()};centigon.mapping.MapApiAdapter.prototype.selectMarkers=function(b){for(var a;b.hasNext();)a=b.next(),this.selectLayerDisplayObjectOnMap(a)}; centigon.mapping.MapApiAdapter.prototype.getAllVisibleObjects=function(){};centigon.mapping.MapApiAdapter.prototype.getAllRenderedObjects=function(){};centigon.mapping.MapApiAdapter.prototype.getRenderedObject=function(b,a){};centigon.mapping.MapApiAdapter.prototype.getShapeInLayer=function(b,a){return this.getLayerDisplayObject(b,a)};centigon.mapping.MapApiAdapter.prototype.getMarkerInLayer=function(b,a){return this.getLayerDisplayObject(b,a)};centigon.mapping.MapApiAdapter.prototype.selectMarkerInLayer= function(b,a){this.selectLayerDisplayObjectOnMap(this.getLayerDisplayObject(b,a))};centigon.mapping.MapApiAdapter.prototype.deselectMarkerInLayer=function(b,a){this.deSelectLayerDisplayObjectOnMap(this.getLayerDisplayObject(b,markerIndex))};centigon.mapping.MapApiAdapter.prototype.getLayerDisplayObject=function(b,a){return this.getLayerById(b).displayObjects[a]};centigon.mapping.MapApiAdapter.prototype.deselectShapeInLayer=function(b,a){this.deSelectLayerDisplayObjectOnMap(this.getLayerDisplayObject(b, markerIndex))};centigon.mapping.MapApiAdapter.prototype.selectShapeInLayer=function(b,a){this.selectLayerDisplayObjectOnMap(this.getLayerDisplayObject(b,a))};centigon.mapping.MapApiAdapter.prototype.removeAllMarkersInLayerFromMap=function(b){try{var a=this.getCanvasLayerForCMapLayer(b);a&&this.setNullMapForOverlay(a)}catch(c){this._logger.logError(c)}};centigon.mapping.MapApiAdapter.prototype.removeCanvasFromCollection=function(b){try{for(var a=this._utilFactory.getCollectionIterator(this._layerCanvases), c,f;a.hasNext();)if(f=a.getPosition(),c=a.next(),c.layer.positionInMapDataProvider===b.positionInMapDataProvider){this._layerCanvases.deleteObjectAt(f);break}}catch(g){this._logger.logError(g)}};centigon.mapping.MapApiAdapter.prototype.destroyMarkerLayer=function(b){try{var a=this.getCanvasLayerForCMapLayer(b);a&&(this.setNullMapForOverlay(a),this.removeCanvasFromCollection(b))}catch(c){this._logger.logError(c)}};centigon.mapping.MapApiAdapter.prototype.removeHeatmapLayerFromMap=function(b){try{b.displayObjects&& 0'+this.infoWindowContentGenerator.getHtml(b.displayIndex, b.metadata.layer,"click")+""),this.setInfoWindowLocation(f,this.locationToApiSpecificLocationObject(b.location)),this.showInfoWindow(f,b.metadata.layer,b.displayIndex),this.registerInfoWindow(f,b.metadata.layer,b.displayIndex),this.handleLayerSelected(b.metadata.layer,b.displayIndex,"click");else if(this._layerSelectedCallback&&!0===c.clusteringEnabled){var g=!0===Object.prototype.hasOwnProperty.call(b,"clusterObj")?b.clusterObj:null;if(g){c.selectedObjectType="cluster";f=this._utilFactory.getCollectionIterator(g.childOpts); for(g=[];f.hasNext();)(c=f.next())&&g.push(c.displayIndex);0'+this.infoWindowContentGenerator.getHtml(b.displayIndex,b.metadata.layer,"click")+""),this.setInfoWindowLocation(f,this.locationToApiSpecificLocationObject(b.location)),this.showInfoWindow(f,b.metadata.layer, b.displayIndex),this.registerInfoWindow(f,b.metadata.layer,b.displayIndex),this.handleLayerSelected(b.metadata.layer,b.displayIndex,"click",b)}};centigon.mapping.MapApiAdapter.prototype.handleLayerSelected=function(b,a,c,f){this._layerSelectedCallback&&("click"===c&&(b.selectedIndex=a),this._layerSelectedCallback(b,a,c,f))};centigon.mapping.MapApiAdapter.prototype.addClickHandlerToDisplayObject=function(b,a,c,f){var g=this;if(this.infoWindowContentGenerator){var h=this.getInfoWindow(a,c);var k=function(b, f){!0===g.preventPolygonFromAbsorbingClickEvent?g.preventPolygonFromAbsorbingClickEvent=!1:h&&!0===a.mouseEnabled&&!1===g.ignoreAllLayerEvents&&("click"===f&&(!1===g.allowMultipleSelection&&g.closeAllInfoWindows(),g.setInfoWindowContent(h,'
'+g.infoWindowContentGenerator.getHtml(c,a,"click")+"
"),g.setInfoWindowLocation(h,g.getLatLngFromClickEvent(b)),g.showInfoWindow(h,a,c),g.registerInfoWindow(h,a,c)),g.handleLayerSelected(a, c,f))};this.addApiEventListener(b,"click",function(a){k(a,"click")});this.addApiEventListener(b,"mouseover",function(a){k(a,"hover")})}};centigon.mapping.MapApiAdapter.prototype.getInfoWindowFromCache=function(b,a){this.allInfoWindows.resetPosition();for(var c,f,g;this.allInfoWindows.hasNext();)if(g=this.allInfoWindows.next(),infoWindow=g.infoWindow,f=g.layer,g=g.index,f.positionInMapDataProvider===b.positionInMapDataProvider&&g===a){c=infoWindow;break}return c};centigon.mapping.MapApiAdapter.prototype.closeInfoWindow= function(b,a){this.allInfoWindows.resetPosition();for(var c,f;this.allInfoWindows.hasNext();)f=this.allInfoWindows.next(),infoWindow=f.infoWindow,c=f.layer,f=f.index,c.positionInMapDataProvider===b.positionInMapDataProvider&&f===a&&infoWindow.close()};centigon.mapping.MapApiAdapter.prototype.openInfoWindow=function(b,a){var c;if(this.infoWindowContentGenerator&&(c=this.getInfoWindow(b,a))){!1===this.allowMultipleSelection&&this.closeAllInfoWindows();var f=!0===this.isShapeLayer(b.type)?this.getPolygonCentroid(b.displayObjects[a].actualApiDisplayObject): this.locationToApiSpecificLocationObject(b.getCleansedLayerLocation(a));this.setInfoWindowContent(c,'
'+this.infoWindowContentGenerator.getHtml(a,b,"click")+"
");this.setInfoWindowLocation(c,f);this.showInfoWindow(c,b,a);this.registerInfoWindow(c,b,a)}};centigon.mapping.MapApiAdapter.prototype.getShapeDisplayObjectCentroid=function(b){return this.getPolygonCentroid(b.actualApiDisplayObject)};centigon.mapping.MapApiAdapter.prototype.isShapeLayer= function(b){return this._stringUtil.stringsMatchInLowercase(b,centigon.mapping.Layer.TYPE.HUB_SPOKE)||this._stringUtil.stringsMatchInLowercase(b,centigon.mapping.Layer.TYPE.DRIVE_TIME_POLYGON)||this._stringUtil.stringsMatchInLowercase(b,centigon.mapping.Layer.TYPE.SHAPE)||this._stringUtil.stringsMatchInLowercase(b,centigon.mapping.Layer.TYPE.SAPDD_SHAPE)||this._stringUtil.stringsMatchInLowercase(b,centigon.mapping.Layer.TYPE.RADIUS)||this._stringUtil.stringsMatchInLowercase(b,centigon.mapping.Layer.TYPE.LINE)? !0:!1};centigon.mapping.MapApiAdapter.prototype.setInfoWindowContentGenerator=function(b){this.infoWindowContentGenerator=b};centigon.mapping.MapApiAdapter.prototype.closeAllInfoWindows=function(){this.allInfoWindows.resetPosition();for(var b;this.allInfoWindows.hasNext();)b=this.allInfoWindows.next().infoWindow,b.close()};centigon.mapping.MapApiAdapter.prototype.getInfoWindow=function(b,a){var c=this.getInfoWindowFromCache(b,a);c||(c=this.getNewInfoWindow(b,a));return c};centigon.mapping.MapApiAdapter.prototype.setDisplayObjectVisibility= function(b){var a=b.displayObject;a.actualApiDisplayObject&&(a.actualApiDisplayObject.visible=b.visible)};centigon.mapping.MapApiAdapter.prototype.showLayerDisplayObjectOnMap=function(b){b.actualApiDisplayObject&&(b.actualApiDisplayObject.visible=!0,this.setMapForOverlay(b.actualApiDisplayObject))};centigon.mapping.MapApiAdapter.prototype.hideLayerDisplayObjectOnMap=function(b){b.actualApiDisplayObject&&(b.actualApiDisplayObject.visible=!1,this.setNullMapForOverlay(b.actualApiDisplayObject))};centigon.mapping.MapApiAdapter.prototype.showTempMessagePopup= function(b){var a=this;this._tempMessagePopupDivId||(this._tempMessagePopupDivId=this._domUtil.getRandomDivId());this._tempMessagePopupTmr&&clearTimeout(this._tempMessagePopupTmr);if(!document.getElementById(this._tempMessagePopupDivId)){var c='
";this._domUtil.getDomObjectById(this.mapParentDivId).append(c)}this._domUtil.showDomObjectById(this._tempMessagePopupDivId); this._tempMessagePopupTmr=setTimeout(function(){a._domUtil.getDomObjectById(a._tempMessagePopupDivId).fadeOut()},2500)};centigon.mapping.MapApiAdapter.prototype.showMessagePopup=function(b){this._tempMessagePopupDivId||(this._tempMessagePopupDivId=this._domUtil.getRandomDivId());if(!document.getElementById(this._tempMessagePopupDivId)){var a='
";this._domUtil.getDomObjectById(this.mapParentDivId).append(a)}this._domUtil.showDomObjectById(this._tempMessagePopupDivId)};centigon.mapping.MapApiAdapter.prototype.hideMessagePopup=function(){document.getElementById(this._tempMessagePopupDivId)&&this._domUtil.hideDomObjectById(this._tempMessagePopupDivId)};centigon.mapping.MapApiAdapter.prototype.getAreaOfViewportInMeters=function(){var b=this.getBounds();if(!b)return 0;var a=b.getNorthEast();b=b.getSouthWest();a=[a,this.getLatLngObject(this.getLatFromApiSpecificLoc(a), this.getLonFromApiSpecificLoc(b)),b,this.getLatLngObject(this.getLatFromApiSpecificLoc(b),this.getLonFromApiSpecificLoc(a),a)];var c=this.getNewPolygon({paths:a,strokeOpacity:0,strokeWeight:0}),f=this;setTimeout(function(){f.setNullMapForOverlay(c);c=null},100);return this.getAreaOfPolyInMeters(c)};centigon.mapping.MapApiAdapter.prototype.showMap=function(){this._domUtil.showDomObjectById(this.mapParentDivId)};centigon.mapping.MapApiAdapter.prototype.hideMap=function(){this._domUtil.hideDomObjectById(this.mapParentDivId)}; centigon.mapping.MapApiAdapter.prototype.freezeMap=function(){this.disableZooming();this.disablePanning()};centigon.mapping.MapApiAdapter.prototype.unFreezeMap=function(){this.enableZooming();this.enablePanning()};centigon.mapping.MapApiAdapter.prototype.redrawAllCanvasLayers=function(){for(var b=this._utilFactory.getCollectionIterator(this._layerCanvases),a;b.hasNext();)a=b.next(),a.draw()};centigon.mapping.MapApiAdapter.prototype.triggerClickHandlerOnAnyDivImageOverlayLayers=function(b){if(!0=== this.preventPolygonFromAbsorbingClickEvent)this.preventPolygonFromAbsorbingClickEvent=!1;else for(var a=this.getAllLayers(),c;a.hasNext();)c=a.next(),c.type===centigon.mapping.Layer.TYPE.ESRI_MULTI_LAYER_IMAGE&&c.handleClick(this.apiSpecificLatLngToLocation(this.getLatLngFromClickEvent(b)))};centigon.mapping.MapApiAdapter.prototype.clearSelectedFlagsFromClusteredCanvasLayers=function(){for(var b=this._utilFactory.getCollectionIterator(this._layerCanvases),a;b.hasNext();)a=b.next(),!0===a.atLeastOneClusterIsSelected&& a.layer.setListOfDisplayObjectSelectedFlags(this._utilFactory.getCollectionIterator())};centigon.mapping.MapApiAdapter.prototype.getCanvasLayerForCMapLayer=function(b){for(var a=this._utilFactory.getCollectionIterator(this._layerCanvases),c,f;a.hasNext();)if(c=a.next(),c.layer.positionInMapDataProvider===b.positionInMapDataProvider){f=c;break}return f};centigon.mapping.MapApiAdapter.prototype.getCanvasLayerIx=function(b){for(var a=this._utilFactory.getCollectionIterator(this._layerCanvases),c,f;a.hasNext();)if(c= a.next(),c.layer.positionInMapDataProvider===b.positionInMapDataProvider){f=a.getPosition();break}return f};centigon.mapping.MapApiAdapter.prototype.clearLayerCanvases=function(){for(var b=this._utilFactory.getCollectionIterator(this._layerCanvases),a;b.hasNext();)a=b.next(),this.setNullMapForOverlay(a),a.destroy();this._layerCanvases=this._utilFactory.getCollectionIterator()};centigon.mapping.MapApiAdapter.prototype.selectMarkersWithinCircle=function(b){try{for(var a=this._utilFactory.getCollectionIterator(this.getAllCanvasMarkerOptionsInViewport()), c,f,g=[],h={},k;a.hasNext();)n=a.next(),c=this.locationToApiSpecificLocationObject(n.location),b.getBounds().contains(c)&&(f=n.metadata.layer,-1===g.indexOf(f)&&(h[f.positionInMapDataProvider]={layer:f,treatAsSpecialClusterSelect:!1,indicesToSelect:[],clusterChildSelectedIndices:[]},g.push(f)),k=h[f.positionInMapDataProvider],!0===f.clusteringEnabled&&n.clusterObj?(k.treatAsSpecialClusterSelect=!0,k.clusterChildSelectedIndices=k.clusterChildSelectedIndices.concat(this.getSelIndicesForClusterSelects(n))): k.clusterChildSelectedIndices.push(n.displayIndex),k.indicesToSelect.push(n.displayIndex));var l;for(l in h){var m=h[l];if(!0===m.treatAsSpecialClusterSelect)this._layerBulkSelectedCallback({layer:m.layer,indices:m.clusterChildSelectedIndices,clusterIndicesToRedraw:m.indicesToSelect});else if(0',a+='Click here to authorize your app
',$("#"+c.mapDivId).append(a))} mapapiLoadedCallbackc5w151c11d21s12dc=function(){mapapiLoadedlds5c115f41dfb12bfdf=!0;createCentigonMappingGoogleMarkerCanvasOverlayClassInterface();createCentigonMappingDivOverlayClassInterface();createCentigonMappingDivImageOverlayClassInterface()};$(document).ready(function(){bodyLoaded5c115f41dfb12bfdf=!0}); (function(){createNamespaceUnderCentigon("mapping.GoogleMapAPIWrapper");var b=!1,a=!1;centigon.mapping.GoogleMapAPIWrapper=function(){centigon.mapping.MapApiAdapter.call(this);var a=centigon.mapping.MapApiAdapter.CAPABILITY_NAMES;this._capabilities={};this._capabilities[a.STREET_VIEW]=!0;this._capabilities[a.DIRECTIONS]=!0;this._capabilities[a.GEOCODING]=!0;this.infoWindowContentGenerator;this._utilFactory=new centigon.util.UtilityFactory;this._objUtil=this._utilFactory.getObjectUtil();this._logger= this._utilFactory.getLoggerUtil();this._domUtil=this._utilFactory.getDomUtil();this._stringUtil=this._utilFactory.getStringUtil();this.onClick=function(){};this.preventPolygonFromAbsorbingClickEvent=this.ignoreAllLayerEvents=!1;this._geocodingTimerInterval=100;this._geocodeThrottleTimer;this._numFailedGeocodes=this._geocodeRequestTimerDelayMs=0;this._selectionPanelTypeChangedHandler;this._directionsDivId;this._selectorPanel;this.presetRadius=50;this.isMoving=!1;this._bikeLayer;this._trafficLayer; this._transitLayer;this._cloudLayer;this.mapOptions;this.selectionOptions;this._layerCanvases=this._utilFactory.getCollectionIterator();this._polygonLayerCanvases=this._utilFactory.getCollectionIterator();this._infoWinClosedCallback;this._infoWinOpenedCallback;this._layerSelectedCallback;this._selectedLayerAndDispObjsIndices={};this.rawAddressToGeocodedLocationMap={};this._duplicateGeocodeRequestObjs=[];this._distinctAddressesOutForGeocoding={};this.divId;this.geocoder;this.mapWidth;this.mapHeight; this.map;this.mapParentDivId;this._tempMessagePopupDivId;this._tempMessagePopupTmr;this._wmsGoogLayer;this._wmsStyleString=this._wmsLayerString=this._wmsUrl="";this.commonMapFuncs=new centigon.mapping.CommonMappingFunctions;this.allInfoWindows=this._utilFactory.getCollectionIterator();this.allowMultipleSelection=!1;this._boundsChangedTimeout;this._lastZoomLevelCanvasesWereRendered;this._mapInitialized=!1;this.overlay;this.layerSelectionGlowAlpha;this.layerSelectionGlowColor;this.useGlowEffectOnLayerSelections; this.directionsDisplay;this.directionsService;this.streetViewService;this.distanceService;this.placesService;this._placesReqCache={}};centigon.mapping.GoogleMapAPIWrapper.prototype=new centigon.mapping.MapApiAdapter;centigon.mapping.GoogleMapAPIWrapper.constructor=centigon.mapping.MapApiAdapter;centigon.mapping.GoogleMapAPIWrapper.prototype.loadApi=function(a){this.mapOptions=a;this.loadMapApiFunctionc5w151c11d21s12dc(this.mapOptions)};centigon.mapping.GoogleMapAPIWrapper.prototype.loadMapApiFunctionc5w151c11d21s12dc= function(a){try{if(!1===mapapiRequestedlds5c115f41dfb12bfdf&&!1===mapapiLoadedlds5c115f41dfb12bfdf&&!0===bodyLoaded5c115f41dfb12bfdf){mapapiRequestedlds5c115f41dfb12bfdf=!0;var b=document.createElement("script");b.type="text/javascript";b.src=!0===a.useSSL?"https://maps.googleapis.com/maps/api/js?v=3"+a.mapApiUrlParameters+"&libraries=geometry,visualization,places&callback=mapapiLoadedCallbackc5w151c11d21s12dc":"http://maps.googleapis.com/maps/api/js?v=3"+a.mapApiUrlParameters+"&libraries=geometry,visualization,places&callback=mapapiLoadedCallbackc5w151c11d21s12dc"; document.head.appendChild(b)}}catch(g){that._logger.logError(g)}};centigon.mapping.GoogleMapAPIWrapper.prototype.getDependencies=function(){return[]};centigon.mapping.GoogleMapAPIWrapper.prototype.toggleSpecialApiLayer=function(a,b){switch(a){case centigon.mapping.CMap.SPECIAL_LAYER_TYPES.BIKE:this.setSpecialLayerVisibility("_bikeLayer",b,"google.maps.BicyclingLayer");break;case centigon.mapping.CMap.SPECIAL_LAYER_TYPES.TRAFFIC:this.setSpecialLayerVisibility("_trafficLayer",b,"google.maps.TrafficLayer"); break;case centigon.mapping.CMap.SPECIAL_LAYER_TYPES.TRANSIT:this.setSpecialLayerVisibility("_transitLayer",b,"google.maps.TransitLayer")}};centigon.mapping.GoogleMapAPIWrapper.prototype.setSpecialLayerVisibility=function(a,b,g,h){var c=function(a){a=a.split(".");for(var b=window||this,c=0,f=a.length;c
', document.getElementById(q._directionsDivId)||q._domUtil.getDomObjectById(q.mapParentDivId).append(g),q.directionsDisplay.setPanel(document.getElementById(q._directionsDivId)));f&&f(a)}})};centigon.mapping.GoogleMapAPIWrapper.prototype.setMapImageryStyle=function(a){a=a.toLowerCase();if("styletypewhiteout"===a||"whiteout"===a)var b=centigon.mapping.GoogleMapAPIWrapper.MAP_STYLES.WHITEOUT;if("styletypegrayscale"===a||"grayscale"===a)b=centigon.mapping.GoogleMapAPIWrapper.MAP_STYLES.GRAYSCALE;else if("styletypemilitary"=== a||"military"===a)b=centigon.mapping.GoogleMapAPIWrapper.MAP_STYLES.MILITARY;else if("styletypecoolgray"===a||"coolgray"===a)b=centigon.mapping.GoogleMapAPIWrapper.MAP_STYLES.COOLGRAY;else if("light_gray_blue"===a)b=centigon.mapping.GoogleMapAPIWrapper.MAP_STYLES.LIGHTGRAY_BLUEOCEAN;else if("styletypeblack"===a||"black"===a)b=centigon.mapping.GoogleMapAPIWrapper.MAP_STYLES.BLACK;if(b)this.map.setOptions({styles:b});else{if("styletypesatellite"===a||"satellite"===a)var c=google.maps.MapTypeId.SATELLITE; else if("styletypeterrain"===a||"terrain"===a)c=google.maps.MapTypeId.TERRAIN;else if("styletyperoadmap"===a||"roadmap"===a)c=google.maps.MapTypeId.ROADMAP;else if("styletypehybrid"===a||"hybrid"===a)c=google.maps.MapTypeId.HYBRID;c&&this.map.setMapTypeId(c)}};centigon.mapping.GoogleMapAPIWrapper.prototype.forceRefresh=function(){google.maps.event.trigger(this.map,"resize")};centigon.mapping.GoogleMapAPIWrapper.prototype.setUseSSL=function(a){};centigon.mapping.GoogleMapAPIWrapper.prototype.getDirectionsRenderer= function(){return new google.maps.DirectionsRenderer({draggable:!1})};centigon.mapping.GoogleMapAPIWrapper.prototype.setNavigationControlVisiblity=function(a){this.map.setOptions({panControl:a,zoomControl:a,scaleControl:a})};centigon.mapping.GoogleMapAPIWrapper.prototype.getLatLngObject=function(a,b){return new google.maps.LatLng(a,b)};centigon.mapping.GoogleMapAPIWrapper.prototype.getGoogleMapType=function(a){return a===centigon.mapping.MapOptions.MAP_TYPES.TERRAIN?google.maps.MapTypeId.TERRAIN: a===centigon.mapping.MapOptions.MAP_TYPES.HYBRID?google.maps.MapTypeId.HYBRID:a===centigon.mapping.MapOptions.MAP_TYPES.SATELLITE?google.maps.MapTypeId.SATELLITE:google.maps.MapTypeId.ROADMAP};centigon.mapping.GoogleMapAPIWrapper.prototype.createMap=function(c){try{if(null!=c&&!1!==mapapiLoadedlds5c115f41dfb12bfdf&&null!=document.body&&null==this.map){this.mapOptions=c;var f=this,g=document.createElement("DIV");g.style.width="100%";g.style.height="100%";g.id="googMapInst"+c.mapParentDivId;this.divId= g.id;this._selectionPanelTypeChangedHandler=c.selectionPanelTypeChangedHandler;this.mapParentDivId=c.mapParentDivId;this.layerSelectionGlowAlpha=c.layerSelectionGlowAlpha;this.layerSelectionGlowColor=c.layerSelectionGlowColor;this.useGlowEffectOnLayerSelections=c.useGlowEffectOnLayerSelections;this._domUtil.getDomObjectById(c.mapParentDivId).append(g);this.geocoder=new google.maps.Geocoder;this.map=new google.maps.Map(document.getElementById(g.id),{minZoom:2,clickableIcons:c.enablePoiInteractivity, zoom:c.zoomLevel,center:this.getLatLngObject(c.panLat,c.panLng),mapTypeId:this.getGoogleMapType(c.mapType),panControl:c.showPanControl,zoomControl:c.showZoomControl,mapTypeControl:c.showMapTypeControl,scaleControl:!1,streetViewControl:c.showStreetViewControl,overviewMapControl:c.showOverviewMapControl,disableDoubleClickZoom:c.disableZoom,fullscreenControl:c.fullscreenControl});allGMaps5c115f41dfb12bfdf.push({map:this.map,mapDivId:g.id});c.mapImageryStyleName&&this.setMapImageryStyle(c.mapImageryStyleName); this._selectorPanel=new centigon.mapping.SelectorPanel(this,c,this.mapParentDivId);this._directionsDivId=c.directionsDivId;this.directionsDisplay=new google.maps.DirectionsRenderer({draggable:!1});this.directionsService=new google.maps.DirectionsService;this.distanceService=new google.maps.DistanceMatrixService;this.placesService=new google.maps.places.PlacesService(this.map);this.overlay=new google.maps.OverlayView;this.overlay.draw=function(){};this.setMapForOverlay(this.overlay);google.maps.event.addListener(this.map, "bounds_changed",function(){f.isMoving=!0;f._boundsChangedTimeout&&clearTimeout(f._boundsChangedTimeout);f._boundsChangedTimeout=setTimeout(function(){if(c.onMapCenterChangedCallback)c.onMapCenterChangedCallback()},250)});google.maps.event.addListener(this.map,"center_changed",function(){!0===f._mapInitialized&&(f.clearSelectedFlagsFromClusteredCanvasLayers(),f.redrawAllCanvasLayers())});google.maps.event.addListener(this.map,"zoom_changed",function(a){if(c.onMapZoomChangedCallback)c.onMapZoomChangedCallback()}); google.maps.event.addListener(this.map,"dragend",function(c){setTimeout(function(){b=a=!1;!0===f._mapInitialized&&f.redrawAllCanvasLayers()},500)});google.maps.event.addListener(this.map,"drag",function(c){a=b=!0;f.isMoving=!0});google.maps.event.addListener(this.map,"idle",function(a){f.isMoving=!1;!0===f._mapInitialized?f.redrawAllCanvasLayers():c.mapReadyCallback&&!1===f._mapInitialized&&c.mapReadyCallback();f._mapInitialized=!0});google.maps.event.addListener(this.map,"click",function(a){f.onClick(f.apiSpecificLatLngToLocation(a.latLng)); f.triggerClickHandlerOnAnyDivImageOverlayLayers(a)});var h=this._domUtil.getDomObjectById(this.mapParentDivId),k=h.height(),l=h.width();setInterval(function(){if(l!==h.width()||k!==h.height()){if(!0===f._mapInitialized&&c.onMapAutoResizeCallback)c.onMapAutoResizeCallback();console.log("auto resize");f.forceRefresh()}l=h.width();k=h.height()},500);this.mapWidth=h.width();this.mapHeight=h.height();this.setWmsLayer();this.selectionOptions=c.selectionOptions;this._layerSelectedCallback=c.layerSelectedCallback; this._infoWinClosedCallback=c.infoWinClosedCallback;this._infoWinOpenedCallback=c.infoWinOpenedCallback;this._layerBulkSelectedCallback=c.layerBulkSelectedCallback;this.onClick=c.onClick}}catch(m){this._logger.logError(m)}};centigon.mapping.GoogleMapAPIWrapper.prototype.setMapForCanvasLayer=function(a){a.setMap(this.map)};centigon.mapping.GoogleMapAPIWrapper.prototype.getCanvasOverlayTarget=function(){return this.overlay.getPanes().overlayMouseTarget};centigon.mapping.GoogleMapAPIWrapper.prototype.getCustomOverlayTarget= function(){return this.overlay.getPanes().overlayMouseTarget};centigon.mapping.GoogleMapAPIWrapper.prototype.alignDomElemToOverlay=function(a){if(a&&a[0]){var b=this.getBounds();if(b){a.css("position","absolute");a=a[0];var c=this.map.getDiv().offsetWidth,h=this.map.getDiv().offsetHeight;a.setAttribute("width",c+"px");a.setAttribute("height",h+"px");a.style.width=c+"px";a.style.height=h+"px";b=this.fromApiSpecificLocToDivPx(b.getSouthWest());h=b.y-h;a.style.left=b.x+"px";a.style.top=h+"px"}}};centigon.mapping.GoogleMapAPIWrapper.prototype.setDomElemPositionInOverlay= function(a,b,g){a.css("left",b);a.css("top",g)};centigon.mapping.GoogleMapAPIWrapper.prototype.getOverlayXY=function(a){a=a.position();return{x:a.left,y:a.top}};centigon.mapping.GoogleMapAPIWrapper.prototype.getDiv=function(a){return this.map.getDiv()};centigon.mapping.GoogleMapAPIWrapper.prototype.setMapForOverlay=function(a){try{a&&!a.getMap()&&a.setMap(this.map)}catch(f){this._logger.logError(f)}};centigon.mapping.GoogleMapAPIWrapper.prototype.setNullMapForOverlay=function(a){try{a&&a.getMap()&& a.setMap(null)}catch(f){this._logger.logError(f)}};centigon.mapping.GoogleMapAPIWrapper.prototype.shapeContains=function(a,b){var c=b.split(",");return google.maps.geometry.poly.containsLocation(this.getLatLngObject(c[0],c[1]),a.actualApiDisplayObject)};centigon.mapping.GoogleMapAPIWrapper.prototype.circleContains=function(a,b){var c=b.split(",");c=this.getLatLngObject(c[0],c[1]);var f=!1;google.maps.geometry.spherical.computeDistanceBetween(a.getCenter(),c)<=a.getRadius()&&(f=!0);return f};centigon.mapping.GoogleMapAPIWrapper.prototype.pointInPolygon= function(a,b){return google.maps.geometry.poly.containsLocation(a,b)};centigon.mapping.GoogleMapAPIWrapper.prototype.mouseMovedCanvasLayer=function(c){if(!1===b&&!1===a){var f=this._utilFactory.getCollectionIterator(this._layerCanvases),g;for(g=[];f.hasNext();){var h=f.next();!0===h.layer.mouseEnabled&&!1===this.ignoreAllLayerEvents&&(g[h.layer.positionInMapDataProvider]=h)}g.reverse();for(f=this._utilFactory.getCollectionIterator(g);f.hasNext();)if((h=f.next())&&!0===h.layer.mouseEnabled&&!1===this.ignoreAllLayerEvents&& (g=h.getObjectWhereMouseClicked(c))){this.preventPolygonFromAbsorbingClickEvent=!0;c.stopImmediatePropagation();this.canvasObjectMousedOver(g,h);break}}};centigon.mapping.GoogleMapAPIWrapper.prototype.mouseClickedCanvasLayer=function(c){if(!1===b&&!1===a){var f=this._utilFactory.getCollectionIterator(this._layerCanvases),g;for(g=[];f.hasNext();){var h=f.next();!0===h.layer.mouseEnabled&&!1===this.ignoreAllLayerEvents&&(g[h.layer.positionInMapDataProvider]=h)}g.reverse();for(f=this._utilFactory.getCollectionIterator(g);f.hasNext();)if((h= f.next())&&!0===h.layer.mouseEnabled&&!1===this.ignoreAllLayerEvents&&(g=h.getObjectWhereMouseClicked(c))){this.preventPolygonFromAbsorbingClickEvent=!0;c.stopImmediatePropagation();this.canvasObjectClicked(g,h);break}}};centigon.mapping.GoogleMapAPIWrapper.prototype.getDistBetweenLocations=function(a){return google.maps.geometry.spherical.computeDistanceBetween(this.locationToApiSpecificLocationObject(a[0]),this.locationToApiSpecificLocationObject(a[1]))};centigon.mapping.GoogleMapAPIWrapper.prototype.getPlacesFromOrigin= function(a,b){var c=this,f=a.location+a.radius+a.searchTerms.join("|"),k=function(g,h,l){var k={places:[]};k.fromCache=l;if(h==google.maps.places.PlacesServiceStatus.OK){for(h=0;hSorry, street view is unavailable here. This message will automatically close shortly.')};this.streetViewExistsAtLocation(c)};centigon.mapping.GoogleMapAPIWrapper.prototype.streetViewExistsAtLocation= function(a){var b=this.locationToApiSpecificLocationObject(a.location);this.streetViewService||(this.streetViewService=new google.maps.StreetViewService);this.streetViewService.getPanoramaByLocation(b,100,function(b,c){c===google.maps.StreetViewStatus.OK?a.success():a.failed()})};centigon.mapping.GoogleMapAPIWrapper.prototype.locationsToGLatLngs=function(a){var b=this._utilFactory.getCollectionIterator();for(a=this._utilFactory.getCollectionIterator(a);a.hasNext();)b.addItem(this.locationToApiSpecificLocationObject(a.next())); return b};centigon.mapping.GoogleMapAPIWrapper.prototype.locationToGLatLng=function(a){return new google.maps.LatLng(a.lat,a.lon)};centigon.mapping.GoogleMapAPIWrapper.prototype.locationToApiSpecificLocationObject=function(a){return this.locationToGLatLng(a)};centigon.mapping.GoogleMapAPIWrapper.prototype.isApiSpecificLocationObject=function(a){return a instanceof google.maps.LatLng?!0:!1};centigon.mapping.GoogleMapAPIWrapper.prototype.gLatLngToLocation=function(a){return new centigon.mapping.Location({lat:a.lat(), lon:a.lng()})};centigon.mapping.GoogleMapAPIWrapper.prototype.apiSpecificLatLngToLocation=function(a){return this.gLatLngToLocation(a)};centigon.mapping.GoogleMapAPIWrapper.prototype.geocode=function(a,b){var c=this;a.address=String(a.address).trim();if(!0===this._objUtil.hasKey(this.rawAddressToGeocodedLocationMap,a.address))this.fireClonedGeocodeCallback(a,b);else if(this._distinctAddressesOutForGeocoding[a.address]&&!1===this._objUtil.hasKey(this.rawAddressToGeocodedLocationMap,a.address))this._duplicateGeocodeRequestObjs.push({obj:a, callback:b});else{this._distinctAddressesOutForGeocoding[a.address]=a.address;var f=function(){var g=a.positionInDataProvider;!0===c._objUtil.hasKey(c.rawAddressToGeocodedLocationMap,a.address)?c.fireClonedGeocodeCallback(a,b):c.geocoder.geocode({address:a.address},function(h,k){var l=new centigon.mapping.GeocodeResponse;l.adddressForGeocoding="";l.reverseGeocodeAddressParts=[];l.positionInDataProvider=g;k==google.maps.GeocoderStatus.OK?(l.responseStatus=centigon.mapping.GeocodeResponse.RESPONSE_STATUS_CODES.SUCCESS, l.locationFromAddress=c.apiSpecificLatLngToLocation(h[0].geometry.location),c.rawAddressToGeocodedLocationMap[a.address]=l,b&&b(l),c.fireAllWaitingDuplicateGeocodeCallbacks(a,l)):k==google.maps.GeocoderStatus.OVER_QUERY_LIMIT?!0===c._objUtil.hasKey(c.rawAddressToGeocodedLocationMap,a.address)?c.fireClonedGeocodeCallback(a,b):(c._numFailedGeocodes++,l=300*c._numFailedGeocodes,c.showTempMessagePopup(),setTimeout(f,l)):(l.responseStatus=centigon.mapping.GeocodeResponse.RESPONSE_STATUS_CODES.FAILURE, b&&b(l))})};this._geocodeRequestTimerDelayMs+=this._geocodingTimerInterval;this._geocodeThrottleTimer&&clearTimeout(this._geocodeThrottleTimer);this._geocodeThrottleTimer=setTimeout(function(){c._geocodeRequestTimerDelayMs=0;c._numFailedGeocodes=0},6E3);setTimeout(f,this._geocodeRequestTimerDelayMs);this.showGeocodingStatusMessage()}};centigon.mapping.GoogleMapAPIWrapper.prototype.fireClonedGeocodeCallback=function(a,b){if(!0===this._objUtil.hasKey(this.rawAddressToGeocodedLocationMap,a.address)){var c= this._objUtil.getKeyValue(this.rawAddressToGeocodedLocationMap,a.address).clone();c.responseStatus=centigon.mapping.GeocodeResponse.RESPONSE_STATUS_CODES.SUCCESS;c.positionInDataProvider=a.positionInDataProvider;b&&b(c)}};centigon.mapping.GoogleMapAPIWrapper.prototype.fireAllWaitingDuplicateGeocodeCallbacks=function(a,b){for(var c,f=0;fg?0:Math.floor(Math.log(g)/Math.LN2)};centigon.mapping.GoogleMapAPIWrapper.prototype.showInfoWindow=function(a,b,g){!0===this.cMap.showInfoWindows&&(a.open(this.map),this._infoWinOpenedCallback&&this._infoWinOpenedCallback(b,g))};centigon.mapping.GoogleMapAPIWrapper.prototype.getNumPolyPoints= function(a){if(null!=a.getPath())return a.getPath().getLength()};centigon.mapping.GoogleMapAPIWrapper.prototype.setInfoWindowContent=function(a,b){a.setContent(b)};centigon.mapping.GoogleMapAPIWrapper.prototype.setInfoWindowLocation=function(a,b){a.setPosition(b)};centigon.mapping.GoogleMapAPIWrapper.prototype.getLatLngFromClickEvent=function(a){return a.latLng};centigon.mapping.GoogleMapAPIWrapper.prototype.getNewInfoWindow=function(a,b){var c=new google.maps.InfoWindow({content:'
'+ this.infoWindowContentGenerator.getHtml(b,a,"click")+"
"}),f=this;google.maps.event.addListener(c,"closeclick",function(c){f._infoWinClosedCallback&&f._infoWinClosedCallback(a,b)});return c};centigon.mapping.GoogleMapAPIWrapper.prototype.fromApiSpecificLocToContainerPx=function(a){return this.overlay.getProjection().fromLatLngToContainerPixel(a)};centigon.mapping.GoogleMapAPIWrapper.prototype.fromApiSpecificLocToDivPx=function(a){return this.overlay.getProjection().fromLatLngToDivPixel(a)};centigon.mapping.GoogleMapAPIWrapper.prototype.addApiEventListener= function(a,b,g){google.maps.event.addListener(a,b,g)};centigon.mapping.GoogleMapAPIWrapper.prototype.renderHeatmapLayer=function(a){try{if(!1===a.layer.visible){this.removeHeatmapLayerFromMap(a.layer);return}for(var b=a.layer.getAllCleansedLayerLocations(),c=a.layer.displayObjectVisibilityFlags,h=[],k,l,m;b.hasNext();)if(m=b.getPosition(),l=b.next(),!(c.length>m&&!0!==c[m])){k={};k.location=this.locationToApiSpecificLocationObject(l);k.weight=Number(a.heatmapPointValues.getItemAt(m));h.push(k);var n= {url:this.mapOptions.cMapAnalytics.getBaseAssetUrl()+"images/transparenticon.png",size:new google.maps.Size(30,30),origin:new google.maps.Point(10,0),anchor:new google.maps.Point(15,13)},p=new google.maps.Marker({position:this.locationToApiSpecificLocationObject(l),map:this.map,icon:n,zIndex:1});this.addClickHandlerToDisplayObject(p,a.metadata.layer,m,p.position)}var q=new google.maps.MVCArray(h);b={};b.data=q;b.gradient=a.gradientType;b.map=this.map;b.radius=Number(a.radius);var u=new google.maps.visualization.HeatmapLayer(b); this.orderLayersZIndex();return u}catch(v){this._logger.logError(v)}return null};centigon.mapping.GoogleMapAPIWrapper.prototype.getBounds=function(){return this.map.getBounds()};centigon.mapping.GoogleMapAPIWrapper.prototype.applyPolylineOptions=function(a,b){var c=(new Color(b.lineColor,1)).hexTriplet();a.setOptions({strokeOpacity:b.fillAlpha,strokeColor:c,path:b.locations,strokeWeight:b.lineThickness,zIndex:b.zIndex,visible:b.visible});!0===b.visible?this.setMapForOverlay(a):this.setNullMapForOverlay(a)}; centigon.mapping.GoogleMapAPIWrapper.prototype.applyPolygonOptions=function(a,b,g){var c=(new Color(b.fillColor,1)).hexTriplet();a.setOptions(g?{fillColor:c,fillOpacity:b.fillAlpha,strokeColor:b.outlineColor,strokeWeight:1,visible:b.visible,zIndex:b.zIndex}:{fillColor:c,fillOpacity:b.fillAlpha,strokeColor:b.outlineColor,paths:b.shapes,strokeWeight:1,visible:b.visible,zIndex:b.zIndex});!0===b.visible?this.setMapForOverlay(a):this.setNullMapForOverlay(a)};centigon.mapping.GoogleMapAPIWrapper.prototype.renderCanvasMarkerLayer= function(a,b,g){var c=this.getCanvasLayerForCMapLayer(b);c?(c.layer=b,c.getMap()||c.setMap(this.map),c.arrMarkerOptions=a,g?c.drawSelected():c.draw()):(c=new centigon.mapping.GoogleMarkerCanvasOverlay(a,this,b),this._layerCanvases.addItem(c))};centigon.mapping.GoogleMapAPIWrapper.prototype.removeEventListener=function(a,b,g){google.maps.event.removeListener(g)};centigon.mapping.GoogleMapAPIWrapper.prototype.removeDomListener=function(a,b,g){this.removeEventListener(g)};centigon.mapping.GoogleMapAPIWrapper.prototype.fromContainerPixelToLocation= function(a){return this.apiSpecificLatLngToLocation(this.overlay.getProjection().fromContainerPixelToLatLng(a))};centigon.mapping.GoogleMapAPIWrapper.prototype.fromContainerPixelToApiSpecificLocationObject=function(a){return this.overlay.getProjection().fromContainerPixelToLatLng(a)};centigon.mapping.GoogleMapAPIWrapper.prototype.getLatFromApiSpecificLoc=function(a){return a.lat()};centigon.mapping.GoogleMapAPIWrapper.prototype.getLonFromApiSpecificLoc=function(a){return a.lng()};centigon.mapping.GoogleMapAPIWrapper.prototype.getAreaOfPolyInMeters= function(a){return google.maps.geometry.spherical.computeArea(a.getPath())};centigon.mapping.GoogleMapAPIWrapper.prototype.interpolate=function(a,b,g){return google.maps.geometry.spherical.interpolate(this.locationToApiSpecificLocationObject(a),this.locationToApiSpecificLocationObject(b),g)};centigon.mapping.GoogleMapAPIWrapper.prototype.interpolateApiLatLngs=function(a,b,g){return google.maps.geometry.spherical.interpolate(a,b,g)};centigon.mapping.GoogleMapAPIWrapper.prototype.getNewMarker=function(a, b){return new google.maps.Marker({position:a,map:this.map,icon:b})};centigon.mapping.GoogleMapAPIWrapper.prototype.getPoint=function(a,b){return new google.maps.Point(a,b)};centigon.mapping.GoogleMapAPIWrapper.prototype.addDomListener=function(a,b,g){return google.maps.event.addDomListener(document.getElementById(a),b,function(a){g(a)})};centigon.mapping.GoogleMapAPIWrapper.prototype.addClickListenerToDiv=function(a,b){return google.maps.event.addDomListener(a,"click",function(a){b(a)})};centigon.mapping.GoogleMapAPIWrapper.prototype.addClickListenerToCanvas= function(a,b){google.maps.event.addDomListener(a,"click",function(a){b(a)})};centigon.mapping.GoogleMapAPIWrapper.prototype.addMouseMoveListenerToCanvas=function(a,b){google.maps.event.addDomListener(a,"mousemove",function(a){b(a)})};centigon.mapping.GoogleMapAPIWrapper.prototype.addClickListenerToMapPolyOverlay=function(a,b){return google.maps.event.addListener(a,"click",function(a){b(a)})};centigon.mapping.GoogleMapAPIWrapper.prototype.renderPolygon=function(a){var b=(new Color(a.fillColor,1)).hexTriplet(); b=new google.maps.Polygon({paths:a.shapes,strokeColor:a.outlineColor,strokeOpacity:1,strokeWeight:1,fillColor:b,zIndex:a.zIndex,fillOpacity:a.fillAlpha,map:this.map,visible:a.visible});this.addClickHandlerToDisplayObject(b,a.metadata.layer,a.displayIndex,this.getPolygonCentroid(b));return b};centigon.mapping.GoogleMapAPIWrapper.prototype.renderPolyline=function(a){var b=(new Color(a.lineColor,1)).hexTriplet();b=new google.maps.Polyline({path:a.locations,geodesic:!1,strokeColor:b,strokeOpacity:a.fillAlpha, strokeWeight:a.lineThickness,map:this.map,visible:a.visible});this.addClickHandlerToDisplayObject(b,a.metadata.layer,a.displayIndex);return b};centigon.mapping.GoogleMapAPIWrapper.prototype.renderDirectionsPolyline=function(a,b){var c=(new Color(b,1)).hexTriplet();return new google.maps.Polyline({path:a.routes[0].overview_path,geodesic:!1,strokeColor:c,strokeOpacity:.8,strokeWeight:5,map:this.map,visible:!0,zIndex:1E3})};centigon.mapping.GoogleMapAPIWrapper.prototype.renderRadius=function(a){(new Color(a.fillColor, 1)).hexTriplet();var b=a.location,c=new google.maps.Circle({fillColor:a.fillColor,fillOpacity:a.fillAlpha,strokeColor:a.outlineColor,strokeWeight:1,visible:a.visible,center:b,map:this.map,zIndex:a.zIndex,radius:a.radiusInMeters});this.addClickHandlerToDisplayObject(c,a.metadata.layer,a.displayIndex,b);return c};centigon.mapping.GoogleMapAPIWrapper.prototype.applyRadiusOptions=function(a,b){(new Color(b.fillColor,1)).hexTriplet();var c={fillColor:b.fillColor,fillOpacity:b.fillAlpha,strokeColor:b.outlineColor, strokeWeight:1,visible:b.visible,center:b.location,radius:b.radiusInMeters,zIndex:b.zIndex};a.setOptions(c);!0===c.visible?this.setMapForOverlay(a):this.setNullMapForOverlay(a)};centigon.mapping.GoogleMapAPIWrapper.prototype.getPolygonCentroid=function(a){var b=new google.maps.LatLngBounds;a=a.getPaths();for(var c=0;cc!=n>c&&k<(u-p)*(c-q)/(n-q)+p&&(l=!l)}return l};centigon.mapping.LeafletMapApiWrapper.prototype.circleContains=function(a,b){var c=b.split(","); c=this.apiSpecificLatLngToLocation(this.getLatLngObject(c[0],c[1]));var f=!1;this.getDistBetweenLocations([this.apiSpecificLatLngToLocation(a.getLatLng()),c])<=a.getRadius()&&(f=!0);return f};centigon.mapping.LeafletMapApiWrapper.prototype.pointInPolygon=function(a,b){return this.shapeContains({actualApiDisplayObject:b},a.lat+","+a.lng)};centigon.mapping.LeafletMapApiWrapper.prototype.getNumPolyPoints=function(a){if(a)return a.getLatLngs().length};centigon.mapping.LeafletMapApiWrapper.prototype.mouseMovedCanvasLayer= function(c){if(!1===b&&!1===a){var f=this._utilFactory.getCollectionIterator(this._layerCanvases),g;for(g=[];f.hasNext();){var h=f.next();!0===h.layer.mouseEnabled&&!1===this.ignoreAllLayerEvents&&(g[h.layer.positionInMapDataProvider]=h)}g.reverse();for(f=this._utilFactory.getCollectionIterator(g);f.hasNext();)if((h=f.next())&&!0===h.layer.mouseEnabled&&!1===this.ignoreAllLayerEvents&&(g=h.getObjectWhereMouseClicked(c))){this.canvasObjectMousedOver(g,h);break}}};centigon.mapping.LeafletMapApiWrapper.prototype.mouseClickedCanvasLayer= function(c){if(!1===b&&!1===a){var f=this._utilFactory.getCollectionIterator(this._layerCanvases),g;for(g=[];f.hasNext();){var h=f.next();!0===h.layer.mouseEnabled&&!1===this.ignoreAllLayerEvents&&(g[h.layer.positionInMapDataProvider]=h)}g.reverse();for(f=this._utilFactory.getCollectionIterator(g);f.hasNext();)if((h=f.next())&&!0===h.layer.mouseEnabled&&!1===this.ignoreAllLayerEvents&&(g=h.getObjectWhereMouseClicked(c))){this.preventPolygonFromAbsorbingClickEvent=!0;c.stopImmediatePropagation();this.canvasObjectClicked(g, h);break}}};centigon.mapping.LeafletMapApiWrapper.prototype.getDistBetweenLocations=function(a){return this.locationToApiSpecificLocationObject(a[0]).distanceTo(this.locationToApiSpecificLocationObject(a[1]))};centigon.mapping.LeafletMapApiWrapper.prototype.setCenter=function(a){this.map.panTo(this.locationToApiSpecificLocationObject(a))};centigon.mapping.LeafletMapApiWrapper.prototype.getCenter=function(){return this.apiSpecificLatLngToLocation(this.map.getCenter())};centigon.mapping.LeafletMapApiWrapper.prototype.zoom= function(a){this.map.setZoom(a,{animate:!1})};centigon.mapping.LeafletMapApiWrapper.prototype.disablePanning=function(){this.map.dragging.disable()};centigon.mapping.LeafletMapApiWrapper.prototype.enablePanning=function(){this.map.dragging.enable()};centigon.mapping.LeafletMapApiWrapper.prototype.disableZooming=function(){var a=this.map.getZoom();this.map.options.maxZoom=a;this.map.options.minZoom=a};centigon.mapping.LeafletMapApiWrapper.prototype.enableZooming=function(){this.map.getZoom();this.map.options.maxZoom= 24;this.map.options.minZoom=1};centigon.mapping.LeafletMapApiWrapper.prototype.getZoom=function(){return this.map.getZoom()};centigon.mapping.LeafletMapApiWrapper.prototype.setWmsFullServiceLayerAndStyleUrl=function(a,b,g){this._wmsUrl=a;this._wmsLayerString=b;this._wmsStyleString=g;this.setWmsLayer()};centigon.mapping.LeafletMapApiWrapper.prototype.hideWMSLayer=function(){try{this.setNullMapForOverlay(this._wmsLeafLayer),this._wmsLeafLayer=null}catch(c){this._logger.logError(c)}};centigon.mapping.LeafletMapApiWrapper.prototype.showWMSLayer= function(){this._wmsLeafLayer||this.setWmsLayer()};centigon.mapping.LeafletMapApiWrapper.prototype.setWmsLayer=function(){this.map&&this._wmsUrl&&""!==this._wmsUrl&&this._wmsLayerString&&""!==this._wmsLayerString&&(this.setNullMapForOverlay(this._wmsLeafLayer),this._wmsLeafLayer=L.tileLayer.wms(this._wmsUrl,{layers:that._wmsLayerString,styles:that._wmsStyleString,format:"image/png",transparent:!0,attribution:""}),this.setMapForOverlay(this._wmsLeafLayer))};centigon.mapping.LeafletMapApiWrapper.prototype.renderWmsLayer= function(a,b,g){return this._wmsLeafLayer=L.tileLayer.wms(a,{layers:b||"",styles:g||"",format:"image/png",transparent:!0,attribution:""})};centigon.mapping.LeafletMapApiWrapper.prototype.removeWMSLayer=function(a){this.setNullMapForOverlay(a)};centigon.mapping.LeafletMapApiWrapper.prototype.locationsToGLatLngs=function(a){var b=this._utilFactory.getCollectionIterator();for(a=this._utilFactory.getCollectionIterator(a);a.hasNext();)b.addItem(this.locationToApiSpecificLocationObject(a.next()));return b}; centigon.mapping.LeafletMapApiWrapper.prototype.locationToLeafLatLng=function(a){return L.latLng(a.lat,a.lon)};centigon.mapping.LeafletMapApiWrapper.prototype.locationToApiSpecificLocationObject=function(a){return this.locationToLeafLatLng(a)};centigon.mapping.LeafletMapApiWrapper.prototype.isApiSpecificLocationObject=function(a){return a instanceof L.latLng||a instanceof L.LatLng?!0:!1};centigon.mapping.LeafletMapApiWrapper.prototype.leafLatLngToLocation=function(a){return new centigon.mapping.Location({lat:a.lat, lon:a.lng})};centigon.mapping.LeafletMapApiWrapper.prototype.apiSpecificLatLngToLocation=function(a){return this.leafLatLngToLocation(a)};centigon.mapping.LeafletMapApiWrapper.prototype.geocode=function(a,b){};centigon.mapping.LeafletMapApiWrapper.prototype.fireClonedGeocodeCallback=function(a,b){if(!0===this._objUtil.hasKey(this.rawAddressToGeocodedLocationMap,a.address)){var c=this._objUtil.getKeyValue(this.rawAddressToGeocodedLocationMap,a.address).clone();c.responseStatus=centigon.mapping.GeocodeResponse.RESPONSE_STATUS_CODES.SUCCESS; c.positionInDataProvider=a.positionInDataProvider;b&&b(c)}};centigon.mapping.LeafletMapApiWrapper.prototype.fireAllWaitingDuplicateGeocodeCallbacks=function(a,b){for(var c,f=0;f'+ this.infoWindowContentGenerator.getHtml(b,a,"click")+"");return f};centigon.mapping.LeafletMapApiWrapper.prototype.closeAllInfoWindows=function(){this._ignorePopupCloseEvents=!0;this.map.closePopup();this._ignorePopupCloseEvents=!1};centigon.mapping.LeafletMapApiWrapper.prototype.closeInfoWindow=function(a,b){this.allInfoWindows.resetPosition();for(var c,f;this.allInfoWindows.hasNext();)f=this.allInfoWindows.next(),infoWindow=f.infoWindow,c=f.layer,f=f.index,c.positionInMapDataProvider===a.positionInMapDataProvider&& f===b&&infoWindow._close()};centigon.mapping.LeafletMapApiWrapper.prototype.showInfoWindow=function(a,b,g){!0===this.cMap.showInfoWindows&&(a.openOn(this.map),this._infoWinOpenedCallback&&this._infoWinOpenedCallback(b,g))};centigon.mapping.LeafletMapApiWrapper.prototype.setInfoWindowContent=function(a,b){a.setContent(b)};centigon.mapping.LeafletMapApiWrapper.prototype.setInfoWindowLocation=function(a,b){a.setLatLng(b)};centigon.mapping.LeafletMapApiWrapper.prototype.getLatLngFromClickEvent=function(a){return a.latlng}; centigon.mapping.LeafletMapApiWrapper.prototype.fromApiSpecificLocToContainerPx=function(a){return this.map.latLngToContainerPoint(a)};centigon.mapping.LeafletMapApiWrapper.prototype.fromApiSpecificLocToDivPx=function(a){return this.map.latLngToContainerPoint(a)};centigon.mapping.LeafletMapApiWrapper.prototype.getLatFromApiSpecificLoc=function(a){return a.lat};centigon.mapping.LeafletMapApiWrapper.prototype.getLonFromApiSpecificLoc=function(a){return a.lng};centigon.mapping.LeafletMapApiWrapper.prototype.addApiEventListener= function(a,b,g){a.on(b,g)};centigon.mapping.LeafletMapApiWrapper.prototype.addDomListener=function(a,b,g){return L.DomEvent.addListener(document.getElementById(a),b,function(a){L.DomEvent.stopPropagation(a);g(event)})};centigon.mapping.LeafletMapApiWrapper.prototype.removeDomListener=function(a,b,g){return L.DomEvent.removeListener(document.getElementById(a),b,g)};centigon.mapping.LeafletMapApiWrapper.prototype.addClickListenerToCanvas=function(a,b){$("#"+a.id).click(function(a){b(a)})};centigon.mapping.LeafletMapApiWrapper.prototype.addMouseMoveListenerToCanvas= function(a,b){$("#"+a.id).mousemove(function(a){b(a)})};centigon.mapping.LeafletMapApiWrapper.prototype.addClickListenerToMapPolyOverlay=function(a,b){return this.addApiEventListener(a,"click",function(a){b(a)})};centigon.mapping.LeafletMapApiWrapper.prototype.renderHeatmapLayer=function(a){try{if(!1===a.layer.visible){this.removeHeatmapLayerFromMap(a.layer);return}for(var b=a.layer.getAllCleansedLayerLocations(),c=a.layer.displayObjectVisibilityFlags,h=[],k,l,m;b.hasNext();)if(m=b.getPosition(), l=b.next(),!(c.length>m&&!0!==c[m])){k=[l.lat,l.lon,Number(a.heatmapPointValues.getItemAt(m))];h.push(k);var n=this.mapOptions.cMapAnalytics.getBaseAssetUrl()+"images/transparenticon.png",p=new L.icon({iconUrl:n,iconSize:[30,30],iconAnchor:[15,13]}),q=L.marker([l.lat,l.lon],{icon:p}).addTo(this.map);this.addClickHandlerToDisplayObject(q,a.metadata.layer,m,q.position)}var u=L.heatLayer(h,{radius:Number(a.radius)}).addTo(this.map);this.orderLayersZIndex();return u}catch(v){this._logger.logError(v)}return null}; centigon.mapping.LeafletMapApiWrapper.prototype.getBounds=function(){return this.map.getBounds()};centigon.mapping.LeafletMapApiWrapper.prototype.applyPolylineOptions=function(a,b){var c=(new Color(b.lineColor,1)).hexTriplet();a.setStyle({fillColor:c,fillOpacity:b.fillAlpha,opacity:b.fillAlpha,color:c,path:b.locations,weight:b.lineThickness,zIndex:b.zIndex});a.setLatLngs(b.locations);!0===b.visible?this.setMapForOverlay(a):this.setNullMapForOverlay(a)};centigon.mapping.LeafletMapApiWrapper.prototype.applyPolygonOptions= function(a,b,g){var c=(new Color(b.fillColor,1)).hexTriplet();g?g={fillColor:c,fillOpacity:b.fillAlpha,strokeColor:b.outlineColor,opacity:b.fillAlpha,weight:1,zIndex:b.zIndex}:(g={fillColor:c,fillOpacity:b.fillAlpha,color:b.outlineColor,opacity:b.fillAlpha,weight:1,zIndex:b.zIndex},a.setLatLngs(b.shapes));a.setStyle(g);!0===b.visible?this.setMapForOverlay(a):this.setNullMapForOverlay(a)};centigon.mapping.LeafletMapApiWrapper.prototype.applyRadiusOptions=function(a,b){(new Color(b.fillColor,1)).hexTriplet(); var c={fillColor:b.fillColor,fillOpacity:b.fillAlpha,color:b.outlineColor,weight:1,zIndex:b.zIndex};a.setLatLng(b.location);a.setStyle(c);a.setRadius(b.radiusInMeters);!0===b.visible?this.setMapForOverlay(a):this.setNullMapForOverlay(a)};centigon.mapping.LeafletMapApiWrapper.prototype.removeEventListener=function(a,b,g){a.off(b,g)};centigon.mapping.LeafletMapApiWrapper.prototype.fromContainerPixelToLocation=function(a){return this.apiSpecificLatLngToLocation(this.map.containerPointToLayerPoint(a))}; centigon.mapping.LeafletMapApiWrapper.prototype.fromContainerPixelToApiSpecificLocationObject=function(a){return this.map.containerPointToLatLng(a)};centigon.mapping.LeafletMapApiWrapper.prototype.getAreaOfPolyInMeters=function(a){a=a.toGeoJSON();return turf.area(a)};centigon.mapping.LeafletMapApiWrapper.prototype.getNewMarker=function(a,b){var c=L.marker([a.lat,a.lng],{icon:b});c.addTo(this.map);return c};centigon.mapping.LeafletMapApiWrapper.prototype.getPoint=function(a,b){return L.point(a,b)}; centigon.mapping.LeafletMapApiWrapper.prototype.renderPolygon=function(a){var b=(new Color(a.fillColor,1)).hexTriplet();b=L.polygon(a.shapes,{color:a.outlineColor,opacity:1,weight:1,fillColor:b,zIndex:a.zIndex,fillOpacity:a.fillAlpha});this.addClickHandlerToDisplayObject(b,a.metadata.layer,a.displayIndex,this.getPolygonCentroid(b));!0===a.visible?this.setMapForOverlay(b):this.setNullMapForOverlay(b);return b};centigon.mapping.LeafletMapApiWrapper.prototype.renderPolyline=function(a){var b=(new Color(a.lineColor, 1)).hexTriplet();b=L.polyline(a.locations,{color:b,opacity:a.fillAlpha,weight:a.lineThickness,visible:a.visible}).addTo(this.map);this.addClickHandlerToDisplayObject(b,a.metadata.layer,a.displayIndex);return b};centigon.mapping.LeafletMapApiWrapper.prototype.renderRadius=function(a){(new Color(a.fillColor,1)).hexTriplet();var b=a.location;!1===a.visible&&(a.fillAlpha=0);var c=this.getNewCircleWithOpts({fillColor:a.fillColor,opacity:a.fillAlpha,fillOpacity:a.fillAlpha,color:a.outlineColor,weight:1, center:b,map:this.map,zIndex:a.zIndex,radius:a.radiusInMeters});this.addClickHandlerToDisplayObject(c,a.metadata.layer,a.displayIndex,b);return c};centigon.mapping.LeafletMapApiWrapper.prototype.getPolygonCentroid=function(a){a=a.getLatLngs();for(var b=[],c=0;c"+a.layer.feature.properties.title+'
This map created with Mapbox!')})}})(); (function(){createNamespaceUnderCentigon("mapping.HeatmapOptions");centigon.mapping.HeatmapOptions=function(){this.radius=20;this.heatmapPointValues=[];this.gradientType=centigon.mapping.HeatmapOptions.GRADIENTS.THERMAL;this.metadata;this.layer;this.visible};centigon.mapping.HeatmapOptions.prototype.getGradientTypeByIndex=function(b){switch(b){case 0:b=centigon.mapping.HeatmapOptions.GRADIENTS.THERMAL;break;case 1:b=centigon.mapping.HeatmapOptions.GRADIENTS.RAINBOW;break;case 2:b=centigon.mapping.HeatmapOptions.GRADIENTS.RED_WHITE_BLUE; break;case 3:b=centigon.mapping.HeatmapOptions.GRADIENTS.BLUESCALE;break;case 4:b=centigon.mapping.HeatmapOptions.GRADIENTS.GRAYSCALE;break;default:b=centigon.mapping.HeatmapOptions.GRADIENTS.THERMAL}return b};centigon.mapping.HeatmapOptions.GRADIENTS={THERMAL:"rgba(0, 255, 255, 0);rgba(0, 255, 255, 1);rgba(0, 191, 255, 1);rgba(0, 127, 255, 1);rgba(0, 63, 255, 1);rgba(0, 0, 255, 1);rgba(0, 0, 223, 1);rgba(0, 0, 191, 1);rgba(0, 0, 159, 1);rgba(0, 0, 127, 1);rgba(63, 0, 91, 1);rgba(127, 0, 63, 1);rgba(191, 0, 31, 1);rgba(255, 0, 0, 1)".split(";"), RAINBOW:"rgba(0, 255, 255, 0);rgba(0, 255, 255, 1);rgba(0, 191, 255, 1);rgba(0, 127, 255, 1);rgba(0, 63, 255, 1);rgba(0, 0, 255, 1);rgba(0, 0, 223, 1);rgba(0, 0, 191, 1);rgba(0, 0, 159, 1);rgba(0, 0, 127, 1);rgba(63, 0, 91, 1);rgba(127, 0, 63, 1);rgba(191, 0, 31, 1);rgba(255, 0, 0, 1)".split(";"),RED_WHITE_BLUE:"rgba(255, 0, 0, 0);rgba(255, 0, 0, 1);rgba(191, 0, 0, 1);rgba(127, 0, 0, 1);rgba(63, 0, 0, 1);rgba(255, 255, 255, 1);rgba(223, 223, 223, 1);rgba(191, 191, 191, 1);rgba(159, 159, 159, 1);rgba(127, 127, 127, 1);rgba(0, 0, 91, 1);rgba(0, 0, 63, 1);rgba(0, 0, 31, 1);rgba(0, 0, 0, 1)".split(";"), BLUESCALE:"rgba(0, 0, 91, 1);rgba(0, 0, 63, 1);rgba(0, 0, 31, 1);rgba(0, 0, 21, 1);rgba(0, 0, 91, 1);rgba(0, 0, 63, 1);rgba(0, 0, 31, 1);rgba(0, 0, 21, 1)".split(";"),GRAYSCALE:"rgba(91, 91, 91, 1);rgba(63, 63, 63, 1);rgba(31, 31, 31, 1);rgba(21, 21, 21, 1);rgba(91, 91, 91, 1);rgba(63, 63, 63, 1);rgba(31, 31, 31, 1);rgba(21, 21, 21, 1)".split(";")}})(); (function(){createNamespaceUnderCentigon("mapping.HeatmapRenderer");centigon.mapping.HeatmapRenderer=function(b){this._utilFactory=new centigon.util.UtilityFactory;this._logger=this._utilFactory.getLoggerUtil();this.layer=b;this.mapApiAdapter=this.layer.cMap.getMapApiAdapter()};centigon.mapping.HeatmapRenderer.prototype.render=function(){try{this.mapApiAdapter.removeHeatmapLayerFromMap(this.layer);var b=this.getHeatmapOptionsFromLayerProps();this.layer.heatmapOpts=b;this.numObjectsToProcess=b.heatmapPointValues.getLength(); this.numObjectsProcessed=0;this.layer.setStatusMessage(centigon.mapping.DrawingProgressDisplay.STATUSES.DRAWING_POINTS);var a=this.mapApiAdapter.renderHeatmapLayer(b),c=[],f=new centigon.mapping.LayerDisplayObject;f.displayObject={options:b,displayObject:a};f.actualApiDisplayObject=a;c.push(f);this.layer.displayObjects=c}catch(g){this._logger.logError(g)}finally{this.layer.setStatusMessage(centigon.mapping.DrawingProgressDisplay.STATUSES.DONE)}};centigon.mapping.HeatmapRenderer.prototype.getHeatmapOptionsFromLayerProps= function(){var b=new centigon.mapping.HeatmapOptions;b.gradientType=b.getGradientTypeByIndex(this.layer.heatmapGradientIndex);b.radius=this.layer.defaultDisplayObjectPixelSize;b.heatmapPointValues=this.layer.displayObjectValues;b.layer=this.layer;b.metadata={layer:this.layer};b.visible=this.layer.visible;return b}})(); (function(){createNamespaceUnderCentigon("mapping.indoor.MapObject");centigon.mapping.indoor.MapObject=function(){this.description="";this.floorNumber=-1;this.id=this.displayName=this.csvLatLng=this.thumbnailBase64="";this.alertsEnabled=!0;this.svgXml="";this.svgDisplayObjects=[];this.useAlerts=!0;this.layerIndex}})();(function(){createNamespaceUnderCentigon("mapping.indoor.SvgDisplayObject");centigon.mapping.indoor.SvgDisplayObject=function(){this.label=this.value="";this.color;this.id="";this.dataIndex}})(); (function(){createNamespaceUnderCentigon("mapping.indoor.SVGHandler");centigon.mapping.indoor.SVGHandler=function(b,a,c){this._svgDisplayObjectToSvgObjectId=this.buildMapOfSvgDispObjToSvgObjIds(a);this._mapObj=a;this._utilFactory=new centigon.util.UtilityFactory;this._logger=this._utilFactory.getLoggerUtil();this._domUtil=this._utilFactory.getDomUtil();this.cMapAnalytics=c;this.infoWindowContentGen=c.infoWindowContentGen;this.originalParentContainerId=b;$("#"+this.originalParentContainerId).width(); $("#"+this.originalParentContainerId).height();c=this._domUtil.getRandomDivId();this._domUtil.appendHtmlToDomObject(b,'
');this.parentContainerID=b=c;this.parentContainer=$("#"+b);this.infoWindowId=b+"infoWindow";this.containerHeight=this.containerWidth=0;this.svgObjectOriginalStyleMap={};this.objectSelectedCallBackHandler=null;this.inBeaconMode=new Boolean(!1);this.inCompassMode= new Boolean(!1);this.theBeacon=this.holdReleaseCallBackHandler=null;this.theBeaconID="theBeacon";this.isReleaseFromHold=new Boolean(!1);this.beaconScale=0;this.beaconPosY=this.beaconPosX=-1E3;this.beaconRotation=0;this.svgRoot=this.id=null;this.data=a.svgXml;this.gestureEngine=null;this.lastTransformEndTime=this.rotation=this.scale=this.lastPosY=this.lastPosX=this.posY=this.posX=0;this.initCallbackError=this.initCallbackSuccess=null;this.infoWindowCloseHtml=''};centigon.mapping.indoor.SVGHandler.prototype.init=function(b,a){this.rotation=this.scale=this.lastPosY=this.lastPosX=this.posY=this.posX=0;this.initCallbackSuccess=b;this.initCallbackError=a;this.addSVGToContainer();this.svgRoot=$("#"+this.parentContainerID+" > svg");this.setID();this.setSVGSizeToFitContainer();var c=this.svgRoot.width(),f=this.svgRoot.height(),g=this.parentContainer.width(),h=this.parentContainer.height(); c=g/2-c/2;f=h/2-f/2;this.posX=c;this.posY=f;this.lastPosX=c;this.lastPosY=f;f={margin:"auto",padding:"0","-webkit-transform":this.getTransform(this.scale,this.posX,this.posY,this.rotation),"-webkit-transform-style":"preserve-3d","-webkit-transform-origin":"center"};this.redrawSVG(f);this.svgRoot.removeAttr("viewBox");this.svgRoot.removeAttr("preserveAspectRatio");this.parentContainer.css("overflow","hidden");this.parentContainer.css("-webkit-transform","translate3d(0,0,0)");this.gestureEngine=this.svgRoot.hammer({prevent_default:!0, transform_always_block:!0,transform_min_scale:1,drag_block_horizontal:!0,drag_block_vertical:!0,drag_min_distance:0});this.removeCompassHandlers();this.turnGestureEngineOn();this.initCallbackSuccess&&this.initCallbackSuccess()};centigon.mapping.indoor.SVGHandler.prototype.buildMapOfSvgDispObjToSvgObjIds=function(b){for(var a={},c=0;ca.originalEvent.wheelDelta?b.zoomOut(a.originalEvent):b.zoomIn(a.originalEvent)})};centigon.mapping.indoor.SVGHandler.prototype.zoomIn=function(b){this.scale=Math.max(centigon.mapping.indoor.SVGHandler.MIN_ZOOM,Math.min(1.2*this.last_scale,centigon.mapping.indoor.SVGHandler.MAX_ZOOM));this.redrawSVG(this.getCssBufferWebkitTransform());this.last_scale=this.scale};centigon.mapping.indoor.SVGHandler.prototype.zoomOut= function(b){this.scale=Math.max(centigon.mapping.indoor.SVGHandler.MIN_ZOOM,Math.min(.8*this.last_scale,centigon.mapping.indoor.SVGHandler.MAX_ZOOM));this.redrawSVG(this.getCssBufferWebkitTransform());this.last_scale=this.scale};centigon.mapping.indoor.SVGHandler.prototype.getCssBufferWebkitTransform=function(){var b={};b["-webkit-transform"]=this.getTransform(this.scale,this.posX,this.posY,this.rotation);return b};centigon.mapping.indoor.SVGHandler.prototype.turnCompassOff=function(){this.inCompassMode= !1;this.removeCompassHandlers();this.beaconPosY=this.beaconPosX=-1E3;this.beaconScale=1;this.beaconRotation=0;this.theBeacon.css("-webkit-transform",this.getTransform(this.beaconScale,this.beaconPosX,this.beaconPosY,this.beaconRotation));this.rotation=0;this.redrawSVG(this.getCssBufferWebkitTransform())};centigon.mapping.indoor.SVGHandler.prototype.removeCompassHandlers=function(){window.removeEventListener("compassneedscalibration",this.calibrateCompass,!1);window.removeEventListener("deviceorientation", this.handleSVG_Orientation,!1)};centigon.mapping.indoor.SVGHandler.prototype.turnCompassOn=function(){this.inCompassMode=!0;window.DeviceOrientationEvent?(window.addEventListener("compassneedscalibration",this.calibrateCompass,!1),window.addEventListener("deviceorientation",this.handleSVG_Orientation,!1)):alert("Device orientation is not supported.")};centigon.mapping.indoor.SVGHandler.prototype.calibrateCompass=function(b){alert("Your compass needs calibrating! Wave your device in a figure-eight motion"); e.preventDefault()};centigon.mapping.indoor.SVGHandler.prototype.handleSVG_Orientation=function(b){b.preventDefault();this.rotation=-window.orientation-(b.compassHeading||b.webkitCompassHeading||0);this.redrawSVG(this.getCssBufferWebkitTransform());this.beaconRotation=-this.rotation;this.theBeacon.css(this.getBeaconCSS())};centigon.mapping.indoor.SVGHandler.prototype.handleSVG_Gesture=function(b){if(b.gesture){b.gesture.preventDefault();var a=b.gesture.center.pageX,c=b.gesture.center.pageY;switch(b.type){case "tap":this.highlightAndShowObjectInfo($(b.target), a,c);break;case "touch":this.last_scale=this.scale;break;case "hold":1==this.inBeaconMode&&this.holdReleaseCallBackHandler("hold",b.timeStamp);this.isReleaseFromHold=!0;break;case "release":1==this.isReleaseFromHold&&(this.isReleaseFromHold=!1,1==this.inBeaconMode&&(this.holdReleaseCallBackHandler("release",b.timeStamp),this.placeBeaconDownAndTurnCompassOn(a,c)),this.highlightAndShowObjectInfo($(b.target),a,c));break;case "drag":a=b.timeStamp;500',b+=this.infoWindowContentGen.getHtml(g.dataIndex, this.cMapAnalytics.cMap.getLayerAt(this._mapObj.layerIndex),"click"),b+=this.infoWindowCloseHtml,b+="",$("#"+this.parentContainerID).append(b),$("#"+this.infoWindowId).click(function(){$("#"+f.infoWindowId).remove()})):this._logger.trace("no svg infowindow for item "+b)};centigon.mapping.indoor.SVGHandler.prototype.deselectAllObjects=function(){var b,a;for(a in this.svgObjectOriginalStyleMap){var c=this.svgObjectOriginalStyleMap[a];var f=c.shape;var g=c.origStrokeColor;var h=c.origStrokeWidth; (b=c.origFillAlpha)&&f.attr("fill-opacity",b);c.origStrokeWidth&&f.attr("stroke-width",h);c.origStrokeColor&&f.attr("stroke",g)}};centigon.mapping.indoor.SVGHandler.prototype.placeBeaconDownAndTurnCompassOn=function(b,a){var c=this.svgRoot.offset().left,f=this.svgRoot.offset().top;c=(b-c)/this.scale;f=(a-f)/this.scale;this.beaconScale=1/this.scale;this.beaconPosX=c-34.5;this.beaconPosY=f-43;this.theBeacon.css(this.getBeaconCSS());this.theBeacon.show();c=c/this.svgRoot.width()*100;f=f/this.svgRoot.height()* 100;this.redrawSVG({"-webkit-transform-origin":c+"% "+f+"%"});this.turnCompassOn();this.setBeaconMode(!1)};centigon.mapping.indoor.SVGHandler.prototype.getBeaconCSS=function(){return{padding:"0px","-webkit-transform-origin":"center","-webkit-transform":this.getTransform(this.beaconScale,this.beaconPosX,this.beaconPosY,this.beaconRotation)}};centigon.mapping.indoor.SVGHandler.prototype.debugCSS=function(){for(var b=["-webkit-transform-origin","-webkit-transform"],a=0;a'+this.layer.displayName+"":"";var l=this.layer.displayObjectLabels.getItemAtOrReturnAlternateValue(b,"");l=l?l:"";var m='style="'+g+'"';if(-1")||-1"))f=!0,m="";l=this.stripHtmlTagsIfPresent(l);l="
"+l+"
";m="
";!f&&c&&(c=this.layer.displayObjectValues.getItemAtOrReturnAlternateValue(b,""),m='
'+(c?c:"")+"
");0")+m,g=this.layer.cleansedLocationData.getItemAt(b),this.layer.type!==centigon.mapping.Layer.TYPE.MARKER&&this.layer.type!==centigon.mapping.Layer.TYPE.HEAT||!g||!0!==this.cMapAnalytics.indoorMapExistsAtLocation(g)||(k+=this.getIndoorMapButtonHtml()));this.layer.type===centigon.mapping.Layer.TYPE.SHAPE&&this.cMapAnalytics.drillLevelsExistBelowLayer(this.layer)&&(k+=this.getDrillIconHtml());return k+=""};centigon.mapping.InfoWindowContentGenerator.prototype.stripHtmlTagsIfPresent= function(b){-1")?b=b.substring(b.indexOf(""),b.length):-1")&&(b=b.substring(b.indexOf(""),b.length));b=b.replace("","");return b=b.replace("","")};centigon.mapping.InfoWindowContentGenerator.prototype.addEventListeners=function(b){var a=this;this._domUtil.getDomObjectById(this._btnIndoorMapsList).click(function(){a.cMapAnalytics.showIndoorMapsList();return!1});this._domUtil.getDomObjectById(this._btnDrillId).click(function(){a.cMapAnalytics.drill(b)})}; centigon.mapping.InfoWindowContentGenerator.prototype.getDrillIconHtml=function(){this._btnDrillId=this._domUtil.getRandomDivId();return''};centigon.mapping.InfoWindowContentGenerator.prototype.getIndoorMapButtonHtml=function(){this._btnIndoorMapsList=this._domUtil.getRandomDivId();this._domUtil.getDomObjectById(this._btnIndoorMapsList).remove(); return'
'};centigon.mapping.InfoWindowContentGenerator.prototype.getLayerNameFontColorStylePart=function(){return"color:"+(new Color(this.cMapAnalytics.infoWindowStyles()[0],1)).hexTriplet()+";"};centigon.mapping.InfoWindowContentGenerator.prototype.getFontFamilyStylePart=function(){return"font-family:"+this.cMapAnalytics.infoWindowFontFamily()+";"};centigon.mapping.InfoWindowContentGenerator.prototype.getFontColorStylePart=function(){var b= new Color(this.cMapAnalytics.infoWindowFontColor(),1);b.hexTriplet();return"color:"+b.hexTriplet()+";"};centigon.mapping.InfoWindowContentGenerator.prototype.getFontSizeStylePart=function(){return"font-size:"+this.cMapAnalytics.infoWindowFontSize()+"px;"};centigon.mapping.InfoWindowContentGenerator.prototype.getFontUnderlineStylePart=function(){var b="text-underline-style: none;";!0===this.cMapAnalytics.infoWindowUseFontUnderline()&&(b="text-underline-style: solid;");return b};centigon.mapping.InfoWindowContentGenerator.prototype.getFontItalicStylePart= function(){var b="";!0===this.cMapAnalytics.infoWindowUseFontUnderline()&&(b="font-style: italic;");return b};centigon.mapping.InfoWindowContentGenerator.prototype.getFontBoldStylePart=function(){var b="font-weight: normal;";!0===this.cMapAnalytics.infoWindowUseFontUnderline()&&(b="font-weight: bold;");return b};centigon.mapping.InfoWindowContentGenerator.prototype.getFontAlignStylePart=function(){return"text-align:"+this.cMapAnalytics.infoWindowFontAlign()+";"};centigon.mapping.InfoWindowContentGenerator.prototype.getInfoWindowRangeHtml= function(){var b=this.getFontFamilyStylePart();b+=this.getFontColorStylePart();b+=this.getFontSizeStylePart();b+=this.getFontUnderlineStylePart();this.getFontAlignStylePart();this.getFontItalicStylePart();this.getFontBoldStylePart();b="";for(var a=this.cMapAnalytics.infoWindowLabelRange(),c,f=0;f")){var g=-1")?c.indexOf(""):c.length;c=c.substring(c.indexOf(""),g)}c+="
"}else c="
";b+=c}return b}})(); (function(){createNamespaceUnderCentigon("ui.ToggleListMenu");centigon.ui.ToggleListMenu=function(b){this._utilFactory=new centigon.util.UtilityFactory;this._domUtil=this._utilFactory.getDomUtil();this._buttonOpts=b;this._lastSelectedButtonId;this._lastSelectedButtonOpts;this.init()};centigon.ui.ToggleListMenu.prototype.init=function(){for(var b=this._utilFactory.getCollectionIterator(this._buttonOpts);b.hasNext();)this.createToggleButton(b.next())};centigon.ui.ToggleListMenu.prototype.createToggleButton= function(b){var a=this,c=this.domObj(b.id);this._lastSelectedButtonId||(this._lastSelectedButtonId=b.id);c.click(function(){a._lastSelectedButtonId=this.id;var b=a.domObj(this.id);a.removeActiveClassFromAllButtons();b.removeClass("active");b.addClass("active");a.change(this)})};centigon.ui.ToggleListMenu.prototype.removeActiveClassFromAllButtons=function(){for(var b=this._utilFactory.getCollectionIterator(this._buttonOpts),a;b.hasNext();)a=b.next().id,this.domObj(a).removeClass("active")};centigon.ui.ToggleListMenu.prototype.change= function(){};centigon.ui.ToggleListMenu.prototype.domObj=function(b){return this._domUtil.getDomObjectById(b)}})(); (function(){createNamespaceUnderCentigon("ui.ToggleButtonMenu");centigon.ui.ToggleButtonMenu=function(b){this._utilFactory=new centigon.util.UtilityFactory;this._domUtil=this._utilFactory.getDomUtil();this._buttonOpts=b;this._lastSelectedButtonId;this._lastSelectedButtonOpts;this.init()};centigon.ui.ToggleButtonMenu.prototype.init=function(){for(var b=this._utilFactory.getCollectionIterator(this._buttonOpts);b.hasNext();)this.createToggleButton(b.next())};centigon.ui.ToggleButtonMenu.prototype.createToggleButton= function(b){var a=this,c=b.iconUrl,f=this.domObj(b.id);this._lastSelectedButtonId||(this._lastSelectedButtonId=b.id,this._lastSelectedButtonOpts=b,c=b.iconSelectedUrl);f.css("background-image","url("+c+")");f.click(function(){a.highlightIcon(b);a._lastSelectedButtonId=this.id;a._lastSelectedButtonOpts=b;a.change(this)});f.mouseenter(function(){$(this).css("background-image","url("+b.iconSelectedUrl+")")});f.mouseleave(function(){this.id!==a._lastSelectedButtonId&&$(this).css("background-image","url("+ b.iconUrl+")")})};centigon.ui.ToggleButtonMenu.prototype.highlightIcon=function(b){if(b.id!==this._lastSelectedButtonId){var a=this.domObj(this._lastSelectedButtonId);a.css("background-image","url("+this._lastSelectedButtonOpts.iconUrl+")")}this.domObj(b.id).css("background-image","url("+b.iconSelectedUrl+")")};centigon.ui.ToggleButtonMenu.prototype.change=function(){};centigon.ui.ToggleButtonMenu.prototype.domObj=function(b){return this._domUtil.getDomObjectById(b)}})(); (function(){createNamespaceUnderCentigon("ui.SlidingSelectMenu");centigon.ui.SlidingSelectMenu=function(b){this._utilFactory=new centigon.util.UtilityFactory;this._domUtil=this._utilFactory.getDomUtil();this.parentDomObj=b;this._selectedLabelPrefix="";this.init()};centigon.ui.SlidingSelectMenu.prototype.init=function(){var b=this;this._selectedLabelPrefix=this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_slidingmenu_selectedlabel").text();this.setDefaultLabel();var a=function(){var a= b.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_toggleslidingselectmenu");a.hasClass("com_cmapsanalytics_menu_dropdownsmall_up")?(a.removeClass("com_cmapsanalytics_menu_dropdownsmall_up"),b.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_accordian").slideUp("fast")):(a.addClass("com_cmapsanalytics_menu_dropdownsmall_up"),b.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_accordian").slideDown("fast"))};this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_selectlist_item a").click(function(a){b.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_slidingmenu_selectedlabel").html(b._selectedLabelPrefix+ a.target.text);b.change(a.target);b.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_toggleslidingselectmenu").removeClass("com_cmapsanalytics_menu_dropdownsmall_up");b.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_accordian").slideUp("fast")});this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_toggleslidingselectmenu").click(function(){a()});this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_slidingmenu_selectedlabel").click(function(){a()})};centigon.ui.SlidingSelectMenu.prototype.change= function(b){};centigon.ui.SlidingSelectMenu.prototype.setSelectedItem=function(b){var a=this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_selectlist_item a");a.length>b&&(b=this._domUtil.castAsDomObject(a[b])[0],this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_slidingmenu_selectedlabel").html(this._selectedLabelPrefix+b.text),this.change(b),this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_toggleslidingselectmenu").removeClass("com_cmapsanalytics_menu_dropdownsmall_up"), this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_accordian").slideUp("fast"))};centigon.ui.SlidingSelectMenu.prototype.setDefaultLabel=function(){var b=this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_selectlist_item").find("a:first");b&&this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_slidingmenu_selectedlabel").html(this._selectedLabelPrefix+b.text())};centigon.ui.SlidingSelectMenu.prototype.getDomObjByClassNameUnderParentRoot=function(b){return this.parentDomObj.find(b)}})(); (function(){createNamespaceUnderCentigon("ui.AdvancedAccordionMenu");centigon.ui.AdvancedAccordionMenu=function(b){this._utilFactory=new centigon.util.UtilityFactory;this._domUtil=this._utilFactory.getDomUtil();this._strUtil=this._utilFactory.getStringUtil();this._logger=this._utilFactory.getLoggerUtil();this.options=b;this.onInitialized;this.onVisChanged=function(){};this.cMap=this.options.cMap;this.childOpts=[];this.selectedLayer;this.selectedCategory;this.onLayerChanged=function(){};this._firstCategoryOpts; this._activeCategoryOpts;this._categoryLabels=[];this._categoryToggleButtonOpts=[];this.toggleBtnMenu;this.htmlContentUrl="https://gmapsplugin.net/cmapsanalytics/assets/v4/advancedInfoWindow/AdvancedAccordionShellMarkup.txt";this.parentRootDivId=this._domUtil.getRandomDivId();this.accordionParentDivId=this._domUtil.getRandomDivId();this._slidingMenu;this.divId=this._domUtil.getRandomDivId();this._initialized=!1;this._lastCollapsedHeaderPosByCat={};this._DEF_COLLAPSED_HEADER_HEIGHT=33;this._DEF_ANIMATION_SPEED= 500;var a=this;this.loadDependencies(function(b){a.buildDom(b);a.onDependenciesLoaded();a.layerChanged()})};centigon.ui.AdvancedAccordionMenu.prototype.buildDom=function(b){b=b.replace("[main_div_id_placeholder]",this.parentRootDivId);b=b.replace("[accordion_div_id_placeholder]",this.accordionParentDivId);this.domObj(this.options.targetDiv).html(b);this.getParentRoot().append('
');this.addInitialEventListeners();this.refreshLayersDropdown()}; centigon.ui.AdvancedAccordionMenu.prototype.refreshLayersDropdown=function(){for(var b="",a=this.cMap.getLayers(),c="",f,g=[],h;a.hasNext();)f=a.next(),!1!==this.cMap.layerCanParticipateInAdvancedInfowindow(f)&&(""===c&&(c=f.displayName),h=this._domUtil.getRandomDivId(),b+='
',b+=''+f.displayName+"",g.push(h));this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_layers_dropdown").html(b); this.addLayerChangedEventListeners(g)};centigon.ui.AdvancedAccordionMenu.prototype.getStyleForLayerLink=function(b){var a='style="background-repeat: no-repeat;background-size: 18px 18px;background-position: 8px 8px;text-indent: 25px;';a=!0===b.visible?a+"background-image: url(https://gmapsplugin.net/cmapsanalytics/assets/v4/advancedInfoWindow/img/checkbox_selected.jpg);":a+"background-image: url(https://gmapsplugin.net/cmapsanalytics/assets/v4/advancedInfoWindow/img/checkbox_unchecked.jpg);";return a+ '"'};centigon.ui.AdvancedAccordionMenu.prototype.getSelectedLayer=function(){this.selectedLayer||(this.selectedLayer=this.cMap.getLayerAt(0));return this.selectedLayer};centigon.ui.AdvancedAccordionMenu.prototype.addCards=function(b){this._firstCategoryOpts=null;this.removeAnyOldCategoryIcons();b=this._utilFactory.getCollectionIterator(b);for(var a;b.hasNext();)a=b.next(),this.addChild(a);this.toggleBtnMenu=new centigon.ui.ToggleButtonMenu(this._categoryToggleButtonOpts);var c=this;setTimeout(function(){c.setDefaultCategory()}, 500)};centigon.ui.AdvancedAccordionMenu.prototype.addChild=function(b){this.selectedCategory||(this.selectedCategory=b.category);this.childOpts.push(b);this.createChild(b);this.setDefaultLabel()};centigon.ui.AdvancedAccordionMenu.prototype.triggerDefaultCategoryClick=function(){var b=this.getSelectedIconButtonOptsForDefaultCategory().id;this.domObj(b).click()};centigon.ui.AdvancedAccordionMenu.prototype.setDefaultCategory=function(){this._firstCategoryOpts&&this.showCategory(this._firstCategoryOpts)}; centigon.ui.AdvancedAccordionMenu.prototype.setDefaultLabel=function(b){this._slidingMenu&&this._slidingMenu.setDefaultLabel()};centigon.ui.AdvancedAccordionMenu.prototype.createChild=function(b){this._domUtil.removeDomObjById(b.divId);this.createCategoryNavIcon(b);var a=this.selectedCategory===b.category?"":"display: none";this.domObj(this.divId).append('
'); a=this.domObj(b.divId);var c=this;a.click(function(){c.expandChild(this,function(){c.onVisChanged()})});this._lastCollapsedHeaderPosByCat[b.category]||(this._lastCollapsedHeaderPosByCat[b.category]=0);var f=this._lastCollapsedHeaderPosByCat[b.category];a.css({top:f,height:this._DEF_COLLAPSED_HEADER_HEIGHT});f+=this._DEF_COLLAPSED_HEADER_HEIGHT;this._lastCollapsedHeaderPosByCat[b.category]=f};centigon.ui.AdvancedAccordionMenu.prototype.addInitialEventListeners=function(){var b=this;this._slidingMenu= new centigon.ui.SlidingSelectMenu(this.domObj(this.accordionParentDivId));this._slidingMenu.change=function(a){b.selectedLayer=b.cMap.getLayerAt(parseInt(b._domUtil.castAsDomObject(a).data("layerindex")));b.layerChanged();b.manageLayerVisIcon()};var a=this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_cblayervis");this.addLayerListItemCheckboxListeners(a);this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_togglebutton_close").click(function(){b.cMap.hideAdvancedInfowindow()})}; centigon.ui.AdvancedAccordionMenu.prototype.addLayerListItemCheckboxListeners=function(b){var a=this;b.click(function(){var c=b.hasClass("com_cmapsanalytics_menu_visible_yes")?"com_cmapsanalytics_menu_visible_no":"com_cmapsanalytics_menu_visible_yes";b.removeClass("com_cmapsanalytics_menu_visible_yes");b.removeClass("com_cmapsanalytics_menu_visible_no");b.addClass(c);var f=a.getSelectedLayer();f&&("com_cmapsanalytics_menu_visible_yes"===c?a.cMap.showLayer(f):a.cMap.hideLayer(f),a.refreshLayersDropdown())})}; centigon.ui.AdvancedAccordionMenu.prototype.addLayerChangedEventListeners=function(b){var a=this;for(b=this._utilFactory.getCollectionIterator(b);b.hasNext();)(function(c){a.domObj(b.next()).click(function(b){a.setSelectedLayer(a.cMap.getLayerAt(parseInt(a._domUtil.castAsDomObject(this).data("layerindex"))));a.manageLayerVisIcon()})})(b.getPosition())};centigon.ui.AdvancedAccordionMenu.prototype.setSelectedLayer=function(b){this.selectedLayer=b;this._slidingMenu&&this._slidingMenu.setSelectedItem(this.selectedLayer.positionInMapDataProvider); this.manageLayerVisIcon()};centigon.ui.AdvancedAccordionMenu.prototype.layerChanged=function(){this.onLayerChanged(this.getSelectedLayer())};centigon.ui.AdvancedAccordionMenu.prototype.manageLayerVisIcon=function(){var b=this.getDomObjByClassNameUnderParentRoot(".com_cmapsanalytics_cblayervis"),a=this.getSelectedLayer().visible?"com_cmapsanalytics_menu_visible_yes":"com_cmapsanalytics_menu_visible_no";b.removeClass("com_cmapsanalytics_menu_visible_yes");b.removeClass("com_cmapsanalytics_menu_visible_no"); b.addClass(a)};centigon.ui.AdvancedAccordionMenu.prototype.showCategory=function(b){this.selectedCategory=b.category;for(var a=this._utilFactory.getCollectionIterator(this.childOpts),c;a.hasNext();)c=a.next(),this.selectedCategory===c.category?this._domUtil.showDomObjectById(c.divId):this._domUtil.hideDomObjectById(c.divId);var f=this;this.expandChild(this.domObj(b.divId),function(){f.onVisChanged()});this._activeCategoryOpts=b};centigon.ui.AdvancedAccordionMenu.prototype.getSelectedIconButtonOptsForDefaultCategory= function(b){return this._categoryToggleButtonOpts[0]};centigon.ui.AdvancedAccordionMenu.prototype.createCategoryNavIcon=function(b){if(!(-1');var c=this;this.domObj(a).click(function(){c.showCategory(b)})}};centigon.ui.AdvancedAccordionMenu.prototype.removeChild=function(b){var a=this.childOpts.indexOf(b);this.childOpts.splice(a,1);this.domObj(b.divId).remove();this.removeAnyOldCategoryIcons()};centigon.ui.AdvancedAccordionMenu.prototype.removeAnyOldCategoryIcons= function(){for(var b=[],a=this._utilFactory.getCollectionIterator(this.childOpts);a.hasNext();)b.push(a.next().category);a=this._utilFactory.getCollectionIterator(this._categoryToggleButtonOpts);for(var c;a.hasNext();)if(c=a.next(),-1===b.indexOf(c.category)){var f=this._categoryToggleButtonOpts.indexOf(c);-1!==g&&this._categoryToggleButtonOpts.splice(f,1);var g=this._categoryLabels.indexOf(c.category);-1!==g&&this._categoryLabels.splice(g,1);this.domObj(c.id).remove()}};centigon.ui.AdvancedAccordionMenu.prototype.expandChild= function(b,a){var c=this._domUtil.castAsDomObject(b),f=c.height(),g=c.css("height","auto").height();f===g?c.css("top","4px"):(this.collapseAllChildren(c,g),c.height(f),c.animate({height:g,top:4},this._DEF_ANIMATION_SPEED,function(){a&&a()}))};centigon.ui.AdvancedAccordionMenu.prototype.collapseChild=function(b,a,c){this._domUtil.castAsDomObject(b).animate({height:this._DEF_COLLAPSED_HEADER_HEIGHT,top:a+10},this._DEF_ANIMATION_SPEED,function(){c&&c()})};centigon.ui.AdvancedAccordionMenu.prototype.collapseAllChildren= function(b,a){var c=this;this.getParentRoot().find(".com_cmapsanalytics_card").not(b).each(function(b,g){c._domUtil.castAsDomObject(g).data("categoryfilter")===c.selectedCategory&&(c.collapseChild(g,a,function(){c.onVisChanged()}),a+=c._DEF_COLLAPSED_HEADER_HEIGHT)})};centigon.ui.AdvancedAccordionMenu.prototype.loadDependencies=function(b){var a=this;$.ajax({url:this.htmlContentUrl,success:function(a){b(a)},error:function(b,f,g){a._logger.trace("couldn't retrieve the advanced infowindow markup"); a._logger.logError(g)}})};centigon.ui.AdvancedAccordionMenu.prototype.onDependenciesLoaded=function(){this._initialized=!0;if(this.onInitialized)this.onInitialized()};centigon.ui.AdvancedAccordionMenu.prototype.isInitialized=function(){return this._initialized};centigon.ui.AdvancedAccordionMenu.prototype.domObj=function(b){return this._domUtil.getDomObjectById(b)};centigon.ui.AdvancedAccordionMenu.prototype.getParentRoot=function(){return this.domObj(this.parentRootDivId)};centigon.ui.AdvancedAccordionMenu.prototype.getDomObjByClassNameUnderParentRoot= function(b){return this.domObj(this.parentRootDivId).find(b)}})(); (function(){createNamespaceUnderCentigon("ui.AdvancedInfoWindow");centigon.ui.AdvancedInfoWindow=function(b){var a=this;this.cMapAnalytics=b;this._utilFactory=new centigon.util.UtilityFactory;this.domUtil=this._utilFactory.getDomUtil();this.strUtil=this._utilFactory.getStringUtil();this._logger=this._utilFactory.getLoggerUtil();this.targetDiv=b.advancedInfoWindowDivId;(!this.domObj(this.targetDiv).length||0>=this.domObj(this.targetDiv).length)&&this.domObj(b.getDivId()).append('');this.accordionMenu=new centigon.ui.AdvancedAccordionMenu({cMap:b,targetDiv:this.targetDiv});this.accordionMenu.onLayerChanged=function(b){a.onLayerChanged(b)};this.accordionMenu.onInitialized=function(){a.createCards()};this.accordionMenu.onVisChanged=function(){a.handleVisChanged()};this.layer;this._lastLayerIx=-1;this._cards=[];this._cardsCache={};this._numCardsToCreate= this._numCardsCreated=0;this._dependenciesLoaded=!1;this.options={cards:[]};this.initialized=!1;this._firstCardOpts;this.allCardsLoaded=this.allCardsRequested=!1};centigon.ui.AdvancedInfoWindow.prototype.init=function(){!0!==this.initialized&&(this.onDependenciesLoaded(),this.setActiveLayer(this.accordionMenu.getSelectedLayer()),this.refreshLayersDropdown(),this.initialized=!0)};centigon.ui.AdvancedInfoWindow.prototype.getPositionBasedOnMapProvider=function(){return this.cMapAnalytics.apiToUse=== centigon.mapping.APICentral.MAP_TYPES.GOOG?"top:50px;left:10px;":"top:70px;left:10px;"};centigon.ui.AdvancedInfoWindow.prototype.onLayerChanged=function(){this.execFuncOnAllCards("aiwLayerChanged")};centigon.ui.AdvancedInfoWindow.prototype.infoWindowClosed=function(b){this.execFuncOnAllCards("infoWindowClosed",[b])};centigon.ui.AdvancedInfoWindow.prototype.onSelectorTypeChanged=function(b){this.execFuncOnAllCards("selectorTypeChanged",[b])};centigon.ui.AdvancedInfoWindow.prototype.applyOptions=function(b){this.options= b;!1===b.opts.display_on_load?this.setVis(!1):this.setVis(!0);this.createCards()};centigon.ui.AdvancedInfoWindow.prototype.createCards=function(){if(!1!==this._dependenciesLoaded&&!1!==this.accordionMenu.isInitialized()&&this.options.opts&&this.options.opts.cardOpts){this.removeAnyUnusedCards(this.options.opts.cardOpts);var b=this.getOnlyNewCardOpts(this.options.opts.cardOpts);b=this._utilFactory.getCollectionIterator(b);var a=[];this._numCardsToCreate=this._numCardsCreated=0;for(var c;b.hasNext();)c= b.next(),this.domObj(c.divId).remove(),!0===c.treatAsAccordionMenuChild?a.push(c):c.divTarget===centigon.ui.CardOptions.DIV_TARGETS.AIW?this.domObj(this.targetDiv).append('
'):c.divTarget===centigon.ui.CardOptions.DIV_TARGETS.MAP?this.domObj(this.cMapAnalytics.getDivId()).append('
'):c.divTarget===centigon.ui.CardOptions.DIV_TARGETS.BODY?$("body").append('
'):""!==c.divTarget?this.domObj(this.divTarget).append('
'):this.domObj(this.targetDiv).append('
'),this._numCardsToCreate++,this.createCard(c);this.accordionMenu.addCards(a);this.startCheckingIfAllCardsLoaded()}};centigon.ui.AdvancedInfoWindow.prototype.getOnlyNewCardOpts=function(b){var a=[];for(c in this._cardsCache)a.push(c);var c=[];for(b=this._utilFactory.getCollectionIterator(b);b.hasNext();){var f=b.next();-1===a.indexOf(f.className)&&c.push(f)}return c};centigon.ui.AdvancedInfoWindow.prototype.removeAnyUnusedCards= function(b){var a=[];for(b=this._utilFactory.getCollectionIterator(b);b.hasNext();)a.push(b.next().className);for(var c in this._cardsCache)-1===a.indexOf(c)&&(b=this._cardsCache[c].card,this.accordionMenu.removeChild(b.options),delete this._cardsCache[c])};centigon.ui.AdvancedInfoWindow.prototype.startCheckingIfAllCardsLoaded=function(){var b=this;var a=setInterval(function(){if(b._numCardsCreated===b._numCardsToCreate){var c=b._utilFactory.getCollectionIterator(b._cards);for(b.allCardsLoaded=!0;c.hasNext();){var f= c.next();if(!f.htmlLoaded){b.allCardsLoaded=!1;break}}b.allCardsLoaded&&(clearInterval(a),b.accordionMenu.setDefaultCategory(),b.manageSearchBarVis())}},100)};centigon.ui.AdvancedInfoWindow.prototype.createCard=function(b){var a=this,c=function(){var c=new (a.domUtil.stringToFunction(b.className));b.cMap=a.cMapAnalytics;c.render(b);a._cards.push(c);c.layer=a.accordionMenu.getSelectedLayer();a._numCardsCreated++;a._cardsCache[b.className].card=c};this._cardsCache[b.className]||(this._cardsCache[b.className]= {card:{}});if(b.classUrl){var f=document.createElement("script");f.type="text/javascript";f.src=b.classUrl;f.onload=function(){c()};document.head.appendChild(f)}else c()};centigon.ui.AdvancedInfoWindow.prototype.execFuncOnAllCards=function(b,a){for(var c=this._utilFactory.getCollectionIterator(this._cards),f,g=this.accordionMenu.getSelectedLayer();c.hasNext();)f=c.next(),f.layer=g,f[b].apply(f,a)};centigon.ui.AdvancedInfoWindow.prototype.handleVisChanged=function(){this.execFuncOnAllCards("visChanged")}; centigon.ui.AdvancedInfoWindow.prototype.handleViewportChange=function(){this.execFuncOnAllCards("viewportChanged")};centigon.ui.AdvancedInfoWindow.prototype.remove=function(){this.domObj(this.targetDiv).html("")};centigon.ui.AdvancedInfoWindow.prototype.loadDependencies=function(b){};centigon.ui.AdvancedInfoWindow.prototype.onDependenciesLoaded=function(){this._dependenciesLoaded=!0;this.setActiveLayer();this.createCards()};centigon.ui.AdvancedInfoWindow.prototype.setActiveLayer=function(b){var a= !1,c=!1,f=this.accordionMenu.getSelectedLayer();this.layer=b?b:f;f&&f.positionInMapDataProvider!==this.layer.positionInMapDataProvider&&(c=!0);this._lastLayerIx!==this.layer.positionInMapDataProvider&&(a=!0);!0===c&&(this.accordionMenu.setSelectedLayer(this.layer),this.accordionMenu.triggerDefaultCategoryClick());!0===a?this.execUpdateViewOnCards():this.execLayerSelectedOnCards();this._lastLayerIx=this.layer.positionInMapDataProvider};centigon.ui.AdvancedInfoWindow.prototype.execUpdateViewOnCards= function(){this.layer&&this.execFuncOnAllCards("updateView")};centigon.ui.AdvancedInfoWindow.prototype.execLayerSelectedOnCards=function(){this.layer&&this.execFuncOnAllCards("layerSelected")};centigon.ui.AdvancedInfoWindow.prototype.domObj=function(b){return this.domUtil.getDomObjectById(b)};centigon.ui.AdvancedInfoWindow.prototype.toggleVis=function(){this.domUtil.getDomObjectById(this.targetDiv).toggle();this.manageSearchBarVis()};centigon.ui.AdvancedInfoWindow.prototype.setVis=function(b){!0=== b?this.domUtil.getDomObjectById(this.targetDiv).show():this.domUtil.getDomObjectById(this.targetDiv).hide();this.manageSearchBarVis()};centigon.ui.AdvancedInfoWindow.prototype.manageSearchBarVis=function(){!0===this.options.opts.show_searchbar_when_aiw_hidden&&!1===this.domUtil.getDomObjectById(this.targetDiv).is(":visible")?this.domObj(this.cMapAnalytics.getDivId()).find(".com_cmapsanalytics_searchbar").show():this.domObj(this.cMapAnalytics.getDivId()).find(".com_cmapsanalytics_searchbar").hide()}; centigon.ui.AdvancedInfoWindow.prototype.refreshLayersDropdown=function(){this.accordionMenu.refreshLayersDropdown()}})(); (function(){createNamespaceUnderCentigon("ui.AdvancedInfoWindowOptions");centigon.ui.AdvancedInfoWindowOptions=function(){this.opts={cardOpts:[],show_searchbar_when_aiw_hidden:!0,display_on_load:!0,display_on_loc_select:!0}};centigon.ui.AdvancedInfoWindowOptions.prototype.clone=function(){var b=new centigon.ui.AdvancedInfoWindowOptions,a;for(a in this.opts)b.opts[a]=this.opts[a];return b}})(); (function(){createNamespaceUnderCentigon("ui.CardOptions");centigon.ui.CardOptions=function(){this._utilFactory=new centigon.util.UtilityFactory;this._domUtil=this._utilFactory.getDomUtil();this.divId=this._domUtil.getRandomDivId();this.uid=this._domUtil.getRandomDivId();this.cMap;this.title=this.classUrl=this.className=this.category=this.iconSelectedUrl=this.iconUrl="";this.getHtmlIsAsync=!1;this.treatAsAccordionMenuChild=!0;this.divTarget=centigon.ui.CardOptions.DIV_TARGETS.AIW};centigon.ui.CardOptions.DIV_TARGETS= {AIW:"aiw",MAP:"map",BODY:"body"}})(); (function(){createNamespaceUnderCentigon("ui.Card");centigon.ui.Card=function(){this._utilFactory=new centigon.util.UtilityFactory;this._objUtil=this._utilFactory.getObjectUtil();this._domUtil=this._utilFactory.getDomUtil();this._strUtil=this._utilFactory.getStringUtil();this._logger=this._utilFactory.getLoggerUtil();this.options={};this.uid=this._domUtil.getRandomDivId();this.controlIdToRandomId={};this.cMap;this.layer;this.htmlLoaded=!1};centigon.ui.Card.prototype.render=function(b){this.options= b;this.cMap=b.cMap;var a=this,c=function(c){a.domObj(b.divId).append(c);a.onHtmlSet();a.addEventListeners();a.htmlLoaded=!0};!0===this.options.getHtmlIsAsync?this.getHtml(c):(this.domObj(b.divId).append(this.getHtml()),this.onHtmlSet(),this.addEventListeners(),this.htmlLoaded=!0)};centigon.ui.Card.prototype.onHtmlSet=function(){};centigon.ui.Card.prototype.getHtml=function(b){};centigon.ui.Card.prototype.getRemoteContent=function(b){var a=this;$.ajax({url:b.url,dataType:"text",success:function(c){b.success(a.replaceStaticIdsWithDynamicIds(c))}, error:function(a,b,g){alert("Could not load remote Card html due to: "+g)}})};centigon.ui.Card.prototype.getCardAssetUrl=function(){return"https://gmapsplugin.net/cmapsanalytics/assets/v4/advancedInfoWindow/cards/"};centigon.ui.Card.prototype.replaceStaticIdsWithDynamicIds=function(b){for(var a in this.controlIdToRandomId)b=b.replace(a,this.controlIdToRandomId[a]);return b};centigon.ui.Card.prototype.addEventListeners=function(){};centigon.ui.Card.prototype.updateView=function(){};centigon.ui.Card.prototype.viewportChanged= function(){};centigon.ui.Card.prototype.aiwLayerChanged=function(){};centigon.ui.Card.prototype.layerSelected=function(){};centigon.ui.Card.prototype.infoWindowClosed=function(b){};centigon.ui.Card.prototype.add=function(){};centigon.ui.Card.prototype.remove=function(){};centigon.ui.Card.prototype.visChanged=function(){};centigon.ui.Card.prototype.selectorTypeChanged=function(b){};centigon.ui.Card.prototype.show=function(){};centigon.ui.Card.prototype.hide=function(){};centigon.ui.Card.prototype.domObj= function(b){return this._domUtil.getDomObjectById(b)};centigon.ui.Card.prototype.domObjByRandField=function(b){return this._domUtil.getDomObjectById(this.controlIdToRandomId[b])};centigon.ui.Card.prototype.getMyDiv=function(){return this.domObj(this.options.divId)};centigon.ui.Card.prototype.getDomObjByClassNameUnderMyDiv=function(b){"."!==b.substring(0,1)&&(b="."+b);return this.getMyDiv().find(b)}})(); (function(){createNamespaceUnderCentigon("ui.Breadcrumbs");centigon.ui.Breadcrumbs=function(b){this._cmapsAnalytics=b;this._parentDivId=b.getDivId();this._divId=this._parentDivId+"cmapsAnalyticsBreadcrumbs";this._utilFactory=new centigon.util.UtilityFactory;this._domUtil=this._utilFactory.getDomUtil();this.layersInDrillPath=[]};centigon.ui.Breadcrumbs.prototype.getHtml=function(){var b=this._utilFactory.getCollectionIterator(this.layersInDrillPath);var a='
'; for(var c,f;b.hasNext();)c=b.next(),f=b.hasNext()?">":"",a+='";return a+"
"};centigon.ui.Breadcrumbs.prototype.addEventListeners=function(){for(var b=this,a=this._utilFactory.getCollectionIterator(this.layersInDrillPath);a.hasNext();)this._domUtil.getDomObjectById(this._divId+a.next().positionInMapDataProvider).click(function(a){a=a.currentTarget.id.replace(b._divId,""); a=b._cmapsAnalytics.getLayerAt(a);b.showLayerAndHideAllLayersBeneath(a)})};centigon.ui.Breadcrumbs.prototype.showLayerAndHideAllLayersBeneath=function(b){this._cmapsAnalytics.cMap.closeAllInfoWindows();this._cmapsAnalytics.clearAllSelections();var a=this._cmapsAnalytics.drillLevels(),c=this._utilFactory.getCollectionIterator(this.layersInDrillPath),f=parseInt(a[b.positionInMapDataProvider]),g=0,h=this._cmapsAnalytics.layersVisibility();for(h=this.showAllLayersAtDrillLevel(f,h);c.hasNext();){var k= c.next();var l=parseInt(a[k.positionInMapDataProvider]);l>f?(h[k.positionInMapDataProvider]=!1,this.removeLabelFromDrillPath(k)):lg&&this.hide();this._cmapsAnalytics.layersVisibility(h,!0);c.resetPosition();this._cmapsAnalytics.setSelectedLayerDrillVars(b);for(f=[];c.hasNext();)a=c.next(),this._cmapsAnalytics.refreshLayer(a,!0,a.drillFilter),a.drillFilter&&""!==a.drillFilter&&f.push(a);!0===this._cmapsAnalytics.dynamicZoomOnDrill()&&(this._cmapsAnalytics.clearAllLocationsForDynamicZooming(), this._cmapsAnalytics.addLayerLocationsForDynamicZooming(b),this._cmapsAnalytics.useDynamicZoom(!0));this._cmapsAnalytics.callDrillEvent(b,f);b&&this._cmapsAnalytics.setAdvancedInfoWindowLayer(b)};centigon.ui.Breadcrumbs.prototype.showAllLayersAtDrillLevel=function(b,a){for(var c=this._cmapsAnalytics.drillLevels(),f=this._cmapsAnalytics.getLayers(),g;f.hasNext();)g=f.next(),parseInt(c[g.positionInMapDataProvider])===b&&(a[g.positionInMapDataProvider]=!0);return a};centigon.ui.Breadcrumbs.prototype.show= function(){this._domUtil.getDomObjectById(this._divId).remove();this._domUtil.appendHtmlToDivById(this._parentDivId,this.getHtml());this._domUtil.getDomObjectById(this._parentDivId).css("top","30px");this._domUtil.showDomObjectById(this._divId);this.addEventListeners()};centigon.ui.Breadcrumbs.prototype.hide=function(){for(var b=this._utilFactory.getCollectionIterator(this.layersInDrillPath),a;b.hasNext();)a=b.next(),a.drillFilter="";this._domUtil.getDomObjectById(this._parentDivId).css("top","0px"); this._domUtil.hideDomObjectById(this._divId)};centigon.ui.Breadcrumbs.prototype.removeLabelFromDrillPath=function(b){b.drillFilter="";this._domUtil.getDomObjectById(this._divId+b.positionInMapDataProvider).remove()}})(); (function(){createNamespaceUnderCentigon("util.PageParameters");centigon.util.PageParameters=function(){};centigon.util.PageParameters.prototype.getParameterVal=function(b){b=b.toLowerCase();for(var a,c=window.location.search.substring(1).split("&"),f=0;fb.numSize&&(b.numSize=80);var k=b.opts.categories.length;b=b.numSize/3;g.globalAlpha=h;g.font="17 pt Arial Bold";g.textAlign="center";g.textBaseline="middle";for(i=h=0;i c&&!0===this.displayObjectVisibilityFlags[c]?b.push(a[c]):this.displayObjectVisibilityFlags.length<=c&&b.push(a[c])}catch(f){b=[],console.log(f)}return b};centigon.mapping.Layer.prototype.destroy=function(){try{this.destroyRenderer(),this._imDestroyed=!0}catch(b){}};centigon.mapping.Layer.prototype.destroyRenderer=function(){try{this.displayObjectRenderer.destroy&&this.displayObjectRenderer.destroy(),this.displayObjectRenderer=null}catch(b){}};centigon.mapping.Layer.prototype.getMeasureIx=function(){return this._measIx}; centigon.mapping.Layer.prototype.setMeasure=function(b){this._measIx=b;b=this.cMapProp("measures");this.values(b[this._measIx])};centigon.mapping.Layer.prototype.locations=function(b){return this.cMapProp("locations",b)};centigon.mapping.Layer.prototype.labels=function(b){return this.cMapProp("labels",b)};centigon.mapping.Layer.prototype.measureNames=function(b){return this.cMapProp("measureNames",b)};centigon.mapping.Layer.prototype.measures=function(b){return this.cMapProp("measures",b)};centigon.mapping.Layer.prototype.values= function(b){return this.cMapProp("values",b)};centigon.mapping.Layer.prototype.colors=function(b){return this.cMapProp("colors",b)};centigon.mapping.Layer.prototype.categories=function(b){return this.cMapProp("categories",b)};centigon.mapping.Layer.prototype.times=function(b){return this.cMapProp("times",b)};centigon.mapping.Layer.prototype.cMapProp=function(b,a){if(a){var c=this.cMapAnalytics[b]();c[this.positionInMapDataProvider]=a;return this.cMapAnalytics[b](c)}return this.cMapAnalytics[b]()[this.positionInMapDataProvider]}; centigon.mapping.Layer.prototype.getLocations=function(){return this.getLayerPropValues(this.getAllCleansedLayerLocations().cloneSourceArray())};centigon.mapping.Layer.prototype.getColors=function(){return this.getLayerPropValues(this.displayObjectColors)};centigon.mapping.Layer.prototype.getLabels=function(){return this.getLayerPropValues(this.displayObjectLabels)};centigon.mapping.Layer.prototype.getValues=function(){return this.getLayerPropValues(this.displayObjectValues)};centigon.mapping.Layer.prototype.getVisibilityFlags= function(){return this.getLayerPropValues(this.displayObjectVisibilityFlags)};centigon.mapping.Layer.prototype.getCategories=function(){return this.getLayerPropValues(this.displayObjectCategories)};centigon.mapping.Layer.prototype.getTimes=function(){return this.getLayerPropValues(this.displayObjectTimes)};centigon.mapping.Layer.prototype.getDateRangeBounds=function(){var b=this.getTimes();b.sort(function(a,b){return ab.max&&(b.max=c),f=c;f=function(a,b){if("days"===b)return Math.round(a/864E5);if("hours"===b)return Math.round(a/ 36E5);if("minutes"===b)return Math.round(a/6E4);if("seconds"===b)return Math.round(a/1E3)};b.dayDiff=f(b.max-b.min,"days");b.hourDiff=f(b.max-b.min,"hours");b.minDiff=f(b.max-b.min,"minutes");b.secDiff=f(b.max-b.min,"seconds");b.msDiff=Math.round(b.max-b.min);b.numTimes=a.getLength();a=g/a.getLength();b.avgDiffBetweenTimesInSecs=f(a,"seconds");b.avgDiffBetweenTimesInMins=f(a,"minutes");b.avgDiffBetweenTimesInHours=f(a,"hours");b.avgDiffBetweenTimesInDays=f(a,"days");b.avgDiffBetweenTimesInMs=a;return b}; centigon.mapping.Layer.prototype.getDataDateRangeGroups=function(){var b={},a={},c={},f=this.getTimes();f.map(function(a,c,f){d=a.date;d=Math.floor(d.getTime()/864E5);b[d]=b[d]||[];b[d].push(a)});f.map(function(b,c,f){d=b.date;d=Math.floor(d.getTime()/6048E5);a[d]=a[d]||[];a[d].push(b)});f.map(function(a,b,f){d=a.date;d=12*(d.getFullYear()-1970)+d.getMonth();c[d]=c[d]||[];c[d].push(a)});return{byday:b,byweek:a,bymonth:c}};centigon.mapping.Layer.prototype.lyrObjTimeWithinRange=function(b,a){var c= this._utilFactory.getCollectionIterator(this.displayObjectTimes).getItemAt(b);return c?c>=a.min&&c<=a.max?!0:!1:!1};centigon.mapping.Layer.prototype.clearLocationInViewportCache=function(){this._locsInVPortCache={}};centigon.mapping.Layer.prototype.getLayerPropValues=function(b){if(!1===this.restrictCalcsToViewport&&!1===this.restrictCalcsToVisible&&!1===this.restrictCalcsToSelected&&!1===this.restrictCalcsToUnselected)return this._utilFactory.getCollectionIterator(b).cloneSourceArray();var a=[]; b=this._utilFactory.getCollectionIterator(b).cloneSourceArray();this.setVportCheckLocs();for(var c=this._utilFactory.getCollectionIterator(this.displayObjects),f,g;c.hasNext();)g=c.getPosition(),f=c.next().displayObject,f=f.options,(!0===this.restrictCalcsToViewport||!0===this.restrictCalcsToVisible)&&!1===f.visible||!0===this.restrictCalcsToViewport&&!1===this.hasLocationInViewport(g)||!0===this.restrictCalcsToSelected&&(0===this.displayObjectSelectedFlags.getLength()||0===this.displayObjectSelectedFlags.getItemAt(g)|| !1===this.displayObjectSelectedFlags.getItemAt(g))||!0===this.restrictCalcsToUnselected&&(0===this.displayObjectSelectedFlags.getLength()||1===this.displayObjectSelectedFlags.getItemAt(g)||!0===this.displayObjectSelectedFlags.getItemAt(g))||a.push(b[g]);return a};centigon.mapping.Layer.prototype.setVportCheckLocs=function(b,a){this._vportLocs=this.getAllCleansedLayerLocations()};centigon.mapping.Layer.prototype.hasLocationInViewport=function(b){try{var a=this._mapApiAdapter.getBounds(),c=this._vportLocs.getItemAt(b), f=this._mapApiAdapter.locationToApiSpecificLocationObject(c);return a.contains(f)}catch(g){return!1}};centigon.mapping.Layer.prototype.getSelectedLocation=function(){return this._utilFactory.getCollectionIterator(this.cleansedLocationData).cloneSourceArray()[this.selectedIndex]};centigon.mapping.Layer.prototype.getSelectedLabel=function(){return this._utilFactory.getCollectionIterator(this.displayObjectLabels).cloneSourceArray()[this.selectedIndex]};centigon.mapping.Layer.prototype.getSelectedValue= function(){return this._utilFactory.getCollectionIterator(this.displayObjectValues).cloneSourceArray()[this.selectedIndex]};centigon.mapping.Layer.prototype.getMedian=function(){var b=this.getValues();b.sort(function(a,b){return a-b});var a=Math.floor(b.length/2);return b.length%2?b[a]:(b[a-1]+b[a])/2};centigon.mapping.Layer.prototype.getMin=function(){return Math.min.apply(Math,this.getValues())};centigon.mapping.Layer.prototype.getMax=function(){return Math.max.apply(Math,this.getValues())};centigon.mapping.Layer.prototype.getAvg= function(){for(var b=this.getValues(),a=0,c=0;cc&&!0===this.displayObjectVisibilityFlags[c]? a.push(b[c]):this.displayObjectVisibilityFlags.length<=c&&a.push(b[c]);return a};centigon.mapping.MarkerLayer.prototype.getLayerDisplayObjectRenderer=function(){this.displayObjectRenderer||(this.displayObjectRenderer=new centigon.mapping.MarkerRenderer(this));return this.displayObjectRenderer}})(); (function(){createNamespaceUnderCentigon("mapping.PolyLayer");centigon.mapping.PolyLayer=function(b){centigon.mapping.Layer.call(this);this.bounds=[];this.showDisplayObjectOutline=!0;this.displayObjectOutlineColor=centigon.mapping.Layer.DEFAULT_DISPLAY_OBJECT_COLOR};centigon.mapping.PolyLayer.prototype=new centigon.mapping.Layer;centigon.mapping.PolyLayer.constructor=centigon.mapping.Layer;centigon.mapping.PolyLayer.prototype.processCsvLatLngsForPolyLayer=function(){this.bounds=[];var b=this.getAllRawLayerLocations(), a=[],c=[];this.cleansedLocationData=this._utilFactory.getCollectionIterator();for(this.apiSpecificLocationData=this._utilFactory.getCollectionIterator();b.hasNext();){b.getPosition();var f=b.next();if(""===f||","===f||!1===b.hasNext())this.cleansedLocationData.addItem(a),this.apiSpecificLocationData.addItem(c),a=[],c=[];this._mapApiAdapter.csvLatLngIsValid(f)&&(f=this.cMap.getLocationFromCSVLatLng(f),a.push(f),f=this._mapApiAdapter.locationToApiSpecificLocationObject(f),c.push(f),this.bounds.push(f))}}; centigon.mapping.PolyLayer.prototype.getApiSpecificLocations=function(){for(var b=this.getAllCleansedLayerLocations(),a=this._utilFactory.getCollectionIterator(),c,f=[];b.hasNext();)(c=b.next())&&f.push(this._mapApiAdapter.locationToApiSpecificLocationObject(c));a.addItem(f);return a}})(); (function(){createNamespaceUnderCentigon("mapping.PolygonLayer");centigon.mapping.PolygonLayer=function(){this._utilFactory=new centigon.util.UtilityFactory;this._objUtil=this._utilFactory.getObjectUtil();this._domUtil=this._utilFactory.getDomUtil();this._uid=this._domUtil.getRandomDivId();centigon.mapping.PolyLayer.call(this);this.legendIconFileName="layer_shapes.png";this.zIndices=[];this.displayObjectRenderer};centigon.mapping.PolygonLayer.prototype=new centigon.mapping.PolyLayer;centigon.mapping.PolygonLayer.constructor= centigon.mapping.PolyLayer;centigon.mapping.PolygonLayer.prototype.processLocationData=function(){this.dataProviderType===centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.SHAPE_DATAPROVIDER||this.dataProviderType===centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.GEOJSON_DATAPROVIDER||this.dataProviderType===centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.SHAPE_GEOCODER&&!1===this.waitingForMyLocationData?(this.processCsvLatLngs(),this.drawLayer()):this.dataProviderType!== centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.SHAPE_DATAPROVIDER&&this.dataProviderType!==centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.GEOJSON_DATAPROVIDER&&this.dataProviderType!==centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.SHAPE_GEOCODER&&!1===this._mapApiAdapter.layerHasGeocodableData(this)?(this.processCsvLatLngsForPolyLayer(),this.drawLayer()):this.dataProviderType!==centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.SHAPE_DATAPROVIDER&&this.dataProviderType!== centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.GEOJSON_DATAPROVIDER&&this.dataProviderType!==centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.SHAPE_GEOCODER&&!0===this._mapApiAdapter.layerHasGeocodableData(this)&&(this.processCsvLatLngsForPolyLayer(),this.geocodeAddresses())};centigon.mapping.PolygonLayer.prototype.setVportCheckLocs=function(b,a){this._vportLocs=this.getApiSpecificLocationsForPolygonLayer()};centigon.mapping.PolygonLayer.prototype.getAllCleansedLayerLocations= function(){return this.getApiSpecificLocationsForPolygonLayer()};centigon.mapping.PolygonLayer.prototype.hasLocationInViewport=function(b){var a=this._mapApiAdapter.getBounds();b=this._vportLocs.getItemAt(b);var c;if(b)for(b=this._utilFactory.getCollectionIterator(b);b.hasNext();){var f=b.next();for(f=f instanceof Array?this._utilFactory.getCollectionIterator(f):this._utilFactory.getCollectionIterator([f]);f.hasNext();)if((c=f.next())&&!0===a.contains(c))return!0}return!1};centigon.mapping.PolygonLayer.prototype.getApiSpecificLocationsForPolygonLayer= function(){return this._utilFactory.getCollectionIterator(this.apiSpecificLocationData)};centigon.mapping.PolygonLayer.prototype.getLayerDisplayObjectRenderer=function(){this.displayObjectRenderer||(this.displayObjectRenderer=new centigon.mapping.PolygonRenderer(this));return this.displayObjectRenderer};centigon.mapping.PolygonLayer.prototype.setBoundMarkerLayerVisibilityKeys=function(b){var a=this.cMapAnalytics.layerAppearanceOptions()[this.positionInMapDataProvider];a=this._utilFactory.getCollectionIterator(String(a.markerLayerBindings).split(",")); for(var c;a.hasNext();)(c=this.cMapAnalytics.getLayerAt(a.next()))&&c.positionInMapDataProvider===b.positionInMapDataProvider&&this.hideAnyMarkersNotInMyShapeBounds(c)};centigon.mapping.PolygonLayer.prototype.hideAnyMarkersNotInMyShapeBounds=function(b){for(var a=b.getAllCleansedLayerLocations(),c=this._utilFactory.getCollectionIterator(b.displayObjectVisibilityFlags).cloneSourceArray(),f=this.getAllDisplayObjectsAsCollection(),g,h,k;f.hasNext();)if(g=f.next(),a.resetPosition(),!1!==this.displayObjectVisibilityFlags[g.displayObject.options.displayIndex]&& (!(-1a&&(a=0),this.indicesToBuffer=c=this.getAllRawLayerLocations(),this.distancesToBuffer=this.displayObjectValues.cloneSourceArray(),this.zIndices=c.createArraySeededWithDefaultValues(c.getLength(),a),a={features:this.getPolygonBufferFeatures()}, a=(new centigon.mapping.GeoJsonShapefile).getShapeRecords(a),this.apiSpecificLocationData=this.cMap.getShapeDataFromShapefileRecords(a).arrayOfApiSpecificProcessedShapeData,centigon.mapping.PolygonLayer.prototype.drawLayer.call(this)))}};centigon.mapping.BufferLayer.prototype.getPolygonBufferFeatures=function(){return this.associatedLayer.type===centigon.mapping.Layer.TYPE.SHAPE||this.associatedLayer.type===centigon.mapping.Layer.TYPE.SAPDD_SHAPE||this.associatedLayer.type===centigon.mapping.Layer.TYPE.DRIVE_TIME_POLYGON? this.getGeoJsonPolygonBuffers():this.associatedLayer.type===centigon.mapping.Layer.TYPE.LINE?this.getGeoJsonPolylineFeatures():this.getGeoJsonPointFeatures()};centigon.mapping.BufferLayer.prototype.getGeoJsonPolygonBuffers=function(){for(var b,a,c,f=[],g,h=this._utilFactory.getCollectionIterator(this.associatedLayer.apiSpecificLocationData),k=this._utilFactory.getCollectionIterator(this.indicesToBuffer),l,m,n;k.hasNext();){n=k.getPosition();b=parseInt(String(k.next()).trim());b=this._utilFactory.getCollectionIterator(h.getItemAt(b)); for(g={type:"Feature",geometry:{type:"Polygon",coordinates:[]},properties:{}};b.hasNext();){l=b.getPosition();g.geometry.coordinates[l]=[];a=this._utilFactory.getCollectionIterator(b.next());for(m=null;a.hasNext();)c=a.next(),m||(m=c),g.geometry.coordinates[l].push([this._mapApiAdapter.getLonFromApiSpecificLoc(c),this._mapApiAdapter.getLatFromApiSpecificLoc(c)]);g.geometry.coordinates[l].push([this._mapApiAdapter.getLonFromApiSpecificLoc(m),this._mapApiAdapter.getLatFromApiSpecificLoc(m)])}f.push(turf.buffer(g, this.distancesToBuffer[n],this.unit))}return f};centigon.mapping.BufferLayer.prototype.getGeoJsonPolylineFeatures=function(){for(var b,a,c=[],f,g=this._utilFactory.getCollectionIterator(this.indicesToBuffer),h=this._utilFactory.getCollectionIterator(this.associatedLayer.apiSpecificLocationData);g.hasNext();){b=this._utilFactory.getCollectionIterator(h.getItemAt(g.next()));for(f={type:"Feature",geometry:{type:"LineString",coordinates:[]},properties:{}};b.hasNext();)a=b.next(),f.geometry.coordinates.push([this._mapApiAdapter.getLonFromApiSpecificLoc(a), this._mapApiAdapter.getLatFromApiSpecificLoc(a)]);c.push(f)}return c};centigon.mapping.BufferLayer.prototype.getGeoJsonPointFeatures=function(){for(var b,a=[],c=this._utilFactory.getCollectionIterator(this.indicesToBuffer),f=this._utilFactory.getCollectionIterator(this.associatedLayer.apiSpecificLocationData);c.hasNext();)b=f.getItemAt(c.next()),b={type:"Feature",geometry:{type:"Point",coordinates:[this._mapApiAdapter.getLonFromApiSpecificLoc(b),this._mapApiAdapter.getLatFromApiSpecificLoc(b)]},properties:{}}, a.push(b);return a};centigon.mapping.BufferLayer.prototype.applyLayerConfig=function(b,a){centigon.mapping.PolygonLayer.prototype.applyLayerConfig.call(this,b,a);this.processLocationData()}})(); (function(){createNamespaceUnderCentigon("mapping.PolylineLayer");centigon.mapping.PolylineLayer=function(){centigon.mapping.PolyLayer.call(this);this.legendIconFileName="layer_line.png";this.displayObjectRenderer};centigon.mapping.PolylineLayer.prototype=new centigon.mapping.PolyLayer;centigon.mapping.PolylineLayer.constructor=centigon.mapping.PolyLayer;centigon.mapping.PolylineLayer.prototype.processLocationData=function(){var b=centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.SHAPE_DATAPROVIDER, a=centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.GEOJSON_DATAPROVIDER;this.type===centigon.mapping.Layer.TYPE.HUB_SPOKE&&this.dataProviderType!==b&&this.dataProviderType!==a?(this.processCsvLatLngsForPolyLayer(),this.drawLayer()):this.dataProviderType===b&&this.dataProviderType===a&&!1===this.waitingForMyLocationData?(this.processCsvLatLngs(),this.drawLayer()):this.dataProviderType!==b&&this.dataProviderType!==a&&!1===this._mapApiAdapter.layerHasGeocodableData(this)?(this.processCsvLatLngsForPolyLayer(), this.drawLayer()):this.dataProviderType!==b&&this.dataProviderType!==a&&!0===this._mapApiAdapter.layerHasGeocodableData(this)&&(this.processCsvLatLngsForPolyLayer(),this.geocodeAddresses())};centigon.mapping.PolylineLayer.prototype.processCsvLatLngsForPolyLayer=function(){var b=this.getAllRawLayerLocations(),a=[],c=[];this.cleansedLocationData=this._utilFactory.getCollectionIterator();for(this.apiSpecificLocationData=this._utilFactory.getCollectionIterator();b.hasNext();){b.getPosition();var f=b.next(); if(this.type===centigon.mapping.Layer.TYPE.HUB_SPOKE){f=f.split("|");var g=this.cMap.getLocationFromCSVLatLng(f[0]);a.push(g);c.push(this._mapApiAdapter.locationToApiSpecificLocationObject(g));f=this.cMap.getLocationFromCSVLatLng(f[1]);a.push(f);c.push(this._mapApiAdapter.locationToApiSpecificLocationObject(f));this.cleansedLocationData.addItem(a);this.apiSpecificLocationData.addItem(c);a=[];c=[]}else{if(""===f||","===f||!1===b.hasNext())this.cleansedLocationData.addItem(a),this.apiSpecificLocationData.addItem(c), a=[],c=[];this._mapApiAdapter.csvLatLngIsValid(f)&&(f=this.cMap.getLocationFromCSVLatLng(f),a.push(f),c.push(this._mapApiAdapter.locationToApiSpecificLocationObject(f)))}}};centigon.mapping.PolylineLayer.prototype.getApiSpecificLocationsForPolylineLayer=function(){if(this.type===centigon.mapping.Layer.TYPE.HUB_SPOKE||this.dataProviderType===centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.SHAPE_DATAPROVIDER||this.dataProviderType===centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.GEOJSON_DATAPROVIDER)return this._utilFactory.getCollectionIterator(this.apiSpecificLocationData); for(var b=this.getAllRawLayerLocations(),a,c=this.cleansedLocationData,f=[],g,h=this._utilFactory.getCollectionIterator();b.hasNext();)g=b.getPosition(),a=b.next(),this._mapApiAdapter.csvLatLngIsValid(a)?(g=this.cMap.getLocationFromCSVLatLng(a),f.push(this._mapApiAdapter.locationToApiSpecificLocationObject(g))):c.hasItemAt(g)&&(g=c.getItemAt(g))&&f.push(this._mapApiAdapter.locationToApiSpecificLocationObject(g)),a&&""!==a&&","!==a&&!1!==b.hasNext()||(h.addItem(f),f=[]);return h};centigon.mapping.PolylineLayer.prototype.setVportCheckLocs= function(b,a){this._vportLocs=this.getApiSpecificLocationsForPolylineLayer()};centigon.mapping.PolylineLayer.prototype.hasLocationInViewport=function(b){var a=this._mapApiAdapter.getBounds();b=this._vportLocs.getItemAt(b);var c;if(b)for(b=this._utilFactory.getCollectionIterator(b);b.hasNext();)if((c=b.next())&&!0===a.contains(c))return!0;return!1};centigon.mapping.PolylineLayer.prototype.getLayerDisplayObjectRenderer=function(){this.displayObjectRenderer||(this.displayObjectRenderer=new centigon.mapping.PolylineRenderer(this)); return this.displayObjectRenderer}})(); (function(){createNamespaceUnderCentigon("mapping.RadiusLayer");centigon.mapping.RadiusLayer=function(){this._utilFactory=new centigon.util.UtilityFactory;this._objUtil=this._utilFactory.getObjectUtil();this._myLayerAppearanceOpts;this.legendIconFileName="layer_radius.png";this.preventPreAndPostDrawCallbacks=!1;centigon.mapping.Layer.call(this)};centigon.mapping.RadiusLayer.prototype=new centigon.mapping.Layer;centigon.mapping.RadiusLayer.constructor=centigon.mapping.Layer;centigon.mapping.RadiusLayer.prototype.processLocationData= function(){this._myLayerAppearanceOpts=this.cMapAnalytics.layerAppearanceOptions()[this.positionInMapDataProvider]||{};var b=this;this.postdrawCallback=function(){for(var a=b.cMapAnalytics.getLayers();a.hasNext();)b.setBoundMarkerLayerVisibilityKeys(a.next())};var a=this._utilFactory.getCollectionIterator(this.displayObjectValues).cloneSourceArray(),c=this._myLayerAppearanceOpts;if(c&&this._objUtil.hasOwnProperty(c,"travelunits")&&c.travelunits.toLowerCase()===centigon.mapping.TravelOptions.UNITS_SYSTEMS.IMPERIAL){a= this._utilFactory.getCollectionIterator(this.displayObjectValues);for(c=this._utilFactory.getCollectionIterator();a.hasNext();)c.addItem(this.cMap.convertDistanceToMeters(a.next(),"yards"));a=this._utilFactory.getCollectionIterator(c).cloneSourceArray()}this.displayObjectValues=this._utilFactory.getCollectionIterator(a);this.zIndices=[];c=[];for(a=this._utilFactory.getCollectionIterator(a);a.hasNext();)c.push({displayObjectIx:a.getPosition(),value:a.next()});a=this._utilFactory.getCollectionIterator(c); a=this._utilFactory.getCollectionIterator(a.getSortedArrayObjsByFieldAscending("value"));c=a.getLength();for(var f;a.hasNext();)f=a.next(),this.zIndices[f.displayObjectIx]=c--;!1===this._mapApiAdapter.layerHasGeocodableData(this)?(this.processCsvLatLngs(),this.drawLayer()):!0===this._mapApiAdapter.layerHasGeocodableData(this)&&(this.processCsvLatLngs(),this.geocodeAddresses())};centigon.mapping.RadiusLayer.prototype.getLayerDisplayObjectRenderer=function(){this.displayObjectRenderer||(this.displayObjectRenderer= new centigon.mapping.RadiusRenderer(this));return this.displayObjectRenderer};centigon.mapping.RadiusLayer.prototype.setBoundMarkerLayerVisibilityKeys=function(b){var a=this._myLayerAppearanceOpts;if(a&&this._objUtil.hasOwnProperty(a,"markerlayerbindings")){a=this._utilFactory.getCollectionIterator(String(a.markerlayerbindings).split(","));for(var c;a.hasNext();)c=this.cMapAnalytics.getLayerAt(a.next()),c.positionInMapDataProvider===b.positionInMapDataProvider&&this.hideAnyMarkersNotInMyShapeBounds(c)}}; centigon.mapping.RadiusLayer.prototype.hideAnyMarkersNotInMyShapeBounds=function(b){for(var a=b.getAllCleansedLayerLocations(),c=this._utilFactory.getCollectionIterator(b.displayObjectVisibilityFlags).cloneSourceArray(),f=this.getAllDisplayObjectsAsCollection(),g,h,k;f.hasNext();)for(g=f.next(),a.resetPosition();a.hasNext();)h=a.next(),k=a.getPosition()-1,c[k]=this.cMap.circleContains(g.actualApiDisplayObject,h.toCsvLatLon());b.displayObjectVisibilityFlags=c;b.drawLayer()};centigon.mapping.RadiusLayer.prototype.destroyRenderer= function(){centigon.mapping.Layer.prototype.destroyRenderer.call(this);this.releaseAllBoundMarkerLayersVisibility()};centigon.mapping.RadiusLayer.prototype.releaseAllBoundMarkerLayersVisibility=function(){var b=this._myLayerAppearanceOpts;if(b&&this._objUtil.hasOwnProperty(b,"markerlayerbindings")){b=this._utilFactory.getCollectionIterator(String(b.markerlayerbindings).split(","));for(var a;b.hasNext();)if(a=this.cMapAnalytics.getLayerAt(b.next()))a.displayObjectVisibilityFlags=this.cMapAnalytics.padLayerArrayProp([], a.getAllCleansedLayerLocations().getLength(),!0),a.drawLayer()}}})(); (function(){createNamespaceUnderCentigon("mapping.DriveTimePolygonLayer");centigon.mapping.DriveTimePolygonLayer=function(){centigon.mapping.PolygonLayer.call(this);this.legendIconFileName="layer_drivepolygon.png"};centigon.mapping.DriveTimePolygonLayer.prototype=new centigon.mapping.PolygonLayer;centigon.mapping.DriveTimePolygonLayer.constructor=centigon.mapping.PolygonLayer;centigon.mapping.DriveTimePolygonLayer.prototype.processLocationData=function(){console.log("Please contact support to enable premium drivetime layers on your account. https://cmapsconnect.com/designerportal")}; centigon.mapping.DriveTimePolygonLayer.prototype.parseServiceResponse=function(b,a){this.cMapAnalytics.drvePolygonRespCache[a]=b;this.cMapAnalytics.drvePolygonRespToLayer[this.positionInMapDataProvider]=b;this.waitingForMyLocationData=!1;this.setRawLocData(b);this.processCsvLatLngsForPolyLayer();.65c.length)){var f=a.getTravelRequest(this.positionInMapDataProvider);var g=c.join("")+f.travelMode+f.unitSystem;f.origin=c[0];f.destinations=c.slice(1,c.length);c=[];a.travelRespToLayer[this.positionInMapDataProvider]=null;c=function(c){a.travelRespCache[g]=c;a.travelRespToLayer[b.positionInMapDataProvider]=c;if(a.onTravelResponse)a.onTravelResponse(c);a.getLayerAt(b.positionInMapDataProvider); var f=[];f.push(c.origin);f=f.concat(c.destinations);var h=[0];h=h.concat(c.rawDistances);a._layerDispObjValues[b.positionInMapDataProvider]=h;displayObjectOverrideKeys=a.padLayerArrayProp(a.getLayerAlertIcons(b.positionInMapDataProvider,f.length),f.length,a._mapAlertDefaultIcons[b.positionInMapDataProvider]);h=a._utilFactory.getCollectionIterator(a._layerDispObjValues[b.positionInMapDataProvider]);var m=[];var n=a._utilFactory.getCollectionIterator(c.rawDistances);var p=a._utilFactory.getCollectionIterator(c.formattedDistances), q=a._utilFactory.getCollectionIterator(c.formattedTravelTimes),u=a._utilFactory.getCollectionIterator(c.destinations);m.push("Origin: "+c.origin);for(var v;n.hasNext();){var r=n.getPosition();n.next();v="From: "+c.origin+" To: "+u.getItemAt(r)+"
";v+=" Distance: "+p.getItemAt(r)+"
";v+=" Takes: "+q.getItemAt(r)+"
";m.push(v)}m=a._utilFactory.getCollectionIterator(m);c=!0===a.layerDynamicSizeEnabled(b.positionInMapDataProvider)?a.padLayerArrayProp(a.getDisplayObjectSizesForLayerAtIndex(b.positionInMapDataProvider, b.defaultDisplayObjectPixelSize),f.length,b.defaultDisplayObjectPixelSize):a.padLayerArrayProp([],f.length,b.defaultDisplayObjectPixelSize);c.insertItemAt(b.defaultDisplayObjectPixelSize,0);n=a.padLayerArrayProp(a.getPropertyValues(a._layerDispObjColors[b.positionInMapDataProvider],b.positionInMapDataProvider),f.length,b.defaultDisplayObjectColor);n=a._utilFactory.getCollectionIterator(n);a.layerAlertsEnabled(b.positionInMapDataProvider)&&(n=a.padLayerArrayProp(a.getLayerAlertColors(b.positionInMapDataProvider, h),f.length,a._mapAlertDefaultColors[b.positionInMapDataProvider]),n=a.getSafeColorCodes(n),displayObjectOverrideKeys=a.padLayerArrayProp(a.getLayerAlertIcons(b.positionInMapDataProvider,f.length),f.length,a._mapAlertDefaultIcons[b.positionInMapDataProvider]),n.setItemAt(b.defaultDisplayObjectColor,0));b.waitingForMyLocationData=!1;b.rawLocationData=f;b.displayObjectPixelSizes=c;b.displayObjectValues=h;b.displayObjectLabels=m;b.displayObjectColors=n;b.displayObjectOverrideKeys=displayObjectOverrideKeys; !1===b._mapApiAdapter.layerHasGeocodableData(b)?(b.processCsvLatLngs(),b.drawLayer()):!0===b._mapApiAdapter.layerHasGeocodableData(b)&&(b.processCsvLatLngs(),b.geocodeAddresses())};a.travelRespCache[g]?c(a.travelRespCache[g]):(f.callback=c,a.cMap.getTravelTimesFromOrigin(f))}}})(); (function(){createNamespaceUnderCentigon("mapping.PlacesMarkerLayer");centigon.mapping.PlacesMarkerLayer=function(){this._utilFactory=new centigon.util.UtilityFactory;this.legendIconFileName="layer_places.png";centigon.mapping.MarkerLayer.call(this)};centigon.mapping.PlacesMarkerLayer.prototype=new centigon.mapping.MarkerLayer;centigon.mapping.PlacesMarkerLayer.constructor=centigon.mapping.MarkerLayer;centigon.mapping.PlacesMarkerLayer.prototype.processLocationData=function(){var b=this,a=this.cMapAnalytics, c=a.cMap.getMapApiAdapter(),f=this.positionInMapDataProvider;this.waitingForMyLocationData=!0;var g={},h=a.locations()[f];h&&0";t+="Rating: "+r+"
";t+="Vicinity: "+w+"
";t+='Directions: Get Directions
';t+="";h.push(t);"No Rating"===r?r=0:u=!1;n.push(r)}f=b._utilFactory.getCollectionIterator();b.rawLocationData=k;b.displayObjectLabels=b._utilFactory.getCollectionIterator(h);!0===a.layerDynamicSizeEnabled(b.positionInMapDataProvider)&& !1===u?(a._layerDispObjValues[b.positionInMapDataProvider]=n,b.displayObjectPixelSizes=b._utilFactory.getCollectionIterator(a.padLayerArrayProp(a.getDisplayObjectSizesForLayerAtIndex(b.positionInMapDataProvider,b.defaultDisplayObjectPixelSize),k.length,b.defaultDisplayObjectPixelSize))):b.displayObjectPixelSizes=b._utilFactory.getCollectionIterator(f.createArraySeededWithDefaultValues(k.length,b.defaultDisplayObjectPixelSize));b.displayObjectValues="bounds"===g.location?b._utilFactory.getCollectionIterator(f.createArraySeededWithDefaultValues(k.length, 20)):b._utilFactory.getCollectionIterator(n);b.displayObjectColors=b._utilFactory.getCollectionIterator(f.createArraySeededWithDefaultValues(k.length,b.defaultDisplayObjectColor));b.processCsvLatLngs();b.drawLayer()},a.cMap.getPlacesFromOrigin(g))))}})(); (function(){createNamespaceUnderCentigon("mapping.DirectionsLayer");centigon.mapping.DirectionsLayer=function(){centigon.mapping.MarkerLayer.call(this);this.legendIconFileName="layer_directions.png";this.directionsUrl="";this.travelDistanceMeters=this.travelDurationSeconds=0;this.polyline;this.stepMarkerSize=6;this.endpointMarkerSize=18};centigon.mapping.DirectionsLayer.prototype=new centigon.mapping.MarkerLayer;centigon.mapping.DirectionsLayer.constructor=centigon.mapping.MarkerLayer;centigon.mapping.DirectionsLayer.prototype.processLocationData= function(){var b=this,a=this.cMapAnalytics;this.waitingForMyLocationData=!0;var c=this.getAllRawLayerLocations().cloneSourceArray(),f=c.join("|"),g=a.getValueAtIndexFromArrayOrDefaultValue(a._layersLocationData,this.positionInMapDataProvider,[]),h=a.getTravelRequest(this.positionInMapDataProvider);h||(h=new centigon.mapping.TravelOptions);!0===h.useCurrentLocationAsStartPoint&&""!==a.currentLocation()&&(g[0]=a.currentLocation());a.directionsRespToLayer[this.positionInMapDataProvider]=null;g=function(c){b.waitingForMyLocationData= !1;a.directionsRespCache[f]=c;var g=[],h=[],l=[],k=[],u=[],v=[];b.travelDurationSeconds=0;for(var r=b.travelDistanceMeters=0;r');var b=document.createElement("script");b.type="text/javascript";b.src="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/cartodb.js"; b.onload=function(){cartoDBapiLoadedlds5dterrtdfb12bfdf=!0};cartoDBapiRequestedlds5dterrtdfb12bfdf=!0;document.head.appendChild(b)}}})(); (function(){createNamespaceUnderCentigon("mapping.CartoDBLayer");centigon.mapping.CartoDBLayer=function(){centigon.mapping.Layer.call(this);this._objUtil=this._utilFactory.getObjectUtil();this._strUtil=this._utilFactory.getStringUtil();this.legendIconFileName="layer_cartodb.png";this._cartoDBLayerData={};this.cartoDBLayer;this._cartoDBSubLayer;this.cartoDBSubLayerId;this.cartoDBUserId;this.cartoDBMeasFieldName;this.cartoDBDrillColName;this.cartoDBApiWrapper;this._hasLatestLayerData=!1;this._layerDataReqOnSuccessQueue= [];this._lastCartoCSSAlerts=this._lastLayerDataSqlQuery="";this._initialCartoCSSBeforeAlerts;this._queueReqIntrvl;this.opts};centigon.mapping.CartoDBLayer.prototype=new centigon.mapping.Layer;centigon.mapping.CartoDBLayer.constructor=centigon.mapping.Layer;centigon.mapping.CartoDBLayer.prototype.processLocationData=function(){if(this.opts=this.cMapAnalytics.wmsOptions()[this.positionInMapDataProvider]){var b=this;this.cartoDBApiWrapper||(this.cartoDBApiWrapper=new centigon.mapping.CartoDBApiWrapper(this._mapApiAdapter)); this.opts.cartoDBMapLayerInteractivity&&""!==this.opts.cartoDBMapLayerInteractivity&&(this.opts.cartoDBMapLayerInteractivity=this._strUtil.removeWhitespace(this.opts.cartoDBMapLayerInteractivity));this.cartoDBSubLayerId=this.opts.cartoDBSubLayerId;this.cartoDBMeasFieldName=this.opts.cartoDBMeasFieldName;this.cartoDBDrillColName=this.opts.cartoDBDrillColName;this.cartoDBUserId=this.opts.cartoDBUser;var a=function(){if(b.cartoDBLayer)b.manageVis(),b.applyDrillSQL(),b.getDefaultLayerData(),b.applyCentigonAlertsUsingCartoCSS(); else{var a={};a.cartoDBLyrCfg=b.getCartoDBLayerCfg();a.opts=b.opts;a.lyrIx=b.positionInMapDataProvider;a.onSuccess=function(a){b.waitingForMyLocationData=!1;b.cartoDBLayer=a;b.setActiveSubLayer();b.cartoDBLayer.setOpacity(b.layerTransparency);b.addLayerClickHandler();b.manageVis();b.applyDrillSQL();b.getDefaultLayerData();b.applyCentigonAlertsUsingCartoCSS()};a.onError=function(){alert("Error encountered when loading "+b.opts.cartoDBJsonVizURL)};b.cartoDBApiWrapper.createLayer(a)}};!0===this.cartoDBApiWrapper.apiReady()? a():(clearInterval(b._queueReqIntrvl),this._queueReqIntrvl=setInterval(function(){!0===b.cartoDBApiWrapper.apiReady()&&(clearInterval(b._queueReqIntrvl),a())},500))}};centigon.mapping.CartoDBLayer.prototype.getCartoDBLayerCfg=function(){return{infowindow:this.opts.useLayerSpecificApiInfWins,tooltip:this.opts.useLayerSpecificApiTooltips}};centigon.mapping.CartoDBLayer.prototype.addLayerClickHandler=function(){var b=this;"nothing"===this.opts.cartoDBMapLayerInteractivity?this.cartoDBLayer.getSubLayer(0).setInteraction(!1): (this.cartoDBLayer.getSubLayer(0).setInteraction(!0),this.cartoDBLayer.on("featureClick",function(a,c,f,g,h){"img"!==a.target.tagName.toLowerCase()&&b.handleMouse(c,g,"click")}),this.cartoDBLayer.on("featureOver",function(a,c,f,g,h){"img"!==a.target.tagName.toLowerCase()&&b.handleMouse(c,g,"hover")}))};centigon.mapping.CartoDBLayer.prototype.setDrillIdsIfDrillable=function(b){try{if(!0===this.isCartoDrillable())for(var a=this.cMapAnalytics.drillIds(),c=this._utilFactory.getCollectionIterator(this._cartoDBLayerData.rows), f;c.hasNext();)if(f=c.next(),f.cartodb_id==b){a[this.positionInMapDataProvider]=[f[this.cartoDBDrillColName]];this.cMapAnalytics.drillIds(a);break}}catch(g){}};centigon.mapping.CartoDBLayer.prototype.isCartoDrillable=function(){return this.type===centigon.mapping.Layer.TYPE.CARTODB&&this.cartoDBDrillColName&&"null"!==this.cartoDBDrillColName&&""!==this.cartoDBDrillColName?!0:!1};centigon.mapping.CartoDBLayer.prototype.getDefaultLayerData=function(){if(this.opts.cartoDBSqlQuery&&""!==this.opts.cartoDBSqlQuery&& "null"!==this.opts.cartoDBSqlQuery&&this.cartoDBUserId&&""!==this.cartoDBUserId&&"null"!==this.cartoDBUserId){var b=this,a={};a.query=this.opts.cartoDBSqlQuery;a.onSuccess=function(a){b._cartoDBLayerData=a;var c=b._utilFactory.getCollectionIterator(a.rows),g=b._utilFactory.getCollectionIterator(),h=b._utilFactory.getCollectionIterator(),k=a.fields.value?"value":null;a=a.fields.label?"label":null;if(k||a)for(;c.hasNext();){var l=c.next();g.addItem(l[k]);h.addItem(l[a])}k&&(b.displayObjectValues=b._utilFactory.getCollectionIterator(g)); a&&(b.displayObjectLabels=b._utilFactory.getCollectionIterator(h))};a.onError=function(){alert("Error encountered fetching CartoDB layer data "+b.positionInMapDataProvider)};this.fetchLayerData(a)}};centigon.mapping.CartoDBLayer.prototype.fetchLayerData=function(b){if(this._lastLayerDataSqlQuery===b.query&&!0===this._hasLatestLayerData)b.onSuccess(this._cartoDBLayerData);else if(this._lastLayerDataSqlQuery===b.query&&!1===this._hasLatestLayerData)this._layerDataReqOnSuccessQueue.push(b.onSuccess); else{var a=this;this._hasLatestLayerData=!1;var c={};c.user=this.cartoDBUserId;c.query=b.query;c.onSuccess=function(c){a._hasLatestLayerData=!0;b.onSuccess(c);for(var f=a._utilFactory.getCollectionIterator(a._layerDataReqOnSuccessQueue);f.hasNext();)f.next()(c);a._layerDataReqOnSuccessQueue=[]};c.onError=b.onError;this._lastLayerDataSqlQuery=this.opts.cartoDBSqlQuery=b.query;this.cartoDBApiWrapper.getLayerData(c)}};centigon.mapping.CartoDBLayer.prototype.applyDrillSQL=function(){if(!1!==this.isCartoDrillable()&& this.drillFilter&&"null"!==this.drillFilter&&""!==this.drillFilter){this.opts.cartoDBSqlQuery&&-1
"+h[k]+ "
"}this.setDrillIdsIfDrillable(a.cartodb_id);f+="

cartodb_id
"+a.cartodb_id+"
";this.rawLocationData=[b[0]+","+b[1]];this.processCsvLatLngs();this._cartoDBLayerData&&this._cartoDBLayerData.rows&&0ADDRESS
"+l.ADDRESS+"
"),l.OBJECTID&&(h+="

OBJECTID
"+l.OBJECTID+"
"),k.layerName&&(h+="

Layer Name
"+k.layerName+"
"),k.value&&(h+="

Value
"+k.value+"
"),h+="

OBJECTID
"+l.OBJECTID+"
";f&&(a.displayObjectLabels=a._utilFactory.getCollectionIterator([h]),a.rawLocationData=[b.toCsvLatLon()],a.processCsvLatLngs(),a._mapApiAdapter.handleLayerSelected(a,0, "click"),a._mapApiAdapter.openInfoWindow(a,0))};this.wmsOpts.esriMapServerLayerName?this.getEsriArcgGisRestApiWrapper().identifyNearbyLayerMetadata(this.wmsOpts.esriMapServerLayerName,b.toCsvLonLat(),c):this.getEsriArcgGisRestApiWrapper().identifyNearbyAllLayersMetadata(b.toCsvLonLat(),c)}})(); (function(){createNamespaceUnderCentigon("mapping.EsriMarkerLayer");centigon.mapping.EsriMarkerLayer=function(){centigon.mapping.MarkerLayer.call(this);this.legendIconFileName="layer_points.png";this._esriArcgGisRestApiWrapper;this.wmsOpts};centigon.mapping.EsriMarkerLayer.prototype=new centigon.mapping.MarkerLayer;centigon.mapping.EsriMarkerLayer.constructor=centigon.mapping.MarkerLayer;centigon.mapping.EsriMarkerLayer.prototype.processLocationData=function(){var b=this.cMapAnalytics;if(this.wmsOpts= this.cMapAnalytics.wmsOptions()[this.positionInMapDataProvider]){var a=this;this.waitingForMyLocationData=!0;a=this;var c=this.getEsriArcgGisRestApiWrapper();c.baseUrl=this.wmsOpts.esriMapServerURL;c.getLayerData(function(c){a.waitingForMyLocationData=!1;for(var f=[],h=[],k=[],l=[],m=[],n=a._utilFactory.getCollectionIterator(c.features);n.hasNext();)c=n.next(),k.push(a.defaultDisplayObjectColor),m.push(a.defaultDisplayObjectPixelSize),f.push(c.geometry.y+","+c.geometry.x),a.wmsOpts.esriLabelField? h.push(a.wmsOpts.esriLabelField+" : "+c.attributes[a.wmsOpts.esriLabelField]):h.push(a.getLabelFromFeatAttrs(c.attributes)),l.push(c.attributes[a.wmsOpts.esriMeasureField]);b.layerAlertsEnabled(a.positionInMapDataProvider)?(k=b.padLayerArrayProp(b.getLayerAlertColors(a.positionInMapDataProvider,l),n.getLength(),b._mapAlertDefaultColors[a.positionInMapDataProvider]),a.displayObjectColors=a._utilFactory.getCollectionIterator(b.getSafeColorCodes(k))):a.displayObjectColors=a._utilFactory.getCollectionIterator(k); a.wmsOpts.esriMeasureField&&(a.displayObjectValues=a._utilFactory.getCollectionIterator(l));a.displayObjectPixelSizes=a._utilFactory.getCollectionIterator(m);a.rawLocationData=f;a.displayObjectLabels=a._utilFactory.getCollectionIterator(h);a.processCsvLatLngs();a.drawLayer()})}};centigon.mapping.EsriMarkerLayer.prototype.getLabelFromFeatAttrs=function(b){var a="",c;for(c in b)a+="

"+c+" : "+b[c]+"

";return a};centigon.mapping.EsriMarkerLayer.prototype.getEsriArcgGisRestApiWrapper=function(){this._esriArcgGisRestApiWrapper|| (this._esriArcgGisRestApiWrapper=new centigon.mapping.EsriArcGisRestApiWrapper(this._mapApiAdapter));return this._esriArcgGisRestApiWrapper}})(); (function(){createNamespaceUnderCentigon("mapping.EsriPolygonLayer");centigon.mapping.EsriPolygonLayer=function(){centigon.mapping.PolygonLayer.call(this);this.legendIconFileName="layer_shapes.png";this._allChildLayerLocations=[];this._alreadyDynamicallyZoomedOnce=!1;this._esriArcgGisRestApiWrapper;this.wmsOpts};centigon.mapping.EsriPolygonLayer.prototype=new centigon.mapping.PolygonLayer;centigon.mapping.EsriPolygonLayer.constructor=centigon.mapping.PolygonLayer;centigon.mapping.EsriPolygonLayer.prototype.processLocationData= function(){var b=this.cMapAnalytics;if(this.wmsOpts=this.cMapAnalytics.wmsOptions()[this.positionInMapDataProvider]){this.waitingForMyLocationData=!0;var a=this,c=this.getEsriArcgGisRestApiWrapper();c.baseUrl=this.wmsOpts.esriMapServerURL;c.getLayerData(function(c){a._rawShapeCoords=[];a.waitingForMyLocationData=!1;for(var f=[],h=[],k=[],l=[],m=a._utilFactory.getCollectionIterator(c.features);m.hasNext();)c=m.next(),k.push(a.defaultDisplayObjectColor),f=f.concat(a.getShapeRecords(c.geometry)),a.wmsOpts.esriLabelField? h.push(a.wmsOpts.esriLabelField+" : "+c.attributes[a.wmsOpts.esriLabelField]):h.push(a.getLabelFromFeatAttrs(c.attributes)),l.push(c.attributes[a.wmsOpts.esriMeasureField]),m.hasNext()&&f.push(",");b.layerAlertsEnabled(a.positionInMapDataProvider)?(k=b.padLayerArrayProp(b.getLayerAlertColors(a.positionInMapDataProvider,l),m.getLength(),b._mapAlertDefaultColors[a.positionInMapDataProvider]),a.displayObjectColors=a._utilFactory.getCollectionIterator(b.getSafeColorCodes(k))):a.displayObjectColors=a._utilFactory.getCollectionIterator(k); a.wmsOpts.esriMeasureField&&(a.displayObjectValues=a._utilFactory.getCollectionIterator(l));a.rawLocationData=f;a.displayObjectLabels=a._utilFactory.getCollectionIterator(h);a.processCsvLatLngsForPolyLayer();a.drawLayer();!1===a._alreadyDynamicallyZoomedOnce&&!0===a.cMapAnalytics.useDynamicZoom()&&a.executeDynamicZoom(f)})}};centigon.mapping.EsriPolygonLayer.prototype.getLabelFromFeatAttrs=function(b){var a="",c;for(c in b)a+="

"+c+" : "+b[c]+"

";return a};centigon.mapping.EsriPolygonLayer.prototype.getShapeRecords= function(b){return 1 : "+b[c]+"

";return a};centigon.mapping.EsriPolylineLayer.prototype.getShapeRecords= function(b){return this.parseRegularPolyline(b)};centigon.mapping.EsriPolylineLayer.prototype.parseRegularPolyline=function(b){for(var a=[],c=this._utilFactory.getCollectionIterator(b.paths[0]);c.hasNext();)b=c.next(),a.push(b[1]+","+b[0]);return a};centigon.mapping.EsriPolylineLayer.prototype.getEsriArcgGisRestApiWrapper=function(){this._esriArcgGisRestApiWrapper||(this._esriArcgGisRestApiWrapper=new centigon.mapping.EsriArcGisRestApiWrapper(this._mapApiAdapter));return this._esriArcgGisRestApiWrapper}; centigon.mapping.EsriPolylineLayer.prototype.buildZoomLocations=function(b){this._allChildLayerLocations=[];b=this._utilFactory.getCollectionIterator(b);for(var a;b.hasNext();)a=b.next(),this._mapApiAdapter.csvLatLngIsValid(a)&&this._allChildLayerLocations.push(this.cMap.getLocationFromCSVLatLng(a))};centigon.mapping.EsriPolylineLayer.prototype.executeDynamicZoom=function(b){this.buildZoomLocations(b);this.cMapAnalytics.addLayerLocationsForDynamicZooming(this);this.cMapAnalytics.setMapViewportToFitAllLayerLocations()}; centigon.mapping.EsriPolylineLayer.prototype.getVisibleLocations=function(){return this._allChildLayerLocations}})(); (function(){createNamespaceUnderCentigon("mapping.EsriArcGisRestApiWrapper");centigon.mapping.EsriArcGisRestApiWrapper=function(b){this._utilFactory=new centigon.util.UtilityFactory;this.baseUrl="";this.mapApiAdapter=b};centigon.mapping.EsriArcGisRestApiWrapper.prototype.getLayerImage=function(b,a){var c=this.mapApiAdapter.getDiv().offsetWidth,f=this.mapApiAdapter.getDiv().offsetHeight;var g="export?bbox="+this.getBoundsParamAsString();g=g+"&bboxSR=4326&layers=show:"+b+"&layerdefs=&size="+(c+","+ f);g+="&imageSR=102100";g+="&format=png";g+="&transparent=true";g+="&dpi=";g+="&time=";g+="&layerTimeOptions=";g+="&f=json";this.callEsriRestApi({qstr:g,callback:a})};centigon.mapping.EsriArcGisRestApiWrapper.prototype.getAllLayersImage=function(b){var a=this.mapApiAdapter.getDiv().offsetWidth,c=this.mapApiAdapter.getDiv().offsetHeight;var f="export?bbox="+this.getBoundsParamAsString();f=f+"&bboxSR=4326&layers=&layerdefs=&size="+(a+","+c)+"&imageSR=102100&format=png";f+="&transparent=true";f+="&dpi="; f+="&time=";f+="&layerTimeOptions=";f+="&f=json";this.callEsriRestApi({qstr:f,callback:b})};centigon.mapping.EsriArcGisRestApiWrapper.prototype.mercXYToLatLng=function(b,a){var c=this.baseUrl;c=c.substring(0,c.indexOf("rest/services/"))+"rest/services/Geometry/GeometryServer";this.callEsriRestApi({qstr:'project?inSR=102113&outSR=4326&geometries={"geometryType":"esriGeometryPoint","geometries":[{"x":'+(b.x+',"y":'+b.y+"}]}&f=json"),callback:a},c)};centigon.mapping.EsriArcGisRestApiWrapper.prototype.mercXYsToLatLngs= function(b,a){var c=this.baseUrl;c=c.substring(0,c.indexOf("rest/services/"))+"rest/services/Geometry/GeometryServer";var f='project?inSR=102113&outSR=4326&geometries={"geometryType":"esriGeometryPoint","geometries":[';for(var g=0;gb&&!0===this.layer.visible?a[b]:this.layer.visible;return f}})(); (function(){createNamespaceUnderCentigon("mapping.CustomRendererLayer");centigon.mapping.CustomRendererLayer=function(){centigon.mapping.MarkerLayer.call(this);this.legendIconFileName="layer_customrenderer.png"};centigon.mapping.CustomRendererLayer.prototype=new centigon.mapping.MarkerLayer;centigon.mapping.CustomRendererLayer.constructor=centigon.mapping.MarkerLayer;centigon.mapping.CustomRendererLayer.prototype.refreshLayerSelectedState=function(){this.displayObjectRenderer&&this.displayObjectRenderer.renderSelected(this)}; centigon.mapping.CustomRendererLayer.prototype.getLayerDisplayObjectRenderer=function(){this.displayObjectRenderer||(this.displayObjectRenderer=new centigon.mapping.CustomRenderer(this),this.displayObjectRenderer.setLayer(this));return this.displayObjectRenderer}})(); (function(){createNamespaceUnderCentigon("mapping.CustomRenderer");centigon.mapping.CustomRenderer=function(){this._utilFactory=new centigon.util.UtilityFactory;this._logger=this._utilFactory.getLoggerUtil();this.layer;this.cMap;this.mapApiAdapter;this.renderedLayerAndMarkerIndicesToMarkerObjectMap={};this._drawTimer;this._drawSelectedTimer;this.optionsCache={}};centigon.mapping.CustomRenderer.prototype.setLayer=function(b){this.layer=b;this.cMap=this.layer.cMap;this.mapApiAdapter=this.layer.cMap.getMapApiAdapter()}; centigon.mapping.CustomRenderer.prototype.getOptions=function(){try{for(var b=this.layer.getApiSpecificLocationsForMarkerLayer(),a,c,f=[],g;b.hasNext();)if(c=b.getPosition(),g=b.next())a=this.getMarkerOptionsFromLayerProps(c,!0,b),f.push(a)}catch(h){this._logger.logError(h)}finally{return f}};centigon.mapping.CustomRenderer.prototype.renderSelected=function(){this._drawSelectedTimer&&clearTimeout(this._drawSelectedTimer);try{this.layer.cMapAnalytics.renderCustomLayerSelected(this.layer)}catch(b){this._logger.logError(b)}}; centigon.mapping.CustomRenderer.prototype.render=function(){this._drawTimer&&clearTimeout(this._drawTimer);var b=this;this._drawTimer=setTimeout(function(){try{b.layer.cMapAnalytics.renderCustomLayer(b.layer)}catch(a){b._logger.logError(a)}},1)};centigon.mapping.CustomRenderer.prototype.optionsHaveSameLocations=function(b,a){return b.location.locationHasSameCoordinates(a.location)};centigon.mapping.CustomRenderer.prototype.getMarkerOptionsFromLayerProps=function(b,a,c){var f=new centigon.mapping.MarkerOptions, g=this.layer.displayObjectPixelSizes.getItemAt(b);f.color=this.layer.displayObjectColors.getItemAt(b);f.location=c.getItemAt(b);f.width=g;f.height=g;f.id=b;f.displayIndex=b;f.metadata={layer:this.layer};f.markerIndex=b;f.category=this.layer.displayObjectCategories.getItemAt(b);f.dataValue=this.layer.displayObjectValues.getItemAt(b);f.label=this.layer.displayObjectLabels.getItemAt(b);f.outlineColor=f.color;c=this.layer.displayObjectSelectedFlags.getItemAt(b);f.isSelected=1===c||!0===c?!0:!1;!0===a&& !0===f.isSelected&&!0===this.cMap.useGlowEffectOnLayerSelections&&(f.outlineColor=this.cMap.layerSelectionGlowColor);(a=this.layer.displayObjectOverrideKeys.getItemAt(b))&&(a=a.split(" ").join(""));a&&""!==a&&!0===centigon.mapping.MarkerIconFactory.isIconTypeSupportedByMarkerIconFactory(a)?f.iconType=String(a).toLowerCase():a&&""!==a&&!1===centigon.mapping.MarkerIconFactory.isIconTypeSupportedByMarkerIconFactory(a)?f.iconType=String(a):f.iconType=this.layer.defaultDisplayObjectIconType.toLowerCase(); ""===f.iconType&&(f.iconType=centigon.mapping.MarkerIconFactory.ICONS.PIN);a=this.layer.displayObjectVisibilityFlags;f.visible=a.length>b&&!0===this.layer.visible?a[b]:this.layer.visible;return f}})();var svgAssetsLoaded5145sdv15ds1=!1,svgAssetsRequested5145sdv15ds1=!1; (function(){createNamespaceUnderCentigon("mapping.SvgLayer");centigon.mapping.SvgLayer=function(){centigon.mapping.MarkerLayer.call(this);this.svgOverlay;this._divId=this._domUtil.getRandomDivId();this._svgId;this._overlay;this._queueReqIntrvl;this._map;this._w;this._h;this.optsToRender=[]};centigon.mapping.SvgLayer.prototype=new centigon.mapping.MarkerLayer;centigon.mapping.SvgLayer.constructor=centigon.mapping.MarkerLayer;centigon.mapping.SvgLayer.prototype.drawLayer=function(){centigon.mapping.MarkerLayer.prototype.drawLayer.call(this); this.loadLibs();this.positions=[];this._map=this.cMap.getBaseMap();this._w=10*this.cMapAnalytics.getWidth();this._h=10*this.cMapAnalytics.getHeight();if(!0===this.libsReady())this.renderSvg();else{var b=this;clearInterval(b._queueReqIntrvl);this._queueReqIntrvl=setInterval(function(){!0===b.libsReady()&&(clearInterval(b._queueReqIntrvl),b.renderSvg())},500)}};centigon.mapping.SvgLayer.prototype.getLayerDisplayObjectRenderer=function(){var b=this,a=centigon.mapping.MarkerLayer.prototype.getLayerDisplayObjectRenderer.call(this); a.render=function(){b.renderSvg()};return a};centigon.mapping.SvgLayer.prototype.renderSvg=function(){if(!this._overlay)this.createDiagramOverlay();else if(this.displayObjectRenderer&&window.d3){d3.selection.prototype.moveToFront=function(){return this.each(function(){this.parentNode.appendChild(this)})};var b=this.getVisibleOptions();this.optsToRender=[];for(var a,c;b.hasNext();)a=b.next(),c=this._mapApiAdapter.locationToApiSpecificLocationObject(a.location),c=this._mapApiAdapter.fromApiSpecificLocToDivPx(c), this.optsToRender.push({x:c.x,y:c.y,markerOptions:a});this.svgOverlay||(this.svgOverlay=this.createSvgDomObj());this.repositionLayerDiagram();this._domUtil.getDomObjectById(this._svgId).css("width",this._w+"px");this._domUtil.getDomObjectById(this._svgId).css("height",this._h+"px")}};centigon.mapping.SvgLayer.prototype.getVisibleOptions=function(){for(var b=this._utilFactory.getCollectionIterator(this.displayObjectRenderer.getOptions()),a,c=this._utilFactory.getCollectionIterator();b.hasNext();)a= b.next(),!0===a.visible&&c.addItem(a);return c};centigon.mapping.SvgLayer.prototype.clearSvg=function(){this._domUtil.getDomObjectById(this._svgId).empty()};centigon.mapping.SvgLayer.prototype.makeClickable=function(b,a){var c=this;b.on("click",function(){b.style("stroke",a.outlineColor);c.cMapAnalytics.selectItem(c.positionInMapDataProvider+1+","+(a.displayIndex+1));d3.select(this).moveToFront()})};centigon.mapping.SvgLayer.prototype.makeHoverable=function(b,a){var c=this;b.on("mouseover",function(){c.cMapAnalytics.showGlow()? b.style("stroke",c.cMapAnalytics.glowColor()):b.style("stroke",a.outlineColor);d3.select(this).moveToFront()});b.on("mouseout",function(){b.style("stroke",a.color)})};centigon.mapping.SvgLayer.prototype.getDivId=function(){return this._divId};centigon.mapping.SvgLayer.prototype.getSVGId=function(){return this._svgId};centigon.mapping.SvgLayer.prototype.createSvgDomObj=function(){this._domUtil.getDomObjectById(this._divId).remove();var b=this._mapApiAdapter.getCustomOverlayTarget();this._divId=this._domUtil.getRandomDivId(); this._svgId="svg"+this._divId;b=d3.select(b).append("div");b.attr("id",this._divId);b=b.append("svg");b.attr("id",this._svgId);this._domUtil.getDomObjectById(this._svgId).css("width",this._w+"px");this._domUtil.getDomObjectById(this._svgId).css("height",this._h+"px");return b};centigon.mapping.SvgLayer.prototype.createDiagramOverlay=function(){if(!this._overlay){var b=this;this._overlay=this.cMapAnalytics.getCustomBaseMapOverlay();this._overlay.centigonActualOnAdd=function(){b.renderSvg()};this._overlay.draw= function(){b.renderSvg()};this.cMapAnalytics.registerCustomLayer(this._overlay)}};centigon.mapping.SvgLayer.prototype.repositionLayerDiagram=function(){if(this.cMapAnalytics.apiToUse!==centigon.mapping.APICentral.MAP_TYPES.GOOG){var b=this._domUtil.getDomObject(this._divId);this._mapApiAdapter.alignDomElemToOverlay(b)}};centigon.mapping.SvgLayer.prototype.libsReady=function(){return svgAssetsLoaded5145sdv15ds1};centigon.mapping.SvgLayer.prototype.loadLibs=function(){if(window.d3)svgAssetsLoaded5145sdv15ds1= svgAssetsRequested5145sdv15ds1=!0;else if(!0!==svgAssetsRequested5145sdv15ds1&&!0!==svgAssetsLoaded5145sdv15ds1){var b=this;(function(a,c){b._domUtil.injectScript({url:b.cMapAnalytics.getBaseAssetUrl()+"v4/libs/"+a,onload:c})})("d3.v3.min.js",function(){svgAssetsLoaded5145sdv15ds1=!0});svgAssetsRequested5145sdv15ds1=!0}}})(); (function(){createNamespaceUnderCentigon("data.AdvancedSankeyDataProvider");centigon.data.AdvancedSankeyDataProvider=function(b){this._utilFactory=new centigon.util.UtilityFactory;this._layer=b;this._layerData};centigon.data.AdvancedSankeyDataProvider.prototype.getDiagramData=function(){this._layerData=this.getLayerData();var b={nodes:this.getTopLevelNodes(),links:this.getLinks()};return JSON.stringify(b)};centigon.data.AdvancedSankeyDataProvider.prototype.getTopLevelNodes=function(){for(var b=this._utilFactory.getCollectionIterator(this._layerData), a,c=[];b.hasNext();)a=b.next(),a={type:a.cat,id:a.id,parent:null,number:a.dataValue,name:a.lbl},c.push(a);return c};centigon.data.AdvancedSankeyDataProvider.prototype.getLinks=function(){for(var b=[],a=this._utilFactory.getCollectionIterator(this.getNodeStructureforLinks(this._layerData)),c;a.hasNext();)c=a.next(),null!=c.parent&&b.push({source:c.id,target:this.getCatParentNode(c.type,a).id,value:c.number});return b};centigon.data.AdvancedSankeyDataProvider.prototype.getNodeStructureforLinks=function(){for(var b= this._utilFactory.getCollectionIterator(this._layerData),a,c="",f="",g=[];b.hasNext();)a=b.next(),a.cat!==c?(c={type:a.cat,id:a.id,parent:null,name:a.cat},f=a.id):c={type:a.cat,id:a.id,parent:f,number:a.dataValue,name:a.cat},g.push(c),c=a.cat;return g};centigon.data.AdvancedSankeyDataProvider.prototype.getCatParentNode=function(b,a){a=this._utilFactory.getCollectionIterator(a);for(var c,f;a.hasNext();)if(c=a.next(),null==c.parent&&c.type===b){f=c;break}return f};centigon.data.AdvancedSankeyDataProvider.prototype.getLayerData= function(){for(var b=this._layer.cMap.getMapApiAdapter(),a=this._utilFactory.getCollectionIterator(this._layer.getLayerDisplayObjectRenderer().getOptions()),c=this._utilFactory.getCollectionIterator(),f;a.hasNext();)a.getPosition(),f=a.next(),c.addItem({id:f.label,lbl:f.label,cat:f.category,dataValue:f.dataValue,clr:f.color,loc:f.location,px:b.fromApiSpecificLocToContainerPx(b.locationToApiSpecificLocationObject(f.location))});return c}})(); var advancedSankeyAssetsLoaded5145sdv15ds1=!1,advancedSankeyAssetsRequested5145sdv15ds1=!1; (function(){createNamespaceUnderCentigon("mapping.AdvancedSankeyLayer");centigon.mapping.AdvancedSankeyLayer=function(){centigon.mapping.CustomRendererLayer.call(this);this.ignoreGeoLocPositioning=!1;this.nodeNameFilter;this.apiOverlay;this._queueReqIntrvl;this.diagramData={}};centigon.mapping.AdvancedSankeyLayer.prototype=new centigon.mapping.CustomRendererLayer;centigon.mapping.AdvancedSankeyLayer.constructor=centigon.mapping.CustomRendererLayer;centigon.mapping.AdvancedSankeyLayer.prototype.getLayerDisplayObjectRenderer= function(){this.displayObjectRenderer||(this.displayObjectRenderer=new centigon.mapping.AdvancedSankeyRenderer(this),this.displayObjectRenderer.setLayer(this));return this.displayObjectRenderer};centigon.mapping.AdvancedSankeyLayer.prototype.handleMouse=function(b){this._mapApiAdapter.handleLayerSelected(this,b,"hover")};centigon.mapping.AdvancedSankeyLayer.prototype.processLocationData=function(){centigon.mapping.CustomRendererLayer.prototype.processLocationData.call(this);this.loadSankeyLibs(); this.opts=this.cMapAnalytics.wmsOptions()[this.positionInMapDataProvider];var b=this;!0===this.libsReady()?this.drawLayer():(clearInterval(b._queueReqIntrvl),this._queueReqIntrvl=setInterval(function(){!0===b.libsReady()&&(clearInterval(b._queueReqIntrvl),b.drawLayer())},500))};centigon.mapping.AdvancedSankeyLayer.prototype.drawLayer=function(){!0!==this.waitingForMyLocationData&&(this.opts=this.cMapAnalytics.wmsOptions()[this.positionInMapDataProvider])&&(this.diagramData=this.opts.sankeyJsonData&& ""!==this.opts.sankeyJsonData?this.opts.sankeyJsonData:(new centigon.data.AdvancedSankeyDataProvider(this)).getDiagramData(),centigon.mapping.CustomRendererLayer.prototype.drawLayer.call(this))};centigon.mapping.AdvancedSankeyLayer.prototype.libsReady=function(){return advancedSankeyAssetsLoaded5145sdv15ds1};centigon.mapping.AdvancedSankeyLayer.prototype.loadSankeyLibs=function(){if(!0!==advancedSankeyAssetsRequested5145sdv15ds1&&!0!==advancedSankeyAssetsLoaded5145sdv15ds1){var b=this.cMapAnalytics.getBaseAssetUrl()+ "v4/libs/",a=this,c=function(c,g){a._domUtil.injectScript({url:b+c,onload:g})};c("d3.v3.min.js",function(){c("advancedsankey.min.js",function(){advancedSankeyAssetsLoaded5145sdv15ds1=!0})});advancedSankeyAssetsRequested5145sdv15ds1=!0}}})(); (function(){createNamespaceUnderCentigon("mapping.AdvancedSankeyRenderer");centigon.mapping.AdvancedSankeyRenderer=function(){centigon.mapping.CustomRenderer.call(this);this._domUtil=this._utilFactory.getDomUtil();this._divId=this._domUtil.getRandomDivId();this._overlay;this.cMapAnalytics;this._map;this._w;this._h;this._ixsToNodes=[];this.locsToNodes=[];this.visToNodes=[]};centigon.mapping.AdvancedSankeyRenderer.prototype=new centigon.mapping.CustomRenderer;centigon.mapping.AdvancedSankeyRenderer.constructor= centigon.mapping.CustomRenderer;centigon.mapping.AdvancedSankeyRenderer.prototype.setLayer=function(b){this.layer=b;this._imDestroyed=!1;this.cMap=this.layer.cMap;this.cMapAnalytics=this.layer.cMapAnalytics;this.mapApiAdapter=this.layer.cMap.getMapApiAdapter();this._map=this.cMap.getBaseMap();this._w=this.cMapAnalytics.getWidth();this._h=1.5*this.cMapAnalytics.getHeight()};centigon.mapping.AdvancedSankeyRenderer.prototype.render=function(){!1===this.layer.libsReady()||this._imDestroyed||(!1===this.layer.visible? $("#"+this._divId).hide():this._overlay?this.buildDiagram():this.createDiagramOverlay())};centigon.mapping.AdvancedSankeyRenderer.prototype.destroy=function(){this._imDestroyed=!0;this.cMapAnalytics.deregisterCustomLayer(this._overlay);$("#"+this._divId).remove();this._overlay.draw=function(){}};centigon.mapping.AdvancedSankeyRenderer.prototype.createDiagramOverlay=function(){if(!this._overlay){var b=this;this._overlay=this.cMapAnalytics.getCustomBaseMapOverlay();this.layer.apiOverlay=this._overlay; this._overlay.centigonActualOnAdd=function(){b.render()};this._overlay.draw=function(){b.render()};this.cMapAnalytics.registerCustomLayer(this._overlay)}};centigon.mapping.AdvancedSankeyRenderer.prototype.buildDiagram=function(){this.seedLocAndVisKeys();if(!this.ignoreGeoLocPositioning){var b=this;$("#"+this._divId).remove();$("#"+this._divId).show();var a=document.createElement("DIV");a.id=this._divId;this.mapApiAdapter.getCanvasOverlayTarget().appendChild(a);a={getLocForNode:function(a){return b.getLocForNode(a)}, highlightColor:this.cMap.layerSelectionGlowColor,colors:this.getPropValsFromOpts("color"),w:this._w,h:this._h,divId:this._divId,data:this.getDiagramData(),onNodeSelected:function(a){b.nodeSelected(a)}};BuildDiagramvermlknsdklmnvkdvnknvkdsnknskldvnlekr(a);this.repositionLayerDiagram();this._domUtil.getDomObjectById(this._divId).css("pointer-events","none");this._domUtil.getDomObjectById(this._divId).find("svg").css("pointer-events","none");this._domUtil.getDomObjectById(this._divId).find("svg").find("rect").css("pointer-events", "all");this._domUtil.getDomObjectById(this._divId).find("svg").find("path").css("pointer-events","all")}};centigon.mapping.AdvancedSankeyRenderer.prototype.getDiagramData=function(){var b=JSON.parse(this.layer.diagramData),a=this.layer.nodeNameFilter,c=this;this._utilFactory.getCollectionIterator(this.getPropValsFromOpts("visible"));var f={};b.links=function(b){b=c._utilFactory.getCollectionIterator(b);for(var g,k=[];b.hasNext();)if(g=b.next(),c.getVisForNode(g.target)||c.getVisForNode(g.source))if(!a)k.push(g), f[g.target]=!0,f[g.source]=!0;else if(g.target===a||g.source===a)k.push(g),f[g.target]=!0,f[g.source]=!0;return k}(b.links);b.nodes=function(b){b=c._utilFactory.getCollectionIterator(b);for(var g,k=[],l;b.hasNext();)if(g=b.next(),l=f[g.parent]||f[g.id]?!0:!1,l||c.getVisForNode(g.id)||c.getVisForNode(g.parent))!a&&l?k.push(g):(g.id===a||g.parent===a||l)&&k.push(g);return k}(b.nodes);return b};centigon.mapping.AdvancedSankeyRenderer.prototype.getVisForNode=function(b){b=String(b)||"";return this.visToNodes[b.toLowerCase().trim()]}; centigon.mapping.AdvancedSankeyRenderer.prototype.getPropValsFromOpts=function(b){for(var a=[],c=this._utilFactory.getCollectionIterator(this.getOptions());c.hasNext();)a.push(c.next()[b]);return a};centigon.mapping.AdvancedSankeyRenderer.prototype.seedLocAndVisKeys=function(){this.locsToNodes=[];this.visToNodes=[];this._ixsToNodes=[];for(var b=[],a=this._utilFactory.getCollectionIterator(this.getOptions()),c,f,g;a.hasNext();)g=a.getPosition(),c=a.next(),f=this.mapApiAdapter.fromApiSpecificLocToContainerPx(this.mapApiAdapter.locationToApiSpecificLocationObject(c.location)), this.locsToNodes[c.label.toLowerCase().trim()]=f,this.visToNodes[c.label.toLowerCase().trim()]=c.visible,this._ixsToNodes[c.label.toLowerCase().trim()]=g,layerDispObj=new centigon.mapping.LayerDisplayObject,layerDispObj.displayObject={options:c,displayObject:c.label.toLowerCase().trim()},b.push(layerDispObj);this.layer.displayObjects=b};centigon.mapping.AdvancedSankeyRenderer.prototype.onCollapseChanged=function(){this.ignoreGeoLocPositioning?this.mapApiAdapter.setZoomingEnabled(!1):this.mapApiAdapter.setZoomingEnabled(!0)}; centigon.mapping.AdvancedSankeyRenderer.prototype.nodeSelected=function(b){b=this._ixsToNodes[b.toLowerCase().trim()];this.layer.handleMouse(b)};centigon.mapping.AdvancedSankeyRenderer.prototype.repositionLayerDiagram=function(){var b=this._domUtil.getDomObject(this._divId);this.mapApiAdapter.alignDomElemToOverlay(this._domUtil.getDomObject(this._divId));this.mapApiAdapter.setDomElemPositionInOverlay(b,"-=28","-=120")};centigon.mapping.AdvancedSankeyRenderer.prototype.getLocForNode=function(b){return this.locsToNodes[(b.parent? b.parent.id:b.id).toLowerCase().trim()]};centigon.mapping.AdvancedSankeyRenderer.prototype.renderSelected=function(){}})();var voronoiAssetsLoaded5145sdv15ds1=!1,voronoiAssetsRequested5145sdv15ds1=!1; (function(){createNamespaceUnderCentigon("mapping.VoronoiDiagramLayer");centigon.mapping.VoronoiDiagramLayer=function(){centigon.mapping.MarkerLayer.call(this);this._divId=this._domUtil.getRandomDivId();this._queueReqIntrvl;this._overlay;this._map;this._w;this._h;this.diagramData={}};centigon.mapping.VoronoiDiagramLayer.prototype=new centigon.mapping.MarkerLayer;centigon.mapping.VoronoiDiagramLayer.constructor=centigon.mapping.MarkerLayer;centigon.mapping.VoronoiDiagramLayer.prototype.drawLayer=function(){centigon.mapping.MarkerLayer.prototype.drawLayer.call(this); this.loadLibs();this._map=this.cMap.getBaseMap();this._w=this.cMapAnalytics.getWidth();this._h=1.5*this.cMapAnalytics.getHeight();if(!0===this.libsReady())this.buildDiagram();else{var b=this;clearInterval(b._queueReqIntrvl);this._queueReqIntrvl=setInterval(function(){!0===b.libsReady()&&(clearInterval(b._queueReqIntrvl),b.buildDiagram())},500)}};centigon.mapping.VoronoiDiagramLayer.prototype.buildDiagram=function(){this._domUtil.getDomObjectById(this._divId).remove();if(!this._overlay)this.createDiagramOverlay(); else if(this.displayObjectRenderer){for(var b=this.getVisibleOptions(),a=[],c=[],f,g;b.hasNext();)f=b.next(),g=this._mapApiAdapter.locationToApiSpecificLocationObject(f.location),f=this._mapApiAdapter.fromApiSpecificLocToDivPx(g),c.push([f.x+5E3,f.y+5E3]),a.push({geom:g});var h=d3.geom.voronoi(c);c={d:function(a,b){return"M"+h[b].join("L")+"Z"},stroke:function(a,c){return b.getItemAt(c).color},fill:"none","stroke-width":function(a,c){return b.getItemAt(c).width}};this.createSvgDomObj().selectAll("path").data(a).attr(c).enter().append("svg:path").attr(c); this.repositionLayerDiagram()}};centigon.mapping.VoronoiDiagramLayer.prototype.getVisibleOptions=function(){for(var b=this._utilFactory.getCollectionIterator(this.displayObjectRenderer.getOptions()),a,c=this._utilFactory.getCollectionIterator();b.hasNext();)a=b.next(),!0===a.visible&&c.addItem(a);return c};centigon.mapping.VoronoiDiagramLayer.prototype.createSvgDomObj=function(){this._domUtil.getDomObjectById(this._divId).remove();var b=this._mapApiAdapter.getCustomOverlayTarget();this._divId=this._domUtil.getRandomDivId(); b=d3.select(b).append("div");b.attr("id",this._divId);b=b.append("svg");this._domUtil.castAsDomObject(b[0]).css("position","absolute");this._domUtil.castAsDomObject(b[0]).css("top","-5000px");this._domUtil.castAsDomObject(b[0]).css("left","-5000px");this._domUtil.castAsDomObject(b[0]).css("width","10000px");this._domUtil.castAsDomObject(b[0]).css("height","10000px");return b.append("g")};centigon.mapping.VoronoiDiagramLayer.prototype.createDiagramOverlay=function(){if(!this._overlay){var b=this;this._overlay= this.cMapAnalytics.getCustomBaseMapOverlay();this._overlay.centigonActualOnAdd=function(){b.buildDiagram()};this._overlay.draw=function(){b.buildDiagram()};this.cMapAnalytics.registerCustomLayer(this._overlay)}};centigon.mapping.VoronoiDiagramLayer.prototype.repositionLayerDiagram=function(){if(this.cMapAnalytics.apiToUse!==centigon.mapping.APICentral.MAP_TYPES.GOOG){var b=this._domUtil.getDomObject(this._divId);this._mapApiAdapter.alignDomElemToOverlay(b)}};centigon.mapping.VoronoiDiagramLayer.prototype.libsReady= function(){return voronoiAssetsLoaded5145sdv15ds1};centigon.mapping.VoronoiDiagramLayer.prototype.loadLibs=function(){if(!0!==voronoiAssetsRequested5145sdv15ds1&&!0!==voronoiAssetsLoaded5145sdv15ds1){var b=this;(function(a,c){b._domUtil.injectScript({url:b.cMapAnalytics.getBaseAssetUrl()+"v4/libs/"+a,onload:c})})("d3.v3.min.js",function(){voronoiAssetsLoaded5145sdv15ds1=!0});voronoiAssetsRequested5145sdv15ds1=!0}}})(); (function(){createNamespaceUnderCentigon("mapping.RadiusOptions");centigon.mapping.RadiusOptions=function(){this.lineThickness=1;this.lineColor;this.location;this.showRadiusLine=!1;this.fillAlpha;this.fillColor;this.metadata;this.radiusInMeters;this.displayIndex;this.visible;this.isSelected=!1;this.zIndex=1}})(); (function(){createNamespaceUnderCentigon("mapping.RadiusRenderer");centigon.mapping.RadiusRenderer=function(b){this._utilFactory=new centigon.util.UtilityFactory;this._objUtil=this._utilFactory.getObjectUtil();this._logger=this._utilFactory.getLoggerUtil();this.layer=b;this.cMap=this.layer.cMap;this.mapApiAdapter=this.layer.cMap.getMapApiAdapter();this.renderedLayerAndPolyIndicesToPolygonObjectMap={};this.optionsCache={}};centigon.mapping.RadiusRenderer.prototype.render=function(){try{var b=this.layer.getApiSpecificLocations(), a=[],c=0,f=0;this.layer.numObjectsToProcess=b.getLength();this.layer.numObjectsProcessed=0;for(this.layer.setStatusMessage(centigon.mapping.DrawingProgressDisplay.STATUSES.DRAWING_SHAPES);b.hasNext();){var g=b.getPosition();var h=this.layer.positionInMapDataProvider+","+g;var k=this.getRadiusOptionsFromLayerProps(g,b);if(!1===this.hasPolygonBeenSuccessfullyRendered(h)){var l=this.mapApiAdapter.renderRadius(k);c++}else l=this._objUtil.getKeyValue(this.renderedLayerAndPolyIndicesToPolygonObjectMap, h),this.mapApiAdapter.setNullMapForOverlay(l),this.mapApiAdapter.applyRadiusOptions(l,k),f++;this.layer.numObjectsProcessed++;var m=new centigon.mapping.LayerDisplayObject;m.displayObject={options:k,displayObject:l};m.actualApiDisplayObject=l;a.push(m);l&&(this.renderedLayerAndPolyIndicesToPolygonObjectMap[h]=l);this.optionsCache[h]=k;b.next()}this.layer.numObjectsToProcess=0;this.mapApiAdapter.orderLayersZIndex();this.layer.displayObjects=a}catch(n){this._logger.logError(n)}finally{this.layer.setStatusMessage(centigon.mapping.DrawingProgressDisplay.STATUSES.DONE)}}; centigon.mapping.RadiusRenderer.prototype.destroy=function(){for(var b in this.renderedLayerAndPolyIndicesToPolygonObjectMap)this.mapApiAdapter.setNullMapForOverlay(this.renderedLayerAndPolyIndicesToPolygonObjectMap[b])};centigon.mapping.RadiusRenderer.prototype.hasPolygonBeenSuccessfullyRendered=function(b){var a=!1;if(!1===(this._objUtil.hasKey(this.renderedLayerAndPolyIndicesToPolygonObjectMap,b)?!0:!1))return a;this._objUtil.getKeyValue(this.renderedLayerAndPolyIndicesToPolygonObjectMap,b)&&(a= !0);return a};centigon.mapping.RadiusRenderer.prototype.getRadiusOptionsFromLayerProps=function(b,a){var c=new centigon.mapping.RadiusOptions,f=this.layer.defaultDisplayObjectColor;c.fillAlpha=this.layer.layerTransparency;c.fillColor=this.layer.displayObjectColors.hasItemAt(b)?this.layer.displayObjectColors.getItemAt(b):f;c.location=a.getItemAt(b);c.id=b;c.metadata={layer:this.layer};c.radiusInMeters=this.layer.displayObjectValues.getItemAt(b);c.displayIndex=b;c.label=this.layer.displayObjectLabels.getItemAt(b); this.layer.zIndices.length>b&&(c.zIndex=this.layer.zIndices[b]);f=this.layer.displayObjectSelectedFlags.getItemAt(b);c.isSelected=1===f||!0===f?!0:!1;c.outlineColor=!0===this.layer.showDisplayObjectOutline&&!1===c.isSelected?this.layer.displayObjectOutlineColor:!0===c.isSelected&&!0===this.cMap.useGlowEffectOnLayerSelections?this.cMap.layerSelectionGlowColor:!0===this.layer.showDisplayObjectOutline&&!1===this.cMap.useGlowEffectOnLayerSelections?this.layer.displayObjectOutlineColor:c.fillColor;c.visible= this.layer.visible;f=this.layer.displayObjectVisibilityFlags;f.length>b&&!0===this.layer.visible?c.visible=f[b]:0b&&(c.zIndex=this.layer.zIndices[b]); f=this.layer.displayObjectSelectedFlags.getItemAt(b);c.isSelected=1===f||!0===f?!0:!1;c.outlineColor=!0===this.layer.showDisplayObjectOutline&&!1===c.isSelected?this.layer.displayObjectOutlineColor:!0===c.isSelected&&!0===this.cMap.useGlowEffectOnLayerSelections?this.cMap.layerSelectionGlowColor:!0===this.layer.showDisplayObjectOutline&&!1===this.cMap.useGlowEffectOnLayerSelections?this.layer.displayObjectOutlineColor:c.fillColor;c.visible=this.layer.visible;f=this.layer.displayObjectVisibilityFlags; f.length>b&&!0===this.layer.visible?c.visible=f[b]:0b&&!0===this.layer.visible?c.visible=f[b]:0'; l+='
';l+='
';l+='
';l+='
';l+='
';l+="";this._clearSelectionIconId= this._divId+"ClearSelectionIcon";this._activeIconId=this._divId+"ActiveIcon";var m='
',n=''; this._areaAndNumSelectedId=this._divId+"AreaNumSelected";var p='';document.getElementById(this._divId)||($("#"+c).append(m),$("#"+c).append(n),$("#"+c).append(l),$("#"+c).append(p));this._domUtil.addClickListenerToDomObjectById(this._clearSelectionIconId,function(){f.setSelectionType(centigon.mapping.SelectorPanel.SelectionTypes.NONE); f._domUtil.hideDomObjectById(f._clearSelectionIconId);f._domUtil.showDomObjectById(f._activeIconId)});this._domUtil.addClickListenerToDomObjectById(b,function(){f.setSelectionType(centigon.mapping.SelectorPanel.SelectionTypes.NONE)});this._domUtil.addClickListenerToDomObjectById(a,function(){f.setSelectionType(centigon.mapping.SelectorPanel.SelectionTypes.CLICK_LASSO)});this._domUtil.addClickListenerToDomObjectById(g,function(){f.setSelectionType(centigon.mapping.SelectorPanel.SelectionTypes.FREEFORM_RADIUS)}); this._domUtil.addClickListenerToDomObjectById(h,function(){f.setSelectionType(centigon.mapping.SelectorPanel.SelectionTypes.MULTIPLE_SELECT)});this._domUtil.addClickListenerToDomObjectById(k,function(){f.setSelectionType(centigon.mapping.SelectorPanel.SelectionTypes.FREEFORM_LASSO)});this._domUtil.hideDomObjectById(this._clearSelectionIconId);this._domUtil.hideDomObjectById(this._activeIconId);this._domUtil.hideDomObjectById(this._divId);this._domUtil.getDomObjectById(this._activeIconId).click(function(a){a.stopPropagation(); f._domUtil.toggleDomObjectVisibility(f._divId)})};centigon.mapping.SelectorPanel.prototype.getPolylineLassoOptions=function(b){var a=new centigon.mapping.PolylineOptions;a.fillAlpha=.7;a.lineThickness=5;a.lineColor="#0d8ac2";a.locations=b?b:[];a.zIndex=5E3;a.visible=!0;return a};centigon.mapping.SelectorPanel.prototype.getPolylineRadiusOptions=function(b){var a=new centigon.mapping.PolylineOptions;a.fillAlpha=.7;a.lineThickness=5;a.lineColor="#0d8ac2";a.locations=b;a.zIndex=5E3;a.visible=!0;return a}; centigon.mapping.SelectorPanel.prototype.getDefaultPolygonOptions=function(b){b=new centigon.mapping.PolygonOptions;b.fillAlpha=.7;b.fillColor="#00325a";b.shapes=this._polyLassoPoints;b.outlineColor="#0d8ac2";b.visible=!0;b.zIndex=5E3;return b};centigon.mapping.SelectorPanel.prototype.getDefaultRadiusOptions=function(){var b=new centigon.mapping.RadiusOptions;b.fillAlpha=.7;b.fillColor="#00325a";b.outlineColor="#0d8ac2";b.visible=!0;b.zIndex=5E3;return b};centigon.mapping.SelectorPanel.prototype.showAreaAndNumSelectedDiv= function(){$("#"+this._areaAndNumSelectedId).html("Area/Selected");$("#"+this._areaAndNumSelectedId).show()};centigon.mapping.SelectorPanel.prototype.hideAreaAndNumSelectedDiv=function(){$("#"+this._areaAndNumSelectedId).hide()};centigon.mapping.SelectorPanel.prototype.refreshRadiusDistanceDiv=function(b,a){var c=this._mapApiAdapter.apiSpecificLatLngToLocation(b),f=this._mapApiAdapter.apiSpecificLatLngToLocation(a);f=this.cMapAnalytics.getDistBetweenLocationsInMeters([c.toCsvLatLon(),f.toCsvLatLon()]); c=this.getNumericDisplayValue(this._cMap.metersToMiles(f));f=this.getNumericDisplayValue(this._cMap.metersToKm(f));c="[mi]"+c+"
[km]"+f;$("#"+this._areaAndNumSelectedId).html(c)};centigon.mapping.SelectorPanel.prototype.refreshAreaAndNumSelectedDiv=function(){for(var b=0,a,c,f,g=this._cMap.getAllLayers();g.hasNext();)f=g.next(),a=f.restrictCalcsToSelected,c=f.restrictCalcsToVisible,f.restrictCalcsToSelected=!0,f.restrictCalcsToVisible=!0,b+=f.getCount(),f.restrictCalcsToSelected=a,f.restrictCalcsToVisible= c;c=this.getAreaOfSelectionInMeters();a=this.getNumericDisplayValue(this._cMap.sqMetersToMiles(c));c=this.getNumericDisplayValue(this._cMap.sqMetersToKm(c));a="[mi]"+a+"
[km]"+c;$("#"+this._areaAndNumSelectedId).html(a+"
Num Selected: "+this.getNumericDisplayValue(b))};centigon.mapping.SelectorPanel.prototype.getNumericDisplayValue=function(b){return!0===isNaN(b)||!1===isFinite(b)?"[No Data]":this._strUtil.getFormattedAbbreviatedDisplayValue(b)};centigon.mapping.SelectorPanel.prototype.selectionCompleted= function(){this.removeMouseAndTouchEventListeners();this.refreshAreaAndNumSelectedDiv();this.showClearSelectionIcon()};centigon.mapping.SelectorPanel.prototype.showClearSelectionIcon=function(){this._domUtil.showDomObjectById(this._clearSelectionIconId);this._domUtil.hideDomObjectById(this._activeIconId)};centigon.mapping.SelectorPanel.prototype.showIcon=function(){this._domUtil.showDomObjectById(this._activeIconId)};centigon.mapping.SelectorPanel.prototype.hideIcon=function(){this._domUtil.hideDomObjectById(this._activeIconId)}; centigon.mapping.SelectorPanel.prototype.showSelectorPanel=function(){this._domUtil.showDomObjectById(this._divId)};centigon.mapping.SelectorPanel.prototype.hideSelectorPanel=function(){this._domUtil.hideDomObjectById(this._divId)};centigon.mapping.SelectorPanel.prototype.mouseClick=function(b){b=b.latLng;this.selectionType==centigon.mapping.SelectorPanel.SelectionTypes.CLICK_LASSO?(this._mapApiAdapter.preventPolygonFromAbsorbingClickEvent=!0,this.drawLassoClicks(b),2b&&(f=this.clusterOptions[b]);f[a]=c;this.clusterOptions[b]=f};centigon.mapping.CMapDesignerCfgParser.prototype.setLyrOption=function(b,a,c){this.setLyrApprncOption(b,a,c)};centigon.mapping.CMapDesignerCfgParser.prototype.setLyrApprncOption=function(b,a,c){var f={};this.layerAppearanceOptions.length>b&&(f=this.layerAppearanceOptions[b]);f[a]=c;this.layerAppearanceOptions[b]=f};centigon.mapping.CMapDesignerCfgParser.prototype.addAdvInfWinCard=function(b){this.advInfWinOptions.opts.cardOpts.push(b)}; centigon.mapping.CMapDesignerCfgParser.prototype.setAIWOptions=function(b,a){this.advInfWinOptions.opts[b]=a};centigon.mapping.CMapDesignerCfgParser.prototype.setTravelOption=function(b,a,c){var f=new centigon.mapping.TravelOptions;this.travelOptions.length>b&&(f=this.travelOptions[b]);"travelmode"===a?f.travelMode=c:"travelunits"===a?f.unitSystem=c:"usecachedrivetimepolyservice"===a?f.useCacheDriveTimePolyService=this.getBoolean(c):"usecurrentlocationasstartpoint"===a?f.useCurrentLocationAsStartPoint= this.getBoolean(c):"markerlayerbindings"===a&&(f.markerLayerBindings=c);this.travelOptions[b]=f};centigon.mapping.CMapDesignerCfgParser.prototype.setWmsOption=function(b,a,c){var f={};this.wmsOptions.length>b&&(f=this.wmsOptions[b]);f[a]=c;this.wmsOptions[b]=f};centigon.mapping.CMapDesignerCfgParser.prototype.getLayerNodeAt=function(b){return(this.mapView.layers.layer&&this.mapView.layers.layer.length?this._utilFactory.getCollectionIterator(this.mapView.layers.layer):this._utilFactory.getCollectionIterator([this.mapView.layers.layer])).getItemAt(b)}; centigon.mapping.CMapDesignerCfgParser.prototype.processLayerAlerts=function(){var b=this.currentLayerNode.alerts,a=this.getLowercasePropVal(b.alertType),c=this.getLowercasePropVal(b.alertDefinition),f=this.getLowercasePropVal(b.alertColors),g=this.getLowercasePropVal(b.alertIcons);b=this.getLowercasePropVal(b.alertValues);"type-none"===a?(this.isEnabled.push(!1),this.isIconsEnabled.push(!1)):(this.isEnabled.push(!0),this.isIconsEnabled.push(!0));"high-values-good"===c?this.alertIsHighGood.push(!0): this.alertIsHighGood.push(!1);"type-target"===a?this.isByTargets.push(!0):this.isByTargets.push(!1);this.mapAlertTypes.push(a);this.alertColors.push(f.split(","));this.alertIcons.push(g.split(","));this.alertLimits.push(b.split(","))};centigon.mapping.CMapDesignerCfgParser.prototype.getDbfDataOrderKeys=function(b,a){var c=this;$.ajax({type:"GET",url:b,success:function(b){b=new centigon.mapping.CsvParser(String(b));for(var f=[],h,k=0;kb.length()-b.position())return a.hasData=!1,a;b.setEndian(centigon.util.ByteArray.ENDIANTYPE.BIG_ENDIAN);a.number=b.readInt();var c=2*b.readInt()-4;b.setEndian(centigon.util.ByteArray.ENDIANTYPE.LITTLE_ENDIAN);a.shapeType=b.readInt();var f=[];if(a.shapeType===centigon.mapping.Shapefile.FILE_TYPES.POLYGON||a.shapeType=== centigon.mapping.Shapefile.FILE_TYPES.POLYLINE){if(b){if(b.length()-b.position()a.length()-a.position())return this._logger.trace("Invalid file header."), null;if(9994!=a.readInt())return this._logger.trace("Invalid file signature."),null;b=a.position();b+=8*centigon.util.ByteArray.INT_LEN;b+=8*centigon.util.ByteArray.DOUBLE_LEN;a.position(b);b=[];for(var c=!0;c;)try{var f=this.getShapeRecord(a);0==f.hasData?c=!1:b.push(f)}catch(g){c=!1,this._logger.trace("Shape processing error, records processed : "+b.length.toString()+g.getStackTrace())}f=[];for(a=0;a