From dfa715e946fec65c39fb0c1a91b56431a1afb9b7 Mon Sep 17 00:00:00 2001
From: Aliyan Haq <55751566+AliyanH@users.noreply.github.com>
Date: Fri, 24 Feb 2023 16:32:17 -0500
Subject: [PATCH] Remove support for sharding (#768)
* remove support for sharding
* remove subdomain code
---
src/mapml/layers/MapMLLayer.js | 16 +---------------
src/mapml/layers/TemplatedTileLayer.js | 8 --------
test/e2e/data/osm.mapml | 8 +-------
.../data/tiles/cbmt/osm-changeProjection.mapml | 8 +-------
4 files changed, 3 insertions(+), 37 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..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];
@@ -268,7 +264,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 +369,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 @@
-
-
-
-
-
-
-
+