小秋的家

          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 棋劍小秋 閱讀(292) 評論(0)  編輯  收藏 所屬分類: GIS
          主站蜘蛛池模板: 汤原县| 雅江县| 达日县| 北川| 大姚县| 五河县| 安西县| 屏南县| 湘潭县| 大厂| 高安市| 汉寿县| 开远市| 六盘水市| 永善县| 三原县| 绵竹市| 南江县| 西昌市| 胶州市| 安泽县| 志丹县| 万宁市| 巴林左旗| 陵水| 汕头市| 平乡县| 定陶县| 玛沁县| 三门县| 桐梓县| 芮城县| 邛崃市| 娄烦县| 郓城县| 石门县| 佛冈县| 小金县| 永川市| 茂名市| 宜阳县|