<a:task id="mapToolsTask" value="#{mapToolsTask}" taskInfo="#{mapToolsTask.taskInfo}" mapId="map1" windowingSupport="false" style="padding:0px;margin:0px;"
xslFile="maptoolstask.xsl"/>
<managed-bean>
<managed-bean-name>mapToolsTask</managed-bean-name>
<managed-bean-class>com.esri.adf.web.tasks.MapToolsTask</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>webContext</property-name>
<value>#{mapContext}</value>
</managed-property>
</managed-bean>
package com.jerry.ags;
import com.esri.adf.web.tasks.MapToolsTaskInfo;
import com.esri.adf.web.tasks.MapToolsTaskConfig;
public class MyToolsTaskInfo extends MapToolsTaskInfo{
public MyToolsTaskInfo(){
MapToolsTaskConfig tc=new MapToolsTaskConfig();
tc.setTools("IDENTIFY,ZOOMIN,ZOOMOUT,");
super.setTaskConfig(tc);
}
}
<managed-bean>
<managed-bean-name>myToolsTaskInfo</managed-bean-name>
<managed-bean-class>com.jerry.ags.MyToolsTaskInfo</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<a:task id="mapToolsTask" value="#{mapToolsTask}" taskInfo="#{myToolsTaskInfo}" mapId="map1" windowingSupport="false" style="padding:0px;margin0px;"
xslFile="maptoolstask.xsl"/>
package com.jerry.ags;
import com.esri.adf.web.tasks.MapToolsTaskInfo;
import com.esri.adf.web.tasks.MapToolsTaskConfig;
import com.esri.adf.web.data.tasks.TaskToolDescriptorModel;
import com.esri.adf.web.data.tasks.TaskToolDescriptor;
import com.esri.adf.web.faces.event.ClientActions;
import com.esri.adf.web.tasks.MapToolsTask;
public class MyToolsTaskInfo extends MapToolsTaskInfo{
private TaskToolDescriptor[] taskTools=new TaskToolDescriptor[3];
public MyToolsTaskInfo(){
MapToolsTaskConfig tc=new MapToolsTaskConfig();
tc.setTools("IDENTIFY,ZOOMIN,ZOOMOUT,");
super.setTaskConfig(tc);
taskTools[0]=new TaskToolDescriptor(MapToolsTask.class,"identify","拉框查询",ClientActions.MAP_RECTANGLE);
taskTools[0].setRendererType(TaskToolDescriptor.IMAGE_RENDERER_TYPE);
taskTools[0].setDefaultImage("http://jerry:8000/gs/images/tasks/maptools/identify.png");
taskTools[0].setSelectedImage("http://jerry:8000/gs/images/tasks/maptools/identifyD.png");
taskTools[0].setHoverImage("http://jerry:8000/gs/images/tasks/maptools/identifyU.png");
taskTools[1]=new TaskToolDescriptor(MapToolsTask.class,"zoomIn","放大",ClientActions.MAP_RECTANGLE);
taskTools[1].setRendererType(TaskToolDescriptor.IMAGE_RENDERER_TYPE);
taskTools[1].setDefaultImage("http://jerry:8000/gs/images/tasks/maptools/zoomin.png");
taskTools[1].setSelectedImage("http://jerry:8000/gs/images/tasks/maptools/zoominD.png");
taskTools[1].setHoverImage("http://jerry:8000/gs/images/tasks/maptools/zoominU.png");
taskTools[2]=new TaskToolDescriptor(MapToolsTask.class,"zoomOut","缩小",ClientActions.MAP_RECTANGLE);
taskTools[2].setRendererType(TaskToolDescriptor.IMAGE_RENDERER_TYPE);
taskTools[2].setDefaultImage("http://jerry:8000/gs/images/tasks/maptools/zoomout.png");
taskTools[2].setSelectedImage("http://jerry:8000/gs/images/tasks/maptools/zoomoutD.png");
taskTools[2].setHoverImage("http://jerry:8000/gs/images/tasks/maptools/zoomoutU.png");
}
public TaskToolDescriptorModel[] getToolDescriptors(){
return taskTools;
}
}