@artstesh/maps 4.1.22 → 4.1.23

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.
@@ -279,6 +279,7 @@ var FeatureOutputFormat;
279
279
  (function (FeatureOutputFormat) {
280
280
  FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
281
281
  FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
282
+ FeatureOutputFormat[FeatureOutputFormat["Geometry"] = 3] = "Geometry";
282
283
  })(FeatureOutputFormat || (FeatureOutputFormat = {}));
283
284
 
284
285
  /**
@@ -1066,7 +1067,9 @@ class DrawingService {
1066
1067
  onEnd(evt, command, layer) {
1067
1068
  command.finish(command.format === FeatureOutputFormat.GeoJson
1068
1069
  ? new GeoJSON().writeFeature(evt.feature)
1069
- : new WKT().writeFeature(evt.feature));
1070
+ : command.format === FeatureOutputFormat.WKT
1071
+ ? new WKT().writeFeature(evt.feature)
1072
+ : new GeoJSON().writeGeometry(evt.feature.getGeometry()));
1070
1073
  this.clearInteraction(layer);
1071
1074
  }
1072
1075
  observeMapRender() {
@@ -1157,7 +1160,9 @@ class FeatureModificationService {
1157
1160
  onModified(command) {
1158
1161
  command.next(command.format === FeatureOutputFormat.GeoJson
1159
1162
  ? new GeoJSON().writeFeature(command.model.feature)
1160
- : new WKT().writeFeature(command.model.feature));
1163
+ : command.format === FeatureOutputFormat.WKT
1164
+ ? new WKT().writeFeature(command.model.feature)
1165
+ : new GeoJSON().writeGeometry(command.model.feature.getGeometry()));
1161
1166
  }
1162
1167
  observeMapRender() {
1163
1168
  this.postboy.sub(MapRenderedEvent).subscribe((m) => {