Skip to content

Conversation

snkashis
Copy link
Member

I don't use WMS layers currently, but this looks like a feature worth having. Issue #973
Including a test as well.

@@ -77,14 +77,20 @@ L.Util = {
return obj.options;
},

getParamString: function (obj) {
getParamString: function (obj, existing_url) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please conform to existing code conventions (camelCase variables, whitespace, etc.)

@snkashis
Copy link
Member Author

Sorry about that - how does it look now, with 8d442b1 in?

var params = [];
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
params.push(i + '=' + obj[i]);
}
}
return '?' + params.join('&');
return (existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also add a check for existingUrl here so that it's not required (and it uses '?' if not provided). Otherwise looks good!

@snkashis
Copy link
Member Author

Okay, in.

mourner added a commit that referenced this pull request Dec 27, 2012
handle existing query strings for WMS urls , #973
@mourner mourner merged commit 5109492 into Leaflet:master Dec 27, 2012
@mourner
Copy link
Member

mourner commented Dec 27, 2012

Looks good, thanks!

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

Successfully merging this pull request may close these issues.

2 participants