Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baseParams duplicated on WMSLegend #51

Open
ahocevar opened this issue Jun 30, 2012 · 2 comments
Open

baseParams duplicated on WMSLegend #51

ahocevar opened this issue Jun 30, 2012 · 2 comments

Comments

@ahocevar
Copy link
Member

If a WMSLegend is configured with a URL, and baseParams e.g. contain a FORMAT, the FORMAT gets appended even if the original URL already has a FORMAT param.

We really need to turn all params into an object, uppercase them, and compare them against uppercased baesParams to make sure we don't duplicate any. Whether we override or ignore is a different question - but baseParams implies that we ignore params that are in the URL already.

@bartvde
Copy link
Member

bartvde commented Sep 11, 2012

AFAICT there is already a check for FORMAT in the code, so it will not be duplicated currently. There is even a test-case that accounts for this case.

Are you suggesting to do this for any baseParam @ahocevar ?

@dncpax
Copy link

dncpax commented Nov 19, 2012

I'm finding GeoExt.WMSLegend is still appending two times "format=" to the legend url. This gives the same problems reported in #434:
http://trac.geoext.org/ticket/434

I find that when url has already got format option and also params has the format option too, in the final lines they get appended in the final url:

url = Ext.urlAppend(url, Ext.urlEncode(params));

This causes the same duplication of format option.

I hacked it quickly with this at the end of the getLegendUrl method:

//avoid duplicated format option

if(params.hasOwnProperty('format') && url.toLowerCase().indexOf("format=") > -1)
delete params.format;
url = Ext.urlAppend(url, Ext.urlEncode(params));

This works for me.

This happens in http://suite.opengeo.org/geoexplorer.

WMS url to replicate:
http://sigims.edia.pt/EDIASIG/AGSProxy/proxy.ashx?key=EDIA_SGRCacheWMSMerc

I can see the legend request:
http://sigims.edia.pt/EDIASIG/AGSProxy/proxy.ashx?key=EDIA_SGRCacheWMSMerc?request=GetLegendGraphic%26version=1.1.1%26format=image/png%26layer=5&transparent=true&format=image%2Fpng&legend_options=fontAntiAliasing%3Atrue%3BfontSize%3A11%3BfontName%3AArial&SCALE=1091958.1364361627

Duarte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants