小秋的家

home

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  1 Posts :: 91 Stories :: 17 Comments :: 0 Trackbacks

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="全图显示" />

posted on 2009-11-13 16:10 棋剑小秋 阅读(286) 评论(0)  编辑  收藏 所属分类: GIS

只有注册用户登录后才能发表评论。


网站导航: