|
1 | 1 | export var FeatureIndex = L.Layer.extend({ |
2 | 2 | onAdd: function (map) { |
3 | | - let svgInnerHTML = `<svg |
4 | | - xmlns:dc="http://purl.org/dc/elements/1.1/" |
5 | | - xmlns:cc="http://creativecommons.org/ns#" |
6 | | - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
7 | | - xmlns:svg="http://www.w3.org/2000/svg" |
8 | | - xmlns="http://www.w3.org/2000/svg" version="1.1" |
9 | | - x="0px" y="0px" viewBox="0 0 99.999998 99.999998" xml:space="preserve"> |
10 | | - <g> |
11 | | - <rect width="100" height="100" |
12 | | - style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:0;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" |
13 | | - /> |
14 | | - </g> |
15 | | - </svg>`; |
| 3 | + let svgInnerHTML = `<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 100 100"><path fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" d="M0 0h100v100H0z" color="#000" overflow="visible"/></svg>`; |
16 | 4 |
|
17 | 5 | this._container = L.DomUtil.create("div", "mapml-feature-index-box", map._container); |
18 | 6 | this._container.innerHTML = svgInnerHTML; |
@@ -124,17 +112,17 @@ export var FeatureIndex = L.Layer.extend({ |
124 | 112 | let obj = this; |
125 | 113 | setTimeout(function() { |
126 | 114 | if (e && e.type === "focus") { |
127 | | - obj._container.querySelector('rect').style.display = "inline"; |
128 | | - obj._output.style.display = "block"; |
| 115 | + obj._container.removeAttribute("hidden"); |
| 116 | + obj._output.removeAttribute("hidden"); |
129 | 117 | } else if (e && e.type === "blur") { |
130 | | - obj._container.querySelector('rect').style.display = "none"; |
131 | | - obj._output.style.display = "none"; |
| 118 | + obj._container.setAttribute("hidden", ""); |
| 119 | + obj._output.setAttribute("hidden", ""); |
132 | 120 | } else if (obj._map.isFocused) { |
133 | | - obj._container.querySelector('rect').style.display = "inline"; |
134 | | - obj._output.style.display = "block"; |
| 121 | + obj._container.removeAttribute("hidden"); |
| 122 | + obj._output.removeAttribute("hidden"); |
135 | 123 | } else { |
136 | | - obj._container.querySelector('rect').style.display = "none"; |
137 | | - obj._output.style.display = "none"; |
| 124 | + obj._container.setAttribute("hidden", ""); |
| 125 | + obj._output.setAttribute("hidden", ""); |
138 | 126 | } |
139 | 127 | }, 0); |
140 | 128 |
|
|
0 commit comments