@artstesh/maps 1.1.37 → 1.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';
@@ -938,11 +938,6 @@ RemoveRasterTileCommand.ID = 'd1c4bf6a-e2f2-4385-a7a2-cecb525f8939';
938
938
  class MapPostboyService extends PostboyService {
939
939
  constructor() {
940
940
  super();
941
- this.addLocker({
942
- locker: StartDrawingCommand.ID,
943
- unlocker: DrawingFinishedEvent.ID,
944
- locking: [MapClickEvent.ID],
945
- });
946
941
  }
947
942
  }
948
943
  MapPostboyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1256,6 +1251,7 @@ class DrawingService {
1256
1251
  }
1257
1252
  observeDrawing() {
1258
1253
  this.postboy.sub(StartDrawingCommand).subscribe((ev) => {
1254
+ this.postboy.exec(new LockMessage(MapClickEvent));
1259
1255
  this.draw((l) => {
1260
1256
  var _a;
1261
1257
  if (!l || !this.map) {
@@ -1303,6 +1299,7 @@ class DrawingService {
1303
1299
  (_a = this.map) === null || _a === void 0 ? void 0 : _a.removeInteraction(this.drawInteraction);
1304
1300
  layer === null || layer === void 0 ? void 0 : layer.setSource(new Vector({}));
1305
1301
  }
1302
+ this.postboy.exec(new UnlockMessage(MapClickEvent));
1306
1303
  setTimeout(() => this.postboy.fire(new DrawingFinishedEvent()), 300);
1307
1304
  }
1308
1305
  }