@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.
@@ -278,6 +278,7 @@ var FeatureOutputFormat;
278
278
  (function (FeatureOutputFormat) {
279
279
  FeatureOutputFormat[FeatureOutputFormat["GeoJson"] = 1] = "GeoJson";
280
280
  FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
281
+ FeatureOutputFormat[FeatureOutputFormat["Geometry"] = 3] = "Geometry";
281
282
  })(FeatureOutputFormat || (FeatureOutputFormat = {}));
282
283
 
283
284
  /**
@@ -1057,7 +1058,9 @@ class DrawingService {
1057
1058
  onEnd(evt, command, layer) {
1058
1059
  command.finish(command.format === FeatureOutputFormat.GeoJson
1059
1060
  ? new GeoJSON().writeFeature(evt.feature)
1060
- : new WKT().writeFeature(evt.feature));
1061
+ : command.format === FeatureOutputFormat.WKT
1062
+ ? new WKT().writeFeature(evt.feature)
1063
+ : new GeoJSON().writeGeometry(evt.feature.getGeometry()));
1061
1064
  this.clearInteraction(layer);
1062
1065
  }
1063
1066
  observeMapRender() {
@@ -1143,7 +1146,9 @@ class FeatureModificationService {
1143
1146
  onModified(command) {
1144
1147
  command.next(command.format === FeatureOutputFormat.GeoJson
1145
1148
  ? new GeoJSON().writeFeature(command.model.feature)
1146
- : new WKT().writeFeature(command.model.feature));
1149
+ : command.format === FeatureOutputFormat.WKT
1150
+ ? new WKT().writeFeature(command.model.feature)
1151
+ : new GeoJSON().writeGeometry(command.model.feature.getGeometry()));
1147
1152
  }
1148
1153
  observeMapRender() {
1149
1154
  this.postboy.sub(MapRenderedEvent).subscribe((m) => {