Skip to content

Commit ea1c4f1

Browse files
prushforprushforth
authored andcommitted
Close #137 Rename the layer- element to map-layer
1 parent 87f3cce commit ea1c4f1

41 files changed

Lines changed: 141 additions & 141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/custom-map-ui/bootstrap-ui.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ <h3>Layers</h3>
4545
<figure>
4646
<mapml-viewer id="custom-map" style="width:500px;height: 500px;" projection="CBMTILE" zoom="0" lat="47"
4747
lon="-92">
48-
<layer- label="Canada Base Map - Geometry" src="../../refactoring-temporary/cbmtgeom.mapml" checked>
49-
</layer->
50-
<layer- label="Fire Danger (forecast)" src="../../refactoring-temporary/fdi.mapml"></layer->
48+
<map-layer label="Canada Base Map - Geometry" src="../../refactoring-temporary/cbmtgeom.mapml" checked>
49+
</map-layer>
50+
<map-layer label="Fire Danger (forecast)" src="../../refactoring-temporary/fdi.mapml"></map-layer>
5151
</mapml-viewer>
5252

5353
<figcaption class="map-controls">

api/custom-map-ui/custom-css-ui.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ <h3>Layers</h3>
4545
<figure>
4646
<mapml-viewer id="custom-map" style="width:500px;height: 500px;" projection="CBMTILE" zoom="0" lat="47"
4747
lon="-92">
48-
<layer- label="Canada Base Map - Geometry" src="../../refactoring-temporary/cbmtgeom.mapml" checked>
49-
</layer->
50-
<layer- label="Fire Danger (forecast)" src="../../refactoring-temporary/fdi.mapml"></layer->
48+
<map-layer label="Canada Base Map - Geometry" src="../../refactoring-temporary/cbmtgeom.mapml" checked>
49+
</map-layer>
50+
<map-layer label="Fire Danger (forecast)" src="../../refactoring-temporary/fdi.mapml"></map-layer>
5151
</mapml-viewer>
5252

5353
<figcaption class="map-controls">

