@open-pioneer/map 1.4.0 → 1.5.0-dev.20260910103330

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @open-pioneer/map
2
2
 
3
+ ## 1.5.0-dev.20260910103330
4
+
5
+ ### Minor Changes
6
+
7
+ - f790fda: Update to Chakra 3.37.0
8
+ - ebda251: The `addLayer` method now also accepts `at: "base"` to add a base layer.
9
+ - ebda251: Add new properties for topmost layers and base layers in `MapConfig`.
10
+
11
+ - With `MapConfig.topmostLayers` topmost layers can now be defined in the initial map setup.
12
+ - Base layers can now be defined in the initial map setup with the `MapConfig.baseLayers` property
13
+
14
+ We recommend using the `baseLayers` property instead of `isBaseLayer: true` for new apps.
15
+
16
+ ```typescript
17
+ export class MapConfigProviderImpl implements MapConfigProvider {
18
+ mapId = MAP_ID;
19
+
20
+ async getMapConfig({ layerFactory }: MapConfigProviderOptions): Promise<MapConfig> {
21
+ return {
22
+ initialView: {...},
23
+ projection: "EPSG:25832",
24
+ baseLayers: [
25
+ //all base layers
26
+ layerFactory.create(...)
27
+ ],
28
+ layers: [
29
+ //all other operational layers
30
+ layerFactory.create(...),
31
+ layerFactory.create(...)
32
+ ],
33
+ topmostLayers: [
34
+ //all operational highlight layers
35
+ layerFactory.create(...)
36
+ ]
37
+ };
38
+ }
39
+ }
40
+ ```
41
+
42
+ ### Patch Changes
43
+
44
+ - 3203815: Update code to match new react linting rules from oxlint.
45
+ - 09ec7c7: Updated dependencies
46
+
3
47
  ## 1.4.0
4
48
 
5
49
  ### Minor Changes
@@ -7,16 +51,16 @@
7
51
  - c30396d: Update Chakra to 3.36.1
8
52
  - 690a892: A layer's loadState is now a derived from three different channels:
9
53
 
10
- - source — the OpenLayers source state (undefined/loading/ready/error).
11
- - health — the result of the optional healthCheck (run once on attach).
12
- - metadata — the result of a layer's own capabilities request (if any).
54
+ - source — the OpenLayers source state (undefined/loading/ready/error).
55
+ - health — the result of the optional healthCheck (run once on attach).
56
+ - metadata — the result of a layer's own capabilities request (if any).
13
57
 
14
- Additionally, a new property `loadError` has been added to the layer class.
58
+ Additionally, a new property `loadError` has been added to the layer class.
15
59
 
16
60
  - e4b47f1: `useMapModel` now prints an error message if the map model could not be created.
17
61
  This error was previously returned and was easy to silently ignore.
18
62
 
19
- Use the option `quiet: true` to suppress this error message.
63
+ Use the option `quiet: true` to suppress this error message.
20
64
 
21
65
  - c9b3ced: Provide reactive rotation in MapModel
22
66
  - 690a892: WMS Layer: add validation that configured sublayers actually exist in the service's capabilities.
@@ -45,17 +89,17 @@
45
89
  - fcbd505: Sanitize HTML used for layer attributions.
46
90
  - 33ab02f: Move highlight methods to `mapModel.highlights`.
47
91
 
48
- - `mapModel.highlight()` -> `mapModel.highlights.add()`
49
- - `mapModel.highlightAndZoom()` -> `mapModel.highlights.addAndZoom()`
50
- - `mapModel.removeHighlights()` -> `mapModel.highlights.clear()`
92
+ - `mapModel.highlight()` -> `mapModel.highlights.add()`
93
+ - `mapModel.highlightAndZoom()` -> `mapModel.highlights.addAndZoom()`
94
+ - `mapModel.removeHighlights()` -> `mapModel.highlights.clear()`
51
95
 
52
- The old methods on the Map Model have been deprecated and will be removed in a future major release.
96
+ The old methods on the Map Model have been deprecated and will be removed in a future major release.
53
97
 
54
98
  - d54ccfd: Update to Chakra UI 3.35.0
55
99
  - 33ab02f: Add new `mapModel.overlays` API to render arbitrary React content on the map at certain coordinates.
56
100
  This can be helpful for feature info, popups and for tooltips during map interactions.
57
101
 
58
- Use `mapModel.overlay.add({ content: <SomeReactContent />, ...})` to create a new overlay.
102
+ Use `mapModel.overlay.add({ content: <SomeReactContent />, ...})` to create a new overlay.
59
103
 
60
104
  - 206b397: Update to trails core packages 4.6.0
61
105
  - 2ceb1ca: MapContainer: allow configuration of `rootProps` and `containerProps`.
@@ -94,22 +138,22 @@
94
138
  Using only a minimum or maximum limit is possible.
95
139
  Missing properties are considered as no limitation.
96
140
 
97
- ```js
98
- layerFactory.create({
99
- type: WMTSLayer,
100
- isBaseLayer: true,
101
- title: "Basemap",
102
- name: "basemap",
103
- minZoom: 10,
104
- maxZoom: 16
105
- });
106
- ```
141
+ ```js
142
+ layerFactory.create({
143
+ type: WMTSLayer,
144
+ isBaseLayer: true,
145
+ title: "Basemap",
146
+ name: "basemap",
147
+ minZoom: 10,
148
+ maxZoom: 16,
149
+ });
150
+ ```
107
151
 
108
- The boolean property `visibleInScale` of a layer indicates the visibility of this layer depending on the current resolution of the map.
152
+ The boolean property `visibleInScale` of a layer indicates the visibility of this layer depending on the current resolution of the map.
109
153
 
110
- Restrictions of a `GroupLayer` are inherited to child layers.
111
- If no restrictions are configured for a child layer, its visibility limitations are equal to the parent `GroupLayer`.
112
- By configuring additional limits for the child layer, its visibility can be further restricted.
154
+ Restrictions of a `GroupLayer` are inherited to child layers.
155
+ If no restrictions are configured for a child layer, its visibility limitations are equal to the parent `GroupLayer`.
156
+ By configuring additional limits for the child layer, its visibility can be further restricted.
113
157
 
114
158
  ### Patch Changes
115
159
 
@@ -122,233 +166,233 @@
122
166
  - b3709f1: **Breaking:** Remove layer constructor types from public API (e.g. `SimpleLayerConstructor`).
123
167
  - 9e9bc6e: **Breaking**: Internal layers are no longer returned from getters such as `getItems()` or `getRecursiveLayers()` by default.
124
168
 
