Revision 7945 trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/wms/WMSProtocolHandler.java

View differences:

WMSProtocolHandler.java
330 330
		}
331 331
    } 
332 332
    
333
    public File getLegendGraphic(String layerName, ICancellable cancel) throws ServerErrorException, WMSException
333
    public File getLegendGraphic(WMSStatus status, String layerName, ICancellable cancel) throws ServerErrorException, WMSException
334 334
    {
335 335
    	URL request = null;
336 336
		try
337 337
		{
338
			request = new URL(buildGetLegendGraphicRequest(layerName));     
338
			request = new URL(buildGetLegendGraphicRequest(status, layerName));     
339 339
			System.out.println(request);
340 340
            File f = Utilities.downloadFile(request, "wmsGetLegendGraphic", cancel);            		    	
341 341
	    	if (f== null)
......
522 522
     */
523 523
    protected String buildGetFeatureInfoRequest(WMSStatus status, int x, int y)
524 524
    {
525
//    	TODO: pass by parameter the info output format?
525 526
		StringBuffer req = new StringBuffer();
526 527
		String symbol = null;
527 528

  
......
550 551
    /**
551 552
     * Builds the GetMapRequest according to the OGC WMS Specifications
552 553
     */
553
    private String buildGetLegendGraphicRequest(String layerName)
554
    private String buildGetLegendGraphicRequest(WMSStatus status, String layerName)
554 555
    { 
556
    	//TODO: pass by parameter the legend output format?
555 557
		StringBuffer req = new StringBuffer();
556 558
		String symbol = null;
557 559
		String onlineResource = null;
558
		onlineResource = getHost();
560
		
561
		if (status.getOnlineResource() == null)
562
			onlineResource = getHost();
563
		else 
564
			onlineResource = status.getOnlineResource();
559 565
		symbol = getSymbol(onlineResource);
560 566
        
561 567
		req.append(onlineResource + symbol + "REQUEST=GetLegendGraphic&SERVICE=WMS&VERSION=").append(getVersion()).append("&");

Also available in: Unified diff