Skip to content

Commit

Permalink
Rename the layer- element to map-layer
Browse files Browse the repository at this point in the history
  • Loading branch information
prushforth committed Oct 21, 2024
1 parent 570779d commit 48c033b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function createMap() {
map.setAttribute("lat", lat);
map.setAttribute("lon", lon);
map.setAttribute("zoom", zoom);
let layer = document.createElement("layer-");
let layer = document.createElement("map-layer");
layer.setAttribute("src", window.location.href);
layer.setAttribute("checked", "");
let title = document.createElement("title");
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/basics/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<mapml-viewer style="height: 500px;width:500px;" is="web-map" projection="CBMTILE" zoom="2" lat="45.5052040" lon="-75.2202344"
controls>

<layer- label="Basic Features" checked>
<map-layer label="Basic Features" checked>
<map-meta name="projection" content="CBMTILE"></map-meta>
<map-meta name="zoom" content="min=1,max=5,value=0"></map-meta>
<map-meta name="cs" content="gcrs"></map-meta>
Expand Down Expand Up @@ -62,7 +62,7 @@ <h1>Test</h1>
</map-polygon>
</map-geometry>
</map-feature>
</layer->
</map-layer>
</mapml-viewer>

</body>
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/basics/popup.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
vertical-align: middle;
}

/* Pre-style to avoid FOUC of inline layer- and fallback content. */
/* Pre-style to avoid FOUC of inline map-layer and fallback content. */
mapml-viewer:not(:defined) > * {
display: none;
}
Expand All @@ -49,15 +49,15 @@
supported, or if javascript is disabled. This needs to be defined separately
from the above, because the `:not(:defined)` selector invalidates the entire
declaration in browsers that do not support it. */
layer- {
map-layer {
display: none;
}
</style>
<noscript>
<style>
/* Ensure fallback content (children of the map element) is displayed if
custom/built-in elements is supported but javascript is disabled. */
mapml-viewer:not(:defined) > :not(layer-) {
mapml-viewer:not(:defined) > :not(map-layer) {
display: initial;
}

Expand All @@ -73,14 +73,14 @@
</head>
<body>
<mapml-viewer projection="OSMTILE" zoom="10" lon="-75.7" lat="45.4" controls="">
<layer- label="OpenStreetMap" checked="">
<map-layer label="OpenStreetMap" checked="">
<map-extent units="OSMTILE" checked>
<map-input name="z" type="zoom" value="18" min="0" max="18"></map-input>
<map-input name="x" type="location" units="tilematrix" axis="column" min="0" max="262144" ></map-input>
<map-input name="y" type="location" units="tilematrix" axis="row" min="0" max="262144" ></map-input>
<map-link rel="tile" tref="https://tile.openstreetmap.org/{z}/{x}/{y}.png" />
</map-extent>
</layer->
</map-layer>
</mapml-viewer>
</body>
</html>
2 changes: 1 addition & 1 deletion test/e2e/basics/preferred-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>
<body>
<mapml-viewer style="height: 500px;width:500px;" projection="CBMTILE" zoom="8" lat="46.51231982020816" lon="-63.25669692277839" controls>
<layer- data-testid="test-layer" label="Provinces and Territories" src="../data/cbmt-cbmtile.mapml" checked></layer->
<map-layer data-testid="test-layer" label="Provinces and Territories" src="../data/cbmt-cbmtile.mapml" checked></map-layer>
</mapml-viewer>
</body>
</html>
2 changes: 1 addition & 1 deletion test/e2e/basics/render.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ test.describe("Render MapML resources test", () => {
expect(projection).toEqual("CBMTILE");
// if this issue gets fixed, the following will fail and should be reversed
// https://github.com/Maps4HTML/MapML.js/issues/677
const disabled = await page.$eval("xpath=//html/body/mapml-viewer/layer-",
const disabled = await page.$eval("xpath=//html/body/mapml-viewer/map-layer",
(layer) => layer.hasAttribute("disabled"));
expect(disabled).toBe(true);
}, {times: 1});
Expand Down

0 comments on commit 48c033b

Please sign in to comment.