@artstesh/maps 4.1.37 → 4.2.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.
@@ -11,7 +11,7 @@ import { getCenter, createEmpty, extend } from 'ol/extent';
11
11
  import Polygon, { circular, fromExtent } from 'ol/geom/Polygon';
12
12
  import { Control, Zoom } from 'ol/control';
13
13
  import { get, useGeographic, transform } from 'ol/proj';
14
- import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
14
+ import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, LockMessage, UnlockMessage, PostboyAbstractRegistrator } from '@artstesh/postboy';
15
15
  import * as Sphere from 'ol/sphere';
16
16
  import { getLength } from 'ol/sphere';
17
17
  import { Draw, Modify, Translate, defaults } from 'ol/interaction';
@@ -937,11 +937,6 @@ RemoveRasterTileCommand.ID = 'd1c4bf6a-e2f2-4385-a7a2-cecb525f8939';
937
937
  class MapPostboyService extends PostboyService {
938
938
  constructor() {
939
939
  super();
940
- this.addLocker({
941
- locker: StartDrawingCommand.ID,
942
- unlocker: DrawingFinishedEvent.ID,
943
- locking: [MapClickEvent.ID],
944
- });
945
940
  }
946
941
  }
947
942
  MapPostboyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1247,6 +1242,7 @@ class DrawingService {
1247
1242
  }
1248
1243
  observeDrawing() {
1249
1244
  this.postboy.sub(StartDrawingCommand).subscribe((ev) => {
1245
+ this.postboy.exec(new LockMessage(MapClickEvent));
1250
1246
  this.draw((l) => {
1251
1247
  if (!l || !this.map) {
1252
1248
  this.clearInteraction(l);
@@ -1292,6 +1288,7 @@ class DrawingService {
1292
1288
  this.map?.removeInteraction(this.drawInteraction);
1293
1289
  layer?.setSource(new Vector({}));
1294
1290
  }
1291
+ this.postboy.exec(new UnlockMessage(MapClickEvent));
1295
1292
  setTimeout(() => this.postboy.fire(new DrawingFinishedEvent()), 300);
1296
1293
  }
1297
1294
  }