@artstesh/maps 6.0.10 → 6.0.11

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.
@@ -9,7 +9,7 @@ import { getCenter, createEmpty, extend } from 'ol/extent';
9
9
  import { Control, Zoom } from 'ol/control';
10
10
  import { get, useGeographic, transform } from 'ol/proj';
11
11
  import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
12
- import { Draw, Modify, Translate } from 'ol/interaction';
12
+ import { Draw, Modify, Translate, defaults } from 'ol/interaction';
13
13
  import { createRegularPolygon, createBox } from 'ol/interaction/Draw';
14
14
  import * as Sphere from 'ol/sphere';
15
15
  import { Dictionary } from '@artstesh/collections';
@@ -75,6 +75,7 @@ class MapSettings {
75
75
  zoom = 4;
76
76
  lyrs = MapLyrs.Hybrid;
77
77
  language = 'en';
78
+ interactionSettings = {};
78
79
  static copy(model) {
79
80
  const result = new MapSettings();
80
81
  result.center = model.center;
@@ -82,9 +83,20 @@ class MapSettings {
82
83
  result.minZoom = model.minZoom;
83
84
  result.zoom = model.zoom;
84
85
  result.lyrs = model.lyrs;
86
+ result.interactionSettings = model.interactionSettings;
85
87
  result.language = model.language;
86
88
  return result;
87
89
  }
90
+ /**
91
+ * Updates the interaction settings of the map and returns a new MapSettings instance
92
+ * with the updated settings.
93
+ *
94
+ * @param {DefaultsOptions} interactionSettings - The new interaction settings to be applied.
95
+ * @return {MapSettings} A new MapSettings instance with the updated interaction settings.
96
+ */
97
+ setInteractionSettings(interactionSettings) {
98
+ return MapSettings.copy({ ...this, interactionSettings });
99
+ }
88
100
  /**
89
101
  * Sets the center for the map settings.
90
102
  *
@@ -156,6 +168,8 @@ class MapSettings {
156
168
  return false;
157
169
  if (this.language !== model.language)
158
170
  return false;
171
+ if (this.interactionSettings !== model.interactionSettings)
172
+ return false;
159
173
  return this.center.length === model.center.length && !this.center.filter((c, i) => c !== model.center[i]).length;
160
174
  }
161
175
  }
@@ -2066,6 +2080,7 @@ class MapPlateFactory {
2066
2080
  maxZoom: settings?.maxZoom || 19,
2067
2081
  }),
2068
2082
  layers: [],
2083
+ interactions: defaults(settings.interactionSettings),
2069
2084
  });
2070
2085
  }
2071
2086
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MapPlateFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });