小秋的家

          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 棋劍小秋 閱讀(294) 評論(0)  編輯  收藏 所屬分類: GIS
          主站蜘蛛池模板: 枣强县| 丰镇市| 灵石县| 铜鼓县| 铁力市| 洱源县| 项城市| 深水埗区| 瑞丽市| 尼勒克县| 江西省| 江川县| 镇坪县| 宁南县| 水城县| 扶沟县| 江城| 武山县| 兴业县| 凤凰县| 安图县| 民勤县| 南城县| 宁河县| 额敏县| 武鸣县| 祁门县| 合阳县| 阳泉市| 潜江市| 彭阳县| 定兴县| 天等县| 丹巴县| 荃湾区| 洛隆县| 保山市| 遵义县| 田东县| 崇阳县| 岑溪市|