From 88249703fee8df7bf77418afb41a22b95e2f8791 Mon Sep 17 00:00:00 2001 From: AliyanH Date: Thu, 23 Feb 2023 14:49:46 -0500 Subject: [PATCH 1/2] remove support for sharding --- src/mapml/layers/MapMLLayer.js | 16 +--------------- src/mapml/layers/TemplatedTileLayer.js | 4 ---- test/e2e/data/osm.mapml | 8 +------- .../data/tiles/cbmt/osm-changeProjection.mapml | 8 +------- 4 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/mapml/layers/MapMLLayer.js b/src/mapml/layers/MapMLLayer.js index 603fcf200..8bed812ab 100644 --- a/src/mapml/layers/MapMLLayer.js +++ b/src/mapml/layers/MapMLLayer.js @@ -926,21 +926,7 @@ export var MapMLLayer = L.Layer.extend({ inputs.push(inp); includesZoom = includesZoom || inp.hasAttribute("type") && inp.getAttribute("type").toLowerCase() === "zoom"; - if (inp.hasAttribute('shard')) { - var id = inp.getAttribute('list'); - inp.servers = []; - var servers = serverExtent.querySelectorAll('map-datalist#'+id + ' > map-option'); - if (servers.length === 0 && inp.hasAttribute('value')) { - servers = inp.getAttribute('value').split(''); - } - for (var s=0;s < servers.length;s++) { - if (servers[s].getAttribute) { - inp.servers.push(servers[s].getAttribute('value')); - } else { - inp.servers.push(servers[s]); - } - } - } else if (inp.tagName.toLowerCase() === 'map-select') { + if (inp.tagName.toLowerCase() === 'map-select') { // use a throwaway div to parse the input from MapML into HTML var div =document.createElement("div"); div.insertAdjacentHTML("afterbegin",inp.outerHTML); diff --git a/src/mapml/layers/TemplatedTileLayer.js b/src/mapml/layers/TemplatedTileLayer.js index 14c178ab2..c8b519451 100644 --- a/src/mapml/layers/TemplatedTileLayer.js +++ b/src/mapml/layers/TemplatedTileLayer.js @@ -268,7 +268,6 @@ export var TemplatedTileLayer = L.TileLayer.extend({ axis = inputs[i].getAttribute("axis"), name = inputs[i].getAttribute("name"), position = inputs[i].getAttribute("position"), - shard = (type === "hidden" && inputs[i].hasAttribute("shard")), select = (inputs[i].tagName.toLowerCase() === "map-select"), value = inputs[i].getAttribute("value"), min = inputs[i].getAttribute("min"), @@ -374,9 +373,6 @@ export var TemplatedTileLayer = L.TileLayer.extend({ zoom.max = Number.parseInt(max,10); } template.zoom = zoom; - } else if (shard) { - template.tile.server = name; - template.tile.subdomains = inputs[i].servers.slice(); } else if (select) { /*jshint -W104 */ const parsedselect = inputs[i].htmlselect; diff --git a/test/e2e/data/osm.mapml b/test/e2e/data/osm.mapml index 0126a32a3..6a6794fbe 100644 --- a/test/e2e/data/osm.mapml +++ b/test/e2e/data/osm.mapml @@ -8,15 +8,9 @@ - - - - - - - + diff --git a/test/e2e/data/tiles/cbmt/osm-changeProjection.mapml b/test/e2e/data/tiles/cbmt/osm-changeProjection.mapml index e8602c6b8..0cb181f02 100644 --- a/test/e2e/data/tiles/cbmt/osm-changeProjection.mapml +++ b/test/e2e/data/tiles/cbmt/osm-changeProjection.mapml @@ -8,15 +8,9 @@ - - - - - - - + From f06864108c79e44b6ae61f9b481c1b4b49bf8835 Mon Sep 17 00:00:00 2001 From: AliyanH Date: Fri, 24 Feb 2023 10:49:14 -0500 Subject: [PATCH 2/2] remove subdomain code --- src/mapml/layers/TemplatedTileLayer.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/mapml/layers/TemplatedTileLayer.js b/src/mapml/layers/TemplatedTileLayer.js index c8b519451..a0a9ccabb 100644 --- a/src/mapml/layers/TemplatedTileLayer.js +++ b/src/mapml/layers/TemplatedTileLayer.js @@ -20,9 +20,6 @@ export var TemplatedTileLayer = L.TileLayer.extend({ L.setOptions(this, options); this._setUpTileTemplateVars(template); - if (template.tile.subdomains) { - L.setOptions(this, L.extend(this.options, {subdomains: template.tile.subdomains})); - } this._template = template; this._initContainer(); // call the parent constructor with the template tref value, per the @@ -166,7 +163,6 @@ export var TemplatedTileLayer = L.TileLayer.extend({ obj[this._template.pcrs.easting.right] = this._tileMatrixToPCRSPosition(coords, 'top-right').x; obj[this._template.pcrs.northing.top] = this._tileMatrixToPCRSPosition(coords, 'top-left').y; obj[this._template.pcrs.northing.bottom] = this._tileMatrixToPCRSPosition(coords, 'bottom-left').y; - obj[this._template.tile.server] = this._getSubdomain(coords); for (var v in this._template.tile) { if (["row","col","zoom","left","right","top","bottom"].indexOf(v) < 0) { obj[v] = this._template.tile[v];