Revision 9075 trunk/extensions/extWMS/src/com/iver/cit/gvsig/fmap/layers/FLyrWMS.java

View differences:

FLyrWMS.java
1734 1734
	}
1735 1735

  
1736 1736
	public Image getImageLegend() {
1737
		try {
1738 1737
			if (wms.hasLegendGraphic() ){
1739 1738
				wmsStatus.setOnlineResource((String) onlineResources.get("GetLegendGraphic"));
1740
				File legend = getDriver().getLegendGraphic(wmsStatus, layerQuery, null);
1739
				String path=getPathImage();//File legend = getDriver().getLegendGraphic(wmsStatus, layerQuery, null);
1741 1740
				Image img = null;
1742
				if ((legend!= null) && (legend.length() > 0))
1743
					//img = ImageIO.read(legend);
1744
					img = new ImageIcon(legend.getAbsolutePath()).getImage();
1741
				if ((path!= null) && (path.length() > 0))
1742
					img = new ImageIcon(path).getImage();
1745 1743
				return img;
1746
			}else{
1744
			}
1747 1745
				return null;
1748
			}
1746
	}
1747

  
1748
	public String getPathImage() {
1749
		try {
1750
			File legend = getDriver().getLegendGraphic(wmsStatus, layerQuery, null);
1751
			return legend.getAbsolutePath();
1749 1752
		}catch(Exception e){
1750 1753
			e.printStackTrace();
1751 1754
			return null;

Also available in: Unified diff