小秋的家

home

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  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 棋剑小秋 阅读(861) 评论(0)  编辑  收藏 所属分类: GIS

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


网站导航: