Skip to content

Commit

Permalink
drop the prefix for tilematrix entirely. also get rid of arcgis nonsense
Browse files Browse the repository at this point in the history
  • Loading branch information
krdyke committed May 15, 2020
1 parent a9a4bb5 commit 5b4ce10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/wmts.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ var _default = _leaflet.default.TileLayer.extend({
// (String, Object)
this._url = url;

this.fromArcGIS = url.search("arcgis") > -1 ? true : false;

var wmtsParams = _leaflet.default.extend({}, this.defaultWmtsParams);

var tileSize = options.tileSize || this.options.tileSize;
Expand Down Expand Up @@ -70,7 +68,7 @@ var _default = _leaflet.default.TileLayer.extend({

var ident = this.matrixIds[zoom].identifier;
//var tilematrix = this.wmtsParams.tilematrixSet + ':' + ident;
var tilematrix = this.fromArcGIS ? ident : this.wmtsParams.tilematrixSet + ':' + ident; // change for ArcGIS WMTS
var tilematrix = ident; //few providers I've seen use the prefix method above.
var X0 = this.matrixIds[zoom].topLeftCorner.lng;
var Y0 = this.matrixIds[zoom].topLeftCorner.lat;
var tilecol = Math.floor((nw.x - X0) / tilewidth);
Expand Down
6 changes: 3 additions & 3 deletions src/wmts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export default L.TileLayer.extend({
initialize: function(url, options) {
// (String, Object)
this._url = url;
this.fromArcGIS = url.search("arcgis") > -1 ? true : false;
var wmtsParams = L.extend({}, this.defaultWmtsParams);
var wmtsParams = L.extend({}, this.defaultWmtsParams);
var tileSize = options.tileSize || this.options.tileSize;
if (options.detectRetina && L.Browser.retina) {
wmtsParams.width = wmtsParams.height = tileSize * 2;
Expand Down Expand Up @@ -53,7 +52,8 @@ export default L.TileLayer.extend({
var tilewidth = se.x - nw.x;
//zoom = this._map.getZoom();
var ident = this.matrixIds[zoom].identifier;
var tilematrix = this.fromArcGIS ? this.wmtsParams.tilematrixSet : this.wmtsParams.tilematrixSet + ':' + ident; // change for ArcGIS WMTS
//var tilematrix = this.wmtsParams.tilematrixSet + ':' + ident;
var tilematrix = ident; //few providers I've seen use the prefix method above
var X0 = this.matrixIds[zoom].topLeftCorner.lng;
var Y0 = this.matrixIds[zoom].topLeftCorner.lat;
var tilecol = Math.floor((nw.x - X0) / tilewidth);
Expand Down

0 comments on commit 5b4ce10

Please sign in to comment.