window.jQuery&&function(o,C){var p=this;if(p.VEMap){p.LNVEOpt={};p.LNVEInit=function(n){return o.extend(n,p.LNVEOpt)};VEMap.prototype.SetAnimationEnabled=function(n){this.vemapcontrol&&this.vemapcontrol.SetAnimationEnabled(n)};p.VEShape.prototype.Redraw=function(n,h,z,q,b){if(this.GetVisibility()&&this._shplayer&&this._shplayer._mapGuid&&this._shplayer.GetVisibility()){var d=GetVEMapInstance(this._shplayer._mapGuid);if(d!==null)if(d.GetMapMode()===Msn.VE.MapActionMode.Mode3D||!this._isDrawn)this.Show();
else{n&&d.m_vegraphicsmanager.UpdatePoints(this,true);h&&d.m_vegraphicsmanager.UpdateIconPoints(this);if(z)if(!this._isDrawn||this.Primitives[0].type!==VEShapeType.Pushpin)d.m_vegraphicsmanager.UpdateStyle(this);else $ID(this.Primitives[0].iid).style.zIndex=this.Primitives[0].symbol.style_zIndex;q&&d.m_vegraphicsmanager.UpdateIconStyle(this);if(b)this.GetIconVisibility()?d.m_vegraphicsmanager.ShowIcon(this):d.m_vegraphicsmanager.HideIcon(this)}}};o.lnmap=function(n){var h=o.extend({useiFrame:false,
zoomToCenter:false,mapMode:VEMapMode.Mode2D,disableObliqueNotification:false,mapOptions:null,tileBuffer:0,dashboardSize:null,showOnClick:true,mapStyle:VEMapStyle.Shaded,showSwitch:false,mapFixed:false,latitude:38.54816542304656,longitude:-98.4375,zoomlevel:4,pinOffsets:{rbb:8,rba:-5,lr:30,lbb:7,lba:-5,ll:-2},allowLoc:{rbb:1,rba:1,lr:1,lbb:1,lba:1,ll:1},showMapLegend:false,showMinimap:false,hideCopyright:false,disableLogo:false,showScaleBar:true,showDashboard:true,dashboardX:1,dashboardY:1,obliqueEnabled:true},
n||{});p.LNVEOpt=h;var z=_xz1,q=null,b=null,d=0,y,D,t,E,F,u,v,w,x,G,A,B,H,r={};y=function(a){if((a=b.GetShapeByID(a.elementID))&&a.GetType()===VEShapeType.Pushpin)return true};D=function(a){a=a.message?a.message:a.error;a==="Sorry, bird's eye images aren't available here."&&alert(a)};t=function(a){if(!(!d||a===C)){b.GetShapeLayerCount()<=a&&b.AddShapeLayer(new VEShapeLayer);return b.GetShapeLayerByIndex(a)}};v=function(a){if(d){a=b.vemapcontrol.PixelToLatLong(a);a=new VELatLong(a.latitude,a.longitude);
a._reserved=(new z).Encode(a.Latitude,a.Longitude);return a}};H=function(a){var c=[],e=a.GetShapeCount();if(e===0)return c;var f=b.GetMapView();f=b.LatLongToPixel(f.BottomRightLatLong);var g=parseInt(Math.ceil(f.x),0),k=parseInt(Math.ceil(f.y),0),i=parseInt(Math.ceil(g/1),0);parseInt(Math.ceil(k/1),0);f={};for(var m=0;m<e;m++){var s=a.GetShapeByIndex(m),j=s.GetPoints()[0],l=b.LatLongToPixel(j);j=l.x;l=l.y;if(g>=j&&k>=l&&j>=0&&l>=0){j=Math.floor(j/1);l=Math.floor(l/1);j="c"+(j+l*i);if(!f[j]){f[j]=
new VEClusterSpecification;f[j].Shapes=[]}f[j].Shapes.push(s)}}for(var I in f)if(f.hasOwnProperty(I)){a=f[I];e=a.Shapes.length;if(e>1){for(i=k=g=0;i<e;i++){m=a.Shapes[i].GetPoints()[0];g+=m.Latitude;k+=m.Longitude}a.LatLong=new VELatLong(g/e,k/e);c.push(a)}}return c};A=function(a,c){var e=new VEClusteringOptions;if(c)e.Callback=c;t(0).SetClusteringConfiguration(a?H:VEClusteringType.None,e)};n=function(a){if(d)return b.GetShapeByID(a)};w=function(a){if(a===true||r===null)r.height=q.outerHeight();return r.height};
x=function(a){if(a===true||r===null)r.width=q.outerWidth();return r.width};F=function(a){if(d)if(a)if(a.Primitives[0])return o("#"+a.Primitives[0].iid)};u=function(){if(d)switch(b.GetMapStyle()){case "o":case "b":return true}return false};G=function(a,c){var e=r.width;if(c!==null&&a)b.SetDashboardSize(c);else if(!a||e<150){b.HideDashboard();b.HideScalebar()}else if(e<240){b.SetDashboardSize(VEDashboardSize.Tiny);b.HideScalebar()}else if(e<400){b.SetDashboardSize(VEDashboardSize.Small);b.HideScalebar()}else{b.SetDashboardSize(VEDashboardSize.Normal);
b.ShowScalebar()}};B=function(){r.width<400?b.HideScalebar():b.ShowScalebar()};E=function(){d=1;h.onLoadMap&&h.onLoadMap()};(function(){q=o("#"+h.id);w(true);x(true);if(b!==null){b.Dispose();d=0}b=new VEMap(h.id);b.onLoadMap=E;G(h.showDashboard,h.dashboardSize);b.LoadMap(h.latlong,h.zoomlevel,h.mapStyle,h.mapFixed,h.mapMode,h.showSwitch,h.tileBuffer,h.mapOptions);B();b.SetAnimationEnabled(false);typeof p.AddDMPParcelLayer!=="undefined"&&p.AddDMPParcelLayer(b,10);b.AttachEvent("onerror",D);b.SetMouseWheelZoomToCenter(h.zoomToCenter);
if(h.showOnClick){b.AttachEvent("onmouseover",y);b.AttachEvent("onmouseout",y)}b.AttachEvent("onmousedown",y)})();return{pan:function(a,c){d&&b.Pan(a,c)},attach:function(a){var c=a.length;if(d&&c>0)for(var e=0;e<c;e++){var f=a[e];b.AttachEvent(f.n,f.f)}},detach:function(a){var c=a.length;if(d&&c>0)for(var e=0;e<c;e++){var f=a[e];b.DetachEvent(f.n,f.f)}return this},pin:function(a,c){if(typeof c==="undefined")c=0;d&&a&&t(c).AddShape(a);return this},addShape:function(a){if(d&&a){b.AddShape(a);return this}},
addShapeLayer:function(a){d&&a&&b.AddShapeLayer(a);return a},pins:function(a,c,e,f){if(d&&a.length>0){if(typeof f==="undefined")f=0;e&&A(e);t(f).AddShape(a);c&&b.SetMapView(a)}return this},resize:function(a,c){if(d){var e=o("#"+b.ID);a=o.extend({width:e.width(),height:e.height()},a||{});c=o.extend({duration:400,easing:"swing",complete:function(){h.resizeDone&&h.resizeDone(a);w(true);x(true);B()}},c||{});if(a.width!==e.width()&&a.height!==e.height()){h.resizeStart&&h.resizeStart(a);b.Resize(a.width,
a.height);e.animate(a,c)}}},pinByID:n,shapeByID:n,pinByIndex:function(a){if(d)return t(0).GetShapeByIndex(a)},pinXY:function(a){if(d){var c=1,e=q.totalOffset(),f={width:q.innerWidth(),height:q.innerHeight()},g=null,k=h.pinOffsets,i=a.popup,m={width:i.outerWidth(),height:i.outerHeight()},s=0,j=0,l=a.allowLoc||h.allowLoc;if(a.el)g=o(a.el).totalOffset();else if(a.p){a=F(a.p);if(a!==null&&a!==C)g=a.totalOffset();else return}else return;if(g!==null){if(l.lr&&g.left<e.left+f.width/2){if(i)j=g.left+k.lr;
if(l.rbb&&g.top<e.top+f.height/2){c=1;if(i)s=g.top+k.rbb}else if(l.rba){c=3;if(i)s=g.top+k.rba-m.height}}else if(l.ll){if(i)j=g.left+k.ll-m.width;if(l.lbb&&g.top<e.top+f.height/2){c=2;if(i)s=g.top+k.lbb}else if(l.lba){c=4;if(i)s=g.top+k.lba-m.height}}i&&i.css({top:s,left:j});return c}}},deleteShape:function(a){d&&a&&b.DeleteShape(a)},clear:function(){d&&b.DeleteAllShapes()},clearLayer:function(a){if(d)(a=b.GetShapeLayerByIndex(a))&&a.DeleteAllShapes()},bounds:function(){if(d){var a;if(u()){var c=
x(),e=w(),f,g=b.GetBirdseyeScene().GetOrientation(),k=v(new VEPixel(0,0)),i=v(new VEPixel(c,0)),m=v(new VEPixel(0,e));c=v(new VEPixel(c,e));switch(g){case "North":a=k;f=c;break;case "West":a=i;f=m;break;case "South":a=c;f=k;break;case "East":a=m;f=i;break}a=new VELatLongRectangle(a,f)}else a=b.GetMapView();return{lat:{rl:a.BottomRightLatLong.Latitude,ru:a.TopLeftLatLong.Latitude},lon:{rl:a.TopLeftLatLong.Longitude,ru:a.BottomRightLatLong.Longitude}}}},isBirdsEye:u,isBirdsEyeAvailable:function(){return b.IsBirdseyeAvailable()},
getOrientation:function(){if(d&&u())return b.GetBirdseyeScene().GetOrientation();return null},setOrientation:function(a){d&&u()&&b.SetBirdseyeOrientation(a)},setBirdseyeScene:function(a,c,e){d&&b.SetBirdseyeScene(a,c,e)},setMapStyle:function(a){b.SetMapStyle(a)},getMapStyle:function(){if(d)return b.GetMapStyle();return"r"},zoomAt:function(a,c){if(d)return b.SetCenterAndZoom(a,c)},getCenter:function(){if(d)return b.GetCenter()},getZoom:function(){if(d)return b.GetZoomLevel();return-1},getView:function(){if(d)return b.GetMapView()},
hideLayer:function(a){if(d)(a=b.GetShapeLayerByIndex(a))&&a.IsVisible()&&a.Hide()},showLayer:function(a){if(d)(a=b.GetShapeLayerByIndex(a))&&!a.IsVisible()&&a.Show()},setView:function(a){d&&b.SetMapView(a)},cluster:A,width:x,height:w,enableGC:function(){d&&b.vemapcontrol.EnableGeoCommunity(true)},disableGC:function(){d&&b.vemapcontrol.EnableGeoCommunity(false)},enableSDT:function(){d&&b.EnableShapeDisplayThreshold(true)},disableSDT:function(){d&&b.EnableShapeDisplayThreshold(false)},pixelsToLatLong:function(a){var c;
if(d&&a){if(a instanceof Array){c=[];for(var e=a.length,f=0;f<e;f++){var g=b.vemapcontrol.PixelToLatLong(a[f]);c.push(new VELatLong(g.latitude,g.longitude))}}else{a=b.vemapcontrol.PixelToLatLong(a);c=new VELatLong(a.latitude,a.longitude)}return c}return null},latLongsToPixel:function(a){var c;if(d&&a){if(a instanceof Array){c=[];for(var e=a.length,f=0;f<e;f++){var g=b.LatLongToPixel(a[f]);c.push(new VEPixel(g.x,g.y))}}else{a=b.LatLongToPixel(a);c=new VEPixel(a.x,a.y)}return c}return null}}}}}(jQuery);

