@eox/layercontrol 0.29.0 → 1.0.0

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 (109) hide show
  1. package/dist/eox-layercontrol.js +2996 -2869
  2. package/dist/eox-layercontrol.umd.cjs +626 -565
  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 +8 -5
  8. package/src/components/add-layers.js +79 -179
  9. package/src/components/layer-config.js +22 -3
  10. package/src/components/layer-group.js +41 -18
  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 -120
  14. package/src/components/layer.js +215 -59
  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/clean-json-input.js +0 -1
  20. package/src/helpers/create-sortable.js +4 -1
  21. package/src/helpers/get-layer-type.js +2 -1
  22. package/src/helpers/get-start-vals.js +0 -3
  23. package/src/helpers/index.js +1 -0
  24. package/src/helpers/layer-tools.js +75 -13
  25. package/src/main.js +37 -7
  26. package/src/methods/layer-config/apply-updated-styles.js +1 -0
  27. package/src/methods/layercontrol/first-update.js +10 -4
  28. package/types/layercontrol/src/components/add-layers.d.ts +2 -2
  29. package/types/layercontrol/src/components/add-layers.d.ts.map +1 -1
  30. package/types/layercontrol/src/components/layer-config.d.ts.map +1 -1
  31. package/types/layercontrol/src/components/layer-datetime.d.ts.map +1 -1
  32. package/types/layercontrol/src/components/layer-group.d.ts.map +1 -1
  33. package/types/layercontrol/src/components/layer-legend.d.ts.map +1 -1
  34. package/types/layercontrol/src/components/layer-list.d.ts.map +1 -1
  35. package/types/layercontrol/src/components/layer-tools.d.ts +8 -4
  36. package/types/layercontrol/src/components/layer-tools.d.ts.map +1 -1
  37. package/types/layercontrol/src/components/layer.d.ts +9 -0
  38. package/types/layercontrol/src/components/layer.d.ts.map +1 -1
  39. package/types/layercontrol/src/components/optional-list.d.ts.map +1 -1
  40. package/types/layercontrol/src/components/tools-items.d.ts.map +1 -1
  41. package/types/layercontrol/src/enums/index.d.ts +1 -1
  42. package/types/layercontrol/src/enums/stories/index.d.ts +1 -0
  43. package/types/layercontrol/src/enums/stories/index.d.ts.map +1 -1
  44. package/types/layercontrol/src/helpers/clean-json-input.d.ts.map +1 -1
  45. package/types/layercontrol/src/helpers/create-sortable.d.ts.map +1 -1
  46. package/types/layercontrol/src/helpers/fetch-capabilities.d.ts.map +1 -1
  47. package/types/layercontrol/src/helpers/filter-layers.d.ts.map +1 -1
  48. package/types/layercontrol/src/helpers/get-layer-type.d.ts.map +1 -1
  49. package/types/layercontrol/src/helpers/get-legend-config.d.ts.map +1 -1
  50. package/types/layercontrol/src/helpers/get-start-vals.d.ts +1 -1
  51. package/types/layercontrol/src/helpers/get-start-vals.d.ts.map +1 -1
  52. package/types/layercontrol/src/helpers/index.d.ts +1 -1
  53. package/types/layercontrol/src/helpers/layer-tools.d.ts +13 -3
  54. package/types/layercontrol/src/helpers/layer-tools.d.ts.map +1 -1
  55. package/types/layercontrol/src/main.d.ts +2 -2
  56. package/types/layercontrol/src/main.d.ts.map +1 -1
  57. package/types/layercontrol/src/methods/add-layer/wms-search-url.d.ts.map +1 -1
  58. package/types/layercontrol/src/methods/layer-config/apply-updated-styles.d.ts +1 -1
  59. package/types/layercontrol/src/methods/layer-config/apply-updated-styles.d.ts.map +1 -1
  60. package/types/layercontrol/src/methods/layercontrol/first-update.d.ts +2 -2
  61. package/types/layercontrol/src/methods/layercontrol/first-update.d.ts.map +1 -1
  62. package/types/map/src/components/compare.d.ts +2 -2
  63. package/types/map/src/components/compare.d.ts.map +1 -1
  64. package/types/map/src/components/tooltip.d.ts +7 -2
  65. package/types/map/src/components/tooltip.d.ts.map +1 -1
  66. package/types/map/src/controls/controls.d.ts +2 -8
  67. package/types/map/src/controls/controls.d.ts.map +1 -1
  68. package/types/map/src/controls/geo-location.d.ts +5 -5
  69. package/types/map/src/controls/geo-location.d.ts.map +1 -1
  70. package/types/map/src/controls/loading-indicator.d.ts +3 -3
  71. package/types/map/src/controls/loading-indicator.d.ts.map +1 -1
  72. package/types/map/src/custom/sources/FlatGeoBuf.d.ts +27 -0
  73. package/types/map/src/custom/sources/FlatGeoBuf.d.ts.map +1 -0
  74. package/types/map/src/custom/sources/WMTSCapabilities.d.ts +35 -0
  75. package/types/map/src/custom/sources/WMTSCapabilities.d.ts.map +1 -0
  76. package/types/map/src/helpers/add-new-feature.d.ts +2 -1
  77. package/types/map/src/helpers/add-new-feature.d.ts.map +1 -1
  78. package/types/map/src/helpers/center.d.ts.map +1 -1
  79. package/types/map/src/helpers/coordinates-roughly-equals.d.ts.map +1 -1
  80. package/types/map/src/helpers/draw.d.ts +6 -6
  81. package/types/map/src/helpers/draw.d.ts.map +1 -1
  82. package/types/map/src/helpers/generate.d.ts +13 -11
  83. package/types/map/src/helpers/generate.d.ts.map +1 -1
  84. package/types/map/src/helpers/interactions.d.ts.map +1 -1
  85. package/types/map/src/helpers/layer.d.ts +5 -5
  86. package/types/map/src/helpers/layer.d.ts.map +1 -1
  87. package/types/map/src/helpers/parse-feature.d.ts.map +1 -1
  88. package/types/map/src/helpers/parse-text.d.ts +3 -1
  89. package/types/map/src/helpers/parse-text.d.ts.map +1 -1
  90. package/types/map/src/helpers/register-projection-from-code.d.ts.map +1 -1
  91. package/types/map/src/helpers/register-projection.d.ts.map +1 -1
  92. package/types/map/src/helpers/select.d.ts +14 -14
  93. package/types/map/src/helpers/select.d.ts.map +1 -1
  94. package/types/map/src/helpers/tile-grid.d.ts +2 -2
  95. package/types/map/src/helpers/tile-grid.d.ts.map +1 -1
  96. package/types/map/src/helpers/transform.d.ts +2 -2
  97. package/types/map/src/helpers/transform.d.ts.map +1 -1
  98. package/types/map/src/layers.d.ts +116 -0
  99. package/types/map/src/layers.d.ts.map +1 -0
  100. package/types/map/src/main.d.ts +31 -31
  101. package/types/map/src/main.d.ts.map +1 -1
  102. package/types/map/src/methods/map/add-update-layer.d.ts +2 -2
  103. package/types/map/src/methods/map/add-update-layer.d.ts.map +1 -1
  104. package/types/map/src/methods/map/getters.d.ts.map +1 -1
  105. package/types/map/src/methods/map/setters.d.ts +12 -12
  106. package/types/map/src/methods/map/setters.d.ts.map +1 -1
  107. package/types/map/{types.d.ts → src/types.d.ts} +35 -34
  108. package/types/map/src/types.d.ts.map +1 -0
  109. package/types/map/types.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@eox/layercontrol",
