@swr-data-lab/components 2.10.0 → 2.11.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.
@@ -4,7 +4,7 @@ import { createMapContext, MapContext } from '../context.svelte.js';
4
4
  import {} from '../types';
5
5
  import FallbackStyle from './FallbackStyle';
6
6
  import { de } from './locale';
7
- let { children, options, style = FallbackStyle, minZoom = 0, maxZoom = 14.99, zoom = $bindable(), center = $bindable(), pitch = $bindable(0), bearing = $bindable(0), loading = $bindable(true), projection = { type: 'mercator' }, allowRotation = false, allowZoom = true, showDebug = false, initialLocation: receivedInitialLocation,
7
+ let { children, options, style = FallbackStyle, minZoom = 0, maxZoom = 14.99, zoom = $bindable(), center = $bindable(), pitch = $bindable(0), bearing = $bindable(0), loading = $bindable(true), projection = { type: 'mercator' }, allowRotation = false, allowZoom = true, showDebug = false, cursor, initialLocation: receivedInitialLocation,
8
8
  // Future: This should become bindable.readonly when that becomes
9
9
  // available, see: https://github.com/sveltejs/svelte/issues/7712
10
10
  mapContext = $bindable(), cooperativeGestures = false, onmoveend, onmovestart } = $props();
@@ -64,6 +64,11 @@ $effect(() => {
64
64
  if (mapContext.map)
65
65
  mapContext.map.setStyle(style);
66
66
  });
67
+ $effect(() => {
68
+ if (mapContext.map) {
69
+ mapContext.map.getCanvas().style.cursor = cursor ?? '';
70
+ }
71
+ });
67
72
  $effect(() => {
68
73
  if (mapContext.styleLoaded) {
69
74
  mapContext.map?.setProjection(projection);
@@ -17,9 +17,13 @@ interface MapProps {
17
17
  projection?: ProjectionSpecification;
18
18
  showDebug?: boolean;
19
19
  options?: any;
20
+ /**
21
+ * Set the mouse cursor. `""` (empty string) restores Maplibre's default behaviour. See VectorLayer/Default for a common usage example
22
+ */
23
+ cursor?: string;
20
24
  mapContext?: MapContext;
21
25
  /**
22
- * "Use Ctrl + scroll to zoom"
26
+ * Show "Use Ctrl + scroll to zoom" overlay
23
27
  */
24
28
  cooperativeGestures?: boolean;
25
29
  onmovestart?: (e: MapLibreEvent) => null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@swr-data-lab/components",
3
3
  "description": "SWR Data Lab component library",
4
- "version": "2.10.0",
4
+ "version": "2.11.0",
5
5
  "author": "SWR Data Lab",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",