125
- A new option `includeInternalLayers` has been implemented to opt-in into internal layers.
126
- By default, internal layers are not returned by functions like `getItems()` or `getRecursiveLayers()`.
127
- If internal layer should be returned this must be specified explicitly with the `includeInternalLayers` option.
169
+ A new option `includeInternalLayers` has been implemented to opt-in into internal layers.
170
+ By default, internal layers are not returned by functions like `getItems()` or `getRecursiveLayers()`.
171
+ If internal layer should be returned this must be specified explicitly with the `includeInternalLayers` option.
128
172
 
129
- ```js
130
- import { MapModel } from "@open-pioneer/map";
173
+ ```js
174
+ import { MapModel } from "@open-pioneer/map";
131
175
 
132
- //internal layers are not included
133
- const layers = myMapModel.layers.getItems();
134
- //include internal layers
135
- const allLayers = myMapModel.layers.getItems({ includeInternalLayers: true });
136
- ```
176
+ //internal layers are not included
177
+ const layers = myMapModel.layers.getItems();
178
+ //include internal layers
179
+ const allLayers = myMapModel.layers.getItems({ includeInternalLayers: true });
180
+ ```
137
181
 
138
- Note that if internal layers are returned this includes system layers (e.g. for highlights or geolocation) that were not explicitly added to the map.
139
- The described behavior is aligned for the functions `getItems()`, `getLayers()`, `getAllLayers()` and `getRecursiveLayers()` in `LayerCollection`, `WMSLayer` and `GroupLayer`.
140
- The function `getRecursiveLayers()` does not return non-internal child layers of an internal layer.
182
+ Note that if internal layers are returned this includes system layers (e.g. for highlights or geolocation) that were not explicitly added to the map.
183
+ The described behavior is aligned for the functions `getItems()`, `getLayers()`, `getAllLayers()` and `getRecursiveLayers()` in `LayerCollection`, `WMSLayer` and `GroupLayer`.
184
+ The function `getRecursiveLayers()` does not return non-internal child layers of an internal layer.
141
185
 
142
186
  - b3709f1: **Breaking:** Remove old event API from layer types and the map model.
143
187
 
144
- These were only used for the `"destroy"` event.
188
+ These were only used for the `"destroy"` event.
145
189
 
146
- ```ts
147
- // OLD, removed API:
148
- const layer = ...;
149
- layer.on("destroyed", () => {
150
- console.debug("layer was destroyed");
151
- });
152
- ```
190
+ ```ts
191
+ // OLD, removed API:
192
+ const layer = ...;
193
+ layer.on("destroyed", () => {
194
+ console.debug("layer was destroyed");
195
+ });
196
+ ```
153
197
 
