package com.demo;
import javax.faces.event.ActionEvent;
import com.esri.adf.web.data.WebContext;
import com.esri.adf.web.data.geometry.WebExtent;
import com.esri.adf.web.faces.event.MapEvent;
import com.esri.adf.web.faces.event.MapToolAction;
public class MyFullExtent {
WebContext context;
public WebContext getContext() {
return context;
}
public void setContext(WebContext context) {
this.context = context;
}
public void setFullExtent(){
try{
WebExtent ex=context.getWebMap().getFullExtent();
context.getWebMap().setCurrentExtent(ex);
context.refresh();
}catch(Exception ex){
ex.printStackTrace();
}
}
}
转载于: http://leo43.blog.hexun.com/p9/default.aspx
<managed-bean>
<managed-bean-name>myFullExtent</managed-bean-name>
<managed-bean-class>com.demo. MyFullExtent </managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>context</property-name>
<value>#{mapContext}</value>
</managed-property>
</managed-bean>
<a:command id="fullExtent" action="#{myFullExtent.setFullExtent}" toolText="全图显示" />