3
- "version": "0.29.0",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
- "@eox/map": "^1.16.0",
6
+ "@eox/map": "*",
7
+ "@types/lodash.throttle": "^4.1.9",
7
8
  "@types/sortablejs": "^1.15.1",
8
- "ol": "^10.0.0",
9
+ "ol": "^10.4.0",
9
10
  "vite": "^6.0.3"
10
11
  },
11
12
  "engines": {
@@ -30,12 +31,14 @@
30
31
  }
31
32
  },
32
33
  "scripts": {
33
- "prepack": "tsc -p tsconfig.build.json || true",
34
+ "types:generate": "tsc --project tsconfig.build.json || true",
35
+ "prepack": "npm run types:generate",
34
36
  "build": "vite build",
35
37
  "watch": "vite build --watch"
36
38
  },
37
39
  "dependencies": {
38
- "@eox/elements-utils": "^0.1.5",
40
+ "@eox/elements-utils": "^1.0.0",
41
+ "@eox/ui": "^0.3.6",
39
42
  "color-legend-element": "^1.3.0",
40
43
  "lit": "^3.2.0",
41
44
  "lodash.debounce": "^4.0.8",
@@ -70,7 +70,7 @@ export class EOxLayerControlAddLayers extends LitElement {
70
70
  /**
71
71
  * Instance of `eox-map` which is a wrapper for the OL
72
72
  *
73
- * @type {import("@eox/map/main").EOxMap}
73
+ * @type {import("@eox/map").EOxMap}
74
74
  */
75
75
  this.eoxMap = null;
76
76
 
@@ -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(
@@ -109,7 +109,9 @@ export class EOxLayerControlLayerGroup extends LitElement {
109
109
  // Check if the group should be open based on a specific control property
110
110
  const groupOpen = Boolean(this.group?.get("layerControlExpand"));
111
111
  const numberOfChildLayers = hideLayersBasedOnProperties(
112
- this.group.getLayers(),
112
+ /** @type import("ol").Collection<import("ol/layer").Layer> */ (
113
+ this.group.getLayers()
114
+ ),
113
115
  )?.length;
114
116
 
115
117
  return html`
@@ -122,10 +124,31 @@ export class EOxLayerControlLayerGroup extends LitElement {
122
124
  () => html`
123
125
  <!-- Render the details element with the layer control -->
124
126
  <details
127
+ class="max-width"
125
128
  open=${groupOpen || nothing}
126
129
  data-children-length=${numberOfChildLayers}
127
130
  >
128
- <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
+
129
152
  <!-- Render the layer control within the summary -->
130
153
  <eox-layercontrol-layer
131
154
  .noShadow=${true}
@@ -133,6 +156,7 @@ export class EOxLayerControlLayerGroup extends LitElement {
133
156
  .map=${this.map}
134
157
  .titleProperty=${this.titleProperty}
135
158
  .showLayerZoomState=${this.showLayerZoomState}
159
+ .layerType=${"group"}
136
160
  .tools=${this.tools}
137
161
  .unstyled=${this.unstyled}
138
162
  .toolsAsList=${this.toolsAsList}
@@ -161,28 +185,27 @@ export class EOxLayerControlLayerGroup extends LitElement {
161
185
 
162
186
  #styleBasic = ``;
163
187
  #styleEOX = `
164
- details summary {
165
- cursor: pointer;
188
+ details > summary {
189
+ min-block-size: 0rem;
166
190
  display: var(--layer-summary-visibility);
191
+ user-select: none;
167
192
  }
168
- details summary { list-style-type: none; } /* Firefox */
169
- details summary::-webkit-details-marker { display: none; } /* Chrome */
170
- details summary::marker { display: none; }
171
- details summary::before {
172
- display: var(--layer-visibility);
173
- 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");
174
- font-size: 13px;
175
- width: 24px;
176
- height: 24px;
177
- margin: 4px 0;
178
- transform-origin: center;
193
+ details .arrow-container > i {
179
194
  transition: transform 0.1s ease-in-out;
180
195
  }
181
- details[open] > summary:before {
196
+ details[open] > summary > .arrow-container > i {
182
197
  transform: rotate(90deg);
183
198
  }
184
- details[data-children-length="0"] summary::before {
185
- 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);
186
209
  }
187
210
  `;
188
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
  }