@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';
@@ -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: "15.2.10", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1255,6 +1250,7 @@ class DrawingService {
1255
1250
  }
1256
1251
  observeDrawing() {
1257
1252
  this.postboy.sub(StartDrawingCommand).subscribe((ev) => {
1253
+ this.postboy.exec(new LockMessage(MapClickEvent));
1258
1254
  this.draw((l) => {
1259
1255
  var _a;
1260
1256
  if (!l || !this.map) {
@@ -1302,6 +1298,7 @@ class DrawingService {
1302
1298
  (_a = this.map) === null || _a === void 0 ? void 0 : _a.removeInteraction(this.drawInteraction);
1303
1299
  layer === null || layer === void 0 ? void 0 : layer.setSource(new Vector({}));
1304
1300
  }
1301
+ this.postboy.exec(new UnlockMessage(MapClickEvent));
1305
1302
  setTimeout(() => this.postboy.fire(new DrawingFinishedEvent()), 300);
1306
1303
  }
1307
1304
  }