@artstesh/maps 5.1.24 → 5.2.1

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.
@@ -285,6 +285,7 @@ var FeatureOutputFormat;
285
285
  (function (FeatureOutputFormat) {
286
286
  FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
287
287
  FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
288
+ FeatureOutputFormat[FeatureOutputFormat["Geometry"] = 3] = "Geometry";
288
289
  })(FeatureOutputFormat || (FeatureOutputFormat = {}));
289
290
 
290
291
  /**
@@ -819,11 +820,6 @@ class ZoomControlFactory {
819
820
  class MapPostboyService extends PostboyService {
820
821
  constructor() {
821
822
  super();
822
- this.addLocker({
823
- locker: StartDrawingCommand.ID,
824
- unlocker: DrawingFinishedEvent.ID,
825
- locking: [MapClickEvent.ID],
826
- });
827
823
  }
828
824
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
829
825
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPostboyService });
@@ -1092,6 +1088,7 @@ class DrawingService {
1092
1088
  }
1093
1089
  observeSelectArea() {
1094
1090
  this.postboy.sub(DrawSelectionAreaCommand).subscribe((ev) => {
1091
+ this.postboy.lock(MapClickEvent);
1095
1092
  this.postboy.fireCallback(new StartDrawingCommand(ev.type, ev.style), (r) => {
1096
1093
  if (!r) {
1097
1094
  ev.finish(new Dictionary());
@@ -1122,7 +1119,9 @@ class DrawingService {
1122
1119
  onEnd(evt, command, layer) {
1123
1120
  command.finish(command.format === FeatureOutputFormat.GeoJson
1124
1121
  ? new GeoJSON().writeFeature(evt.feature)
1125
- : new WKT().writeFeature(evt.feature));
1122
+ : command.format === FeatureOutputFormat.WKT
1123
+ ? new WKT().writeFeature(evt.feature)
1124
+ : new GeoJSON().writeGeometry(evt.feature.getGeometry()));
1126
1125
  this.clearInteraction(layer);
1127
1126
  }
1128
1127
  observeMapRender() {
@@ -1147,6 +1146,7 @@ class DrawingService {
1147
1146
  this.map?.removeInteraction(this.drawInteraction);
1148
1147
  layer?.setSource(new Vector({}));
1149
1148
  }
1149
+ this.postboy.unlock(MapClickEvent);
1150
1150
  setTimeout(() => this.postboy.fire(new DrawingFinishedEvent()), 300);
1151
1151
  }
1152
1152
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DrawingService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1212,7 +1212,9 @@ class FeatureModificationService {
1212
1212
  onModified(command) {
1213
1213
  command.next(command.format === FeatureOutputFormat.GeoJson
1214
1214
  ? new GeoJSON().writeFeature(command.model.feature)
1215
- : new WKT().writeFeature(command.model.feature));
1215
+ : command.format === FeatureOutputFormat.WKT
1216
+ ? new WKT().writeFeature(command.model.feature)
1217
+ : new GeoJSON().writeGeometry(command.model.feature.getGeometry()));
1216
1218
  }
1217
1219
  observeMapRender() {
1218
1220
  this.postboy.sub(MapRenderedEvent).subscribe((m) => {