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

Subdomain {s} substitution not supported in L.TileLayer.WMS #735

Closed
greeninfo opened this issue Jun 18, 2012 · 1 comment
Closed

Subdomain {s} substitution not supported in L.TileLayer.WMS #735

greeninfo opened this issue Jun 18, 2012 · 1 comment
Assignees
Labels
Milestone

Comments

@greeninfo
Copy link

In Leaflet 3, L.TileLayer.WMS does not use the subdomains option and the {s} template tag to use subdomains.

The following patch to WMS getTileUrl() adds support for subdomains and {s} in the URL.

OLD:
return this._url + L.Util.getParamString(this.wmsParams) + "&bbox=" + bbox;

NEW:
var subdomains = this.options.subdomains;
var s = this.options.subdomains[(tilePoint.x + tilePoint.y) % subdomains.length];
var baseurl = L.Util.template(this._url, L.Util.extend({ s: s }) );
var tileurl = baseurl + L.Util.getParamString(this.wmsParams) + "&bbox=" + bbox;
return tileurl;

@ghost ghost assigned mourner Jun 19, 2012
@mourner
Copy link
Member

mourner commented Jun 19, 2012

Agreed, thanks for the suggestion - will be added!

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

No branches or pull requests

2 participants