Skip to content

Commit

Permalink
Get rid of resetTemplatedLayers, which was a hold-over from the
Browse files Browse the repository at this point in the history
initial extent era.
  • Loading branch information
prushforth committed Jul 20, 2023
1 parent 5ce4ed9 commit 5e184e3
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/mapml/layers/MapMLLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,8 @@ export var MapMLLayer = L.Layer.extend({
: mapml.baseURI || this.responseURL,
this.responseURL
).href;
// TODO try to remove need for _extent, or rename it to e.g. _private
layer._extent = {};
if (mapml.querySelector && mapml.querySelector('map-feature'))
layer._content = mapml;
if (!this.responseXML && this.responseText)
Expand All @@ -1416,7 +1418,6 @@ export var MapMLLayer = L.Layer.extend({
thinkOfAGoodName();
parseLicenseAndLegend();
setZoomInOrOutLinks();
resetTemplatedLayers();
processTiles();
M._parseStylesheetAsHTML(mapml, base, layer._container);
getExtentLayerControls();
Expand Down Expand Up @@ -1504,7 +1505,6 @@ export var MapMLLayer = L.Layer.extend({
);
return;
} else if (!serverMeta) {
layer._extent = {};
if (projectionMatch) {
layer._extent.crs = M[projection];
}
Expand Down Expand Up @@ -1556,8 +1556,6 @@ export var MapMLLayer = L.Layer.extend({
function setZoomInOrOutLinks() {
var zoomin = mapml.querySelector('map-link[rel=zoomin]'),
zoomout = mapml.querySelector('map-link[rel=zoomout]');
delete layer._extent.zoomin;
delete layer._extent.zoomout;
if (zoomin) {
layer._extent.zoomin = new URL(
zoomin.getAttribute('href'),
Expand All @@ -1571,18 +1569,6 @@ export var MapMLLayer = L.Layer.extend({
).href;
}
}
function resetTemplatedLayers() {
if (layer._extent._mapExtents) {
for (let i = 0; i < layer._extent._mapExtents.length; i++) {
if (layer._extent._mapExtents[i].templatedLayer) {
layer._extent._mapExtents[i].templatedLayer.reset(
layer._extent._mapExtents[i]._templateVars,
layer._extent._mapExtents[i].extentZIndex
);
}
}
}
}
function processTiles() {
if (mapml.querySelector('map-tile')) {
var tiles = document.createElement('map-tiles'),
Expand Down

0 comments on commit 5e184e3

Please sign in to comment.