function numberWithCommas(n){return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function addLabelToGeometry(n,t,i){var f=new Date(i.SaleDate).getFullYear(),o=t,e=new esri.InfoTemplate,r,u,c,s,h;e.setTitle(numberWithCommas(n).addDollarSign());e.setContent(lakegis.sales.getTextContent);u=new esri.symbol.TextSymbol({type:"esriTS",color:[255,255,255,255],verticalAlignment:"middle",horizontalAlignment:"center",font:{family:"Arial",size:8,style:"normal",weight:"bold",decoration:"none"}});f<=2020?(r=new esri.symbol.PictureMarkerSymbol("/"+appDirectory+"/Content/images/house_icon_red_small.png",31,44),r.setOffset(5,0),u.setOffset(10,-15)):f===2021?(r=new esri.symbol.PictureMarkerSymbol("/"+appDirectory+"/Content/images/house_icon_purple_small.png",31,44),r.setOffset(-5,0),u.setOffset(-10,-15)):f===2022?(r=new esri.symbol.PictureMarkerSymbol("/"+appDirectory+"/Content/images/house_icon_blue_small.png",31,44),r.setOffset(-8,0),u.setOffset(-10,-15)):f===2023?(r=new esri.symbol.PictureMarkerSymbol("/"+appDirectory+"/Content/images/house_icon_orange_small.png",31,44),r.setOffset(0,0),u.setOffset(0,-15)):(r=new esri.symbol.PictureMarkerSymbol("/"+appDirectory+"/Content/images/house_icon_green_small.png",31,44),r.setOffset(0,0),u.setOffset(0,-15));c=new esri.renderer.SimpleRenderer(r);u.setText(n.toShortString());s=new esri.Graphic(o,u);h=new esri.Graphic(o,r,i,e);map.graphics.add(h);map.graphics.add(s)}var lakegis,feat,replaceEsriToolbarIconsWithBetterOnes,initialData,PagedGridModel;$.extend(!0,lakegis,{configuration:{noIdentify:["County Boundary","Tax Parcels Alternate Key","2008 Imagery","Street Names","Subdivision Lot Numbers","FLU Codes"],fieldsNoDisplay:["OBJECTID","DateCreated","GlobalID","Shape.len","Shape.area","SHAPE.area","SHAPE.len","Shape","SHAPE","WaterBodyID","PermanentID","Shape.STArea()","Shape.STLength()"],tipFont:"Arial",tipFontSize:"12",tipFontOffsetX:-1,tipFontOffsetY:-3,services:{geometry:rootUrl101+"Utilities/Geometry/GeometryServer",dynamic:rootUrl101+"InteractiveMap/MapServer",aerial2022:rootUrl101+"Aerial2022/ImageServer",aerial2019:rootUrl101+"Aerial2019/ImageServer",aerial2017:rootUrl101+"Aerial2017/ImageServer",aerial2014:rootUrl101+"Aerial2014/ImageServer",aerial2011:rootUrl101+"Aerial2011/ImageServer",aerial2009:rootUrl101+"Aerial2009/ImageServer",aerial2008:rootUrl101+"Aerial2008/ImageServer",aerial2006:rootUrl101+"Aerial2006/ImageServer",aerial2004:rootUrl101+"Aerial2004/ImageServer",contours:rootUrl101+"Contours/MapServer",terrain:rootUrl101+"Terrain/MapServer",locator:rootUrl101+"Locators/CompositeLocator/GeocodeServer",sales:rootUrl101+"SalesHistory/FeatureServer/0",taxParcelQuery:rootUrl101+"InteractiveMap/MapServer/"+lakegis.taxParcelLayerNum,print:rootUrl101+"Utilities/PrintingTools/GPServer/Export Web Map Task"},symbols:{selection:undefined,buffer:undefined,bufferSelection:undefined},messages:{shareError:"An error occurred while trying to send your email"}}});lakegis=lakegis||{};lakegis.models=lakegis.models||{};lakegis.models.Tip=Backbone.Model.extend({defaults:{number:undefined,feature:[]},initialize:function(){},asString:function(){return JSON.stringify(this.toJSON())},foo:function(){console.log("Tip.foo called")}});lakegis.models.Feature=Backbone.Model.extend({defaults:function(){return{title:"default title",infoWindow:undefined,point:"default from Feature"}},initialize:function(){},showInfoWindow:function(){console.log("lakegis.models.Feature showInfoWindow called");console.log("point: "+this.get("point"))},outputHello:function(){return"hello: "+this.get("title")}});lakegis.models.TaxParcel=lakegis.models.Feature.extend({defaults:{modelType:"TaxParcel",fields:undefined}});lakegis.models.Address=lakegis.models.Feature.extend({defaults:{modelType:"Address",address:undefined,score:undefined}});lakegis.models.Tips=Backbone.Collection.extend({model:lakegis.models.Tip,initialize:function(){console.log("collection created")}});lakegis.models.TipViewModel=kb.ViewModel.extend({constructor:function(n){console.log("lakegis.models.TipViewModel constructor running");kb.ViewModel.prototype.constructor.apply(this,arguments);var t=this;this.returnPoint=function(){console.log(this.model().get("feature").get("point"))};this.showStreetView=function(){lakegis.identify.streetView(this.model().get("feature").get("point").x,this.model().get("feature").get("point").y)};this.showIPA=function(){lakegis.identify.IPAView(this.model().get("feature").get("fields").PropertyAddress.trim())};this.buffer=function(){console.log("buffer clicked");console.log(this.model().get("feature").get("geo"));lakegis.buffer.geo=this.model().get("feature").get("geo");lakegis.buffer.searchResultsClicked()};this.returnFemaUrl=function(){return lakegis.urlFema+this.model().get("feature").get("fields").PropertyAddress};this.returnBingBirdsEyeUrl=function(){return"http://www.bing.com/maps/default.aspx?style=b&lvl=20&where1="+this.model().get("feature").get("fields").PropertyAddress};this.returnGoogleMapsUrl=function(){return"https://maps.google.com/maps?q="+this.model().get("feature").get("fields").PropertyAddress};this.returnPAUrl=function(){return lakegis.urlPA+this.model().get("feature").get("fields").AltKey};this.returnTaxUrl=function(){return lakegis.urlTax+this.model().get("feature").get("fields").AltKey};this.returnPermitsUrl=function(){return lakegis.urlPermits+this.model().get("feature").get("fields").AltKey};this.returnEagleViewUrl=function(){return"EagleView?address="+this.model().get("feature").get("fields").PropertyAddress};this.returnMyPublicServicesUrl=function(){var i,n=lakegis.urlMyPublicServices+this.model().get("feature").get("fields").PropertyAddress,t=n.lastIndexOf("FL");return t!=-1&&(i=n.substring(0,t)+", "+n.substring(t+2,n.length)),i};this.returnLastSalePrice=function(){return this.model().get("feature").get("fields").LastSalePrice?this.model().get("feature").get("fields").LastSalePrice.formatMoney(2):"N/A"};this.returnLastSaleDate=function(){return lakegis.utils.convertToUserFriendlyDate(this.model().get("feature").get("fields").LastSaleDate)};this.showInfoWindow=function(){console.log("lakegis.models.TipViewModel showInfoWindow called");feat=n.get("feature");var t=lakegis.utils.pointToExtent(map,feat.get("point"),10),i=dojo.filter(tipLayer.graphics,function(n){return t.contains(n.geometry)});dojo.forEach(i,function(n){n.symbol.type=="picturemarkersymbol"&&(map.infoWindow.setContent(n.getContent()),map.infoWindow.setTitle(n.getTitle()),map.infoWindow.show(n.geometry,map.getInfoWindowAnchor(n.geometry),{closestFirst:!0}),map.centerAt(n.geometry,15))})};this.zoomTo=function(){map.centerAndZoom(n.get("feature").get("point"),15)};this.save=kb.observable(n,{key:"save",read:function(){return!n.isNew()},write:function(){return n.save({},{wait:!0,success:function(n,i){console.log(n);console.log(i);console.log(t)},error:function(){alert("Oh NooooOOOes you broked it!!!11!")}})}},this);this.tipEditLinkdomainId=ko.dependentObservable(function(){return this.save()?"cms?action=domainDetail&domainID="+this.model().id:""},this)}});lakegis.models.TipsViewModel=function(n){this.tips=kb.collectionObservable(n,{view_model:lakegis.models.TipViewModel});this.addTip=function(n,t,i){var u,f,r;this.tips.push(new lakegis.models.TipViewModel(n));u=new esri.symbol.PictureMarkerSymbol("/"+appDirectory+"/Content/images/tip-blue.png",36,36);f=n.get("number")>=100?new esri.symbol.Font(lakegis.configuration.tipFontSize-1,esri.symbol.Font.STYLE_NORMAL,esri.symbol.Font.VARIANT_NORMAL,esri.symbol.Font.WEIGHT_BOLD,lakegis.configuration.tipFont):new esri.symbol.Font(lakegis.configuration.tipFontSize,esri.symbol.Font.STYLE_NORMAL,esri.symbol.Font.VARIANT_NORMAL,esri.symbol.Font.WEIGHT_BOLD,lakegis.configuration.tipFont);r=new esri.symbol.TextSymbol(n.get("number"),f,new dojo.Color("white"));r.setOffset(lakegis.configuration.tipFontOffsetX,lakegis.configuration.tipFontOffsetY);t.add(new esri.Graphic(n.get("feature").get("point"),u,i,n.get("feature").get("infoTemplate")));t.add(new esri.Graphic(n.get("feature").get("point"),r,i,n.get("feature").get("infoTemplate")))};this.removeAll=function(){this.tips.removeAll();tipLayer.clear()};this.export=function(){console.log("lakegis.tipsViewModel.export");var t=[],n=ko.toJS(this.tips);jQuery.each(n,function(i){n[i].model.get("feature").get("fields").LastSaleDate=lakegis.utils.convertToUserFriendlyDate(n[i].model.get("feature").get("fields").LastSaleDate);t.push(n[i].model.get("feature").get("fields"))});$.ajax({url:"/"+appDirectory+"/Home/GatherCSVData",type:"POST",contentType:"application/json",data:JSON.stringify(t),success:function(n){$("#hidData").val(n);$("#formGenerate").attr("action","/"+appDirectory+"/Home/Download");$("#formGenerate").submit()}})}};lakegis.models.TipView=Backbone.View.extend({el:"#query-results",initialize:function(){this.template=_.template($("#tipTemplate").html());this.collection.bind("reset",this.render,this);this.collection.bind("add",this.render,this)},render:function(){console.log("tipView render called");var n=this.template(this.collection.toJSON());return $(this.el).html(n),this},events:{"click .tipMarker":"tipClick"},tipClick:function(){console.log("tipClick clicked");console.log(this.collection)}});feat=new lakegis.models.Feature;feat.set("title","hello");console.log("feat title: "+feat.get("title"));lakegis.tips=new lakegis.models.Tips;lakegis.tips.on("add",function(){});$.extend(!0,lakegis,{utils:{pointToExtent:function(n,t,i){var u=n.extent.getWidth()/n.width,r=i*u;return new esri.geometry.Extent(t.x-r,t.y-r,t.x+r,t.y+r,n.spatialReference)},convertToUserFriendlyDate:function(n){var t=new Date(n);return t.addHours(5),t.customFormat("#M#/#DD#/#YYYY#")},addDollarSign:function(){}}});Number.prototype.formatMoney=function(n,t,i){var u=this,n=isNaN(n=Math.abs(n))?2:n,t=t==undefined?".":t,i=i==undefined?",":i,e=u<0?"-":"",f=parseInt(u=Math.abs(+u||0).toFixed(n))+"",r=(r=f.length)>3?r%3:0;return"$"+e+(r?f.substr(0,r)+i:"")+f.substr(r).replace(/(\d{3})(?=\d)/g,"$1"+i)+(n?t+Math.abs(u-f).toFixed(n).slice(2):"")};Array.prototype.remove=function(){for(var n,t=arguments,i=t.length,r;i&&this.length;)for(n=t[--i];(r=this.indexOf(n))!==-1;)this.splice(r,1);return this};Date.prototype.addHours=function(n){return this.setHours(this.getHours()+n),this};Date.prototype.customFormat=function(n){var h,c,l,a,v,u,y,p,w,i,o,b,t,k,f,d,e,g,nt,s,tt,r=this;return c=((h=r.getFullYear())+"").slice(-2),v=(u=r.getMonth()+1)<10?"0"+u:u,a=(l=["January","February","March","April","May","June","July","August","September","October","November","December"][u-1]).substring(0,3),w=(i=r.getDate())<10?"0"+i:i,p=(y=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][r.getDay()]).substring(0,3),tt=i>=10&&i<=20?"th":(s=i%10)==1?"st":s==2?"nd":s==3?"rd":"th",n=n.replace("#YYYY#",h).replace("#YY#",c).replace("#MMMM#",l).replace("#MMM#",a).replace("#MM#",v).replace("#M#",u).replace("#DDDD#",y).replace("#DDD#",p).replace("#DD#",w).replace("#D#",i).replace("#th#",tt),t=o=r.getHours(),t==0&&(t=24),t>12&&(t-=12),b=t<10?"0"+t:t,nt=(g=o<12?"am":"pm").toUpperCase(),k=(f=r.getMinutes())<10?"0"+f:f,d=(e=r.getSeconds())<10?"0"+e:e,n.replace("#hhh#",o).replace("#hh#",b).replace("#h#",t).replace("#mm#",k).replace("#m#",f).replace("#ss#",d).replace("#s#",e).replace("#ampm#",g).replace("#AMPM#",nt)};String.prototype.addDollarSign=function(){return"$"+this};Number.prototype.toShortString=function(){return this<1e3?this.toFixed(0).addDollarSign():this<1e6?(this/1e3).toFixed(0).addDollarSign()+"K":(this/1e6).toFixed(1).addDollarSign()+"M"};$.extend(!0,lakegis,{map:{scalebar:undefined,tooltip:undefined,zoomHandle:undefined,init:function(){var n,t;console.log("lakegis.map.init");esri.config.defaults.geometryService=new esri.tasks.GeometryService(lakegis.configuration.services.geometry);widgetWaterBodiesTab=dijit.byId("waterBodiesTab");widgetParcelTab=dijit.byId("parcelTab");lakegis.map.createMap();navToolbar=new esri.toolbars.Navigation(map);dojo.connect(map,"onLoad",function(){lakegis.map.loaded()});dojo.connect(map,"onExtentChange",lakegis.map.onExtentChange);dojo.connect(map,"onZoomEnd",lakegis.map.onZoomEnd);n=new esri.layers.ImageParameters;n.format="PNG8";lakegis.layers.create();dojo.connect(map,"onLayersAddResult",function(){console.log("onLayersAddResult");toc=new agsjs_incode.dijit.TOC({map:map,layerInfos:[{layer:lakegis.layers.dynamic,collapsed:!1,title:"Lake County",slider:!0},{layer:lakegis.layers.contours,title:"Contours",noLegend:!0,slider:!0},{layer:lakegis.layers.terrain,title:"Terrain",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2022,title:"2023 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2019,title:"2020 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2017,title:"2017 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2014,title:"2014 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2011,title:"2011 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2009,title:"2009 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2008,title:"2008 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2006,title:"2006 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2004,title:"2004 Aerials",noLegend:!0,slider:!0}]},"tocDiv");toc.startup();replaceEsriToolbarIconsWithBetterOnes()});dojo.connect(map,"onLayersAddResult",function(){console.log("onLayersAddResult");toc=new agsjs_incode.dijit.TOC({map:map,layerInfos:[{layer:lakegis.layers.dynamic,collapsed:!1,title:"Lake County",slider:!0},{layer:lakegis.layers.contours,title:"Contours",noLegend:!0,slider:!0},{layer:lakegis.layers.terrain,title:"Terrain",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2022,title:"2022 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2019,title:"2020 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2017,title:"2017 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2014,title:"2014 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2011,title:"2011 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2009,title:"2009 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2008,title:"2008 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2006,title:"2006 Aerials",noLegend:!0,slider:!0},{layer:lakegis.layers.aerial2004,title:"2004 Aerials",noLegend:!0,slider:!0}]},"tocDiv2");toc.startup()});map.addLayers([lakegis.layers.aerial2004,lakegis.layers.aerial2006,lakegis.layers.aerial2008,lakegis.layers.aerial2009,lakegis.layers.aerial2011,lakegis.layers.aerial2014,lakegis.layers.aerial2017,lakegis.layers.aerial2019,lakegis.layers.aerial2022,lakegis.layers.terrain,lakegis.layers.contours,lakegis.layers.dynamic]);t=map.enableSnapping({snapKey:dojo.keys.copyKey});locator=new esri.tasks.Locator(lakegis.configuration.services.locator);dojo.connect(locator,"onAddressToLocationsComplete",showAddressResults);parcelsGraphicsLayer=new esri.layers.GraphicsLayer;tipLayer=new esri.layers.GraphicsLayer;bufferResultsLayer=new esri.layers.GraphicsLayer;salesGraphicsLayer=new esri.layers.GraphicsLayer;map.addLayer(bufferResultsLayer);map.addLayer(parcelsGraphicsLayer);map.addLayer(tipLayer);map.addLayer(salesGraphicsLayer);dojo.disconnect(map.infoWindow._eventConnections[4]);lakegis.setInitialValues();console.log("init finished")},loaded:function(){console.log("lakegis.map.loaded");lakegis.map.scalebar=new esri.dijit.Scalebar({map:map,scalebarUnit:"english"},dojo.byId("scalebar"));lakegis.checkUrl();lakegis.identify.initialize();symbol=new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([255,0,0]),2),new dojo.Color([255,255,0,.25]));lakegis.select.selectionToolbar=new esri.toolbars.Draw(map);lakegis.select.selectQuery=new esri.tasks.Query;lakegis.select.selectionToolbar.on("draw-end",lakegis.select.doSelect);lakegis.$panel.height($("#left").height()-($("#left-top").outerHeight()+$("#arrow-left").outerHeight()+60));lakegis.share.updateUrl(lakegis.queryParams);$("#mapDiv_zoom_slider").wrap("<div class='zoomHolder'><\/div>");$(".zoomHolder").css("top",lakegis.$mapDiv.height()-330);lakegis.panels.setDefaultState();console.log("lakegis.map.loaded finished")},createMap:function(){map=lakegis.queryParams.x&&lakegis.queryParams.y&&lakegis.queryParams.level?new esri.Map("mapDiv",{sliderOrientation:"vertical",sliderStyle:"large",zoom:lakegis.queryParams.level,center:new esri.geometry.Point(Number(lakegis.queryParams.x),Number(lakegis.queryParams.y),new esri.SpatialReference({wkid:lakegis.SpatialReference}))}):new esri.Map("mapDiv",{sliderOrientation:"vertical",sliderStyle:"large"})},resize:function(){console.log("lakegis.map.resize called");lakegis.$mapDiv.height($(window).height());lakegis.$scaleBar.css("top",lakegis.$mapDiv.height()-105);$(".zoomHolder").css("top",lakegis.$mapDiv.height()-330);lakegis.$tocDiv!=undefined&&lakegis.$tocDiv.height($(window).height()-($("#navToolbar").height()+$("#views").height()+150));lakegis.$tocDiv2!=undefined&&lakegis.$tocDiv2.height($(window).height()-($("#navToolbar").height()+$("#views").height()+150));$("#right").height($(window).height()-($("#navToolbar").height()+50));$("#left").height($(window).height()-($("#navToolbar").height()+50));lakegis.$panel.height($("#left").height()-($("#left-top").outerHeight()+$("#arrow-left").outerHeight()+60))},queryOff:function(){dojo.disconnect(queryMouseOutEvent)},clear:function(){console.log("lakegis.map.clear called");map.graphics.clear();bufferResultsLayer.clear();lakegis.tipsViewModel.removeAll();lakegis.measure.resetTool();lakegis.queryParams.query=null;lakegis.map.pushState();parcelsGraphicsLayer!==undefined&&parcelsGraphicsLayer.clear();lakegis.identify.off();lakegis.map.queryOff();lakegis.buffer.off();lakegis.lastTipNumber=0;lakegis.select.off();$(".card").hide()},setInfoWindow:function(n,t){map.infoWindow.setTitle("Location");map.infoWindow.setContent(t)},getVisibleLayers:function(n){var t=[],i=dojo.map(n.layerInfos,function(n){layerID=n.id;n.visible&&!n.subLayerIds&&t.push(layerID)});return t},setVisibleLayers:function(n,t){t=t.sort(function(n,t){return n-t});console.log(t);n.setVisibleLayers(t)},turnParcelsOnAndZoom:function(){map.getScale()>18001&&map.setScale(18e3);var n=lakegis.layers.dynamic.visibleLayers;n.indexOf(19)==-1&&(n.push(19),lakegis.map.setVisibleLayers(lakegis.layers.dynamic,n));guiders.hideAll();lakegis.select.clicked()},onZoomEnd:function(){lakegis.sales.checkScaleLevel()},zoomOff:function(){console.log("zoomOff");$("#cbZoomIn").removeClass("navActive");lakegis.activeTool="";navToolbar.deactivate()},zoomOn:function(){lakegis.select.off();lakegis.activeTool="zoom";$("#cbZoomIn").addClass("navActive")},onExtentChange:function(){lakegis.map.setQueryParams(lakegis.queryParams.query)},setQueryParams:function(n){lakegis.queryParams.query=n;lakegis.initialPageLoad==!0?lakegis.initialPageLoad=!1:(lakegis.queryParams.x=map.extent.getCenter().x,lakegis.queryParams.y=map.extent.getCenter().y,lakegis.queryParams.level=map.getZoom(),lakegis.map.pushState())},pushState:function(){History.pushState({x:lakegis.queryParams.x,y:lakegis.queryParams.y,l:lakegis.queryParams.level},"Lake County Interactive Map Beta","?x="+lakegis.queryParams.x+"&y="+lakegis.queryParams.y+"&l="+lakegis.queryParams.level+(lakegis.queryParams.query?"&query="+lakegis.queryParams.query:""));lakegis.share.updateUrl(lakegis.queryParams)}}});replaceEsriToolbarIconsWithBetterOnes=function(){var n=$("#cbLayers > .ui-icon-copy"),t=$("#cbZoomIn > .ui-icon-zoomin"),i=$("#cbPan > .ui-icon-arrow-4"),r=$("#cbFullExtent > .ui-icon-image"),u=$("#cbIdentify > .ui-icon-info"),f=$("#cbSelect > .ui-icon-check"),e=$("#cbMeasure > .ui-icon-flag"),o=$("#cbBuffer > .ui-icon-signal-diag"),s=$("#cbSales > .ui-icon-info"),h=$("#cbClear > .ui-icon-close"),c=$("#cbPrint > .ui-icon-print"),l=$("#cbShare > .ui-icon-link"),a=$("#cbAbout > .ui-icon-comment"),v=$("#cbHelp > .ui-icon-help"),y=$("#cbFeedback > .ui-icon-info");n.remove();t.remove();i.remove();r.remove();u.remove();f.remove();e.remove();o.remove();s.remove();h.remove();c.remove();l.remove();a.remove();v.remove();y.remove()};$.extend(!0,lakegis,{identify:{identifyTask:null,identifyEvent:undefined,results:[],tabCounter:1,tabTemplate:"<li><a href='#{href}'>#{label}<\/a><\/li>",tolerance:3,addTab:function(n,t){var r=n||"Tab "+lakegis.identify.tabCounter,i="tabs-"+lakegis.identify.tabCounter,u=$(lakegis.identify.tabTemplate.replace(/#\{href\}/g,"#"+i).replace(/#\{label\}/g,r)),f=t||"Tab "+lakegis.identify.tabCounter+" content.";$("#identifyTabs").find(".ui-tabs-nav").append(u);$("#identifyTabs").append("<div id='"+i+"'><p>"+f+"<\/p><\/div>");$("#identifyTabs").tabs("refresh");lakegis.identify.tabCounter++},removeTabs:function(){console.log("removeTabs");$("#identifyTabs li").remove();$("#identifyTabs .ui-tabs-panel").remove();lakegis.identify.tabCounter=1},clicked:function(){lakegis.buffer.off();lakegis.select.off();map.setCursor("pointer");(lakegis.identify.identifyEvent===undefined||lakegis.identify.identifyEvent.advice==null)&&(lakegis.identify.identifyEvent=dojo.connect(map,"onClick",lakegis.identify.doIdentify))},off:function(){dojo.disconnect(lakegis.identify.identifyEvent);map.setCursor("default")},compare:function(n,t){return(console.log("compare called"),n.layerName=="Tax Parcels")?-1:t.layerName=="Tax Parcels"?1:0},initialize:function(){},doIdentify:function(n,t,i){console.log("doIdentify running");console.log(n);console.log(Object.prototype.toString.call(n).slice(8,-1));n.screenPoint||(console.log("setting evt object"),n.screenPoint=t,n.mapPoint=i);Object.prototype.toString.call(n).slice(8,-1)!="MouseEvent"&&(console.log("got here"),lakegis.identify.identifyTask=new esri.tasks.IdentifyTask(lakegis.configuration.services.dynamic),identifyParams=new esri.tasks.IdentifyParameters,identifyParams.tolerance=lakegis.identify.tolerance,identifyParams.returnGeometry=!0,identifyParams.layerIds=lakegis.map.getVisibleLayers(lakegis.layers.dynamic),identifyParams.layerOption=esri.tasks.IdentifyParameters.LAYER_OPTION_ALL,identifyParams.width=map.width,identifyParams.height=map.height,map.graphics.clear(),lakegis.identify.results=[],$("#identifyTabs").length==0,map.infoWindow.setContent("<div id='identifyTabs'><ul><\/ul><\/div>"),$("#identifyTabs").tabs(),map.infoWindow.resize(415,200),map.infoWindow.setTitle("Identify Results"),identifyParams.geometry=n.mapPoint,identifyParams.mapExtent=map.extent,lakegis.identify.identifyTask.execute(identifyParams,function(t){lakegis.identify.addToMap(t,n.screenPoint,n.mapPoint)}))},addToMap:function(n,t,i){var h,u,s,f,e,o,r;for(console.log("lakegis.identify.addToMap running"),h=[],u=0,s=n.length;u<s;u++)if(f=n[u].layerName,$.inArray(f,lakegis.configuration.noIdentify)>-1)console.log(f+" identify not allowed");else if(e={layerName:n[u].layerName,features:[]},e.features.push(n[u].feature),lakegis.identify.results.length==0)lakegis.identify.results.push(e);else{for(o=!1,r=0;r<lakegis.identify.results.length;r++)lakegis.identify.results[r].layerName==f&&(lakegis.identify.results[r].features.push(n[u].feature),o=!0);o||lakegis.identify.results.push(e)}if(lakegis.identify.results.length==0)map.infoWindow.setContent("Sorry no results were found");else for(lakegis.identify.results.sort(lakegis.identify.compare),console.log(lakegis.identify.results),r=0;r<lakegis.identify.results.length;r++)lakegis.identify.addTab(lakegis.identify.results[r].layerName,lakegis.identify.createTabContent(lakegis.identify.results[r].features,i));$("#identifyTabs").tabs({active:0});map.infoWindow.show(t,map.getInfoWindowAnchor(t))},createTabContent:function(n,t){var s,c,r,i,h,f,o;console.log("createTabContent running");var t=t,u="",e=!1;for(u="<i>Total features returned: "+n.length+"<\/i>",s=0,c=n.length;s<c;s++)if(r=n[s].attributes,r.PlatBookType=="TOWN"&&(e=!0),r.OwnerName=="Not for public record"&&"OwnerName"in r)for(i in r)$.inArray(i,lakegis.configuration.fieldsNoDisplay)>-1||i=="OwnerName"||i=="OwnerAddress"||i=="OwnerCity"||i=="OwnerState"||i=="OwnerZip"||i=="LastSalePrice"||i=="LastSaleDate"||i=="OwnerProvince"||i=="OwnerCountry"||(i=="ImagePath"?u+="<div><a target='_blank' href='"+r[i]+"'>View Document<\/a><\/div>":i=="Annexation URL"?u+="<div><a target='_blank' href='"+r["Annexation URL"]+"'>View Document<\/a><\/div>":i=="AltKey"&&"FloodInfo"in r?u+="<div><h3>AltKey: "+r[i]+"<\/h3><\/div>":i=="FloodInfo"?u+="To request a copy of  FEMA documents the County may have on file such as Elevation Certificates or Letters of Map Change for structures built after April 1, 1982, please contact Lake County Public Works via email at flood@lakecountyfl.gov  or call 352-253-9081.  Please include the Alternate Key or Parcel ID number in your request.":i=="AltKey"&&"Parcel Number"in r?(u+="<div><h3>AltKey: "+r[i]+"<\/h3><\/div>",u+="<div><a href='http://maps.google.com/maps?q="+r.PropertyAddress+"' target='_blank'>Google Maps<\/a> | <a href='#' onclick='javascript:lakegis.identify.streetView("+t.x+", "+t.y+")'>Street View<\/a> | <a href='EagleView?address="+r.PropertyAddress+"' target='_blank'>EagleView<\/a> | <a href='http://www.bing.com/maps/default.aspx?style=b&lvl=20&where1="+r.PropertyAddress+"' target='_blank'>Bing Bird's Eye<\/a> | <a href='"+lakegis.urlPA+r[i]+"' target='_blank'>Property Appraiser<\/a> | <a href='"+lakegis.urlTax+r[i]+"' target='_blank'>Tax Collector<\/a> | <a href='"+lakegis.urlPermits+r[i]+"' target='_blank'>Building Permits<\/a> |  <a href='"+lakegis.urlFema+r.PropertyAddress+"' target='_blank'>FEMA Flood Map<\/a><\/div>"):u+="<div>"+i+": "+r[i]+"<\/div>");else if(r.OwnerName==""&&"OwnerName"in r)for(i in r)$.inArray(i,lakegis.configuration.fieldsNoDisplay)>-1?console.log("NOPE!"):i=="OwnerName"||i=="OwnerAddress"||i=="OwnerCity"||i=="OwnerState"||i=="OwnerZip"||i=="LastSalePrice"||i=="LastSaleDate"||i=="OwnerProvince"||i=="OwnerCountry"||(i=="PlatBookType"?(h=r[i],h=="TOWN"&&(e=!0),u+="<div>Plat Book Type: "+r[i]+"<\/div>"):i=="PlatPage1"?e||(u+="<div>Plat Page 1: "+r[i]+"<\/div>"):i=="PlatPage2"?e||(u+="<div>Plat Page 2: "+r[i]+"<\/div>"):i=="BookNumber"?e||(u+="<div>Book Number: "+r[i]+"<\/div>"):i=="Units"?e||(u+="<div>Units: "+r[i]+"<\/div>"):i=="YearAdded"?r[i]>0&&(u+="<div>Year Added: "+r[i]+"<\/div>"):i=="Lots"?r[i]!==null&&r[i]>0&&(u+="<div>Lots: "+r[i]+"<\/div>"):i=="Units"?r[i]!==null&&r[i]>0&&(u+="<div>Units: "+r[i]+"<\/div>"):i=="ImagePath"?e==!1?(f=r[i],o=r[i],f.includes("www.lakecountyfl.gov")?o=f.replace("//www.lakecountyfl.gov","//c.lakecountyfl.gov"):f.includes("//lakecountyfl.gov")&&(o=f.replace("//lakecountyfl.gov","//c.lakecountyfl.gov")),u+="<div><a target='_blank' href='"+o+"'>View Document<\/a><\/div>"):u+="<div>Platbook Unrecorded<\/div>":i=="ImagePath"?(console.log("HIIIIIII!"),console.log("IN THE IMAGE PATH. Show? "+hideImagePath),f=r[i],o=r[i],hideImagePath==!1?(f.includes("www.lakecountyfl.gov")?o=f.replace("//www.lakecountyfl.gov","//c.lakecountyfl.gov"):f.includes("//lakecountyfl.gov")&&(o=f.replace("//lakecountyfl.gov","//c.lakecountyfl.gov")),u+="<div><a target='_blank' href='"+o+"'>View Document<\/a><\/div>"):u+="<div>Platbook Unrecorded<\/div>"):i=="Annexation URL"?u+="<div><a target='_blank' href='"+r["Annexation URL"]+"'>View Document<\/a><\/div>":i=="AltKey"&&"FloodInfo"in r?u+="<div><h3>AltKey: "+r[i]+"<\/h3><\/div>":i=="FloodInfo"?u+="To request a copy of  FEMA documents the County may have on file such as Elevation Certificates or Letters of Map Change for structures built after April 1, 1982, please contact Lake County Public Works via email at flood@lakecountyfl.gov  or call 352-253-9081.  Please include the Alternate Key or Parcel ID number in your request.":i=="AltKey"&&"Parcel Number"in r?(u+="<div><h3>AltKey: "+r[i]+"<\/h3><\/div>",u+="<div><a href='http://maps.google.com/maps?q="+r.PropertyAddress+"' target='_blank'>Google Maps<\/a> | <a href='#' onclick='javascript:lakegis.identify.streetView("+t.x+", "+t.y+")'>Street View<\/a> | <a href='EagleView?address="+r.PropertyAddress+"' target='_blank'>EagleView<\/a> | <a href='http://www.bing.com/maps/default.aspx?style=b&lvl=20&where1="+r.PropertyAddress+"' target='_blank'>Bing Bird's Eye<\/a> | <a href='"+lakegis.urlPA+r[i]+"' target='_blank'>Property Appraiser<\/a> | <a href='"+lakegis.urlTax+r[i]+"' target='_blank'>Tax Collector<\/a> | <a href='"+lakegis.urlPermits+r[i]+"' target='_blank'>Building Permits<\/a> |  <a href='"+lakegis.urlFema+r.PropertyAddress+"' target='_blank'>FEMA Flood Map<\/a><\/div>"):u+="<div>"+i+": "+r[i]+"<\/div>");else{console.log("I am in a regular parcel");for(i in r)$.inArray(i,lakegis.configuration.fieldsNoDisplay)>-1||(i=="PlatBookType"?(h=r[i],h=="TOWN"&&(e=!0),u+="<div>Plat Book Type: "+r[i]+"<\/div>"):i=="PlatPage1"?e||(u+="<div>Plat Page 1: "+r[i]+"<\/div>"):i=="PlatPage2"?e||(u+="<div>Plat Page 2: "+r[i]+"<\/div>"):i=="BookNumber"?e||(u+="<div>Book Number: "+r[i]+"<\/div>"):i=="Units"?e||(u+="<div>Units: "+r[i]+"<\/div>"):i=="YearAdded"?r[i]>0&&(u+="<div>Year Added: "+r[i]+"<\/div>"):i=="Lots"?r[i]!==null&&r[i]>0&&(u+="<div>Lots: "+r[i]+"<\/div>"):i=="Units"?r[i]!==null&&r[i]>0&&(u+="<div>Units: "+r[i]+"<\/div>"):i=="ImagePath"?e==!1?(f=r[i],o=r[i],f.includes("www.lakecountyfl.gov")?o=f.replace("//www.lakecountyfl.gov","//c.lakecountyfl.gov"):f.includes("//lakecountyfl.gov")&&(o=f.replace("//lakecountyfl.gov","//c.lakecountyfl.gov")),u+="<div><a target='_blank' href='"+o+"'>View Document<\/a><\/div>"):u+="<div>Platbook Unrecorded<\/div>":i=="Annexation URL"?u+="<div><a target='_blank' href='"+r["Annexation URL"]+"'>View Document<\/a><\/div>":i=="AltKey"&&"FloodInfo"in r?u+="<div><h3>AltKey: "+r[i]+"<\/h3><\/div>":i=="FloodInfo"?u+="To request a copy of  FEMA documents the County may have on file such as Elevation Certificates or Letters of Map Change for structures built after April 1, 1982, please contact Lake County Public Works via email at flood@lakecountyfl.gov  or call 352-253-9081.  Please include the Alternate Key or Parcel ID number in your request.":i=="AltKey"&&"Parcel Number"in r?(u+="<div><h3>AltKey: "+r[i]+"<\/h3><\/div>",u+="<div><a href='http://maps.google.com/maps?q="+r.PropertyAddress+"' target='_blank'>Google Maps<\/a> | <a href='#' onclick='javascript:lakegis.identify.streetView("+t.x+", "+t.y+")'>Street View<\/a> | <a href='EagleView?address="+r.PropertyAddress+"' target='_blank'>EagleView<\/a> | <a href='http://www.bing.com/maps/default.aspx?style=b&lvl=20&where1="+r.PropertyAddress+"' target='_blank'>Bing Bird's Eye<\/a> | <a href='"+lakegis.urlPA+r[i]+"' target='_blank'>Property Appraiser<\/a> | <a href='"+lakegis.urlTax+r[i]+"' target='_blank'>Tax Collector<\/a> | <a href='"+lakegis.urlPermits+r[i]+"' target='_blank'>Building Permits<\/a> |  <a href='"+lakegis.urlFema+r.PropertyAddress+"' target='_blank'>FEMA Flood Map<\/a><\/div>"):i=="OwnerName"in r?console.log("OWNER Name FOUND"):u+="<div>"+i+": "+r[i]+"<\/div>")}return u},streetView:function(n,t){var f=function(n,t,r,u,e){console.log("trying to find a street view",n,t);var o=200,s=new google.maps.LatLng(i.y,i.x);r.getPanoramaByLocation(s,t,function(i,s){if(console.log(i),s===google.maps.StreetViewStatus.OK){console.log("successing streetview");u(i);return}if(t>=o){console.log("failing street view");e();return}console.log("calling street view again");f(n,t+50,r,u,e);return})},r,e,u,i;gsvc=new esri.tasks.GeometryService(lakegis.configuration.services.geometry);r=new esri.tasks.ProjectParameters;e=new esri.geometry.Point(n,t,new esri.SpatialReference({wkid:lakegis.spatialReference}));r.geometries=[e];r.outSR=new esri.SpatialReference({wkid:4326});gsvc.project(r,function(n){i=n[0];console.log("long: "+i.x);console.log("lat: "+i.y);var t=new google.maps.StreetViewService;f(i,50,t,function(n){console.log("success method from street view");$("#streetview-card h3").text("Street View");$("#pano").show();u=new google.maps.StreetViewPanorama(document.getElementById("pano"));var t=n.location.pano;console.log(t);u.setPano(t);u.setVisible(!0);$("#panoUrl").html("<a href='http://maps.google.com/maps?layer=c&cbp=0,,,,30&panoid="+t+"' target='_blank'>Open in Google Maps<\/a>");$("#streetview-card").show()},function(){console.log("fail method from street view");$("#streetview-card h3").text("Street View not available");$("#pano").hide();$("#panoUrl").html("");$("#streetview-card").show()})})},IPAView:function(n){ipa.gotoAddress({searchString:n});$("#ipaview-card").height($(window).height()-($("#navToolbar").height()+50));$("#ipaview-card").show()},layerTabContent:function(n,t){var i,r,u;if(n.features.length>0){i="";switch(t){case"Parcels":for(i="<i>Total features returned: "+n.features.length+"<\/i>",i+="<table border='1'><tr><th>ID<\/th><th>AltKey<\/th><th>Type<\/th><th>Status<\/th><\/tr>",r=0,u=n.features.length;r<u;r++)i+="<tr><td>"+n.features[r].attributes.OBJECTID+" <a href='#' onclick='showFeature(parcelResults.features["+r+"]); return false;'>(show)<\/a><\/td>",i+="<td>"+n.features[r].attributes.AltKey+"<\/td>",i+="<td>"+n.features[r].attributes.ParcelType+"<\/td>",i+="<td>"+n.features[r].attributes.ParcelStatus+"<\/td>";i+="<\/tr><\/table>";i+="<a href='#' onclick='map.infoWindow.maximize();'>view details<\/a>";break;case"Major Water Bodies":for(i="<i>Total features returned: "+n.features.length+"<\/i>",i+="<table border='1'><tr><th>ID<\/th><th>DisplayName<\/th><\/tr>",r=0,u=n.features.length;r<u;r++)i+="<tr><td>"+n.features[r].attributes.WaterBodyID+" <a href='#' onclick='showFeature(bldgResults.features["+r+"]); return false;'>(show)<\/a><\/td>",i+="<td>"+n.features[r].attributes.DisplayName+"<\/td>";i+="<\/tr><\/table>"}lakegis.identify.addTab(t,i)}}}});$.extend(!0,lakegis,{query:{attributes:"",taxParcelOutFields:["AltKey","ParcelType","ParcelNumber","OwnerName","OwnerAddress","OwnerCity","OwnerState","OwnerZip","PropertyAddress","SubdivisionName","YearBuilt","LandValue","BuildingValue","TotalJustValue","MiscValue","LastSalePrice","LastSaleDate","Millage","LastTaxAmount","LandUseDescription","PropertyClassDescription","Acres","NumberOfBuildings","Section","Township","Range","Subdivision","ComResStatus","Exemptions","LandUseCode","PropertyClassCode","PropertyName","DeedAcreage","NeighborhoodCode","PoolIndicator","TotalLivingArea"],setAttributes:function(n){lakegis.query.attributes=n},queryCommon:function(n,t,i,r,u){var e,o;i||(lakegis.lastTipNumber=0,lakegis.tipsViewModel.removeAll(),parcelsGraphicsLayer.clear());var h=0,s=new esri.tasks.QueryTask(lakegis.configuration.services.taxParcelQuery),f=new esri.tasks.Query;f.returnGeometry=!0;f.outFields=lakegis.query.taxParcelOutFields;f.outSpatialReference={wkid:lakegis.spatialReference};f.orderByFields=["OwnerName"];switch(n){case"altkey":f.where="AltKey ='"+t+"'";break;case"universal":console.log("universal case");t.indexOf(",")!=-1?(altkeyStr=t.replace(/ /g,""),altkeysArr=altkeyStr.split(","),f.where="AltKey IN ("+(altkeysArr.length?"'"+altkeysArr.join("','")+"'":"")+")"):f.where=t!=""?"OwnerName LIKE '"+t+"%' OR AltKey ='"+t+"' Or ParcelNumber = '"+t+"'":"1=2";break;default:f.geometry=r}console.log(f.where);e=new esri.InfoTemplate;e.setTitle("${AltKey}");o=new esri.InfoTemplate;o.setTitle("${AltKey}");console.log("setting up Information Templates");o.setContent("<strong>Altkey: ${AltKey}<\/strong><br/><strong>${PropertyAddress}<\/strong><br/>Parcel Number: ${ParcelNumber}<br/>Parcel Type: ${ParcelType}<br/>Subdivision: ${SubdivisionName}<br/>Year Built: ${YearBuilt}<br/>Land Value: $${LandValue:NumberFormat}<br/>Building Value: $${BuildingValue:NumberFormat}<br/>Misc Value: $${MiscValue:NumberFormat}<br/>Total Just Value: $${TotalJustValue:NumberFormat}<br/>Millage: ${Millage}<br/>Last Tax Amount: $${LastTaxAmount:NumberFormat}<br/>Land Use: ${LandUseDescription}<br/>Property Class Description: ${PropertyClassDescription}<br/>Acres: ${Acres}");e.setContent("<strong>Altkey: ${AltKey}<\/strong><br/><strong>${PropertyAddress}<\/strong><br/>Owner: ${OwnerName}<br/>Owner Address: ${OwnerAddress}, ${OwnerCity}, ${OwnerState} ${OwnerZip}<br/>Parcel Number: ${ParcelNumber}<br/>Parcel Type: ${ParcelType}<br/>Subdivision: ${SubdivisionName}<br/>Year Built: ${YearBuilt}<br/>Land Value: $${LandValue:NumberFormat}<br/>Building Value: $${BuildingValue:NumberFormat}<br/>Misc Value: $${MiscValue:NumberFormat}<br/>Total Just Value: $${TotalJustValue:NumberFormat}<br/>Last Sale Price: $${LastSalePrice:NumberFormat}<br/>Last Sale Date: ${LastSaleDate:DateFormat(selector: 'date', fullYear: true)}<br/>Millage: ${Millage}<br/>Last Tax Amount: $${LastTaxAmount:NumberFormat}<br/>Land Use: ${LandUseDescription}<br/>Property Class Description: ${PropertyClassDescription}<br/>Acres: ${Acres}");dojo.connect(s,"onComplete",function(t){var s,v,c,i,y,r,l,a,p,f;if(queryFeatureSet=t,map.graphics.clear(),s="",t.features.length==0?(console.log("no query results found"),$("#query-noresults").fadeIn()):($("#query-noresults").hide(),lakegis.panels.openPanelState!=0&&lakegis.panels.left.open()),v=t.features||[],c=esri.graphicsExtent(v),n=="select"&&$("#selectBuffer").prop("checked"))lakegis.buffer.geo=c,lakegis.buffer.doBufferFromSelection();else for(i=0,y=t.features.length;i<y;i++){h+=1;lakegis.lastTipNumber+=1;r=t.features[i].attributes;for(att in r)s=s+"<b>"+att+":<\/b>  "+r[att]+"<br />";s+="<p><a href='#' onclick='showFeature(queryFeatureSet.features["+i+"]); return false;'>(show)<\/a><\/p><br/>";l=r.AltKey;a=new lakegis.models.TaxParcel({fields:r,infoTemplate:e,title:l,point:t.features[i].geometry.getExtent().getCenter(),geo:t.features[i].geometry});r.OwnerName=="Not for public record"&&(a=new lakegis.models.TaxParcel({fields:r,infoTemplate:o,title:l,point:t.features[i].geometry.getExtent().getCenter(),geo:t.features[i].geometry}));p=new lakegis.models.Tip({number:lakegis.lastTipNumber,feature:a});lakegis.tipsViewModel.addTip(p,tipLayer,r);f=t.features[i];f.setSymbol(lakegis.configuration.symbols.selection);r.OwnerName=="Not for public record"?f.setInfoTemplate(o):f.setInfoTemplate(e);parcelsGraphicsLayer.add(f)}u&&lakegis.query.zoomToResults(c)});s.execute(f)},zoomToResults:function(n){if(!n&&features.length==1){var t=features[0];n=new esri.geometry.Extent(t.x-1,t.y-1,t.x+1,t.y+1,t.SpatialReference)}n&&map.setExtent(n,!0)}}});$.extend(!0,lakegis,{buffer:{bufferEvent:undefined,geo:undefined,zoomToResults:!1,clicked:function(){$("#buffer-card").slideToggle("fast");map.setCursor("pointer");lakegis.identify.off();lakegis.select.clear();(lakegis.buffer.bufferEvent===undefined||lakegis.buffer.bufferEvent.advice==null)&&(lakegis.buffer.bufferEvent=dojo.connect(map,"onClick",lakegis.buffer.doBuffer))},searchResultsClicked:function(){$("#buffer-card").slideToggle("fast");$("#phBufferButton").show();lakegis.identify.off()},off:function(n){dojo.disconnect(lakegis.buffer.bufferEvent);map.setCursor("default");n&&bufferResultsLayer.clear()},doBuffer:function(n){if(console.log("doBuffer running"),console.log("event prototype toString: "+Object.prototype.toString.call(n).slice(8,-1)),Object.prototype.toString.call(n).slice(8,-1)!="MouseEvent"){console.log("running buffer code!");var i=n.mapPoint,t=new esri.tasks.BufferParameters;t.distances=[$("#bufferDistance").val()];t.bufferSpatialReference=new esri.SpatialReference({wkid:lakegis.spatialReference});t.outSpatialReference=map.spatialReference;t.unit=esri.tasks.GeometryService.UNIT_FOOT;t.geometries=[i];lakegis.buffer.zoomToResults=!1;esri.config.defaults.geometryService.buffer(t,lakegis.buffer.showBuffer)}},doBufferPolygon:function(){console.log("doBufferPolygon with running");var n=new esri.tasks.BufferParameters;n.distances=[$("#bufferDistance").val()];n.bufferSpatialReference=new esri.SpatialReference({wkid:lakegis.spatialReference});n.outSpatialReference=map.spatialReference;n.unit=esri.tasks.GeometryService.UNIT_FOOT;n.geometries=[lakegis.buffer.geo];lakegis.buffer.zoomToResults=!0;esri.config.defaults.geometryService.buffer(n,lakegis.buffer.showBuffer)},doBufferFromSelection:function(){console.log("doBufferFromSelection with running");var n=new esri.tasks.BufferParameters;n.distances=[$("#selectBufferDistance").val()];n.bufferSpatialReference=new esri.SpatialReference({wkid:lakegis.spatialReference});n.outSpatialReference=map.spatialReference;n.unit=esri.tasks.GeometryService.UNIT_FOOT;n.geometries=[lakegis.buffer.geo];lakegis.buffer.zoomToResults=!0;esri.config.defaults.geometryService.buffer(n,lakegis.buffer.showBuffer)},showBuffer:function(n){console.log("showbuffer running");map.graphics.clear();bufferResultsLayer.clear();lakegis.tipsViewModel.tips.removeAll();tipLayer.clear();var t=n[0],i=new esri.Graphic(t,lakegis.configuration.symbols.buffer);bufferResultsLayer.add(i);lakegis.query.queryCommon("buffer","",!1,t,lakegis.buffer.zoomToResults)}}});initialData=[{name:"Well-Travelled Kitten",sales:352,price:75.95},{name:"Speedy Coyote",sales:89,price:190},{name:"Furious Lizard",sales:152,price:25},{name:"Indifferent Monkey",sales:1,price:99.95},{name:"Brooding Dragon",sales:0,price:6350},{name:"Ingenious Tadpole",sales:39450,price:.35},{name:"Optimistic Snail",sales:420,price:1.5}];PagedGridModel=function(n){this.items=ko.observableArray(n);this.addItem=function(){this.items.push({name:"New item",sales:0,price:100})};this.sortByName=function(){this.items.sort(function(n,t){return n.name<t.name?-1:1})};this.jumpToFirstPage=function(){this.gridViewModel.currentPageIndex(0)};this.gridViewModel=new ko.simpleGrid.viewModel({data:this.items,columns:[{headerText:"Item Name",rowText:"name"},{headerText:"Sales Count",rowText:"sales"},{headerText:"Price",rowText:function(n){return"$"+n.price.toFixed(2)}}],pageSize:4})};$.extend(!0,lakegis,{share:{clicked:function(){$("#share-card").slideToggle("fast");$("#shareurl").select();$("#sharesuccess").hide()},updateUrl:function(){lakegis.queryParams.x==null?$("#shareurl").val("http://"+appUrl):$("#shareurl").val("http://"+appUrl+"/?x="+lakegis.queryParams.x+"&y="+lakegis.queryParams.y+"&l="+lakegis.queryParams.level+(lakegis.queryParams.query?"&query="+lakegis.queryParams.query:""));$("#shareurl").select()}}});$.extend(!0,lakegis,{select:{selectEvent:undefined,selectionToolbar:undefined,selectQuery:undefined,clicked:function(){console.log("select.clicked");$("#select-card").slideDown("fast");lakegis.buffer.off(!0);lakegis.identify.off();lakegis.select.activate($("#select-tool").val())},activate:function(n){lakegis.activeTool=="zoom"&&lakegis.map.zoomOff();switch(n){case"EXTENT":lakegis.select.selectionToolbar.activate(esri.toolbars.Draw.EXTENT);break;case"POINT":lakegis.select.selectionToolbar.activate(esri.toolbars.Draw.POINT);break;case"FREEHAND_POLYLINE":lakegis.select.selectionToolbar.activate(esri.toolbars.Draw.FREEHAND_POLYLINE);break;default:lakegis.select.selectionToolbar.activate(esri.toolbars.Draw.EXTENT)}},clear:function(){lakegis.select.off();lakegis.lastTipNumber=0;parcelsGraphicsLayer.clear();lakegis.tipsViewModel.removeAll()},off:function(){lakegis.select.selectionToolbar.deactivate();$("#select-card").hide()},doSelect:function(n,t){if(n.geometry||(n.geometry=t),Object.prototype.toString.call(n).slice(8,-1)!="MouseEvent"){$("#selectionActive").prop("checked")||lakegis.select.off();layers=map.getLayersVisibleAtScale(map.getScale());var i=layers.find(function(n){return n.url==="https://gis.lakecountyfl.gov/lakegis/rest/services/InteractiveMap/MapServer"});!i||map.getScale()>18001?guiders.show("selectionError"):lakegis.query.queryCommon("select","",$("#addToSelection").prop("checked"),n.geometry,!1)}}}});$.extend(!0,lakegis,{guiders:{disableWelcome:function(){console.log("disable welcome");$.cookie("gisWelcome",!0,{expires:365,path:"/"});guiders.hideAll()},handleLegalAgreement:function(){!$.cookie("gisWelcome")!=!0||IsMobile()?guiders.hideAll():guiders.next()},create:function(){guiders.createGuider({id:"legal",title:"Disclaimer",description:"Data is provided 'as is' without any warranty or any representation of accuracy, timeliness, or completeness. The burden of determining accuracy, completeness, timeliness, merchantability, and fitness for or the appropriateness for use rests solely on the requestor. Lake County makes no warranties, express or implied, as to the use of the data. There are no implied warranties of merchantability or fitness for a particular purpose. The requestor acknowledges and accepts the limits of the data, including the fact that the data is dynamic and is in a constant state of maintenance, correction, and update.",buttons:[{name:"I Agree",onclick:lakegis.guiders.handleLegalAgreement}],next:"welcome",overlay:!0,closeOnEscape:!1});guiders.createGuider({description:"Loading, please wait.",id:"loadingLayer",overlay:!0,title:"Loading Data please wait"});guiders.createGuider({buttons:[{name:"Continue to Walkthrough",onclick:guiders.next},{name:"Close and do not show again",onclick:lakegis.guiders.disableWelcome}],description:"We have developed a walkthrough to help you get up to speed on the features of the map. You can access this walkthrough by clicking the button below. You can also access it by clicking the Help button at any time. <p>We would love to hear your feedback on the site. Click the <a href='https://lakecountyfl.gov/contact' target='blank'>Feedback button<\/a> at anytime to drop us a note. You can tell us things you like or dislike about the new site, which will help us improve the site.",id:"welcome",next:"first",overlay:!0,title:"Welcome to the GIS Interactive Map"});guiders.createGuider({buttons:[{name:"End Walkthough",onclick:guiders.hideAll},{name:"Next"}],description:"This walkthrough will guide you through all of the new features of the Lake County Interactive Map. <p>In addition to this walkthrough, there is a video you can watch that will show you the new features of this site. <a href='http://youtu.be/yfKZCwD6UnA' target='_blank'>Watch video<\/a><\/p> <p>For questions about the map <a href='https://lakecountyfl.gov/contact' target='blank'>use our online form<\/a> (select Information Technology) or call Enterprise Support division at (352) 343-9796.<\/p> ",id:"first",next:"second",overlay:!0,title:"Welcome to the GIS Interactive Map"});guiders.createGuider({attachTo:"#searchDiv",position:5,highlight:"#searchDiv",buttons:[{name:"End Walkthough",onclick:guiders.hideAll},{name:"Back"},{name:"Next"}],description:"The search box now accepts an address, owner name or altkey",id:"second",next:"third",overlay:!0,title:"Single Search and Autocomplete"});guiders.createGuider({attachTo:"#searchDiv",position:3,highlight:"#searchDiv",buttons:[{name:"End Walkthough",onclick:guiders.hideAll},{name:"Back"},{name:"Next"}],description:"When entering an owner name the search box will give you suggestions right away based on what you typed. ",id:"third",next:"fourth",overlay:!0,title:"Autocomplete",offset:{left:-40,top:60},onShow:function(){$("#uSearch").val("lake county bcc");$("#uSearch").autocomplete("search","ross e");$(".ui-autocomplete").css("z-index","900003")},onHide:function(){$("#uSearch").val("");$("#uSearch").autocomplete("close")}});guiders.createGuider({attachTo:"#mapDiv",highlight:"#mapDiv",buttons:[{name:"End Walkthough",onclick:guiders.hideAll},{name:"Back"},{name:"Next"}],description:"The map is now much larger and will adjust its sized based on your browser window.",id:"fourth",next:"fifth",overlay:!0,title:"Bigger Map Screen"});guiders.createGuider({attachTo:"#cbPrint",position:6,highlight:"#left",buttons:[{name:"End Walkthough",onclick:guiders.hideAll},{name:"Back"},{name:"Next"}],description:"The print button will open the print card which has several options for printing or exporting the map contents.",id:"fifth",next:"sixth",overlay:!0,title:"Print",onShow:function(){closeCards();print();$("#print-card").css("z-index","900003")},onHide:function(){}});guiders.createGuider({attachTo:"#print-card",position:3,highlight:"#print-card",buttons:[{name:"End Walkthough",onclick:guiders.hideAll},{name:"Back"},{name:"Next"}],description:"Printing options include format, resolution, template and title. The title field allows you to specify a title that will be printed on the top of the template. If you choose Map only as the template the title will not be displayed.  ",id:"sixth",next:"seventh",overlay:!0,title:"Print",offset:{left:0,top:75},onShow:function(){},onHide:function(){closeCards();$("#cbPrint").removeClass("guiders_highlight")}});guiders.createGuider({attachTo:"#views",position:9,highlight:"#right",buttons:[{name:"End Walkthough",onclick:guiders.hideAll},{name:"Back"},{name:"Next"}],description:"The Views option allows you to pick from several pre-defined views of the layers. Click one of the links and watch how the layers displayed in the map automatically change. ",id:"seventh",next:"eighth",overlay:!0,title:"Views",onShow:function(){$("#right").css("z-index","900003")}});guiders.createGuider({attachTo:"#tocDiv",position:9,highlight:"#right",buttons:[{name:"End Walkthough",onclick:guiders.hideAll},{name:"Back"},{name:"Next"}],description:"The layers control which features are currently visible on the map. You can turn layers on and off by checking the box next to the name.",id:"eighth",next:"ninth",overlay:!0,title:"Layers"});guiders.createGuider({attachTo:"#tocDiv",highlight:"#mapDiv",position:9,buttons:[{name:"End Walkthough",onclick:guiders.hideAll},{name:"Back"},{name:"Next"}],description:"Each layer has a visibility slider which can be used to change the transparency of the layer. Dragging the slider to the left will make the layer less visible.<p>This gives you the ability to see the differences between two aerial images. Turn two of the aerials on and then drag the slider of the top aerial to the left. This will show you the visible changes between the different imagery.",id:"ninth",next:"tenth",overlay:!0,title:"Layer Visibility",onShow:function(){$("#mapDiv").css("z-index","800002")},onHide:function(){$("#right").css("z-index","3");$("#mapDiv").css("z-index","auto")}});guiders.createGuider({highlight:"#mapDiv",buttons:[{name:"End Walkthrough",onclick:guiders.hideAll},{name:"Back"}],description:"More help windows coming soon.",id:"tenth",overlay:!0,title:"More help coming soon"});guiders.createGuider({highlight:"#mapDiv",buttons:[{name:"Turn Parcels On and Try Again",onclick:lakegis.map.turnParcelsOnAndZoom},{name:"Cancel",onclick:guiders.hideAll}],description:"The Tax Parcel layer is not currently visible. In order to make a selection, the Tax Parcel layer must be visible. Press the button below to turn the Tax Parcels on and try again. ",id:"selectionError",overlay:!0,title:"Tax Parcels Not Visible",xButton:!0});guiders.createGuider({highlight:"#mapDiv",buttons:[{name:"Cancel",onclick:guiders.hideAll}],description:"An error has occurred.",id:"mapServiceError",overlay:!0,title:"Map Service Unavailable",xButton:!0});guiders.createGuider({highlight:"#mapDiv",buttons:[{name:"Zoom in Further",onclick:lakegis.map.turnParcelsOnAndZoom},{name:"Cancel",onclick:guiders.hideAll}],description:"You must zoom in further in order to view the sales layer information. ",id:"salesError",overlay:!0,title:"Tax Parcels Not Visible",xButton:!0})}}});$.extend(!0,lakegis,{panels:{openPanelState:1,setDefaultState:function(){$.cookie("gisLeftPanel")=="1"&&lakegis.panels.left.open();$.cookie("gisRightPanel")=="0"&&lakegis.panels.right.close();$.cookie("gisOpenPanel")=="0"&&(lakegis.panels.openPanelState=0,$("#cbOpenPanel").prop("checked",!1),$("#cbOpenPanel").button("refresh"),$("#cbOpenPanel").button("option","icons",{primary:"ui-icon-circle-close"}))},createCookies:function(){console.log("createCookies");$.cookie("gisLeftPanel")||$.cookie("gisRightPanel")||($.cookie("gisLeftPanel",0,{path:"/",expires:365}),$.cookie("gisRightPanel",1,{path:"/",expires:365}));$.cookie("gisOpenPanel")||$.cookie("gisOpenPanel",1,{path:"/",expires:365})},right:{close:function(){lakegis.$arrowRight.hasClass("arrow-right")&&lakegis.$arrowRight.trigger("click")},click:function(){var n=lakegis.$right.outerWidth();lakegis.$right.animate({right:parseInt(lakegis.$right.css("right"),10)==0?-n+20:0});lakegis.$arrowRight.hasClass("arrow-right")?(lakegis.$arrowRight.removeClass("arrow-right").addClass("arrow-left"),$.cookie("gisRightPanel",0,{path:"/"})):lakegis.$arrowRight.hasClass("arrow-left")&&(lakegis.$arrowRight.removeClass("arrow-left").addClass("arrow-right"),$.cookie("gisRightPanel",1,{path:"/"}))}},left:{open:function(){lakegis.$arrowLeft.hasClass("arrow-right")&&lakegis.$arrowLeft.trigger("click")},alignScroller:function(){$("#mapDiv_zoom_slider").length&&$.cookie("gisLeftPanel")=="1"&&$("#mapDiv_zoom_slider").animate({left:parseInt($("#mapDiv_zoom_slider").css("left"),10)==40?lakegis.$left.outerWidth()+20:40})},click:function(){lakegis.$left.animate({left:parseInt(lakegis.$left.css("left"),10)==0?-lakegis.$left.outerWidth()+20:0});$("#mapDiv_zoom_slider").length?$("#mapDiv_zoom_slider").animate({left:parseInt($("#mapDiv_zoom_slider").css("left"),10)==40?lakegis.$left.outerWidth()+20:40}):setTimeout(function(){lakegis.panels.left.alignScroller()},750);lakegis.$scaleBar.animate({left:parseInt(lakegis.$scaleBar.css("left"),10)==40?lakegis.$left.outerWidth()+20:40});lakegis.$arrowLeft.hasClass("arrow-right")?(lakegis.$arrowLeft.attr("title","Click to hide panel"),lakegis.$arrowLeft.removeClass("arrow-right").addClass("arrow-left"),$.cookie("gisLeftPanel",1,{path:"/"})):lakegis.$arrowLeft.hasClass("arrow-left")&&(lakegis.$arrowLeft.attr("title","Click to show panel"),lakegis.$arrowLeft.removeClass("arrow-left").addClass("arrow-right"),$.cookie("gisLeftPanel",0,{path:"/"}))}}}});$.extend(!0,lakegis,{layers:{aerial2022:undefined,aerial2019:undefined,aerial2017:undefined,aerial2014:undefined,aerial2011:undefined,aerial2009:undefined,aerial2008:undefined,aerial2006:undefined,aerial2004:undefined,contours:undefined,terrain:undefined,create:function(){console.log("lakegis.layers.create");lakegis.layers.dynamic=new esri.layers.ArcGISDynamicMapServiceLayer(lakegis.configuration.services.dynamic,{id:"dynamic"});lakegis.layers.dynamic.on("update-end",lakegis.layers.dynamicLayerUpdateEnd);lakegis.layers.dynamic.on("load",lakegis.layers.dynamicLayerLoad);lakegis.layers.dynamic.on("update-start",lakegis.layers.dynamicLayerUpdateStart);lakegis.layers.aerial2022=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.aerial2022,{id:"2022",visible:!0});lakegis.layers.aerial2019=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.aerial2019,{id:"2019",visible:!1});lakegis.layers.aerial2017=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.aerial2017,{id:"2017",visible:!1});lakegis.layers.aerial2014=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.aerial2014,{id:"2014",visible:!1});lakegis.layers.aerial2011=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.aerial2011,{id:"2011",visible:!1});lakegis.layers.aerial2006=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.aerial2006,{id:"2006",visible:!1});lakegis.layers.aerial2008=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.aerial2008,{id:"2008",visible:!1});lakegis.layers.aerial2009=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.aerial2009,{id:"2009",visible:!1});lakegis.layers.aerial2004=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.aerial2004,{id:"2004",visible:!1});lakegis.layers.contours=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.contours,{id:"Contours",visible:!1});lakegis.layers.terrain=new esri.layers.ArcGISTiledMapServiceLayer(lakegis.configuration.services.terrain,{id:"Terrain",visible:!1})},changeBasemap:function(n){switch(n){case 0:lakegis.layers.dynamic.setVisibleLayers(lakegis.layers.dynamic._defaultVisibleLayers);lakegis.layers.dynamic.setDefaultVisibleLayers();lakegis.layers.aerial2022.show();break;case 1:lakegis.layers.dynamic.setVisibleLayers([27,33,34,35]);break;case 2:lakegis.layers.dynamic.setVisibleLayers([27,50]);break;case 3:lakegis.layers.aerial2022.hide();lakegis.layers.aerial2019.hide();lakegis.layers.aerial2017.hide();lakegis.layers.aerial2014.hide();lakegis.layers.aerial2011.hide();lakegis.layers.aerial2008.hide();lakegis.layers.aerial2009.hide();lakegis.layers.aerial2006.hide();lakegis.layers.aerial2004.hide();break;default:lakegis.layers.dynamic.setDefaultVisibleLayers();lakegis.layers.dynamic.setDefaultVisibleLayers()}},dynamicLayerLoad:function(){$.cookie("gisVisibleLayers3")?lakegis.layers.dynamic.setVisibleLayers(JSON.parse("["+$.cookie("gisVisibleLayers3")+"]")):$.cookie("gisVisibleLayers3",lakegis.layers.setVisibleLayersForCookie(lakegis.layers.dynamic.visibleLayers),{path:"/",expires:365})},dynamicLayerUpdateStart:function(){},dynamicLayerUpdateEnd:function(){$.cookie("gisVisibleLayers3",lakegis.layers.setVisibleLayersForCookie(lakegis.layers.dynamic.visibleLayers),{path:"/",expires:365})},setVisibleLayersForCookie:function(n){return n.remove(0),n.remove(7),n.remove(28),n.remove(32),n.remove(39),n.remove(51),n.remove(61),n}}});$.extend(!0,lakegis,{Sale:function(n,t,i,r,u,f,e,o,s,h,c,l,a){this.Price=n;this.Date=new Date(t);this.AltKey=i;this.YearBuilt=r;this.HeatedArea=u;this.Beds=f;this.HalfBaths=e;this.FullBaths=o;this.Pool=s;this.Fireplace=h;this.Address=c;this.Book=l;this.Page=a},sales:{labelList:[],searchParams:{minSalePrice:100,maxSalePrice:undefined,years:[],startDate:undefined,endDate:undefined,houseSize:undefined},minScale:24e3,active:!1,clicked:function(){console.log("sales.clicked");$("#sales-card").slideDown("fast");lakegis.sales.active=!0;lakegis.buffer.off(!0);lakegis.identify.off();lakegis.map.zoomOff()},off:function(){salesLayer.suspend();map.graphics.clear();lakegis.sales.labelList=[];$("#sales-card").hide()},getTextContent:function(n){console.log("getTextContent called");console.log(n.attributes);var i,t=new lakegis.Sale(n.attributes.SalePrice,n.attributes.SaleDate,n.attributes.AltKey,n.attributes.YearBuilt,n.attributes.HeatedArea,n.attributes.Beds,n.attributes.HalfBaths,n.attributes.FullBaths,n.attributes.Pool,n.attributes.Fireplace,n.attributes.PhysicalStreetAddress,n.attributes.ORBook,n.attributes.ORPage);return console.log(t),i='<table class="salesTable">',i+="<tr><td>Address: <\/td><td>"+t.Address+"<\/td><\/tr>",i+="<tr><td>AltKey: <\/td><td>"+t.AltKey+"<\/td><\/tr>",i+="<tr><td>Sale Date: <\/td><td>"+lakegis.utils.convertToUserFriendlyDate(t.Date)+"<\/td><\/tr>",i+="<tr><td>Sale Price: <\/td><td>"+numberWithCommas(t.Price).addDollarSign(),+ '</td></tr>',i+="<tr><td>Year Built: <\/td><td>"+t.YearBuilt+"<\/td><\/tr>",i+="<tr><td>Heated SqFt: <\/td><td>"+t.HeatedArea+"<\/td><\/tr>",i+="<tr><td>Beds: <\/td><td>"+t.Beds+"<\/td><\/tr>",i+="<tr><td>Half Baths: <\/td><td>"+t.HalfBaths+"<\/td><\/tr>",i+="<tr><td>Full Baths: <\/td><td>"+t.FullBaths+"<\/td><\/tr>",i+="<tr><td>Pool: <\/td><td>"+t.Pool+"<\/td><\/tr>",i+="<tr><td>Fireplace: <\/td><td>"+t.Fireplace+"<\/td><\/tr>",i+='<tr><td colspan="2"><a href="'+lakegis.urlSaleRecord+t.Book+"/"+t.Page+'" target="_blank">Sale Record<\/a> | <a href="'+lakegis.urlPA+t.AltKey+'" target="_blank">Property Record Card<\/a><\/td><\/tr>',i+"<\/table>"},checkScaleLevel:function(){lakegis.sales.active==!0&&map.getScale()>lakegis.sales.minScale&&console.log("sales info will not be updated")},start:function(){var n,r,u,t,i;console.log("start");n=new esri.InfoTemplate("${SalePrice}","${Date:DateFormat(selector: 'date', fullYear: true)}:  ${SalePrice:NumberFormat}");n=new esri.InfoTemplate;n.setTitle("${SalePrice}");n.setContent("test");n.setContent(lakegis.sales.getTextContent);salesLayer=new esri.layers.FeatureLayer(lakegis.configuration.services.sales,{mode:esri.layers.FeatureLayer.MODE_ONDEMAND,outFields:["*"],infoTemplate:n});salesLayer.setDefinitionExpression("SaleDate >='1/1/2020'");r=new esri.symbol.PictureMarkerSymbol("/"+appDirectory+"/Content/images/house_icon_purple_small.png",31,44);u=new esri.renderer.SimpleRenderer(r);salesLayer.minScale=lakegis.sales.minScale;t=(new esri.symbol.TextSymbol).setColor(new dojo.Color("white"));t.font.setSize("8pt");t.font.setWeight(esri.symbol.Font.WEIGHT_BOLD);t.font.setFamily(lakegis.configuration.tipFont);t.setOffset(0,-15);salesLabelRenderer=new esri.renderer.SimpleRenderer(t);i=new esri.layers.LabelLayer({id:"labels"});i.addFeatureLayer(salesLayer,salesLabelRenderer,"${SalePrice:lakegis.sales.setPriceLabel}");map.addLayer(salesLayer);map.addLayer(i)},start:function(n,t,i,r,u){if(console.log("start newest: "+i+", "+r),$("#salesSelectYear").hide(),lakegis.sales.searchParams.years=[],lakegis.sales.searchParams.startDate=n,lakegis.sales.searchParams.endDate=t,lakegis.sales.searchParams.minSalePrice=i,lakegis.sales.searchParams.maxSalePrice=r,lakegis.sales.searchParams.houseSize=u,console.log(lakegis.sales.searchParams),lakegis.sales.searchParams.startDate!=""&&lakegis.sales.searchParams.endDate!=""){if(salesLayer===undefined){console.log("creating salesLayer");salesLayer=new esri.layers.FeatureLayer(lakegis.configuration.services.sales,{mode:esri.layers.FeatureLayer.MODE_ONDEMAND,outFields:["*"]});salesLayer.on("update-start",function(){console.log("update starting");$("#salesUpdating").show();$("#salesUpdateBtn").hide()});salesLayer.on("update-end",function(n){var i,t;for(console.log("salesLayer.update-end"),console.log(n.target),$("#salesUpdating").hide(),$("#salesUpdateBtn").show(),i=0;i<n.target.graphics.length;i++)t=n.target.graphics[i],console.log(t),lakegis.sales.labelList.indexOf(t.attributes.ObjectID)==-1?(lakegis.sales.labelList.push(t.attributes.ObjectID),addLabelToGeometry(t.attributes.SalePrice,t.geometry,t.attributes)):console.log("not adding label")});map.addLayer(salesLayer)}var f="1=1 ";lakegis.sales.searchParams.minSalePrice>0&&(f+="AND SalePrice >= "+lakegis.sales.searchParams.minSalePrice+" ");lakegis.sales.searchParams.maxSalePrice>0&&(f+="AND SalePrice <= "+lakegis.sales.searchParams.maxSalePrice+" ");f+="AND ( SaleDate BETWEEN '"+lakegis.sales.searchParams.startDate+"' AND '"+lakegis.sales.searchParams.endDate+"') ";lakegis.sales.searchParams.houseSize&&(f+="AND ( HeatedArea >= "+lakegis.sales.searchParams.houseSize+") ");salesLayer.resume();salesLayer.setDefinitionExpression(f);console.log("got here");salesLayer.clear();map.graphics.clear();lakegis.sales.labelList=[];salesLayer.refresh();salesLayer.minScale=24e3}else $("#salesSelectYear").show()},setPriceLabel:function(n){return n<1e3?n.toFixed(0):n<1e6?(n/1e3).toFixed(0)+"k":(n/1e6).toFixed(1)+"m"}}});$.extend(!0,lakegis,{measure:{measurementInstance:null,openTool:function(){lakegis.measure.measurementInstance||(lakegis.measure.measurementInstance=new esri.dijit.Measurement({map:map,defaultLengthUnit:esri.Units.FEET},dojo.byId("measurementDiv")));lakegis.measure.measurementInstance.startup();lakegis.measure.measurementInstance.setTool("distance",!0);$("#measure-card").slideToggle("fast");lakegis.$measureBox.show();lakegis.identify.off();lakegis.map.queryOff();lakegis.buffer.off();lakegis.measure.measurementInstance.on("measure-start",lakegis.measure.eventHandlers.measureStart)},resetTool:function(){if(!lakegis.measure.measurementInstance)return!1;var n=lakegis.measure.measurementInstance.activeTool;if(lakegis.measure.measurementInstance.clearResult(),!n||n=="location")return!1;lakegis.measure.measurementInstance.setTool("distance",!1);lakegis.measure.measurementInstance.setTool("area",!1);$("#measurementRunningTotal").empty();lakegis.measure.measurementInstance.setTool(n,!0);lakegis.measure.clearMapEventListeners()},clearMapEventListeners:function(){lakegis.measure.mapEventHolder.forEach(function(n){n.remove()})},mapEventHolder:[],eventHandlers:{mapMouseMove:function(n){var r,t,u,i=lakegis.measure.measurementInstance.activeTool;i=="area"?(r=lakegis.measure.measurementInstance._areaUnitStrings[lakegis.measure.measurementInstance._areaUnitStringsLong.indexOf(lakegis.measure.measurementInstance.currentAreaUnit)],t=["acres","square-miles","square-kilometers","hectares","square-yards","square-feet","square-feet","square-meters"][lakegis.measure.measurementInstance._areaUnitStringsLong.indexOf(lakegis.measure.measurementInstance.currentAreaUnit)]):i=="distance"&&(r=lakegis.measure.measurementInstance._distanceUnitStrings[lakegis.measure.measurementInstance._distanceUnitStringsLong.indexOf(lakegis.measure.measurementInstance.currentDistanceUnit)],t=["miles","kilometers","feet","feet","meters","yards","nautical-miles"][lakegis.measure.measurementInstance._distanceUnitStringsLong.indexOf(lakegis.measure.measurementInstance.currentDistanceUnit)]);i=="area"?u=lakegis.measure.calculateAreaMeasurement(n.mapPoint,lakegis.spatialReference,t,globalEsriGeometryEngine):i=="distance"&&(u=lakegis.measure.calculateDistanceMeasurement(n.mapPoint,lakegis.spatialReference,t,globalEsriGeometryEngine));lakegis.measure.displayDynamicCalculation(u,r)},measureStart:function(){var n=map.on("mouse-move",lakegis.measure.eventHandlers.mapMouseMove);lakegis.measure.mapEventHolder.push(n)},measureToolChange:function(){$("#measurementRunningTotal").empty();lakegis.measure.clearMapEventListeners()}},getInputPoints:function(n){for(var i=[],t=0;t<n.length;t++)i.push(n[t]);return i},calculateAreaMeasurement:function(n,t,i,r){var u=esri.geometry.Point(n.x,n.y,t),e=this.getInputPoints(this.measurementInstance._inputPoints),o=[].concat([u],e,[u]),f=esri.geometry.Polygon(esri.SpatialReference({wkid:t}));return f.addRing(o),r.planarArea(f,i)},calculateDistanceMeasurement:function(n,t,i,r){var f=esri.geometry.Point(n.x,n.y,t),e=this.getInputPoints(lakegis.measure.measurementInstance._inputPoints),u=esri.geometry.Polyline(esri.SpatialReference({wkid:t}));return u.addPath([].concat(e,f)),r.planarLength(u,i)},displayDynamicCalculation:function(n,t){var i=10,r;["Miles","Kilometers","Sq Kilometers","Sq Miles","Nautical Miles","Acres"].indexOf(t)>-1&&(i=100);r=Math.abs(Math.round(n*i)/i).toLocaleString();$("#measurementRunningTotal").html(r+" "+t)}}})