154
- The destroy event still exists, but is now based on the event system of the [reactivity API](https://github.com/conterra/reactivity/tree/main/packages/reactivity-events):
198
+ The destroy event still exists, but is now based on the event system of the [reactivity API](https://github.com/conterra/reactivity/tree/main/packages/reactivity-events):
155
199
 
156
- ```ts
157
- // NEW
158
- import { on } from "@conterra/reactivity-events";
200
+ ```ts
201
+ // NEW
202
+ import { on } from "@conterra/reactivity-events";
159
203
 
160
- const layer = ...;
161
- on(layer.destroyed, () => {
162
- console.debug("layer was destroyed");
163
- });
204
+ const layer = ...;
205
+ on(layer.destroyed, () => {
206
+ console.debug("layer was destroyed");
207
+ });
164
208
 
165
- const mapModel = ...;
166
- on(mapModel.destroyed, () => {
167
- console.debug("layer was destroyed");
168
- });
169
- ```
209
+ const mapModel = ...;
210
+ on(mapModel.destroyed, () => {
211
+ console.debug("layer was destroyed");
212
+ });
213
+ ```
170
214
 
171
215
  - a1614de: **Breaking**: Remove support for `mapId` in all React components.
172
216
 
173
- To configure the map for a component (for example: `Legend`), either pass the `map`
174
- as an explicit parameter or use the `DefaultMapProvider`:
217
+ To configure the map for a component (for example: `Legend`), either pass the `map`
218
+ as an explicit parameter or use the `DefaultMapProvider`:
175
219
 
176
- ```ts
177
- // Explicit API
178
- <Legend map={map} />
220
+ ```ts
221
+ // Explicit API
222
+ <Legend map={map} />
179
223
 
180
- // All children of the DefaultMapProvider can use the configured map
181
- <DefaultMapProvider map={map}>
182
- <MapContainer />
183
- <Legend />
184
- <SomeOtherComponent />
185
- </DefaultMapProvider>;
186
- ```
224
+ // All children of the DefaultMapProvider can use the configured map
225
+ <DefaultMapProvider map={map}>
226
+ <MapContainer />
227
+ <Legend />
228
+ <SomeOtherComponent />
229
+ </DefaultMapProvider>;
230
+ ```
187
231
 
188
- Support for `mapId` was removed in [PR #486](https://github.com/open-pioneer/trails-openlayers-base-packages/pull/486).
232
+ Support for `mapId` was removed in [PR #486](https://github.com/open-pioneer/trails-openlayers-base-packages/pull/486).
189
233
 
190
234
  ### Minor Changes
191
235
 
192
236
  - 29a10df: Support buffer for zoom geometries.
193
237
  Use the `buffer` option to specify the size increase. E.g. `0.1` for 10% size increase.
194
238
 
195
- We use the already existing `calculateBufferedExtent` function to compute the buffer.
239
+ We use the already existing `calculateBufferedExtent` function to compute the buffer.
196
240
 
197
- For example:
241
+ For example:
198
242
 
199
- ```ts
200
- const map: MapModel = ...;
201
- const highlight = map.highlightAndZoom(someGeometries, {
202
- // Grows extent by 10%
203
- buffer: 0.1
204
- });
205
- ```
243
+ ```ts
244
+ const map: MapModel = ...;
245
+ const highlight = map.highlightAndZoom(someGeometries, {
246
+ // Grows extent by 10%
247
+ buffer: 0.1
248
+ });
249
+ ```
206
250
 
207
251
  - 2702df4: Introduce `internal` property for all layer types (including sublayers).
208
252
  If `internal` is `true` (default: `false`) the layer is not considered by any UI widget (e.g. Legend and Toc).
209
253
  The `internal` state of a layer is not to be confused with the layer's visibility on the map which is determined by the `visible` property.
210
254
 
211
- ```typescript
212
- //internal layer is visible on the map but hidden in UI elements like legend and Toc
213
- const internalLayer = new SimpleLayer({
214
- id: "layer1",
215
- title: "layer 1",
216
- olLayer: myOlLayer,
217
- visible: true,
218
- internal: true
219
- });
220
- ```
255
+ ```typescript
256
+ //internal layer is visible on the map but hidden in UI elements like legend and Toc
257
+ const internalLayer = new SimpleLayer({
258
+ id: "layer1",
259
+ title: "layer 1",
260
+ olLayer: myOlLayer,
261
+ visible: true,
262
+ internal: true,
263
+ });
264
+ ```
221
265
 
222
266
  - 5df900f: Add a new hook `useMapModelValue(props?)`.
223
267
  The hook returns either the directly configured `map` (via props) or the default map from a parent `DefaultMapProvider`.
224
268
  If neither is present, an error will be thrown.
225
269
 
226
- This hook is used in all components that work with the map.
227
- The typical usage works like this:
270
+ This hook is used in all components that work with the map.
271
+ The typical usage works like this:
228
272
 
229
- ```ts
230
- import { MapModelProps, useMapModelValue } from "@open-pioneer/map";
273
+ ```ts
274
+ import { MapModelProps, useMapModelValue } from "@open-pioneer/map";
231
275
 
232
- // optional `map` property inherited from `MapModelProps`
233
- export interface MyComponentProps extends MapModelProps {
234
- // ... other properties
235
- }
276
+ // optional `map` property inherited from `MapModelProps`
277
+ export interface MyComponentProps extends MapModelProps {
278
+ // ... other properties
279
+ }
236
280
 
237
- export function MyComponent(props) {
238
- const map = useMapModelValue(props); // looks up the map
239
- }
240
- ```
281
+ export function MyComponent(props) {
282
+ const map = useMapModelValue(props); // looks up the map
283
+ }
284
+ ```
241
285
 
242
- You can also call this hook without any arguments:
286
+ You can also call this hook without any arguments:
243
287
 
244
- ```ts
245
- // Map model from DefaultMapProvider or an error.
246
- const mapModel = useMapModelValue();
247
- ```
288
+ ```ts
289
+ // Map model from DefaultMapProvider or an error.
290
+ const mapModel = useMapModelValue();
291
+ ```
248
292
 
249
- This hook should replace _most_ usages `useMapModel`, which can't return the map model directly since it may not have finished construction yet.
293
+ This hook should replace _most_ usages `useMapModel`, which can't return the map model directly since it may not have finished construction yet.
250
294
 
251
295
  - 14c484e: Introduce the `LayerFactory` service (interface `"map.LayerFactory"`).
252
296
 
253
- The layer factory should be used to construct new layer instances, instead of calling the layer constructor directly.
254
- Calling the constructor directly (e.g. `new SimpleLayer`) is deprecated (but still fully supported).
255
-
256
- For example:
257
-
258
- ```ts
259
- // OLD
260
- new SimpleLayer({
261
- title: "OSM",
262
- isBaseLayer: true,
263
- olLayer: new TileLayer({
264
- source: new OSM()
265
- })
266
- });
267
- ```
268
-
269
- ```ts
270
- // NEW
271
- const layerFactory = ...; // injected
272
- layerFactory.create({
273
- type: SimpleLayer,
274
- title: "OSM",
275
- isBaseLayer: true,
276
- olLayer: new TileLayer({
277
- source: new OSM()
278
- })
279
- });
280
- ```
281
-
282
- This was done to support passing hidden dependencies from the layer factory to the layer instance (such as the `HttpService`),
283
- without forcing the user to supply these dependencies manually.
284
-
285
- The `MapConfigProvider` has been updated as well.
286
- The `getMapConfig` method will now receive the layer factory as an option.
287
- This makes it easy to migrate to the new API:
288
-
289
- ```diff
290
- # Example MapConfigProvider
291
- export class MapConfigProviderImpl implements MapConfigProvider {
292
- mapId = MAP_ID;
293
-
294
- - async getMapConfig(): Promise<MapConfig> {
295
- + async getMapConfig({ layerFactory }: MapConfigProviderOptions): Promise<MapConfig> {
296
- return {
297
- initialView: {
298
- kind: "position",
299
- center: { x: 404747, y: 5757920 },
300
- zoom: 14
301
- },
302
- layers: [
303
- - new SimpleLayer({
304
- + layerFactory.create({
305
- + type: SimpleLayer,
306
- title: "OSM",
307
- isBaseLayer: true,
308
- olLayer: new TileLayer({
309
- source: new OSM()
310
- })
311
- })
312
- ]
313
- };
314
- }
315
- }
316
- ```
297
+ The layer factory should be used to construct new layer instances, instead of calling the layer constructor directly.
298
+ Calling the constructor directly (e.g. `new SimpleLayer`) is deprecated (but still fully supported).
299
+
300
+ For example:
301
+
302
+ ```ts
303
+ // OLD
304
+ new SimpleLayer({
305
+ title: "OSM",
306
+ isBaseLayer: true,
307
+ olLayer: new TileLayer({
308
+ source: new OSM(),
309
+ }),
310
+ });
311
+ ```
312
+
313
+ ```ts
314
+ // NEW
315
+ const layerFactory = ...; // injected
316
+ layerFactory.create({
317
+ type: SimpleLayer,
318
+ title: "OSM",
319
+ isBaseLayer: true,
320
+ olLayer: new TileLayer({
321
+ source: new OSM()
322
+ })
323
+ });
324
+ ```
325
+
326
+ This was done to support passing hidden dependencies from the layer factory to the layer instance (such as the `HttpService`),
327
+ without forcing the user to supply these dependencies manually.
328
+
329
+ The `MapConfigProvider` has been updated as well.
330
+ The `getMapConfig` method will now receive the layer factory as an option.
331
+ This makes it easy to migrate to the new API:
332
+
333
+ ```diff
334
+ # Example MapConfigProvider
335
+ export class MapConfigProviderImpl implements MapConfigProvider {
336
+ mapId = MAP_ID;
337
+
338
+ - async getMapConfig(): Promise<MapConfig> {
339
+ + async getMapConfig({ layerFactory }: MapConfigProviderOptions): Promise<MapConfig> {
340
+ return {
341
+ initialView: {
342
+ kind: "position",
343
+ center: { x: 404747, y: 5757920 },
344
+ zoom: 14
345
+ },
346
+ layers: [
347
+ - new SimpleLayer({
348
+ + layerFactory.create({
349
+ + type: SimpleLayer,
350
+ title: "OSM",
351
+ isBaseLayer: true,
352
+ olLayer: new TileLayer({
353
+ source: new OSM()
354
+ })
355
+ })
356
+ ]
357
+ };
358
+ }
359
+ }
360
+ ```
317
361
 
318
362
  - aeb9000: Add new `"topmost"` option to add layers that are always displayed on top (above all other layers).
319
363
 
320
- A new layers can be added at `topmost` to ensure that this layer will always be displayed on top of the other layers.
321
- This can be used, for example, to implement highlights or to draw graphics.
322
- Layers added at `"topmost"` will always be shown above layers at `"top"`.
364
+ A new layers can be added at `topmost` to ensure that this layer will always be displayed on top of the other layers.
365
+ This can be used, for example, to implement highlights or to draw graphics.
366
+ Layers added at `"topmost"` will always be shown above layers at `"top"`.
323
367
 
324
- When using the `"above"` or `"below"` options with a `"topmost"` reference layer, that layer becomes `"topmost"` as well.
368
+ When using the `"above"` or `"below"` options with a `"topmost"` reference layer, that layer becomes `"topmost"` as well.
325
369
 
326
- ```typescript
327
- import { MapModel, SimpleLayer } from "@open-pioneer/map";
370
+ ```typescript
371
+ import { MapModel, SimpleLayer } from "@open-pioneer/map";
328
372
 
329
- const highlightLayer = new SimpleLayer({
330
- title: "highlights",
331
- olLayer: myOlLayer
332
- });
333
- //always displayed at the top
334
- myMapModel.layers.addLayer(highlightLayer, { at: "topmost" });
335
- ```
373
+ const highlightLayer = new SimpleLayer({
374
+ title: "highlights",
375
+ olLayer: myOlLayer,
376
+ });
377
+ //always displayed at the top
378
+ myMapModel.layers.addLayer(highlightLayer, { at: "topmost" });
379
+ ```
336
380
 
337
381
  - 5df900f: Deprecate the parameter-less signature of `useMapModel()`:
338
382
 
339
- ```ts
340
- // Returns the DefaultMapProvider's map, but wrapped in a result value (loading/resolved/rejected)
341
- const result = useMapModel();
342
- ```
383
+ ```ts
384
+ // Returns the DefaultMapProvider's map, but wrapped in a result value (loading/resolved/rejected)
385
+ const result = useMapModel();
386
+ ```
343
387
 
344
- Use `useMapModelValue()` instead:
388
+ Use `useMapModelValue()` instead:
345
389
 
346
- ```ts
347
- // Returns the map model directly.
348
- const mapModel = useMapModelValue();
349
- ```
390
+ ```ts
391
+ // Returns the map model directly.
392
+ const mapModel = useMapModelValue();
393
+ ```
350
394
 
351
- All other signatures of `useMapModel()` are still fully supported.
395
+ All other signatures of `useMapModel()` are still fully supported.
352
396
 
353
397
  - 773fa2d: The map now has an appropriate focus outline style by default, which respects the map view's padding.
354
398
  For information on disabling this behavior, see the map package documentation.
@@ -366,8 +410,8 @@
366
410
  - 4f1e7bd: The internal constant `TOPMOST_LAYER_Z` has been removed.
367
411
  To configure a layer that is always on top:
368
412
 
369
- - Create a layer using the `LayerFactory`
370
- - Add it to the map model and specify the `at: "topmost"` option
413
+ - Create a layer using the `LayerFactory`
414
+ - Add it to the map model and specify the `at: "topmost"` option
371
415
 
372
416
  - 2c8b617: Introduce `MapRegistry.createMapModel` method to create a `MapModel` without a `MapConfigProvider`.
373
417
  For more details, see [PR](https://github.com/open-pioneer/trails-openlayers-base-packages/pull/499) and [issue](https://github.com/open-pioneer/trails-openlayers-base-packages/issues/483).
@@ -382,13 +426,13 @@
382
426
  - 66179bc: Update to core-packages v4.0.0
383
427
  - acd5115: **Breaking:** Remove the following hooks, which were deprecated since version 0.8.0:
384
428
 
385
- - useView
386
- - useProjection
387
- - useResolution
388
- - useCenter
389
- - useScale
429
+ - useView
430
+ - useProjection
431
+ - useResolution
432
+ - useCenter
433
+ - useScale
390
434
 
391
- Use reactive properties on the map model instead, e.g. `mapModel.scale`.
435
+ Use reactive properties on the map model instead, e.g. `mapModel.scale`.
392
436
 
393
437
  - 738390e: Update to Chakra v3
394
438
 
@@ -396,30 +440,30 @@
396
440
 
397
441
  - 738390e: Fix an issue with "raw" map container children that are not wrapped in a map anchor.
398
442
 
399
- Consider, for example, the following snippet:
443
+ Consider, for example, the following snippet:
400
444
 
401
- ```tsx
402
- <MapContainer>
403
- {/* .custom-content does absolute positioning relative to map container */}
404
- <div className="custom-content">Hi</div>
405
- </MapContainer>
406
- ```
445
+ ```tsx
446
+ <MapContainer>
447
+ {/* .custom-content does absolute positioning relative to map container */}
448
+ <div className="custom-content">Hi</div>
449
+ </MapContainer>
450
+ ```
407
451
 
408
- Previously, the `div` was rendered relative to the map container div but did _not_ respect the map's view padding.
409
- Now the `div` will move according to the map padding as well.
452
+ Previously, the `div` was rendered relative to the map container div but did _not_ respect the map's view padding.
453
+ Now the `div` will move according to the map padding as well.
410
454
 
411
455
  - 0a8ff71: The default attribution widget created for the map now has `role="region"` and an `aria-label` for improved screen reader support.
412
456
 
413
- ```html
414
- <div
415
- style="pointer-events: auto;"
416
- class="ol-attribution ol-unselectable ol-control ol-uncollapsible"
417
- role="region"
418
- aria-label="Quellenangaben"
419
- >
420
- <!-- Attributions -->
421
- </div>
422
- ```
457
+ ```html
458
+ <div
459
+ style="pointer-events: auto;"
460
+ class="ol-attribution ol-unselectable ol-control ol-uncollapsible"
461
+ role="region"
462
+ aria-label="Quellenangaben"
463
+ >
464
+ <!-- Attributions -->
465
+ </div>
466
+ ```
423
467
 
424
468
  ## 0.10.0
425
469
 
@@ -428,82 +472,82 @@
428
472
  - 193068a: Deprecate the `mapId` property on React components.
429
473
  Use the `MapModel` directly instead to pass a reference to the map.
430
474
 
431
- Example:
475
+ Example:
432
476
 
433
- ```tsx
434
- // Default map for entire component tree
435
- <DefaultMapProvider map={mapModel}>
436
- <Toc />
437
- </DefaultMapProvider>
477
+ ```tsx
478
+ // Default map for entire component tree
479
+ <DefaultMapProvider map={mapModel}>
480
+ <Toc />
481
+ </DefaultMapProvider>
438
482
 
439
- // Map for specific component
440
- <Toc map={mapModel} />
441
- ```
483
+ // Map for specific component
484
+ <Toc map={mapModel} />
485
+ ```
442
486
 
443
487
  ### Patch Changes
444
488
 
445
489
  - 2bafdad: Top level operational layers can now be inserted at an arbitrary position.
446
490
 
447
- ```ts
448
- const mapModel = ...;
449
- const newLayer = new SimpleLayer({
450
- title: "New layer",
451
- // ...
452
- });
491
+ ```ts
492
+ const mapModel = ...;
493
+ const newLayer = new SimpleLayer({
494
+ title: "New layer",
495
+ // ...
496
+ });
453
497
 
454
- mapModel.layers.addLayer(newLayer, { at: "top" }); // Same as default: on top of all existing operational layers
455
- mapModel.layers.addLayer(newLayer, { at: "bottom" }); // Below all other operational layers
498
+ mapModel.layers.addLayer(newLayer, { at: "top" }); // Same as default: on top of all existing operational layers
499
+ mapModel.layers.addLayer(newLayer, { at: "bottom" }); // Below all other operational layers
456
500
 
457
- const otherLayer = ...; // Eiter a valid layer id or a layer instance. Must be from the same collection.
458
- mapModel.layers.addLayer(newLayer, { at: "above", reference: otherLayer }); // Above the reference layer
459
- mapModel.layers.addLayer(newLayer, { at: "below", reference: otherLayer }); // Below the reference layer
460
- ```
501
+ const otherLayer = ...; // Eiter a valid layer id or a layer instance. Must be from the same collection.
502
+ mapModel.layers.addLayer(newLayer, { at: "above", reference: otherLayer }); // Above the reference layer
503
+ mapModel.layers.addLayer(newLayer, { at: "below", reference: otherLayer }); // Below the reference layer
504
+ ```
461
505
 
462
506
  - cd1435b: Update ol to 10.5.0
463
507
  - 032eed7: Bump dependencies.
464
508
  - cd1435b: Update to react 19.1.0
465
509
  - 7558df4: Add new map anchor positioning options.
466
510
 
467
- The following positions are now supported:
468
-
469
- ```ts
470
- export type MapAnchorPosition =
471
- | "manual"
472
- | "top-left"
473
- | "top-right"
474
- | "top-center"
475
- | "bottom-left"
476
- | "bottom-right"
477
- | "bottom-center"
478
- | "left-center"
479
- | "right-center"
480
- | "center";
481
- ```
482
-
483
- You can use `manual` positioning to position an anchor using CSS.
484
- For example:
485
-
486
- ```tsx
487
- <MapAnchor className="manual-position" position="manual">
488
- <Box
489
- backgroundColor="whiteAlpha.800"
490
- borderWidth="1px"
491
- borderRadius="lg"
492
- padding={2}
493
- boxShadow="lg"
494
- >
495
- Manually positioned anchor
496
- </Box>
497
- ```
498
-
499
- Combined with css:
500
-
501
- ```css
502
- .manual-position {
503
- left: 200px;
504
- top: 200px;
505
- }
506
- ```
511
+ The following positions are now supported:
512
+
513
+ ```ts
514
+ export type MapAnchorPosition =
515
+ | "manual"
516
+ | "top-left"
517
+ | "top-right"
518
+ | "top-center"
519
+ | "bottom-left"
520
+ | "bottom-right"
521
+ | "bottom-center"
522
+ | "left-center"
523
+ | "right-center"
524
+ | "center";
525
+ ```
526
+
527
+ You can use `manual` positioning to position an anchor using CSS.
528
+ For example:
529
+
530
+ ```tsx
531
+ <MapAnchor className="manual-position" position="manual">
532
+ <Box
533
+ backgroundColor="whiteAlpha.800"
534
+ borderWidth="1px"
535
+ borderRadius="lg"
536
+ padding={2}
537
+ boxShadow="lg"
538
+ >
539
+ Manually positioned anchor
540
+ </Box>
541
+ ```
542
+
543
+ Combined with css:
544
+
545
+ ```css
546
+ .manual-position {
547
+ left: 200px;
548
+ top: 200px;
549
+ }
550
+ ```
507
551
 
508
552
  ## 0.9.0
509
553
 
@@ -511,8 +555,8 @@
511
555
 
512
556
  - e7fdc5d: improve scale calculation for none-metric projections
513
557
 
514
- Fix scale calculation for projections with none-metric units (e.g. EPSG:4326).
515
- Note: The calculated scale (`useScale`) still may deviate from the desired scale (`setScale`) for non-metric projections. This is due to limitiations in the [getPointResolution](https://openlayers.org/en/latest/apidoc/module-ol_proj.html#.getPointResolution) function from OL.
558
+ Fix scale calculation for projections with none-metric units (e.g. EPSG:4326).
559
+ Note: The calculated scale (`useScale`) still may deviate from the desired scale (`setScale`) for non-metric projections. This is due to limitiations in the [getPointResolution](https://openlayers.org/en/latest/apidoc/module-ol_proj.html#.getPointResolution) function from OL.
516
560
 
517
561
  - cb94c75: update dependencies
518
562
  - f327eec: Deprecate `mapModel.layers.getAllLayers()`.
@@ -520,43 +564,43 @@
520
564
  The name of `getAllLayers()` is misleading because it does not recurse into nested layers.
521
565
  - f327eec: Add function `getRecursiveLayers()` to `LayerCollection`, `SublayerCollection` and `GroupLayerCollection` in `@open-pioneer/map`
522
566
 
523
- Compared to `getLayers` and `getOperationalLayers`, `getRecursiveLayer` returns all (nested) child and sub layers of a collection.
524
- The property `options.filter` can be used to exclude layers (and their child layers) from the result. For `LayerCollection`, `getRecursiveLayers()` provides the predefined filters `base` and `operational` to return either base layers or operation layers only.
525
-
526
- The function might be costly if the hierarchy of layers is deeply nested because the layer tree has to be traversed recursively.
527
- In some scenarios using `options.filter` could be used to improve the performance because it is not necessary to traverse the layer tree completely if some layers are excluded.
528
-
529
- Example (using GroupLayerCollection):
530
-
531
- ```typescript
532
- const grouplayer = new GroupLayer({
533
- id: "group",
534
- title: "group test",
567
+ Compared to `getLayers` and `getOperationalLayers`, `getRecursiveLayer` returns all (nested) child and sub layers of a collection.
568
+ The property `options.filter` can be used to exclude layers (and their child layers) from the result. For `LayerCollection`, `getRecursiveLayers()` provides the predefined filters `base` and `operational` to return either base layers or operation layers only.
569
+
570
+ The function might be costly if the hierarchy of layers is deeply nested because the layer tree has to be traversed recursively.
571
+ In some scenarios using `options.filter` could be used to improve the performance because it is not necessary to traverse the layer tree completely if some layers are excluded.
572
+
573
+ Example (using GroupLayerCollection):
574
+
575
+ ```typescript
576
+ const grouplayer = new GroupLayer({
577
+ id: "group",
578
+ title: "group test",
579
+ layers: [
580
+ new SimpleLayer({
581
+ id: "member",
582
+ title: "group member",
583
+ olLayer: olLayer1,
584
+ }),
585
+ new GroupLayer({
586
+ id: "subgroup",
587
+ title: "subgroup test",
535
588
  layers: [
536
- new SimpleLayer({
537
- id: "member",
538
- title: "group member",
539
- olLayer: olLayer1
540
- }),
541
- new GroupLayer({
542
- id: "subgroup",
543
- title: "subgroup test",
544
- layers: [
545
- new SimpleLayer({
546
- id: "subgroupmember",
547
- title: "subgroup member",
548
- olLayer: olLayer2
549
- })
550
- ]
551
- })
552
- ]
553
- });
554
-
555
- // Returns only the layer "member" because the provided filter function excludes "subgroup" and (implicitly) its child "subgroupmember".
556
- const layers = grouplayer.layers.getRecursiveLayers({
557
- filter: (layer) => layer.id !== "subgroup"
558
- });
559
- ```
589
+ new SimpleLayer({
590
+ id: "subgroupmember",
591
+ title: "subgroup member",
592
+ olLayer: olLayer2,
593
+ }),
594
+ ],
595
+ }),
596
+ ],
597
+ });
598
+
599
+ // Returns only the layer "member" because the provided filter function excludes "subgroup" and (implicitly) its child "subgroupmember".
600
+ const layers = grouplayer.layers.getRecursiveLayers({
601
+ filter: (layer) => layer.id !== "subgroup",
602
+ });
603
+ ```
560
604
 
561
605
  ### Patch Changes
562
606
 
@@ -564,23 +608,23 @@
564
608
  This allows specifying the type of the `properties` attribute.
565
609
  The default type is `Readonly<Record<string, unknown>>` for backwards compatibility.
566
610
 
567
- Example:
611
+ Example:
568
612
 
569
- ```ts
570
- interface MyFeatureProperties {
571
- name: string;
572
- }
613
+ ```ts
614
+ interface MyFeatureProperties {
615
+ name: string;
616
+ }
573
617
 
574
- const feature: BaseFeature<MyFeatureProperties> = {
575
- id: 123,
576
- properties: {
577
- name: "Example Feature"
578
- }
579
- };
618
+ const feature: BaseFeature<MyFeatureProperties> = {
619
+ id: 123,
620
+ properties: {
621
+ name: "Example Feature",
622
+ },
623
+ };
580
624
 
581
- // string | undefined instead of `unknown`
582
- const name = feature.properties?.name;
583
- ```
625
+ // string | undefined instead of `unknown`
626
+ const name = feature.properties?.name;
627
+ ```
584
628
 
585
629
  - 32ed2cd: Fix `mapModel.layers.getLayerById()` not being reactive (#400).
586
630
  - 209eb8e: Added a configuration option to disable fetching of WMS service capabilities.
@@ -594,126 +638,126 @@
594
638
  - e7978a8: **Breaking:** Remove most events from the map model and the layer interfaces.
595
639
  All events that were merely used to synchronized state (e.g. `changed:title` etc.) have been removed.
596
640
 
597
- The map model and related objects (layers, layer collections, etc.) are now based on the [Reactivity API](https://github.com/conterra/reactivity/blob/main/packages/reactivity-core/README.md).
598
- This change greatly simplifies the code that is necessary to access up-to-date values and to react to changes.
641
+ The map model and related objects (layers, layer collections, etc.) are now based on the [Reactivity API](https://github.com/conterra/reactivity/blob/main/packages/reactivity-core/README.md).
642
+ This change greatly simplifies the code that is necessary to access up-to-date values and to react to changes.
599
643
 
600
- For example, from inside a React component, you can now write:
644
+ For example, from inside a React component, you can now write:
601
645
 
602
- ```jsx
603
- import { useReactiveSnapshot } from "@open-pioneer/reactivity";
646
+ ```jsx
647
+ import { useReactiveSnapshot } from "@open-pioneer/reactivity";
604
648
 
605
- function YourComponent() {
606
- // Always up to date, even if the layer's title changes.
607
- // No more need to listen to events.
608
- const title = useReactiveSnapshot(() => layer.title, [layer]);
609
- return <div>{title}</div>;
610
- }
611
- ```
649
+ function YourComponent() {
650
+ // Always up to date, even if the layer's title changes.
651
+ // No more need to listen to events.
652
+ const title = useReactiveSnapshot(() => layer.title, [layer]);
653
+ return <div>{title}</div>;
654
+ }
655
+ ```
612
656
 
613
- And inside a normal JavaScript function, you can watch for changes like this:
657
+ And inside a normal JavaScript function, you can watch for changes like this:
614
658
 
615
- ```js
616
- import { watch } from "@conterra/reactivity-core";
659
+ ```js
660
+ import { watch } from "@conterra/reactivity-core";
617
661
 
618
- const watchHandle = watch(
619
- () => [layer.title],
620
- ([newTitle]) => {
621
- console.log("The title changed to", newTitle);
622
- }
623
- );
662
+ const watchHandle = watch(
663
+ () => [layer.title],
664
+ ([newTitle]) => {
665
+ console.log("The title changed to", newTitle);
666
+ }
667
+ );
624
668
 
625
- // Later, cleanup:
626
- watchHandle.destroy();
627
- ```
669
+ // Later, cleanup:
670
+ watchHandle.destroy();
671
+ ```
628
672
 
629
- For more details, check the [Reactivity API documentation](https://github.com/conterra/reactivity/blob/main/packages/reactivity-core/README.md).
673
+ For more details, check the [Reactivity API documentation](https://github.com/conterra/reactivity/blob/main/packages/reactivity-core/README.md).
630
674
 
631
675
  - 7ae9f90: Add new `children` property to all layers.
632
676
  This property makes it possible to handle any layer children in a generic fashion, regardless of the layer's actual type.
633
677
 
634
- `layer.children` is either an alias of `layer.sublayers` (if the layer has sublayers), `layer.layers` (if it's a `GroupLayer`) or undefined, if the layer does not have any children.
678
+ `layer.children` is either an alias of `layer.sublayers` (if the layer has sublayers), `layer.layers` (if it's a `GroupLayer`) or undefined, if the layer does not have any children.
635
679
 
636
680
  - d8337a6: The following hooks are deprecated and will be removed in a future release:
637
681
 
638
- - `useView`
639
- - `useProjection`
640
- - `useResolution`
641
- - `useCenter`
642
- - `useScale`
682
+ - `useView`
683
+ - `useProjection`
684
+ - `useResolution`
685
+ - `useCenter`
686
+ - `useScale`
643
687
 
644
- They can all be replaced by using the new reactive properties on the `MapModel`, for example:
688
+ They can all be replaced by using the new reactive properties on the `MapModel`, for example:
645
689
 
646
- ```javascript
647
- // old:
648
- const center = useCenter(olMap);
690
+ ```javascript
691
+ // old:
692
+ const center = useCenter(olMap);
649
693
 
650
- // new:
651
- const center = useReactiveSnapshot(() => mapModel.center, [mapModel]);
652
- ```
694
+ // new:
695
+ const center = useReactiveSnapshot(() => mapModel.center, [mapModel]);
696
+ ```
653
697
 
654
698
  - 2fa8020: Update trails core package dependencies.
655
699
 
656
- - Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
657
- - Removes any obsolete references to `@chakra-ui/system`.
658
- This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
700
+ - Also updates Chakra UI to the latest 2.x version and Chakra React Select to version 5.
701
+ - Removes any obsolete references to `@chakra-ui/system`.
702
+ This dependency seems to be no longer required and may lead to duplicate packages in your dependency tree.
659
703
 
660
704
  - 7ae9f90: Add new layer type `GroupLayer` to to the Map API.
661
705
 
662
- A `GroupLayer` contains a list of `Layer` (e.g. `SimpleLayer` or `WMSLayer`). Because `GroupLayer` is a `Layer` as well nested groups are supported.
663
- The child layers of a `GroupLayer` can be accessed with the `layers` property - `layers` is `undefined` if it is not a group.
664
- The parent `GroupLayer` of a child layer can be accessed with the `parent` property - `parent` is `undefined` if this layer is not part of a group (or not a sublayer).
665
-
666
- ```js
667
- const olLayer1 = new TileLayer({
668
- source: new OSM(),
669
- });
670
- const olLayer2 = new TileLayer({
671
- source: new BkgTopPlusOpen(),
672
- });
673
-
674
- // Create group layer with nested sub group
675
- const group = new GroupLayer({
676
- id: "group",
677
- title: "a group layer",
678
- layers: [
679
- new SimpleLayer({
680
- id: "member",
681
- title: "group member",
682
- olLayer: olLayer1,
683
- }),
684
- new GroupLayer({
685
- id: "subgroup",
686
- title: "a nested group layer",
687
- layers: [
688
- new SimpleLayer({
689
- id: "submember",
690
- title: "subgroup member",
691
- olLayer: olLayer2,
692
- }),
693
- ],
694
- }),
695
- ],
696
- });
697
-
698
- const childLayers: GroupLayerCollection = group.layers; // Access child layers
699
- ```
700
-
701
- Layers can only be added to a single group or map.
702
- Sublayers (e.g. `WMSSublayer`) cannot be added to a group directly.
706
+ A `GroupLayer` contains a list of `Layer` (e.g. `SimpleLayer` or `WMSLayer`). Because `GroupLayer` is a `Layer` as well nested groups are supported.
707
+ The child layers of a `GroupLayer` can be accessed with the `layers` property - `layers` is `undefined` if it is not a group.
708
+ The parent `GroupLayer` of a child layer can be accessed with the `parent` property - `parent` is `undefined` if this layer is not part of a group (or not a sublayer).
709
+
710
+ ```js
711
+ const olLayer1 = new TileLayer({
712
+ source: new OSM(),
713
+ });
714
+ const olLayer2 = new TileLayer({
715
+ source: new BkgTopPlusOpen(),
716
+ });
717
+
718
+ // Create group layer with nested sub group
719
+ const group = new GroupLayer({
720
+ id: "group",
721
+ title: "a group layer",
722
+ layers: [
723
+ new SimpleLayer({
724
+ id: "member",
725
+ title: "group member",
726
+ olLayer: olLayer1,
727
+ }),
728
+ new GroupLayer({
729
+ id: "subgroup",
730
+ title: "a nested group layer",
731
+ layers: [
732
+ new SimpleLayer({
733
+ id: "submember",
734
+ title: "subgroup member",
735
+ olLayer: olLayer2,
736
+ }),
737
+ ],
738
+ }),
739
+ ],
740
+ });
741
+
742
+ const childLayers: GroupLayerCollection = group.layers; // Access child layers
743
+ ```
744
+
745
+ Layers can only be added to a single group or map.
746
+ Sublayers (e.g. `WMSSublayer`) cannot be added to a group directly.
703
747
 
704
748
  - d8337a6: Provide new reactive properties on the `MapModel` type.
705
749
 
706
- - `olView` (-> `olMap.getView()`)
707
- - `projection` (-> `olMap.getView().getProjection()`)
708
- - `resolution` (-> `olMap.getView().getResolution()`)
709
- - `zoomLevel` (-> `olMap.getView().getZoom()`)
710
- - `center` (-> `olMap.getView().getCenter()`)
711
- - `scale` (derived from center and resolution)
750
+ - `olView` (-> `olMap.getView()`)
751
+ - `projection` (-> `olMap.getView().getProjection()`)
752
+ - `resolution` (-> `olMap.getView().getResolution()`)
753
+ - `zoomLevel` (-> `olMap.getView().getZoom()`)
754
+ - `center` (-> `olMap.getView().getCenter()`)
755
+ - `scale` (derived from center and resolution)
712
756
 
713
- Most of the listed properties are already available on raw OpenLayers objects (see code in parentheses above).
714
- However, those OpenLayers properties require manual work for synchronization, whereas the new properties are reactive (and can be watched, for example, using `useReactiveSnapshot()`).
757
+ Most of the listed properties are already available on raw OpenLayers objects (see code in parentheses above).
758
+ However, those OpenLayers properties require manual work for synchronization, whereas the new properties are reactive (and can be watched, for example, using `useReactiveSnapshot()`).
715
759
 
716
- A new method `setScale()` has also been added to the model.
760
+ A new method `setScale()` has also been added to the model.
717
761
 
718
762
  ### Patch Changes
719
763
 
@@ -727,45 +771,45 @@
727
771
 
728
772
  - 2502050: Introduce union types and `type` attributes for layers. This allows TypeScript narrowing for layers and determining a layer's type.
729
773
 
730
- The `Layer` and `Sublayer` types for layers remain, but are unions of the corresponding concrete layer types now.
731
- The layer type `LayerBase` has been removed and is replaced by `AnyLayerType`
732
- to clarify that this type represents a union of all types of layer (currently `Layer` and `Sublayer`).
774
+ The `Layer` and `Sublayer` types for layers remain, but are unions of the corresponding concrete layer types now.
775
+ The layer type `LayerBase` has been removed and is replaced by `AnyLayerType`
776
+ to clarify that this type represents a union of all types of layer (currently `Layer` and `Sublayer`).
733
777
 
734
- Two type guards have been implemented that allow to check if a layer instance is a `Layer` or `Sublayer`: `isLayer()`and `isSublayer()` (see example below).
778
+ Two type guards have been implemented that allow to check if a layer instance is a `Layer` or `Sublayer`: `isLayer()`and `isSublayer()` (see example below).
735
779
 
736
- The following `type` attribute values have been implemented at the layers:
780
+ The following `type` attribute values have been implemented at the layers:
737
781
 
738
- - SimpleLayer: `simple`
739
- - WMSLayer: `wms`
740
- - WMSSubLayer: `wms-sublayer`
741
- - WMTSLayer: `wmts`
782
+ - SimpleLayer: `simple`
783
+ - WMSLayer: `wms`
784
+ - WMSSubLayer: `wms-sublayer`
785
+ - WMTSLayer: `wmts`
742
786
 
743
- Example of usage:
787
+ Example of usage:
744
788
 
745
- ```ts
746
- import { AnyLayer, WMTSLayer, isSublayer } from "@open-pioneer/map";
789
+ ```ts
790
+ import { AnyLayer, WMTSLayer, isSublayer } from "@open-pioneer/map";
747
791
 
748
- export class ExampleClass {
749
- //...
792
+ export class ExampleClass {
793
+ //...
750
794
 
751
- exampleFunction(layer: AnyLayer) {
752
- // prop may be a layer of any type
795
+ exampleFunction(layer: AnyLayer) {
796
+ // prop may be a layer of any type
753
797
 
754
- // use layers type attribute to check layer type
755
- if (layer.type === "wmts") {
756
- layer.matrixSet; // prop only available on WMTSLayer
798
+ // use layers type attribute to check layer type
799
+ if (layer.type === "wmts") {
800
+ layer.matrixSet; // prop only available on WMTSLayer
757
801
 
758
- const wmtsLayer: WMTSLayer = layer; // type of layer is now narrowed to `WMTSLayer`
759
- }
802
+ const wmtsLayer: WMTSLayer = layer; // type of layer is now narrowed to `WMTSLayer`
803
+ }
760
804
 
761
- // use new type guard to check if layer is a Sublayer
762
- if (isSublayer(layer)) {
763
- // type of layer is now narrowed to `WMSSublayer` (as it is currently the only type of Sublayer existing)
764
- layer.parentLayer; // prop only available on Sublayers
765
- }
766
- }
805
+ // use new type guard to check if layer is a Sublayer
806
+ if (isSublayer(layer)) {
807
+ // type of layer is now narrowed to `WMSSublayer` (as it is currently the only type of Sublayer existing)
808
+ layer.parentLayer; // prop only available on Sublayers
809
+ }
767
810
  }
768
- ```
811
+ }
812
+ ```
769
813
 
770
814
  - 310800c: Switch from `peerDependencies` to normal `dependencies`. Peer dependencies have some usability problems when used at scale.
771
815
 
@@ -775,7 +819,7 @@
775
819
  - 583f1d6: The `mapId` or `map` properties are now optional on individual components.
776
820
  You can use the `DefaultMapProvider` to configure an implicit default value.
777
821
 
778
- Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
822
+ Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
779
823
 
780
824
  - 583f1d6: All UI components in this project now accept the `mapId` (a `string`) _or_ the `map` (a `MapModel`) directly.
781
825
  - 397d617: Reimplement computation of map anchor positioning using new css props.
@@ -785,20 +829,20 @@
785
829
  - 583f1d6: The new component `DefaultMapProvider` allows you to configure the _default map_ for its children.
786
830
  If `DefaultMapProvider` is used, you can omit the explicit `mapId` (or `map`) property on the individual UI components.
787
831
 
788
- For many applications, `DefaultMapProvider` can be used to surround all (or most of) the application's UI.
832
+ For many applications, `DefaultMapProvider` can be used to surround all (or most of) the application's UI.
789
833
 
790
- Example:
834
+ Example:
791
835
 
792
- ```tsx
793
- import { DefaultMapProvider } from "@open-pioneer/map";
836
+ ```tsx
837
+ import { DefaultMapProvider } from "@open-pioneer/map";
794
838
 
795
- <DefaultMapProvider mapId={MAP_ID}>
796
- {/* no need to repeat the map id in this subtree, unless you want to use a different one */}
797
- <MapContainer />
798
- <Toc />
799
- <ComplexChild />
800
- </DefaultMapProvider>;
801
- ```
839
+ <DefaultMapProvider mapId={MAP_ID}>
840
+ {/* no need to repeat the map id in this subtree, unless you want to use a different one */}
841
+ <MapContainer />
842
+ <Toc />
843
+ <ComplexChild />
844
+ </DefaultMapProvider>;
845
+ ```
802
846
 
803
847
  - 397d617: Move attribution of OL map according to the map view's padding.
804
848
 
@@ -815,36 +859,36 @@
815
859
 
816
860
  - 0d51d2f: Change how map anchors are positioned in the DOM.
817
861
 
818
- Previously, map anchor divs were children of the OpenLayers map viewport:
862
+ Previously, map anchor divs were children of the OpenLayers map viewport:
819
863
 
820
- ```
821
- .map-container
822
- └── .ol-viewport
823
- └── .ol-overlaycontainer-stopevent
824
- └── .map-anchors
825
- └── .map-anchor
826
- └── ... children ...
827
- ```
864
+ ```
865
+ .map-container
866
+ └── .ol-viewport
867
+ └── .ol-overlaycontainer-stopevent
868
+ └── .map-anchors
869
+ └── .map-anchor
870
+ └── ... children ...
871
+ ```
828
872
 
829
- This interfered with browser event handling, especially if the map anchor's content was interactive.
830
- The workarounds to stop events from map-anchors to bubble into the map caused surprising behavior (e.g. https://github.com/open-pioneer/trails-openlayers-base-packages/issues/312).
873
+ This interfered with browser event handling, especially if the map anchor's content was interactive.
874
+ The workarounds to stop events from map-anchors to bubble into the map caused surprising behavior (e.g. https://github.com/open-pioneer/trails-openlayers-base-packages/issues/312).
831
875
 
832
- Now, the DOM looks like this:
876
+ Now, the DOM looks like this:
833
877
 
834
- ```
835
- .map-container
836
- ├── .map-anchors
837
- │ └── .map-anchor
838
- │ └── ... children ...
839
- └── .ol-viewport
840
- ```
878
+ ```
879
+ .map-container
880
+ ├── .map-anchors
881
+ │ └── .map-anchor
882
+ │ └── ... children ...
883
+ └── .ol-viewport
884
+ ```
841
885
 
842
- Which means that the map-anchors are no longer children of the map.
886
+ Which means that the map-anchors are no longer children of the map.
843
887
 
844
- You may have to update your custom styles if you relied on the previous DOM hierarchy.
888
+ You may have to update your custom styles if you relied on the previous DOM hierarchy.
845
889
 
846
- The `MapAnchor`'s prop `stopEvents` has been deleted as it is no longer needed.
847
- Browser events happening inside a map anchor or its children will no longer affect the map.
890
+ The `MapAnchor`'s prop `stopEvents` has been deleted as it is no longer needed.
891
+ Browser events happening inside a map anchor or its children will no longer affect the map.
848
892
 
849
893
  ### Patch Changes
850
894