@artstesh/maps 6.1.0 → 6.1.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
  /**
@@ -1118,7 +1119,9 @@ class DrawingService {
1118
1119
  onEnd(evt, command, layer) {
1119
1120
  command.finish(command.format === FeatureOutputFormat.GeoJson
1120
1121
  ? new GeoJSON().writeFeature(evt.feature)
1121
- : new WKT().writeFeature(evt.feature));
1122
+ : command.format === FeatureOutputFormat.WKT
1123
+ ? new WKT().writeFeature(evt.feature)
1124
+ : new GeoJSON().writeGeometry(evt.feature.getGeometry()));
1122
1125
  this.clearInteraction(layer);
1123
1126
  }
1124
1127
  observeMapRender() {
@@ -1209,7 +1212,9 @@ class FeatureModificationService {
1209
1212
  onModified(command) {
1210
1213
  command.next(command.format === FeatureOutputFormat.GeoJson
1211
1214
  ? new GeoJSON().writeFeature(command.model.feature)
1212
- : 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()));
1213
1218
  }
1214
1219
  observeMapRender() {
1215
1220
  this.postboy.sub(MapRenderedEvent).subscribe((m) => {