@artstesh/maps 1.1.21 → 1.1.22

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
  /**
@@ -1067,7 +1068,9 @@ class DrawingService {
1067
1068
  onEnd(evt, command, layer) {
1068
1069
  command.finish(command.format === FeatureOutputFormat.GeoJson
1069
1070
  ? new GeoJSON().writeFeature(evt.feature)
1070
- : new WKT().writeFeature(evt.feature));
1071
+ : command.format === FeatureOutputFormat.WKT
1072
+ ? new WKT().writeFeature(evt.feature)
1073
+ : new GeoJSON().writeGeometry(evt.feature.getGeometry()));
1071
1074
  this.clearInteraction(layer);
1072
1075
  }
1073
1076
  observeMapRender() {
@@ -1158,7 +1161,9 @@ class FeatureModificationService {
1158
1161
  onModified(command) {
1159
1162
  command.next(command.format === FeatureOutputFormat.GeoJson
1160
1163
  ? new GeoJSON().writeFeature(command.model.feature)
1161
- : new WKT().writeFeature(command.model.feature));
1164
+ : command.format === FeatureOutputFormat.WKT
1165
+ ? new WKT().writeFeature(command.model.feature)
1166
+ : new GeoJSON().writeGeometry(command.model.feature.getGeometry()));
1162
1167
  }
1163
1168
  observeMapRender() {
1164
1169
  this.postboy.sub(MapRenderedEvent).subscribe((m) => {