Skip to content

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

@greeninfo

Description

@greeninfo

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;

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions