@eox/layercontrol 0.29.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/eox-layercontrol.js +2999 -2864
  2. package/dist/eox-layercontrol.umd.cjs +627 -566
  3. package/dist/material-symbols-outlined.woff2 +0 -0
  4. package/dist/material-symbols-rounded.woff2 +0 -0
  5. package/dist/material-symbols-sharp.woff2 +0 -0
  6. package/dist/material-symbols-subset.woff2 +0 -0
  7. package/package.json +4 -3
  8. package/src/components/add-layers.js +78 -178
  9. package/src/components/layer-config.js +22 -3
  10. package/src/components/layer-group.js +38 -17
  11. package/src/components/layer-legend.js +7 -4
  12. package/src/components/layer-list.js +27 -19
  13. package/src/components/layer-tools.js +60 -118
  14. package/src/components/layer.js +220 -60
  15. package/src/components/optional-list.js +32 -25
  16. package/src/components/tools-items.js +34 -31
  17. package/src/enums/index.js +1 -0
  18. package/src/enums/stories/index.js +4 -2
  19. package/src/helpers/create-sortable.js +4 -1
  20. package/src/helpers/get-layer-type.js +2 -1
  21. package/src/helpers/index.js +1 -0
  22. package/src/helpers/layer-tools.js +75 -13
  23. package/src/main.js +36 -6
  24. package/types/layercontrol/src/components/add-layers.d.ts.map +1 -1
  25. package/types/layercontrol/src/components/layer-config.d.ts.map +1 -1
  26. package/types/layercontrol/src/components/layer-group.d.ts.map +1 -1
  27. package/types/layercontrol/src/components/layer-legend.d.ts.map +1 -1
  28. package/types/layercontrol/src/components/layer-list.d.ts.map +1 -1
  29. package/types/layercontrol/src/components/layer-tools.d.ts +8 -4
  30. package/types/layercontrol/src/components/layer-tools.d.ts.map +1 -1
  31. package/types/layercontrol/src/components/layer.d.ts +9 -0
  32. package/types/layercontrol/src/components/layer.d.ts.map +1 -1
  33. package/types/layercontrol/src/components/optional-list.d.ts.map +1 -1
  34. package/types/layercontrol/src/components/tools-items.d.ts.map +1 -1
  35. package/types/layercontrol/src/enums/index.d.ts +1 -1
  36. package/types/layercontrol/src/enums/stories/index.d.ts +1 -0
  37. package/types/layercontrol/src/enums/stories/index.d.ts.map +1 -1
  38. package/types/layercontrol/src/helpers/create-sortable.d.ts.map +1 -1
  39. package/types/layercontrol/src/helpers/get-layer-type.d.ts.map +1 -1
  40. package/types/layercontrol/src/helpers/index.d.ts +1 -1
  41. package/types/layercontrol/src/helpers/layer-tools.d.ts +13 -3
  42. package/types/layercontrol/src/helpers/layer-tools.d.ts.map +1 -1
  43. package/types/layercontrol/src/main.d.ts.map +1 -1
  44. package/types/map/src/components/compare.d.ts +2 -2
  45. package/types/map/src/components/compare.d.ts.map +1 -1
  46. package/types/map/src/components/tooltip.d.ts +7 -2
  47. package/types/map/src/components/tooltip.d.ts.map +1 -1
  48. package/types/map/src/controls/controls.d.ts +0 -6
  49. package/types/map/src/controls/controls.d.ts.map +1 -1
  50. package/types/map/src/controls/geo-location.d.ts +3 -3
  51. package/types/map/src/controls/geo-location.d.ts.map +1 -1
  52. package/types/map/src/controls/loading-indicator.d.ts +1 -1
  53. package/types/map/src/controls/loading-indicator.d.ts.map +1 -1
  54. package/types/map/src/custom/sources/FlatGeoBuf.d.ts +27 -0
  55. package/types/map/src/custom/sources/FlatGeoBuf.d.ts.map +1 -0
  56. package/types/map/src/custom/sources/WMTSCapabilities.d.ts +35 -0
  57. package/types/map/src/custom/sources/WMTSCapabilities.d.ts.map +1 -0
  58. package/types/map/src/helpers/add-new-feature.d.ts +2 -1
  59. package/types/map/src/helpers/add-new-feature.d.ts.map +1 -1
  60. package/types/map/src/helpers/generate.d.ts +5 -4
  61. package/types/map/src/helpers/generate.d.ts.map +1 -1
  62. package/types/map/src/helpers/interactions.d.ts.map +1 -1
  63. package/types/map/src/helpers/parse-text.d.ts +3 -1
  64. package/types/map/src/helpers/parse-text.d.ts.map +1 -1
  65. package/types/map/src/helpers/select.d.ts +5 -5
  66. package/types/map/src/helpers/select.d.ts.map +1 -1
  67. package/types/map/src/helpers/tile-grid.d.ts +2 -2
  68. package/types/map/src/helpers/tile-grid.d.ts.map +1 -1
  69. package/types/map/src/layers.d.ts +116 -0
  70. package/types/map/src/layers.d.ts.map +1 -0
  71. package/types/map/src/main.d.ts +7 -7
  72. package/types/map/src/main.d.ts.map +1 -1
  73. package/types/map/src/methods/map/add-update-layer.d.ts +2 -2
  74. package/types/map/src/methods/map/add-update-layer.d.ts.map +1 -1
  75. package/types/map/src/methods/map/setters.d.ts +2 -2
  76. package/types/map/src/methods/map/setters.d.ts.map +1 -1
  77. package/types/map/src/types.d.ts +28 -38
  78. package/types/map/src/types.d.ts.map +1 -1
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@eox/layercontrol",
3
- "version": "0.29.1",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
- "@eox/map": "^1.16.0",
6
+ "@eox/map": "*",
7
7
  "@types/lodash.throttle": "^4.1.9",
