//獲得的標(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