小秋的家

          home

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

          //獲得的標點
          WebPoint pt=(WebPoint)arg0.getWebGeometry().toMapGeometry(arg0.getWebContext().getWebMap());
                                       

          //獲得圖片的二進制 可以在application啟動時進行讀取,放在context的某個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();


          //在地圖上標注
          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();


          轉載于: http://leo43.blog.hexun.com/p9/default.aspx
          posted on 2009-11-13 16:08 棋劍小秋 閱讀(878) 評論(0)  編輯  收藏 所屬分類: GIS
          主站蜘蛛池模板: 邻水| 海原县| 南华县| 麻江县| 长沙县| 长岭县| 阳山县| 微山县| 云龙县| 阿合奇县| 奉新县| 吴忠市| 昌邑市| 丰城市| 绍兴市| 滁州市| 秭归县| 湘乡市| 林州市| 合肥市| 郑州市| 台州市| 庄浪县| 墨脱县| 五莲县| 沙湾县| 南华县| 东海县| 阿拉尔市| 浦城县| 自贡市| 江山市| 天门市| 阿坝县| 论坛| 大足县| 丰顺县| 祥云县| 甘谷县| 柏乡县| 梅河口市|