eview.ButtonManager=Class.create();
eview.ButtonManager.prototype={initialize:function(){
this.buttons={};
this.activeButton=null;
this.aButtons=null;
},addButton:function(_1,_2){
this.buttons[_1]=_2;
},getButton:function(_3){
return this.buttons[_3];
},setReportName:function(_4,_5){
this.getButton(_4).setReportName(_5);
},eviewButtonPressed:function(_6,_7){
this.activeButton=_7[0];
if(!this.buttons[_7[0].buttonName]){
alert("Could not find a button for "+_7[0].buttonName);
return;
}
if(this.buttons[_7[0].buttonName].enabled){
Logger.debug("Button Enabled: "+_7[0].buttonName);
this.buttons[_7[0].buttonName].selected();
}
},selectActiveButon:function(){
this.selectButton(this.activeButton.buttonName);
},selectButton:function(id){
this._deselectAllButtons();
var _9=$(id);
if(_9!=null){
_9.className="button button_selected";
}
},_deselectAllButtons:function(id){
if(this.aButtons==null){
this.aButtons=getAllButtons();
}
if(this.aButtons!=null){
this.aButtons.each(function(_b){
_b.className="button";
});
}
},selectionSizeListener:function(_c,_d){
this.updateButtons();
},updateButtons:function(){
if(this.aButtons==null){
this.aButtons=getAllButtons();
}
var _e=this;
for(var i=0;i<this.aButtons.length;i++){
if(this.aButtons[i].button){
var _10=_e.buttons[this.aButtons[i].button.buttonName];
if(_10){
if(!_10.canEnable()){
_10.enabled=false;
Element.setOpacity(this.aButtons[i].childNodes[0],0.3);
}else{
_10.enabled=true;
Element.setOpacity(this.aButtons[i].childNodes[0],1);
}
}else{
Logger.warn("Non-existent button referenced: "+this.aButtons[i].button.buttonName);
}
}
}
},mapHistoryListener:function(_11,_12){
this.updateButtons();
},selectionChangedListener:function(_13,_14){
this.updateButtons();
}};
eview.Button=Class.create();
eview.Button.prototype={initialize:function(){
},canEnable:function(){
return true;
}};
eview.DependantButton=Class.create();
eview.DependantButton.prototype=Object.extend(new eview.Button(),{initialize:function(){
this.selectableDependant=false;
this.selectionDependant=false;
this.layerDocumentationDependant=false;
this.documentationDependant=false;
this.externalDependant=false;
this.gridDependant=false;
this.layerReportDependant=null;
this.reportDependant=null;
},canEnable:function(){
return this._canEnable();
},_canEnable:function(){
var _15=true;
if(this.selectableDependant&&!selectionManager.isLayerSelectable()){
_15=false;
}
if(this.selectionDependant&&selectionManager.getSelectionSize()<=0){
_15=false;
}
if(this.documentationDependant&&!selectionManager.areLayersDocumented()){
_15=false;
}
if(this.layerDocumentationDependant&&!selectionManager.isLayerDocumented()){
_15=false;
}
if(this.externalDependant&&!selectionManager.isLayerExternal()){
_15=false;
}
if(this.layerReportDependant!=null&&!this._areReportsAvailable(selectionManager.getActiveLayer().name,this.layerReportDependant)){
_15=false;
}
if(this.reportDependant!=null&&!selectionManager.areReportsAvailable(null,this.reportDependant)){
_15=false;
}
if(this.gridDependant&&!selectionManager.isLayerGridded(null)){
_15=false;
}
return _15;
},_areReportsAvailable:function(_16,_17){
_17=_17.split(",");
var _18=false;
for(var i=0;i<_17.length;i++){
_18=_18|selectionManager.areReportsAvailable(_16,_17[i]);
}
return _18;
},selectSpatial:function(_1a,_1b,_1c){
var _1d=new Object();
_1d.requestName="selectspatial";
_1d.layer=selectionManager.getActiveLayer().name;
_1d.operator=_1c;
_1d.shape=_1a.asString();
_1d.shapeType=_1b;
mapProperties.checkScale=false;
var _1e=selectionManager.updateSelections.bind(selectionManager);
EView.sendRequest(_1d,_1e);
}});
eview.LeftButton=Class.create();
eview.LeftButton.prototype=Object.extend(new eview.Button(),{selected:function(){
if(mapHistory.goBackward()){
var _1f=mapHistory.current();
mapHistory.insertNext=false;
mapProperties.extent=_1f;
callMapRefresh();
}
},canEnable:function(){
return mapHistory.hasAPrevious();
}});
eview.RightButton=Class.create();
eview.RightButton.prototype=Object.extend(new eview.Button(),{selected:function(){
if(mapHistory.goForward()){
var _20=mapHistory.current();
mapHistory.insertNext=false;
mapProperties.extent=_20;
callMapRefresh();
}
},canEnable:function(){
return mapHistory.hasANext();
}});
eview.FullButton=Class.create();
eview.FullButton.prototype=Object.extend(new eview.Button(),{selected:function(){
mapProperties.extent=mapProperties.fullExtent;
callMapRefresh();
}});
eview.HomeButton=Class.create();
eview.HomeButton.prototype=Object.extend(new eview.Button(),{selected:function(){
mapProperties.extent=mapProperties.initialExtent;
callMapRefresh();
}});
eview.ReloadButton=Class.create();
eview.ReloadButton.prototype=Object.extend(new eview.Button(),{selected:function(){
callMapRefresh();
}});
eview.NewWindowButton=Class.create();
eview.NewWindowButton.prototype=Object.extend(new eview.Button(),{selected:function(){
window.open(Maps["map"].getMapImage());
}});
eview.ZoomToGridButton=Class.create();
eview.ZoomToGridButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.gridDependant=true;
},selected:function(){
new eview.ZoomToGridDialog(serviceInfo.data.layers);
}});
eview.ZoomSelectedButton=Class.create();
eview.ZoomSelectedButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
},selected:function(){
mapProperties.extent=selectionManager.getActiveLayer().selection.extent;
mapProperties.checkScale=true;
callMapRefresh();
}});
eview.ClearSelectionButton=Class.create();
eview.ClearSelectionButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
},selected:function(){
var _21=new Array();
_21.push(selectionManager.getActiveLayer().name);
var _22=new Object();
_22.requestName="clear";
_22.layers=_21;
var _23=selectionManager.updateSelections.bind(selectionManager);
EView.sendRequest(_22,_23);
}});
eview.SelectByBufferButton=Class.create();
eview.SelectByBufferButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectableDependant=true;
},selected:function(){
var _24=selectionManager.layers.findAll(function(_25){
if(_25.selection){
return _25.selection.size>0;
}else{
return false;
}
});
if(_24.length>0){
new eview.BufferDialog(_24);
}
},canEnable:function(){
var _26=serviceInfo.getSelectionLayers().findAll(function(_27){
if(_27.selection){
return _27.selection.size>0;
}else{
return false;
}
}).length>0;
return _26&&this._canEnable();
}});
eview.SelectByIntersectionButton=Class.create();
eview.SelectByIntersectionButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectableDependant=true;
},selected:function(){
var _28=selectionManager.layers.findAll(function(_29){
if(_29.selection){
return _29.name!=selectionManager.getActiveLayer().name&&_29.selection.size>0;
}else{
return false;
}
});
if(_28.length>0){
new eview.IntersectWithSelectionDialog(_28);
}
},canEnable:function(){
var _2a=selectionManager.layers.findAll(function(_2b){
if(_2b.selection){
return _2b.name!=selectionManager.getActiveLayer().name&&_2b.selection.size>0;
}else{
return false;
}
}).length>0;
return _2a&&this._canEnable();
}});
eview.AttributeReportButton=Class.create();
eview.AttributeReportButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
if(serviceInfo.data.properties["mapreports.in.attribute"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},selected:function(){
var _2c=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _2d=_2c;
if(serviceInfo.data.properties["mapreports.in.attribute"].equalsIgnoreCase("true")){
var _2e=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_2d=_2c.concat(_2e);
}
var _2f=null;
if(_2d.length==1){
_2f=_2d[0].name;
}else{
_2d.each(function(_30,_31){
if(_30.defaultReport){
_2f=_30.name;
}
});
if(_2f==null){
_2f=_2d[0].name;
}
}
var _32=new Object();
_32.requestName="attributes";
_32.mapProperties=mapProperties;
_32.layer=selectionManager.getActiveLayer().name;
_32.report=_2f;
EView.sendRequest(_32,function(_33){
new eview.AttributeReportDialog(_33.recordset);
sortables_init();
document.getElementById("dialog_title").innerHTML="Attribute Report";
});
}});
eview.MapReportButton=Class.create();
eview.MapReportButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
this.layerReportDependant="map";
},selected:function(){
var _34=serviceInfo._getReportsForLayer(selectionManager.getActiveLayer().name,"map");
_34.sortBy(function(_35){
return _35.label;
});
var _36=new Object();
_36.requestName="attributes";
_36.mapProperties=mapProperties;
_36.layer=selectionManager.getActiveLayer().name;
_36.report=_34[0].name;
EView.sendRequest(_36,function(_37){
new eview.MapReportDialog(_34,_37.recordset);
sortables_init();
});
}});
eview.MailMergeButton=Class.create();
eview.MailMergeButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
this.layerReportDependant="mailmerge";
},selected:function(){
var _38=serviceInfo._getReportsForLayer(selectionManager.getActiveLayer().name,"mailmerge");
new eview.MailMergeDialog(_38);
}});
eview.AddDocumentButton=Class.create();
eview.AddDocumentButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.layerDocumentationDependant=true;
this.selectionDependant=true;
},selected:function(){
new eview.DocUploadDialog();
}});
eview.DocSelectionButton=Class.create();
eview.DocSelectionButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.layerDocumentationDependant=true;
this.selectionDependant=true;
},selected:function(){
var _39=new Object();
_39.requestName="documents";
_39.layers=[selectionManager.getActiveLayer().name];
_39.mapProperties=mapProperties;
EView.sendRequest(_39,showDocument);
}});
eview.DocSelectionIntersectButton=Class.create();
eview.DocSelectionIntersectButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.layerDocumentationDependant=true;
this.selectionDependant=true;
},selected:function(){
var _3a=selectionManager.layers.findAll(function(_3b){
return _3b.documented;
});
new eview.DocViewerDialog(_3a);
}});
eview.ViewPrintButton=Class.create();
eview.ViewPrintButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.reportDependant="print";
},selected:function(){
var _3c=serviceInfo._getReportsForLayer(null,"print");
new eview.PrintReportDialog(_3c);
}});
eview.ZoominButton=Class.create();
eview.ZoominButton.prototype=Object.extend(new eview.DependantButton(),{selected:function(){
buttonManager.selectActiveButon();
MapDragBox("map",0,true,null,function(rec){
var _3e=$("scale_input").value;
var _3f=_3e.substring(_3e.indexOf(":")+1,_3e.length);
var _40=((rec.maxx-rec.minx)/document.body.clientWidth)*_3f;
var _41=((rec.maxy-rec.miny)/document.body.clientHeight)*_3f;
if((_40>0.1)&&(_41>0.1)){
Logger.info("valid rec for zoom in.");
var _42=_3f*((rec.maxx-rec.minx)/(mapProperties.extent.maxx-mapProperties.extent.minx));
var _43=_3f*((rec.maxy-rec.miny)/(mapProperties.extent.maxy-mapProperties.extent.miny));
if((_42<1)||(_43<1)){
Logger.info("extent will be to small, defaulting to 1:1 and centering map on center of rec");
var _44=parseFloat(rec.minx)+((rec.maxx-rec.minx)/2);
var _45=parseFloat(rec.miny)+((rec.maxy-rec.miny)/2);
var _46=new eview.Extent(mapProperties.extent.minx,mapProperties.extent.miny,mapProperties.extent.maxx,mapProperties.extent.maxy);
_46.center(_44,_45);
mapProperties.extent=_46;
$("scale_input").value="1:1";
updateMapScale();
return;
}
mapProperties.extent=rec;
callMapRefresh();
}else{
if((mapProperties.lastMapScale)<2){
Logger.info("extent will be to small defaulting to 1:1 and centering map at location clicked");
var _46=new eview.Extent(mapProperties.extent.minx,mapProperties.extent.miny,mapProperties.extent.maxx,mapProperties.extent.maxy);
_46.center(parseFloat(rec.minx),parseFloat(rec.miny));
mapProperties.extent=_46;
$("scale_input").value="1:1";
updateMapScale();
return;
}
Logger.info("invalid rec for zoom in. will use bottom left corner as zoom in point.");
setNavigatorZoomIn(rec.minx,rec.miny);
}
});
}});
eview.ZoomoutButton=Class.create();
eview.ZoomoutButton.prototype=Object.extend(new eview.DependantButton(),{selected:function(){
buttonManager.selectActiveButon();
MapDragBox("map",0,true,null,function(rec){
var _48=$("scale_input").value;
var _49=_48.substring(_48.indexOf(":")+1,_48.length);
var _4a=((rec.maxx-rec.minx)/document.body.clientWidth)*_49;
var _4b=((rec.maxy-rec.miny)/document.body.clientHeight)*_49;
if((_4a>0.1)&&(_4b>0.1)){
Logger.info("valid rec for zoom out.");
rec=new eview.Extent(rec.minx,rec.miny,rec.maxx,rec.maxy);
var _4c=rec.getWidth();
var _4d=rec.getHeight();
var _4e=new eview.Extent(mapProperties.extent.minx,mapProperties.extent.miny,mapProperties.extent.maxx,mapProperties.extent.maxy);
var _4f=1;
var _50=1;
if(_4c>0||_4d>0){
_4f=_4e.getWidth()/_4c;
_50=_4e.getHeight()/_4d;
}
var _51=_4f*xDistance*0.25;
var _52=_50*yDistance*0.25;
_4e.minx=_4e.minx-_51;
_4e.miny=_4e.miny-_52;
_4e.maxx=_4e.maxx+_51;
_4e.maxy=_4e.maxy+_52;
mapProperties.extent=_4e;
callMapRefresh();
}else{
Logger.info("invalid rec for zoom out. will use bottom left corner as zoom out point.");
setNavigatorZoomOut(rec.minx,rec.miny);
}
});
}});
eview.PanButton=Class.create();
eview.PanButton.prototype=Object.extend(new eview.DependantButton(),{selected:function(){
buttonManager.selectActiveButon();
MapDragImage("map",0,true,null,function(rec){
mapProperties.extent=rec;
callMapRefresh();
});
}});
eview.MeasureAreaButton=Class.create();
eview.MeasureAreaButton.prototype=Object.extend(new eview.DependantButton(),{selected:function(){
MapPolygon("map",0,false,null,function(_54){
var _55=0;
var p=_54.parts[0].subparts[0].points;
var _57=p.length;
if(p.length>2){
_55=_55+p[0].y*(p[1].x-p[_57-1].x);
for(var i=1;i<_57-1;i++){
_55=_55+p[i].y*(p[i+1].x-p[i-1].x);
}
_55=_55+p[_57-1].y*(p[0].x-p[_57-2].x);
_55=_55/2;
}
var win=new Window("dialog",{className:"dialog",width:300,height:100,zIndex:100,resizable:false,title:"Measured Area"});
win.getContent().innerHTML="Area = "+Math.abs(_55).toFixed(3)+" square "+mapProperties.mapUnits.toLowerCase()+" (approx)";
win.showCenter();
});
}});
eview.MeasureDistanceButton=Class.create();
eview.MeasureDistanceButton.prototype=Object.extend(new eview.DependantButton(),{selected:function(){
MapPolyline("map",0,false,null,function(_5a){
var p=_5a.parts[0].subparts[0].points;
if(p.length>1){
var _5c=0;
for(var i=0;i<p.length-1;i++){
var dd=(p[i+1].x-p[0].x)*(p[i+1].x-p[0].x)+(p[i+1].y-p[0].y)*(p[i+1].y-p[0].y);
_5c+=Math.sqrt(dd);
}
var win=new Window("dialog",{className:"dialog",width:300,height:100,zIndex:100,resizable:false,title:"Measured Distance"});
win.getContent().innerHTML="Distance = "+_5c.toFixed(3)+" "+mapProperties.mapUnits.toLowerCase()+" (approx)";
win.showCenter();
}
});
}});
eview.SelectByPolygonButton=Class.create();
eview.SelectByPolygonButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectableDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _60=this;
MapPolygon("map",0,false,null,function(_61){
_60.selectSpatial(_61,POLYGON,getModifier());
});
}});
eview.UnSelectByPolygonButton=Class.create();
eview.UnSelectByPolygonButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _62=this;
MapPolygon("map",0,false,null,function(_63){
_62.selectSpatial(_63,POLYGON,UNSELECT_OPERATOR);
});
}});
eview.ReSelectByPolygonButton=Class.create();
eview.ReSelectByPolygonButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _64=this;
MapPolygon("map",0,false,null,function(_65){
_64.selectSpatial(_65,POLYGON,RESELECT_OPERATOR);
});
}});
eview.SelectByRectangleButton=Class.create();
eview.SelectByRectangleButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectableDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _66=this;
MapDragBox("map",0,false,null,function(_67){
_66.selectSpatial(_67,RECTANGLE,getModifier());
});
}});
eview.UnSelectByRectangleButton=Class.create();
eview.UnSelectByRectangleButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _68=this;
MapDragBox("map",0,false,null,function(_69){
_68.selectSpatial(_69,RECTANGLE,UNSELECT_OPERATOR);
});
}});
eview.ReSelectByRectangleButton=Class.create();
eview.ReSelectByRectangleButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _6a=this;
MapDragBox("map",0,false,null,function(_6b){
_6a.selectSpatial(_6b,RECTANGLE,RESELECT_OPERATOR);
});
}});
eview.SelectByPolylineButton=Class.create();
eview.SelectByPolylineButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectableDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _6c=this;
MapPolyline("map",0,false,null,function(_6d){
_6c.selectSpatial(_6d,POLYLINE,getModifier());
});
}});
eview.UnSelectByPolylineButton=Class.create();
eview.UnSelectByPolylineButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _6e=this;
MapPolyline("map",0,false,null,function(_6f){
_6e.selectSpatial(_6f,POLYLINE,UNSELECT_OPERATOR);
});
}});
eview.ReSelectByPolylineButton=Class.create();
eview.ReSelectByPolylineButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _70=this;
MapPolyline("map",0,false,null,function(_71){
_70.selectSpatial(_71,POLYLINE,RESELECT_OPERATOR);
});
}});
eview.SelectByPointButton=Class.create();
eview.SelectByPointButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectableDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _72=this;
MapDragCircle("map",0,false,null,function(_73){
_72.selectSpatial(_73,CIRCLE,getModifier());
});
}});
eview.UnSelectByPointButton=Class.create();
eview.UnSelectByPointButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _74=this;
MapDragCircle("map",0,false,null,function(_75){
_74.selectSpatial(_75,CIRCLE,UNSELECT_OPERATOR);
});
}});
eview.ReSelectByPointButton=Class.create();
eview.ReSelectByPointButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectionDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _76=this;
MapDragCircle("map",0,false,null,function(_77){
_76.selectSpatial(_77,CIRCLE,RESELECT_OPERATOR);
});
}});
eview.SelectByOverlayButton=Class.create();
eview.SelectByOverlayButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.selectableDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _78=selectionManager.layers.findAll(function(_79){
return _79.selectable&&_79.name!=selectionManager.getActiveLayer().name;
});
new eview.IntersectWithFeatureDialog(_78);
}});
eview.SpatialIdentifyButton=Class.create();
eview.SpatialIdentifyButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_7a){
var _7b=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _7c=_7b;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _7d=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_7c=_7b.concat(_7d);
}
var _7e=null;
if(_7c!=null&&_7c.length>0){
if(_7c.length==1){
_7e=_7c[0].name;
}else{
_7c.each(function(_7f,_80){
if(_7f.defaultReport){
_7e=_7f.name;
}
});
if(_7e==null){
_7e=_7c[0].name;
}
}
var _81=new Object();
_81.requestName="identify";
_81.layer=selectionManager.getActiveLayer().name;
_81.shape=_7a.asString();
_81.shapeType=CIRCLE;
_81.report=_7e;
_81.mapProperties=mapProperties;
EView.sendRequest(_81,function(_82){
new eview.IdentifyDialog(_82.recordset);
sortables_init();
document.getElementById("dialog_title").innerHTML="Identify";
});
}
});
}});
eview.DocPointButton=Class.create();
eview.DocPointButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.documentationDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _83=selectionManager.layers.findAll(function(_84){
return _84.documented;
});
new eview.DocViewerDialog(_83,CIRCLE);
}});
eview.DocPolygonButton=Class.create();
eview.DocPolygonButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.documentationDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _85=selectionManager.layers.findAll(function(_86){
return _86.documented;
});
new eview.DocViewerDialog(_85,POLYGON);
}});
eview.CrystalReportsButton=Class.create();
eview.CrystalReportsButton.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
this.layerReportDependant="crystalreports";
this.selectionDependant=true;
},selected:function(){
buttonManager.selectActiveButon();
var _87=serviceInfo._getReportsForLayer(null,"crystalreports");
new eview.CrystalReportsDialog(_87);
}});
eview.CustomReport1=Class.create();
eview.CustomReport1.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
reportname1="";
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},setReportName:function(_88){
reportname1=_88;
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_89){
var _8a=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _8b=_8a;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _8c=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_8b=_8a.concat(_8c);
}
var _8d=null;
if(_8b!=null&&_8b.length>0){
var _8e=new Object();
_8e.requestName="identify";
_8e.layer=selectionManager.getActiveLayer().name;
_8e.shape=_89.asString();
_8e.shapeType=CIRCLE;
_8e.report=reportname1;
_8e.mapProperties=mapProperties;
EView.sendRequest(_8e,function(_8f){
new eview.IdentifyDialog(_8f.recordset);
sortables_init();
var _90=document.getElementById("attributeReports");
for(r=0;r<_90.length;r++){
if(reportname1==_90.options[r].value){
document.getElementById("dialog_title").innerHTML=_90.options[r].text;
r=_90.length;
}
}
document.getElementById("div_report_label").style.display="none";
document.getElementById("attributeReports").style.display="none";
});
}
});
}});
eview.CustomReport2=Class.create();
eview.CustomReport2.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
reportname2="";
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},setReportName:function(_91){
reportname2=_91;
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_92){
var _93=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _94=_93;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _95=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_94=_93.concat(_95);
}
var _96=null;
if(_94!=null&&_94.length>0){
var _97=new Object();
_97.requestName="identify";
_97.layer=selectionManager.getActiveLayer().name;
_97.shape=_92.asString();
_97.shapeType=CIRCLE;
_97.report=reportname2;
_97.mapProperties=mapProperties;
EView.sendRequest(_97,function(_98){
new eview.IdentifyDialog(_98.recordset);
sortables_init();
var _99=document.getElementById("attributeReports");
for(r=0;r<_99.length;r++){
if(reportname2==_99.options[r].value){
document.getElementById("dialog_title").innerHTML=_99.options[r].text;
r=_99.length;
}
}
document.getElementById("div_report_label").style.display="none";
document.getElementById("attributeReports").style.display="none";
});
}
});
}});
eview.CustomReport3=Class.create();
eview.CustomReport3.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
reportname3="";
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},setReportName:function(_9a){
reportname3=_9a;
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_9b){
var _9c=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _9d=_9c;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _9e=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_9d=_9c.concat(_9e);
}
var _9f=null;
if(_9d!=null&&_9d.length>0){
var _a0=new Object();
_a0.requestName="identify";
_a0.layer=selectionManager.getActiveLayer().name;
_a0.shape=_9b.asString();
_a0.shapeType=CIRCLE;
_a0.report=reportname3;
_a0.mapProperties=mapProperties;
EView.sendRequest(_a0,function(_a1){
new eview.IdentifyDialog(_a1.recordset);
sortables_init();
var _a2=document.getElementById("attributeReports");
for(r=0;r<_a2.length;r++){
if(reportname3==_a2.options[r].value){
document.getElementById("dialog_title").innerHTML=_a2.options[r].text;
r=_a2.length;
}
}
document.getElementById("div_report_label").style.display="none";
document.getElementById("attributeReports").style.display="none";
});
}
});
}});
eview.CustomReport4=Class.create();
eview.CustomReport4.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
reportname4="";
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},setReportName:function(_a3){
reportname4=_a3;
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_a4){
var _a5=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _a6=_a5;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _a7=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_a6=_a5.concat(_a7);
}
var _a8=null;
if(_a6!=null&&_a6.length>0){
var _a9=new Object();
_a9.requestName="identify";
_a9.layer=selectionManager.getActiveLayer().name;
_a9.shape=_a4.asString();
_a9.shapeType=CIRCLE;
_a9.report=reportname4;
_a9.mapProperties=mapProperties;
EView.sendRequest(_a9,function(_aa){
new eview.IdentifyDialog(_aa.recordset);
sortables_init();
var _ab=document.getElementById("attributeReports");
for(r=0;r<_ab.length;r++){
if(reportname4==_ab.options[r].value){
document.getElementById("dialog_title").innerHTML=_ab.options[r].text;
r=_ab.length;
}
}
document.getElementById("div_report_label").style.display="none";
document.getElementById("attributeReports").style.display="none";
});
}
});
}});
eview.CustomReport5=Class.create();
eview.CustomReport5.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
reportname5="";
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},setReportName:function(_ac){
reportname5=_ac;
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_ad){
var _ae=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _af=_ae;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _b0=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_af=_ae.concat(_b0);
}
var _b1=null;
if(_af!=null&&_af.length>0){
var _b2=new Object();
_b2.requestName="identify";
_b2.layer=selectionManager.getActiveLayer().name;
_b2.shape=_ad.asString();
_b2.shapeType=CIRCLE;
_b2.report=reportname5;
_b2.mapProperties=mapProperties;
EView.sendRequest(_b2,function(_b3){
new eview.IdentifyDialog(_b3.recordset);
sortables_init();
var _b4=document.getElementById("attributeReports");
for(r=0;r<_b4.length;r++){
if(reportname5==_b4.options[r].value){
document.getElementById("dialog_title").innerHTML=_b4.options[r].text;
r=_b4.length;
}
}
document.getElementById("div_report_label").style.display="none";
document.getElementById("attributeReports").style.display="none";
});
}
});
}});
eview.CustomReport6=Class.create();
eview.CustomReport6.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
reportname6="";
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},setReportName:function(_b5){
reportname6=_b5;
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_b6){
var _b7=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _b8=_b7;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _b9=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_b8=_b7.concat(_b9);
}
var _ba=null;
if(_b8!=null&&_b8.length>0){
var _bb=new Object();
_bb.requestName="identify";
_bb.layer=selectionManager.getActiveLayer().name;
_bb.shape=_b6.asString();
_bb.shapeType=CIRCLE;
_bb.report=reportname6;
_bb.mapProperties=mapProperties;
EView.sendRequest(_bb,function(_bc){
new eview.IdentifyDialog(_bc.recordset);
sortables_init();
var _bd=document.getElementById("attributeReports");
for(r=0;r<_bd.length;r++){
if(reportname6==_bd.options[r].value){
document.getElementById("dialog_title").innerHTML=_bd.options[r].text;
r=_bd.length;
}
}
document.getElementById("div_report_label").style.display="none";
document.getElementById("attributeReports").style.display="none";
});
}
});
}});
eview.CustomReport7=Class.create();
eview.CustomReport7.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
reportname7="";
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},setReportName:function(_be){
reportname7=_be;
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_bf){
var _c0=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _c1=_c0;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _c2=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_c1=_c0.concat(_c2);
}
var _c3=null;
if(_c1!=null&&_c1.length>0){
var _c4=new Object();
_c4.requestName="identify";
_c4.layer=selectionManager.getActiveLayer().name;
_c4.shape=_bf.asString();
_c4.shapeType=CIRCLE;
_c4.report=reportname7;
_c4.mapProperties=mapProperties;
EView.sendRequest(_c4,function(_c5){
new eview.IdentifyDialog(_c5.recordset);
sortables_init();
var _c6=document.getElementById("attributeReports");
for(r=0;r<_c6.length;r++){
if(reportname7==_c6.options[r].value){
document.getElementById("dialog_title").innerHTML=_c6.options[r].text;
r=_c6.length;
}
}
document.getElementById("div_report_label").style.display="none";
document.getElementById("attributeReports").style.display="none";
});
}
});
}});
eview.CustomReport8=Class.create();
eview.CustomReport8.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
reportname8="";
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},setReportName:function(_c7){
reportname8=_c7;
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_c8){
var _c9=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _ca=_c9;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _cb=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_ca=_c9.concat(_cb);
}
var _cc=null;
if(_ca!=null&&_ca.length>0){
var _cd=new Object();
_cd.requestName="identify";
_cd.layer=selectionManager.getActiveLayer().name;
_cd.shape=_c8.asString();
_cd.shapeType=CIRCLE;
_cd.report=reportname8;
_cd.mapProperties=mapProperties;
EView.sendRequest(_cd,function(_ce){
new eview.IdentifyDialog(_ce.recordset);
sortables_init();
var _cf=document.getElementById("attributeReports");
for(r=0;r<_cf.length;r++){
if(reportname8==_cf.options[r].value){
document.getElementById("dialog_title").innerHTML=_cf.options[r].text;
r=_cf.length;
}
}
document.getElementById("div_report_label").style.display="none";
document.getElementById("attributeReports").style.display="none";
});
}
});
}});
eview.CustomReport9=Class.create();
eview.CustomReport9.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
reportname9="";
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},setReportName:function(_d0){
reportname9=_d0;
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_d1){
var _d2=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _d3=_d2;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _d4=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_d3=_d2.concat(_d4);
}
var _d5=null;
if(_d3!=null&&_d3.length>0){
var _d6=new Object();
_d6.requestName="identify";
_d6.layer=selectionManager.getActiveLayer().name;
_d6.shape=_d1.asString();
_d6.shapeType=CIRCLE;
_d6.report=reportname9;
_d6.mapProperties=mapProperties;
EView.sendRequest(_d6,function(_d7){
new eview.IdentifyDialog(_d7.recordset);
sortables_init();
var _d8=document.getElementById("attributeReports");
for(r=0;r<_d8.length;r++){
if(reportname9==_d8.options[r].value){
document.getElementById("dialog_title").innerHTML=_d8.options[r].text;
r=_d8.length;
}
}
document.getElementById("div_report_label").style.display="none";
document.getElementById("attributeReports").style.display="none";
});
}
});
}});
eview.CustomReport10=Class.create();
eview.CustomReport10.prototype=Object.extend(new eview.DependantButton(),{initialize:function(){
reportname10="";
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
this.layerReportDependant="attribute,map";
}else{
this.layerReportDependant="attribute";
}
},setReportName:function(_d9){
reportname10=_d9;
},selected:function(){
buttonManager.selectActiveButon();
MapDragCircle("map",0,false,null,function(_da){
var _db=serviceInfo.getAttributeReportsForLayer(selectionManager.getActiveLayer().name);
var _dc=_db;
if(serviceInfo.data.properties["mapreports.in.identify"].equalsIgnoreCase("true")){
var _dd=serviceInfo.getMapReportsForLayer(selectionManager.getActiveLayer().name);
_dc=_db.concat(_dd);
}
var _de=null;
if(_dc!=null&&_dc.length>0){
var _df=new Object();
_df.requestName="identify";
_df.layer=selectionManager.getActiveLayer().name;
_df.shape=_da.asString();
_df.shapeType=CIRCLE;
_df.report=reportname10;
_df.mapProperties=mapProperties;
EView.sendRequest(_df,function(_e0){
new eview.IdentifyDialog(_e0.recordset);
sortables_init();
var _e1=document.getElementById("attributeReports");
for(r=0;r<_e1.length;r++){
if(reportname10==_e1.options[r].value){
document.getElementById("dialog_title").innerHTML=_e1.options[r].text;
r=_e1.length;
}
}
document.getElementById("div_report_label").style.display="none";
document.getElementById("attributeReports").style.display="none";
});
}
});
}});
eview.GotoCoord=Class.create();
eview.GotoCoord.prototype=Object.extend(new eview.DependantButton(),{selected:function(){
new eview.gotoCoordinatesDialog();
}});
var buttonManager=new eview.ButtonManager();
buttonPressed.subscribe(buttonManager.eviewButtonPressed,buttonManager,true);
mapHistory.mapHistoryChanged.subscribe(buttonManager.mapHistoryListener,buttonManager,true);
function createButtons(){
buttonManager.addButton("Left",new eview.LeftButton());
buttonManager.addButton("Right",new eview.RightButton());
buttonManager.addButton("Full",new eview.FullButton());
buttonManager.addButton("Home",new eview.HomeButton());
buttonManager.addButton("Reload",new eview.ReloadButton());
buttonManager.addButton("NewWindow",new eview.NewWindowButton());
buttonManager.addButton("ZoomToGrid",new eview.ZoomToGridButton());
buttonManager.addButton("ZoomSelected",new eview.ZoomSelectedButton());
buttonManager.addButton("ClearSelection",new eview.ClearSelectionButton());
buttonManager.addButton("SelectByBuffer",new eview.SelectByBufferButton());
buttonManager.addButton("SelectByIntersection",new eview.SelectByIntersectionButton());
buttonManager.addButton("AttributeReport",new eview.AttributeReportButton());
buttonManager.addButton("MapReport",new eview.MapReportButton());
buttonManager.addButton("MailMerge",new eview.MailMergeButton());
buttonManager.addButton("AddDocument",new eview.AddDocumentButton());
buttonManager.addButton("DocSelection",new eview.DocSelectionButton());
buttonManager.addButton("DocSelectionIntersect",new eview.DocSelectionIntersectButton());
buttonManager.addButton("ViewPrint",new eview.ViewPrintButton());
buttonManager.addButton("Zoomin",new eview.ZoominButton());
buttonManager.addButton("Zoomout",new eview.ZoomoutButton());
buttonManager.addButton("Pan",new eview.PanButton());
buttonManager.addButton("MeasureArea",new eview.MeasureAreaButton());
buttonManager.addButton("MeasureDistance",new eview.MeasureDistanceButton());
buttonManager.addButton("SelectByPolygon",new eview.SelectByPolygonButton());
buttonManager.addButton("UnSelectByPolygon",new eview.UnSelectByPolygonButton());
buttonManager.addButton("ReSelectByPolygon",new eview.ReSelectByPolygonButton());
buttonManager.addButton("SelectByRectangle",new eview.SelectByRectangleButton());
buttonManager.addButton("UnSelectByRectangle",new eview.UnSelectByRectangleButton());
buttonManager.addButton("ReSelectByRectangle",new eview.ReSelectByRectangleButton());
buttonManager.addButton("SelectByPolyline",new eview.SelectByPolylineButton());
buttonManager.addButton("UnSelectByPolyline",new eview.UnSelectByPolylineButton());
buttonManager.addButton("ReSelectByPolyline",new eview.ReSelectByPolylineButton());
buttonManager.addButton("SelectByPoint",new eview.SelectByPointButton());
buttonManager.addButton("UnSelectByPoint",new eview.UnSelectByPointButton());
buttonManager.addButton("ReSelectByPoint",new eview.ReSelectByPointButton());
buttonManager.addButton("SelectByOverlay",new eview.SelectByOverlayButton());
buttonManager.addButton("SpatialIdentify",new eview.SpatialIdentifyButton());
buttonManager.addButton("DocPoint",new eview.DocPointButton());
buttonManager.addButton("DocPolygon",new eview.DocPolygonButton());
buttonManager.addButton("CrystalReports",new eview.CrystalReportsButton());
buttonManager.addButton("CustomReport1",new eview.CustomReport1());
buttonManager.addButton("CustomReport2",new eview.CustomReport2());
buttonManager.addButton("CustomReport3",new eview.CustomReport3());
buttonManager.addButton("CustomReport4",new eview.CustomReport4());
buttonManager.addButton("CustomReport5",new eview.CustomReport5());
buttonManager.addButton("CustomReport6",new eview.CustomReport6());
buttonManager.addButton("CustomReport7",new eview.CustomReport7());
buttonManager.addButton("CustomReport8",new eview.CustomReport8());
buttonManager.addButton("CustomReport9",new eview.CustomReport9());
buttonManager.addButton("CustomReport10",new eview.CustomReport10());
buttonManager.addButton("GotoCoord",new eview.GotoCoord());
}