8
8
  "@types/sortablejs": "^1.15.1",
9
9
  "ol": "^10.4.0",
@@ -37,7 +37,8 @@
37
37
  "watch": "vite build --watch"
38
38
  },
39
39
  "dependencies": {
40
- "@eox/elements-utils": "^0.1.5",
40
+ "@eox/elements-utils": "^1.0.0",
41
+ "@eox/ui": "^0.3.6",
41
42
  "color-legend-element": "^1.3.0",
42
43
  "lit": "^3.2.0",
43
44
  "lodash.debounce": "^4.0.8",
@@ -156,6 +156,25 @@ export class EOxLayerControlAddLayers extends LitElement {
156
156
  * Handles input fields, search, and addition of layers.
157
157
  */
158
158
  render() {
159
+ const icons = {
160
+ add: html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
161
+ <title>layers-plus</title>
162
+ <path
163
+ d="M17,14H19V17H22V19H19V22H17V19H14V17H17V14M11,16L2,9L11,2L20,9L11,16M11,18.54L12,17.75V18C12,18.71 12.12,19.39 12.35,20L11,21.07L2,14.07L3.62,12.81L11,18.54Z"
164
+ />
165
+ </svg>`,
166
+ plus: html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
167
+ <title>plus</title>
168
+ <path d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" />
169
+ </svg>`,
170
+ search: html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
171
+ <title>magnify</title>
172
+ <path
173
+ d="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"
174
+ />
175
+ </svg>`,
176
+ };
177
+
159
178
  // Determine classes and tab states based on 'open' property
160
179
  const openCloseClassName = this.open ? "open" : "close";
161
180
  const isUrlTabOpen = this.open === "url";
@@ -166,60 +185,67 @@ export class EOxLayerControlAddLayers extends LitElement {
166
185
  return html`
167
186
  <style>
168
187
  ${this.#styleBasic}
169
- ${!this.unstyled && this.#styleEOX}
170
188
  </style>
171
189
  <div class="eox-add-layer-main">
172
- <div class="eox-add-layer-col">
190
+ <nav class="eox-add-layer-col">
173
191
  <!-- Tabbed interface for URL and JSON -->
174
- <ul class="eox-add-layer-tab ${openCloseClassName}">
175
- <li
192
+ <div
193
+ class="eox-add-layer-tab tabs min left-align ${openCloseClassName}"
194
+ >
195
+ <a
176
196
  @click=${() => this.#handleOpenCloseTab("url")}
177
197
  class="${isUrlTabOpen ? "active" : ""}"
178
198
  >
179
199
  URL
180
- </li>
181
- <li
200
+ </a>
201
+ <a
182
202
  @click=${() => this.#handleOpenCloseTab("json")}
183
203
  class="${isJsonTabOpen ? "active" : ""}"
184
204
  >
185
205
  JSON
186
- </li>
187
- </ul>
206
+ </a>
207
+ </div>
208
+
209
+ <div class="max"></div>
188
210
 
189
211
  <!-- Button to toggle tabs -->
190
212
  <button
191
- class="add-icon icon"
213
+ class="add-icon transparent square primary-text small"
192
214
  @click=${() => this.#handleOpenCloseTab(!this.open ? "url" : null)}
193
215
  >
194
- ${this.unstyled ? "Add Layer" : ""}
216
+ ${this.unstyled
217
+ ? "Add Layer"
218
+ : html`<i class="small primary-text">${icons.add}</i>`}
195
219
  </button>
196
- </div>
197
- <div class="eox-add ${openCloseClassName}">
220
+ </nav>
221
+ <div class="eox-add ${openCloseClassName}" style="padding: 15px 0">
198
222
  ${isUrlTabOpen
199
223
  ? html`
200
- <!-- Input field for URL -->
201
- <div class="eox-add-layer-col">
202
- <input
203
- type="text"
204
- class="add-url"
205
- placeholder="Add URL (WMS/XYZ)"
206
- .value="${this.urlInput}"
207
- @input=${this.#handleURLChange}
208
- >
209
- </input>
210
- <!-- Search button for URL -->
211
- <button
212
- class="search-icon"
213
- disabled=${disableSearchBtn}
214
- @click=${this.#handleWMSSearchURL}
215
- >
216
- ${this.unstyled ? "Search" : ""}
217
- </button>
218
- </div>
224
+ <nav>
225
+ <!-- Input field for URL -->
226
+ <div class="eox-add-layer-col field border small responsive">
227
+ <input
228
+ type="text"
229
+ class="add-url"
230
+ placeholder="Add URL (WMS/XYZ)"
231
+ .value="${this.urlInput}"
232
+ @input=${this.#handleURLChange}
233
+ />
234
+ </div>
235
+ <!-- Search button for URL -->
236
+ <button
237
+ class="search-icon"
238
+ disabled=${disableSearchBtn}
239
+ @click=${this.#handleWMSSearchURL}
240
+ >
241
+ ${this.unstyled
242
+ ? "Search"
243
+ : html`<i class="small">${icons.search}</i>`}
244
+ </button>
245
+ </nav>
219
246
 
220
- <!-- Display layers for WMS capabilities -->
221
- ${
222
- this.wmsCapabilities
247
+ <!-- Display layers for WMS capabilities -->
248
+ ${this.wmsCapabilities
223
249
  ? html`<ul class="search-lists">
224
250
  ${this.wmsCapabilities.Capability.Layer.Layer.map(
225
251
  (layer) => {
@@ -243,25 +269,30 @@ export class EOxLayerControlAddLayers extends LitElement {
243
269
  },
244
270
  )}
245
271
  </ul>`
246
- : nothing
247
- }
248
- `
272
+ : nothing}
273
+ `
249
274
  : html`
250
275
  <!-- Textarea for JSON input -->
251
- <textarea
252
- class="add-layer-input"
253
- placeholder="Please put a valid eox-map layer JSON."
254
- @input=${this.#handleInputChange}
255
- .value=${this.jsonInput}
256
- ></textarea>
276
+ <div class="field textarea small border no-margin">
277
+ <textarea
278
+ class="add-layer-input small"
279
+ style="overflow-wrap: break-word; font-family: monospace;"
280
+ placeholder="Please input a valid eox-map layer JSON."
281
+ @input=${this.#handleInputChange}
282
+ .value=${this.jsonInput}
283
+ ></textarea>
284
+ </div>
257
285
 
258
286
  <!-- Button to add JSON layer -->
259
287
  <button
260
- class="add-layer-icon json-add-layer"
288
+ class="add-layer-icon json-add-layer small square small-margin"
289
+ style="position: absolute; bottom: 15px; right: 0;"
261
290
  disabled=${isLayerJSONValid(this.jsonInput) ? nothing : true}
262
291
  @click=${this.#handleAddLayer}
263
292
  >
264
- ${this.unstyled ? "Add JSON" : ""}
293
+ ${this.unstyled
294
+ ? "Add JSON"
295
+ : html`<i class="small">${icons.plus}</i>`}
265
296
  </button>
266
297
  `}
267
298
  </div>
@@ -276,139 +307,8 @@ export class EOxLayerControlAddLayers extends LitElement {
276
307
  .eox-add-layer-main .close {
277
308
  display: none;
278
309
  }
279
- `;
280
- #styleEOX = `
281
- .eox-add {
282
- background: #f0f2f5;
283
- border-top: 1px solid #0041701a;
284
- padding: 0.5rem;
285
- font-size: small;
286
- }
287
- .eox-add-layer-col, .eox-add-layer-tab {
288
- display: flex;
289
- width: 100%;
290
- }
291
- .eox-add-layer-main .close {
292
- display: none;
293
- }
294
- .eox-add-layer-main .open {
295
- position: relative;
296
- }
297
- button.icon.add-icon {
298
- flex-grow: 1;
299
- }
300
- .eox-add-layer-tab li {
301
- border: 0 !important;
302
- font-size: smaller;
303
- padding: 0.2rem 0.7rem;
304
- background: #f0f2f5;
305
- border-radius: 4px 4px 0px 0px;
306
- font-size: 0.8rem;
307
- font-weight: 500;
308
- cursor: pointer;
309
- }
310
- .eox-add-layer-tab li.active {
311
- background: #204270;
312
- color: white;
313
- font-weight: 700;
314
- }
315
- .relative {
316
- position: relative
317
- }
318
- .eox-add-layer-col.justify-end {
319
- justify-content: end;
320
- }
321
- .eox-add ul {
322
- max-height: 120px;
323
- overflow: scroll;
324
- }
325
- .eox-add ul li {
326
- display: flex;
327
- align-items: center;
328
- justify-content: space-between;
329
- padding: 0.1rem 0.2rem;
330
- }
331
- button.icon {
332
- justify-content: end;
333
- transition: opacity .2s;
334
- opacity: .7;
335
- }
336
- button.icon:hover {
337
- opacity: 1;
338
- }
339
- button.icon.add-layer-icon::before {
340
- width: 16px;
341
- min-width: 16px;
342
- height: 16px;
343
- }
344
- button.icon.add-icon::before {
345
- width: 18px;
346
- min-width: 18px;
347
- height: 18px;
348
- }
349
- .add-icon.icon::before {
350
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath xmlns='http://www.w3.org/2000/svg' d='M17,14H19V17H22V19H19V22H17V19H14V17H17V14M11,16L2,9L11,2L20,9L11,16M11,18.54L12,17.75V18C12,18.71 12.12,19.39 12.35,20L11,21.07L2,14.07L3.62,12.81L11,18.54Z' fill='%23004270'/%3E%3C/svg%3E");
351
- }
352
- .add-layer-icon::before {
353
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Eplus-thick%3C/title%3E%3Cpath fill='%23004270' d='M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z' /%3E%3C/svg%3E");
354
- }
355
- .json-add-layer {
356
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Eplus-thick%3C/title%3E%3Cpath fill='white' d='M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z' /%3E%3C/svg%3E");
357
- }
358
- .search-icon::after {
359
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Emagnify%3C/title%3E%3Cpath d='M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z' fill='white' /%3E%3C/svg%3E");
360
- }
361
- .search-icon::after, .json-add-layer::before {
362
- width: 14px;
363
- min-width: 14px;
364
- height: 14px;
365
- display:flex
366
- margin-right: 6px;
367
- color: white;
368
- }
369
- .search-icon, .json-add-layer {
370
- padding: 4px 6px;
371
- height: 28px;
372
- border-radius: 0px 4px 4px 0px;
373
- box-shadow: none;
374
- }
375
- .json-add-layer {
376
- position: absolute;
377
- bottom: 16px;
378
- right: 14px;
379
- border-radius: 4px;
380
- height: 24px;
381
- padding: 4px;
382
- }
383
- input.add-url, textarea.add-layer-input {
384
- box-sizing: border-box !important;
385
- width: 100%;
386
- height: 28px;
387
- padding: 5px 7px !important;
388
- border: 1px solid #0004 !important;
389
- font-size: smaller;
390
- border-radius: 4px 0px 0px 4px;
391
- }
392
- textarea.add-layer-input {
393
- height: 90px;
394
- resize: none;
395
- border-radius: 4px;
396
- }
397
- .divider {
398
- margin: 1rem 0px;
399
- height: 1px;
400
- border-top: 1.5px solid #00417059;
401
- text-align: center;
402
- position: relative;
403
- }
404
- .divider span {
405
- position: relative;
406
- top: -.6em;
407
- padding: 0px 0.5rem;
408
- background: #f0f2f5;
409
- color: #00417059;
410
- font-weight: bold;
411
- display: inline-block;
310
+ .field.small > :is(input, textarea, select) {
311
+ font-size: 0.75rem;
412
312
  }
413
313
  `;
414
314
  }
@@ -200,6 +200,7 @@ export class EOxLayerControlLayerConfig extends LitElement {
200
200
  .schema=${this.layerConfig.schema}
201
201
  .value=${this.#startVals}
202
202
  .options=${options}
203
+ .noShadow=${true}
203
204
  @change=${this.throttleDataChange}
204
205
  ></eox-jsonform>
205
206
  `,
@@ -211,12 +212,30 @@ export class EOxLayerControlLayerConfig extends LitElement {
211
212
  color-legend {
212
213
  --cle-background: transparent;
213
214
  --cle-font-family: inherit;
214
- --cle-font-size: inherit;
215
- --cle-font-weight: inherit --cle-letter-spacing: inherit;
215
+ --cle-font-size: 12px;
216
+ --cle-font-size-title: 12px;
217
+ --cle-font-weight: 400;
218
+ --cle-font-weight-title: 400;
219
+ --cle-letter-spacing: inherit;
216
220
  --cle-letter-spacing-title: inherit;
221
+ font-size: small;
222
+ }
223
+ `;
224
+ #styleEOX = css`
225
+ input[type="range"],
226
+ eox-jsonform {
227
+ --eox-slider-thumb-height: 10px !important;
228
+ --eox-slider-thumb-width: 10px !important;
229
+ --eox-slider-track-height: 4px !important;
230
+ --eox-panel-spacing: 0 !important;
231
+ --eox-slider-margin: 0 !important;
232
+ font-size: small;
233
+ }
234
+ eox-layercontrol-layer-legend {
235
+ display: block;
236
+ margin-bottom: 1rem;
217
237
  }
218
238
  `;
219
- #styleEOX = ``;
220
239
  }
221
240
 
222
241
  customElements.define(
@@ -124,10 +124,31 @@ export class EOxLayerControlLayerGroup extends LitElement {
124
124
  () => html`
125
125
  <!-- Render the details element with the layer control -->
126
126
  <details
127
+ class="max-width"
127
128
  open=${groupOpen || nothing}
128
129
  data-children-length=${numberOfChildLayers}
129
130
  >
130
- <summary>
131
+ <summary class="square">
132
+ ${when(
133
+ numberOfChildLayers > 0,
134
+ () => html`
135
+ <!-- Open/close arrow -->
136
+ <div class="arrow-container">
137
+ <i class="small">
138
+ <svg
139
+ xmlns="http://www.w3.org/2000/svg"
140
+ viewBox="0 0 24 24"
141
+ >
142
+ <title>chevron-right</title>
143
+ <path
144
+ d="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"
145
+ />
146
+ </svg>
147
+ </i>
148
+ </div>
149
+ `,
150
+ )}
151
+
131
152
  <!-- Render the layer control within the summary -->
132
153
  <eox-layercontrol-layer
133
154
  .noShadow=${true}
@@ -135,6 +156,7 @@ export class EOxLayerControlLayerGroup extends LitElement {
135
156
  .map=${this.map}
136
157
  .titleProperty=${this.titleProperty}
137
158
  .showLayerZoomState=${this.showLayerZoomState}
159
+ .layerType=${"group"}
138
160
  .tools=${this.tools}
139
161
  .unstyled=${this.unstyled}
140
162
  .toolsAsList=${this.toolsAsList}
@@ -163,28 +185,27 @@ export class EOxLayerControlLayerGroup extends LitElement {
163
185
 
164
186
  #styleBasic = ``;
165
187
  #styleEOX = `
166
- details summary {
167
- cursor: pointer;
188
+ details > summary {
189
+ min-block-size: 0rem;
168
190
  display: var(--layer-summary-visibility);
191
+ user-select: none;
169
192
  }
170
- details summary { list-style-type: none; } /* Firefox */
171
- details summary::-webkit-details-marker { display: none; } /* Chrome */
172
- details summary::marker { display: none; }
173
- details summary::before {
174
- display: var(--layer-visibility);
175
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echevron-right%3C/title%3E%3Cpath d='M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z' /%3E%3C/svg%3E");
176
- font-size: 13px;
177
- width: 24px;
178
- height: 24px;
179
- margin: 4px 0;
180
- transform-origin: center;
193
+ details .arrow-container > i {
181
194
  transition: transform 0.1s ease-in-out;
182
195
  }
183
- details[open] > summary:before {
196
+ details[open] > summary > .arrow-container > i {
184
197
  transform: rotate(90deg);
185
198
  }
186
- details[data-children-length="0"] summary::before {
187
- display: none;
199
+ .arrow-container {
200
+ position: absolute;
201
+ height: 32px;
202
+ display: flex;
203
+ align-items: center;
204
+ left: calc(var(--padding));
205
+ z-index: 1;
206
+ }
207
+ .list li ul.list > li .arrow-container {
208
+ left: calc(var(--padding) + var(--list-padding) - .5rem);
188
209
  }
189
210
  `;
190
211
  }
@@ -144,8 +144,8 @@ export class EOxLayerControlLayerLegend extends LitElement {
144
144
  tickFormat="${ifDefined(legend.tickFormat)}"
145
145
  .ticks=${legend.ticks ?? 5}
146
146
  .tickValues=${legend.tickValues}
147
- .marginLeft=${0}
148
- .marginRight=${0}
147
+ .marginLeft=${8}
148
+ .marginRight=${8}
149
149
  >
150
150
  </color-legend>
151
151
  ${idx !== configs.length - 1
@@ -166,8 +166,11 @@ export class EOxLayerControlLayerLegend extends LitElement {
166
166
  color-legend {
167
167
  --cle-background: transparent;
168
168
  --cle-font-family: inherit;
169
- --cle-font-size: inherit;
170
- --cle-font-weight: inherit --cle-letter-spacing: inherit;
169
+ --cle-font-size: 12px;
170
+ --cle-font-size-title: 12px;
171
+ --cle-font-weight: 400;
172
+ --cle-font-weight-title: 400;
173
+ --cle-letter-spacing: inherit;
171
174
  --cle-letter-spacing-title: inherit;
172
175
  --cle-padding: 0;
173
176
  }
@@ -123,7 +123,7 @@ export class EOxLayerControlLayerList extends LitElement {
123
123
  ${this.#styleBasic}
124
124
  ${!this.unstyled && this.#styleEOX}
125
125
  </style>
126
- <ul>
126
+ <ul class="list no-space">
127
127
  ${when(
128
128
  this.layers,
129
129
  () => html`
@@ -134,6 +134,7 @@ export class EOxLayerControlLayerList extends LitElement {
134
134
  <li
135
135
  data-layer="${layer.get(this.idProperty)}"
136
136
  data-type="${getLayerType(layer, this.map)}"
137
+ class="square"
137
138
  >
138
139
  ${
139
140
  /** Checks if the layer is a group or individual layer and renders accordingly */
@@ -160,6 +161,7 @@ export class EOxLayerControlLayerList extends LitElement {
160
161
  .map=${this.map}
161
162
  .titleProperty=${this.titleProperty}
162
163
  .showLayerZoomState=${this.showLayerZoomState}
164
+ .layerType=${getLayerType(layer, this.map)}
163
165
  .tools=${this.tools}
164
166
  .unstyled=${this.unstyled}
165
167
  .toolsAsList=${this.toolsAsList}
@@ -178,31 +180,37 @@ export class EOxLayerControlLayerList extends LitElement {
178
180
 
179
181
  #styleBasic = ``;
180
182
  #styleEOX = `
181
- ul {
182
- padding: 0;
183
- margin: 0;
183
+ eox-layercontrol-layer-group {
184
+ box-sizing: border-box;
185
+ width: 100%;
184
186
  }
185
- ul ul {
186
- padding-left: var(--list-padding);
187
+ eox-layercontrol-layer.sortable-chosen {
188
+ background: #eeea !important;
187
189
  }
188
- li:not(li li) {
189
- padding-left: var(--padding);
190
+ eox-layercontrol-layer.sortable-drag {
191
+ opacity: 0;
190
192
  }
191
- li {
192
- list-style: none;
193
- border-bottom: 1px solid #0041703a;
194
- border: var(--layer-visibility);
193
+ eox-layercontrol-layer.sortable-ghost {
195
194
  }
196
- li:last-child {
197
- border: none;
195
+ eox-layercontrol-layer {
196
+ padding: 0 var(--padding);
198
197
  }
199
- li.sortable-chosen {
200
- background: #eeea;
198
+ @media (pointer:fine) {
199
+ eox-layercontrol-layer:not(:has(details[open])):hover {
200
+ background-color: var(--item-hover-color);
201
+ }
201
202
  }
202
- li.sortable-drag {
203
- opacity: 0;
203
+ .list li ul.list > li eox-layercontrol-layer {
204
+ padding-left: var(--list-padding);
205
+ }
206
+ .list li ul.list li ul.list > li eox-layercontrol-layer {
207
+ padding-left: calc(var(--list-padding) * 2 - .5rem);
204
208
  }
205
- li.sortable-ghost {
209
+ .list li ul.list > li:has(details[open]) eox-layercontrol-tools-items {
210
+ display: block;
211
+ }
212
+ .list.no-space li.square {
213
+ padding: 0;
206
214
  }
207
215
  `;
208
216
  }