小秋的家

          home

            BlogJava :: 首頁(yè) :: 聯(lián)系 :: 聚合  :: 管理
            1 Posts :: 91 Stories :: 17 Comments :: 0 Trackbacks

          //獲得的標(biāo)點(diǎn)
          WebPoint pt=(WebPoint)arg0.getWebGeometry().toMapGeometry(arg0.getWebContext().getWebMap());
                                       

          //獲得圖片的二進(jìn)制 可以在application啟動(dòng)時(shí)進(jìn)行讀取,放在context的某個(gè)attribute里面。
          String picPath= FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath()+"\\images\\angle.gif";
          File myFile = new File(picPath);       
          FileInputStream myStream= newFileInputStream(myFile);   
          BufferedInputStream buf = newBufferedInputStream(myStream);
          byte[] bytInput = newbyte[(int)myFile.length()];
          buf.read(bytInput, 0, (int) myFile.length());
          buf.close();
          myStream.close();


          //在地圖上標(biāo)注
          WebPictureMarkerSymbol markers=newWebPictureMarkerSymbol();
          markers.setPicture(bytInput);
          GraphicElement ge=new GraphicElement();
          ge.setGeometry(pt);
          ge.setSymbol(markers);
          WebGraphics graphics=arg0.getWebContext().getWebGraphics();
          graphics.addGraphics(ge);
          arg0.getWebContext().refresh();


          轉(zhuǎn)載于: http://leo43.blog.hexun.com/p9/default.aspx
          posted on 2009-11-13 16:08 棋劍小秋 閱讀(878) 評(píng)論(0)  編輯  收藏 所屬分類: GIS
          主站蜘蛛池模板: 闸北区| 朔州市| 罗田县| 澄迈县| 巫山县| 云阳县| 吴桥县| 郴州市| 武功县| 长治市| 瑞安市| 济南市| 上栗县| 合山市| 远安县| 益阳市| 布拖县| 云阳县| 衡东县| 金门县| 太和县| 布尔津县| 舒兰市| 贺兰县| 隆回县| 襄垣县| 泸定县| 邯郸市| 石渠县| 孟连| 白玉县| 玉环县| 辰溪县| 宁武县| 湖州市| 黔江区| 凤冈县| 宣汉县| SHOW| 阿尔山市| 广昌县|