api/custom-map-ui/custom-ui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
CustomUI = {
22
initialize: function () {
3-
let layers = document.querySelectorAll("layer-");
3+
let layers = document.querySelectorAll("map-layer");
44
let map = document.querySelector("mapml-viewer");
55

66
let mapObserver = new MutationObserver((m) => {
77
m.forEach((mut) => {
88
if (mut.type === "childList") {
99
mut.addedNodes.forEach((l) => {
10-
if (l.tagName === "LAYER-") {
10+
if (l.tagName === "MAP-LAYER") {
1111
CustomUI.addLayer(l);
1212
}
1313
});

api/custom-map-ui/geolocation-search-ui.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</div>
2626

2727
<mapml-viewer projection="OSMTILE" zoom="4" lat="58.276703" lon="-103.710938" controls controlslist="nofullscreen" id="map">
28-
<layer- label="OpenStreetMap" src="../../refactoring-temporary/osm.mapml" checked></layer->
28+
<map-layer label="OpenStreetMap" src="../../refactoring-temporary/osm.mapml" checked></map-layer>
2929
</mapml-viewer>
3030

3131
<script>

api/custom-map-ui/geoname-search-ui.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</div>
2727

2828
<mapml-viewer projection="OSMTILE" zoom="4" lat="58.276703" lon="-103.710938" controls controlslist="nofullscreen" id="map">
29-
<layer- label="OpenStreetMap" src="../../refactoring-temporary/osm.mapml" checked></layer->
29+
<map-layer label="OpenStreetMap" src="../../refactoring-temporary/osm.mapml" checked></map-layer>
3030
</mapml-viewer>
3131

3232
<script>

api/geojson/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
vertical-align: middle;
101101
}
102102

103-
/* Pre-style to avoid FOUC of inline layer- and fallback content. */
103+
/* Pre-style to avoid FOUC of inline map-layer and fallback content. */
104104
mapml-viewer:not(:defined) > * {
105105
display: none;
106106
}
@@ -116,15 +116,15 @@
116116
supported, or if javascript is disabled. This needs to be defined separately
117117
from the above, because the `:not(:defined)` selector invalidates the entire
118118
declaration in browsers that do not support it. */
119-
layer- {
119+
map-layer {
120120
display: none;
121121
}
122122
</style>
123123
<noscript>
124124
<style>
125125
/* Ensure fallback content (children of the map element) is displayed if
126126
custom/built-in elements is supported but javascript is disabled. */
127-
mapml-viewer:not(:defined) > :not(layer-) {
127+
mapml-viewer:not(:defined) > :not(map-layer) {
128128
display: initial;
129129
}
130130

@@ -140,14 +140,14 @@
140140
</head>
141141
<body>
142142
<mapml-viewer projection="OSMTILE" zoom="2" lat="45" lon="-90" controls>
143-
<layer- label="United States - The National Map" checked>
143+
<map-layer label="United States - The National Map" checked>
144144
<map-extent units="OSMTILE" checked hidden>
145145
<map-input name="TileMatrix" type="zoom" value="18" min="0" max="16"></map-input>
146146
<map-input name="TileCol" type="location" units="tilematrix" axis="column" min="0" max="262144"></map-input>
147147
<map-input name="TileRow" type="location" units="tilematrix" axis="row" min="0" max="262144"></map-input>
148148
<map-link rel="tile" tref="https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{TileMatrix}/{TileRow}/{TileCol}"></map-link>
149149
</map-extent>
150-
</layer->
150+
</map-layer>
151151
</mapml-viewer>
152152
<script src="https://leafletjs.com/examples/choropleth/us-states.js"></script>
153153
<script src="canada.js"></script>

api/map-feature/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@
100100
document.querySelector('map-feature').zoomTo();
101101
}
102102
function removeMan() {
103-
document.querySelector('layer-[label="Two Hat Man"]').remove();
103+
document.querySelector('map-layer[label="Two Hat Man"]').remove();
104104
toggleDisabled();
105105
}
106106
</script>
107107
<template id="projection">
108108
<map-meta name="projection" content="OSMTILE"></map-meta>
109109
</template>
110110
<template id="empty-layer">
111-
<layer- label="Empty" checked>
111+
<map-layer label="Empty" checked>
112112
<map-meta name="projection" content="OSMTILE"></map-meta>
113-
</layer->
113+
</map-layer>
114114
</template>
115115

116116
<template id="hatman">
@@ -143,10 +143,10 @@
143143

144144

145145
<mapml-viewer projection="OSMTILE" zoom="1" lat="0" lon="0" controls>
146-
<layer- label="OSM" src="../../refactoring-temporary/osm.mapml" checked></layer->
147-
<!-- <layer- id="target-layer" label="Empty" checked>
146+
<map-layer label="OSM" src="../../refactoring-temporary/osm.mapml" checked></map-layer>
147+
<!-- <map-layer id="target-layer" label="Empty" checked>
148148
<map-meta name="projection" content="OSMTILE"></map-meta>
149-
</layer->-->
149+
</map-layer>-->
150150
</mapml-viewer>
151151
<button id="add" onclick="_doMan('add')">Add feature</button>
152152
<button id="focus" disabled onclick="_doMan('focus')">Focus feature</button>

api/pwa/file-handling/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ In this post, we will not dive into all the details, so I will just show the sni
132132
...
133133
// Create the map with one layer
134134
<mapml-viewer zoom="2" lat="0" lon="0" controls controlslist="geolocation">
135-
<layer- label="OpenStreetMap" checked >
135+
<map-layer label="OpenStreetMap" checked >
136136
<map-link rel="license" href="https://www.openstreetmap.org/copyright" title="© OpenStreetMap contributors CC BY-SA"></map-link>
137137
<map-extent units="OSMTILE" checked>
138138
<map-input name="z" type="zoom" value="18" min="0" max="18"></map-input>
139139
<map-input name="x" type="location" units="tilematrix" axis="column" min="0" max="262144"></map-input>
140140
<map-input name="y" type="location" units="tilematrix" axis="row" min="0" max="262144"></map-input>
141141
<map-link rel="tile" tref="https://tile.openstreetmap.org/{z}/{x}/{y}.png"></map-link>
142142
</map-extent>
143-
</layer->
143+
</map-layer>
144144
</mapml-viewer>
145145
...
146146
```

api/pwa/file-handling/src/main-app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,15 @@ mapml-viewer {
135135
<label for="loadfile">Load GeoJSON</label>
136136
</div>
137137
<mapml-viewer zoom="2" lat="0" lon="0" controls controlslist="geolocation">
138-
<layer- label="OpenStreetMap" checked >
138+
<map-layer label="OpenStreetMap" checked >
139139
<map-link rel="license" href="https://www.openstreetmap.org/copyright" title="© OpenStreetMap contributors CC BY-SA"></map-link>
140140
<map-extent units="OSMTILE" checked>
141141
<map-input name="z" type="zoom" value="18" min="0" max="18"></map-input>
142142
<map-input name="x" type="location" units="tilematrix" axis="column" min="0" max="262144"></map-input>
143143
<map-input name="y" type="location" units="tilematrix" axis="row" min="0" max="262144"></map-input>
144144
<map-link rel="tile" tref="https://tile.openstreetmap.org/{z}/{x}/{y}.png"></map-link>
145145
</map-extent>
146-
</layer->
146+
</map-layer>
147147
</mapml-viewer>
148148
<a class="credits" href="https://www.flaticon.com/free-icons/parchment" title="parchment icons">Parchment icons created by Freepik - Flaticon</a>
149149
</div>

change-projection/default-projection/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</head>
2424
<body>
2525
<mapml-viewer zoom="5" lon="-97.288195" lat="56.555669" controls>
26-
<layer- checked>
26+
<map-layer checked>
2727
<map-meta name="extent" content="top-left-easting=-19959237, top-left-northing=13854059, bottom-right-easting=-1174073, bottom-right-northing=4647371"></map-meta>
2828
<map-title>Topo base</map-title>
2929
<map-extent units="OSMTILE" label="Toprama - Mercator" checked>
@@ -41,8 +41,8 @@
4141
<map-input name="y" type="location" units="tilematrix" axis="row"></map-input>
4242
<map-input name="x" type="location" units="tilematrix" axis="column"></map-input>
4343
<map-link rel="tile" tref="https://geoappext.nrcan.gc.ca/arcgis/rest/services/BaseMaps/CBMT3978/MapServer/tile/{z}/{y}/{x}?m4h=t" ></map-link>
44-
</map-extent> </layer->
45-
<layer- label="Projection not specified" checked>
44+
</map-extent> </map-layer>
45+
<map-layer label="Projection not specified" checked>
4646
<map-feature zoom="14">
4747
<map-featurecaption>Copied OSMTILE pcrs location</map-featurecaption>
4848
<map-properties>
@@ -55,7 +55,7 @@ <h2>Copied OSMTILE pcrs location</h2>
5555
</map-point>
5656
</map-geometry>
5757
</map-feature>
58-
</layer->
58+
</map-layer>
5959
</mapml-viewer>
6060
</body>
6161
</html>

0 commit comments

Comments
 (0)