@artstesh/maps 4.0.10 → 4.0.11

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.
Files changed (64) hide show
  1. package/dist/esm2020/map/helpers/polygon-style.helper.mjs +19 -2
  2. package/dist/esm2020/map/map-plate/map-plate.component.mjs +4 -1
  3. package/dist/esm2020/map/messages/commands/cancel-feature-modification.command.mjs +8 -0
  4. package/dist/esm2020/map/messages/commands/modify-feature.command.mjs +15 -0
  5. package/dist/esm2020/map/messages/executors/filter-features-in-area.executor.mjs +13 -0
  6. package/dist/esm2020/map/messages/executors/generate-draw.executor.mjs +14 -0
  7. package/dist/esm2020/map/messages/index.mjs +3 -1
  8. package/dist/esm2020/map/models/drawing-type.enum.mjs +2 -1
  9. package/dist/esm2020/map/services/drawing/drawing-generation.service.mjs +16 -21
  10. package/dist/esm2020/map/services/drawing/drawing.service.mjs +8 -12
  11. package/dist/esm2020/map/services/drawing/feature-modification.service.mjs +99 -0
  12. package/dist/esm2020/map/services/feature.service.mjs +4 -17
  13. package/dist/esm2020/map/services/map-management.service.mjs +5 -13
  14. package/dist/esm2020/map/services/message-registrator.service.mjs +19 -11
  15. package/dist/esm2020/src/map/helpers/polygon-style.helper.mjs +19 -2
  16. package/dist/esm2020/src/map/map-plate/map-plate.component.mjs +4 -1
  17. package/dist/esm2020/src/map/messages/commands/cancel-feature-modification.command.mjs +8 -0
  18. package/dist/esm2020/src/map/messages/commands/modify-feature.command.mjs +15 -0
  19. package/dist/esm2020/src/map/messages/executors/filter-features-in-area.executor.mjs +13 -0
  20. package/dist/esm2020/src/map/messages/executors/generate-draw.executor.mjs +14 -0
  21. package/dist/esm2020/src/map/messages/index.mjs +3 -1
  22. package/dist/esm2020/src/map/models/drawing-type.enum.mjs +2 -1
  23. package/dist/esm2020/src/map/services/drawing/drawing-generation.service.mjs +16 -21
  24. package/dist/esm2020/src/map/services/drawing/drawing.service.mjs +8 -12
  25. package/dist/esm2020/src/map/services/drawing/feature-modification.service.mjs +99 -0
  26. package/dist/esm2020/src/map/services/feature.service.mjs +4 -17
  27. package/dist/esm2020/src/map/services/map-management.service.mjs +5 -13
  28. package/dist/esm2020/src/map/services/message-registrator.service.mjs +19 -11
  29. package/dist/fesm2015/maps-components-src-map.mjs +197 -81
  30. package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
  31. package/dist/fesm2015/maps-components.mjs +197 -81
  32. package/dist/fesm2015/maps-components.mjs.map +1 -1
  33. package/dist/fesm2020/maps-components-src-map.mjs +191 -80
  34. package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
  35. package/dist/fesm2020/maps-components.mjs +191 -80
  36. package/dist/fesm2020/maps-components.mjs.map +1 -1
  37. package/dist/map/helpers/polygon-style.helper.d.ts +1 -0
  38. package/dist/map/messages/commands/cancel-feature-modification.command.d.ts +5 -0
  39. package/dist/map/messages/commands/modify-feature.command.d.ts +11 -0
  40. package/dist/map/messages/{queries/filter-features-in-area.query.d.ts → executors/filter-features-in-area.executor.d.ts} +2 -2
  41. package/dist/map/messages/{queries/generate-draw.query.d.ts → executors/generate-draw.executor.d.ts} +2 -2
  42. package/dist/map/messages/index.d.ts +2 -0
  43. package/dist/map/models/drawing-type.enum.d.ts +2 -1
  44. package/dist/map/services/drawing/drawing-generation.service.d.ts +5 -9
  45. package/dist/map/services/drawing/feature-modification.service.d.ts +22 -0
  46. package/dist/map/services/feature.service.d.ts +6 -9
  47. package/dist/map/services/message-registrator.service.d.ts +3 -3
  48. package/dist/package.json +1 -1
  49. package/dist/src/map/helpers/polygon-style.helper.d.ts +1 -0
  50. package/dist/src/map/messages/commands/cancel-feature-modification.command.d.ts +5 -0
  51. package/dist/src/map/messages/commands/modify-feature.command.d.ts +11 -0
  52. package/dist/src/map/messages/{queries/filter-features-in-area.query.d.ts → executors/filter-features-in-area.executor.d.ts} +2 -2
  53. package/dist/src/map/messages/{queries/generate-draw.query.d.ts → executors/generate-draw.executor.d.ts} +2 -2
  54. package/dist/src/map/messages/index.d.ts +2 -0
  55. package/dist/src/map/models/drawing-type.enum.d.ts +2 -1
  56. package/dist/src/map/services/drawing/drawing-generation.service.d.ts +5 -9
  57. package/dist/src/map/services/drawing/feature-modification.service.d.ts +22 -0
  58. package/dist/src/map/services/feature.service.d.ts +6 -9
  59. package/dist/src/map/services/message-registrator.service.d.ts +3 -3
  60. package/package.json +2 -2
  61. package/dist/esm2020/map/messages/queries/filter-features-in-area.query.mjs +0 -13
  62. package/dist/esm2020/map/messages/queries/generate-draw.query.mjs +0 -14
  63. package/dist/esm2020/src/map/messages/queries/filter-features-in-area.query.mjs +0 -13
  64. package/dist/esm2020/src/map/messages/queries/generate-draw.query.mjs +0 -14
@@ -2,23 +2,23 @@ import * as i0 from '@angular/core';
2
2
  import { Component, Injectable, ChangeDetectionStrategy, Input, ViewChild, NgModule } from '@angular/core';
3
3
  import * as i4 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
- import { Feature } from 'ol';
5
+ import { Feature, Collection } from 'ol';
6
6
  import { Point, LineString } from 'ol/geom';
7
7
  import { GeoJSON, WKT } from 'ol/format';
8
8
  import { getCenter, createEmpty, extend } from 'ol/extent';
9
9
  import { get, useGeographic, transform } from 'ol/proj';
10
- import { PostboyGenericMessage, PostboyCallbackMessage, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
11
- import { forkJoin, combineLatest } from 'rxjs';
12
- import { tap, first, filter, auditTime } from 'rxjs/operators';
13
- import { Vector, XYZ } from 'ol/source';
14
- import { Draw } from 'ol/interaction';
10
+ import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
11
+ import { Draw, Modify, Translate } from 'ol/interaction';
15
12
  import { createRegularPolygon } from 'ol/interaction/Draw';
13
+ import { first, filter, auditTime } from 'rxjs/operators';
14
+ import { Vector, XYZ } from 'ol/source';
16
15
  import TileLayer from 'ol/layer/Tile';
17
16
  import OSM from 'ol/source/OSM';
18
17
  import { Vector as Vector$1 } from 'ol/layer';
19
18
  import { bbox } from 'ol/loadingstrategy';
20
19
  import Polygon, { fromExtent } from 'ol/geom/Polygon';
21
20
  import Cluster from 'ol/source/Cluster';
21
+ import { combineLatest } from 'rxjs';
22
22
  import Map from 'ol/Map';
23
23
  import View from 'ol/View';
24
24
  import Overlay from 'ol/Overlay';
@@ -179,6 +179,7 @@ var DrawingType;
179
179
  (function (DrawingType) {
180
180
  DrawingType[DrawingType["Polygon"] = 1] = "Polygon";
181
181
  DrawingType[DrawingType["Circle"] = 2] = "Circle";
182
+ DrawingType[DrawingType["Square"] = 3] = "Square";
182
183
  })(DrawingType || (DrawingType = {}));
183
184
 
184
185
  var FeatureOutputFormat;
@@ -323,6 +324,26 @@ class DrawSelectionAreaCommand extends PostboyCallbackMessage {
323
324
  }
324
325
  DrawSelectionAreaCommand.ID = '573d8a0d-f25b-42b7-9ad7-0ac6d86ac362';
325
326
 
327
+ class ModifyFeatureCommand extends PostboyCallbackMessage {
328
+ constructor(model, style, format = FeatureOutputFormat.GeoJson) {
329
+ super();
330
+ this.model = model;
331
+ this.style = style;
332
+ this.format = format;
333
+ }
334
+ get id() {
335
+ return ModifyFeatureCommand.ID;
336
+ }
337
+ }
338
+ ModifyFeatureCommand.ID = 'ead85caa-24c6-4844-a68c-2cea91774c8c';
339
+
340
+ class CancelFeatureModificationCommand extends PostboyGenericMessage {
341
+ get id() {
342
+ return CancelFeatureModificationCommand.ID;
343
+ }
344
+ }
345
+ CancelFeatureModificationCommand.ID = '9c9fb40f-ea95-4704-8177-0e9ecabf36fa';
346
+
326
347
  class AddLayerCommand extends PostboyGenericMessage {
327
348
  constructor(layer) {
328
349
  super();
@@ -412,42 +433,78 @@ class DrawingFinishedEvent extends PostboyGenericMessage {
412
433
  }
413
434
  DrawingFinishedEvent.ID = 'c724b68e-b4eb-4783-90f1-a8e31973fd36';
414
435
 
415
- class GenerateDrawQuery extends PostboyCallbackMessage {
416
- constructor(layer, style, type) {
436
+ class DrawingGenerationService {
437
+ static getDraw(ev) {
438
+ return new Draw({
439
+ source: ev.layer.getSource(),
440
+ type: ev.type === DrawingType.Polygon ? 'Polygon' : 'Circle',
441
+ style: ev.style,
442
+ geometryFunction: DrawingGenerationService.geometryFunc(ev.type),
443
+ });
444
+ }
445
+ static geometryFunc(type) {
446
+ switch (type) {
447
+ case DrawingType.Circle:
448
+ return createRegularPolygon(32);
449
+ case DrawingType.Square:
450
+ return createRegularPolygon(4);
451
+ }
452
+ return undefined;
453
+ }
454
+ }
455
+
456
+ class FeatureService {
457
+ constructor() { }
458
+ static filterFeaturesInArea(query) {
459
+ return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
460
+ }
461
+ static booleanIntersects(g1, g2) {
462
+ if (g2.getType() === 'Point')
463
+ return g1.intersectsCoordinate(g2.getCoordinates());
464
+ if (g2.getType() === 'Circle')
465
+ return g1.intersectsCoordinate(g2.getCenter());
466
+ if (g2.getType() === 'Polygon')
467
+ return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
468
+ return false;
469
+ }
470
+ }
471
+
472
+ class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
473
+ constructor(area, ignore = new Set()) {
417
474
  super();
418
- this.layer = layer;
419
- this.style = style;
420
- this.type = type;
475
+ this.area = area;
476
+ this.ignore = ignore;
421
477
  }
422
478
  get id() {
423
- return GenerateDrawQuery.ID;
479
+ return GetFeaturesInAreaQuery.ID;
424
480
  }
425
481
  }
426
- GenerateDrawQuery.ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
482
+ GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
427
483
 
428
- class FilterFeaturesInAreaQuery extends PostboyCallbackMessage {
484
+ class FilterFeaturesInAreaExecutor extends PostboyExecutor {
429
485
  constructor(area, features) {
430
486
  super();
431
487
  this.area = area;
432
488
  this.features = features;
433
489
  }
434
490
  get id() {
435
- return FilterFeaturesInAreaQuery.ID;
491
+ return FilterFeaturesInAreaExecutor.ID;
436
492
  }
437
493
  }
438
- FilterFeaturesInAreaQuery.ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
494
+ FilterFeaturesInAreaExecutor.ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
439
495
 
440
- class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
441
- constructor(area, ignore = new Set()) {
496
+ class GenerateDrawExecutor extends PostboyExecutor {
497
+ constructor(layer, style, type) {
442
498
  super();
443
- this.area = area;
444
- this.ignore = ignore;
499
+ this.layer = layer;
500
+ this.style = style;
501
+ this.type = type;
445
502
  }
446
503
  get id() {
447
- return GetFeaturesInAreaQuery.ID;
504
+ return GenerateDrawExecutor.ID;
448
505
  }
449
506
  }
450
- GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
507
+ GenerateDrawExecutor.ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
451
508
 
452
509
  class MapPostboyService extends PostboyService {
453
510
  constructor() {
@@ -528,8 +585,6 @@ class MapManagementService {
528
585
  observeFeaturesInArea() {
529
586
  this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
530
587
  let result = new Dictionary();
531
- const queue = [];
532
- const queries = [];
533
588
  this.layers.forEach((l) => {
534
589
  let layerName = l.get('name');
535
590
  if (qr.ignore.has(layerName) || layerName === MapConstants.DrawingLayerId)
@@ -537,14 +592,10 @@ class MapManagementService {
537
592
  let source = l.getSource();
538
593
  if (!!source['getSource'])
539
594
  source = source?.getSource();
540
- const query = new FilterFeaturesInAreaQuery(qr.area, source?.getFeatures() ?? []);
541
- queue.push(query.result.pipe(tap((r) => {
542
- result.put(l.get('name'), r.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
543
- })));
544
- queries.push(query);
595
+ let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, source?.getFeatures() ?? []));
596
+ result.put(layerName, features.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
545
597
  });
546
- forkJoin(queue).subscribe(() => qr.finish(result));
547
- queries.forEach((q) => this.postboy.fire(q));
598
+ qr.finish(result);
548
599
  });
549
600
  }
550
601
  }
@@ -687,17 +738,13 @@ class DrawingService {
687
738
  this.clearInteraction(l);
688
739
  return;
689
740
  }
690
- const drawQuery = new GenerateDrawQuery(l, ev.style, ev.type);
691
- drawQuery.result.subscribe((draw) => {
692
- const cancelSub = this.observeCancelation(ev, l);
693
- this.drawInteraction = draw;
694
- this.map?.addInteraction(this.drawInteraction);
695
- this.drawInteraction.on('drawend', (evt) => {
696
- cancelSub.unsubscribe();
697
- this.onEnd(evt, ev, l);
698
- });
741
+ const cancelSub = this.observeCancelation(ev, l);
742
+ this.drawInteraction = this.postboy.execute(new GenerateDrawExecutor(l, ev.style, ev.type));
743
+ this.map?.addInteraction(this.drawInteraction);
744
+ this.drawInteraction.on('drawend', (evt) => {
745
+ cancelSub.unsubscribe();
746
+ this.onEnd(evt, ev, l);
699
747
  });
700
- this.postboy.fire(drawQuery);
701
748
  });
702
749
  });
703
750
  }
@@ -740,56 +787,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
740
787
  type: Injectable
741
788
  }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
742
789
 
743
- class DrawingGenerationService {
790
+ class FeatureModificationService {
744
791
  constructor(postboy) {
745
792
  this.postboy = postboy;
746
793
  }
747
794
  up() {
748
- this.postboy.subscribe(GenerateDrawQuery.ID).subscribe((ev) => {
749
- ev.finish(new Draw({
750
- source: ev.layer.getSource(),
751
- type: DrawingType[ev.type],
752
- style: ev.style,
753
- geometryFunction: ev.type !== DrawingType.Circle ? undefined : createRegularPolygon(32),
754
- }));
795
+ this.observeModification();
796
+ this.observeMapRender();
797
+ }
798
+ observeModification() {
799
+ this.postboy.subscribe(ModifyFeatureCommand.ID).subscribe((ev) => {
800
+ this.defineLayer((l) => {
801
+ if (!l || !this.map) {
802
+ this.clearInteraction(l);
803
+ return;
804
+ }
805
+ this.observeCancelation(ev, l);
806
+ this.initFeature(l, ev.model.feature);
807
+ this.addModify(ev);
808
+ this.addDragging(ev);
809
+ });
755
810
  });
756
811
  }
757
- }
758
- DrawingGenerationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DrawingGenerationService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
759
- DrawingGenerationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DrawingGenerationService });
760
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DrawingGenerationService, decorators: [{
761
- type: Injectable
762
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
763
-
764
- class FeatureService {
765
- constructor(postboy) {
766
- this.postboy = postboy;
812
+ initFeature(layer, feature) {
813
+ layer.getSource()?.clear();
814
+ layer.getSource()?.addFeature(feature);
767
815
  }
768
- up() {
769
- this.postboy.subscribe(FilterFeaturesInAreaQuery.ID).subscribe((qr) => {
770
- qr.finish(qr.features.filter((f) => FeatureService.booleanIntersects(qr.area, f.getGeometry())));
816
+ addModify(command) {
817
+ this.modify = new Modify({
818
+ features: new Collection([command.model.feature]),
819
+ style: command.style,
820
+ });
821
+ this.modify.on('modifyend', () => {
822
+ this.onModified(command);
823
+ command.model.feature.changed();
771
824
  });
825
+ this.map?.addInteraction(this.modify);
826
+ }
827
+ addDragging(command) {
828
+ this.translate = new Translate({
829
+ features: new Collection([command.model.feature]),
830
+ condition: (ev) => {
831
+ const clone = command.model.feature.clone();
832
+ clone.getGeometry()?.scale(0.999);
833
+ return clone.getGeometry().intersectsCoordinate(ev.coordinate);
834
+ },
835
+ });
836
+ this.translate.on('translateend', () => this.onModified(command));
837
+ this.map?.addInteraction(this.translate);
772
838
  }
773
- static booleanIntersects(g1, g2) {
774
- if (g2.getType() === 'Point')
775
- return g1.intersectsCoordinate(g2.getCoordinates());
776
- if (g2.getType() === 'Circle')
777
- return g1.intersectsCoordinate(g2.getCenter());
778
- if (g2.getType() === 'Polygon')
779
- return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
780
- return false;
839
+ onModified(command) {
840
+ command.next(command.format === FeatureOutputFormat.GeoJson
841
+ ? new GeoJSON().writeFeature(command.model.feature)
842
+ : new WKT().writeFeature(command.model.feature));
843
+ }
844
+ observeMapRender() {
845
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
846
+ this.map = m.map;
847
+ });
848
+ }
849
+ defineLayer(action) {
850
+ const query = new GetLayerQuery(MapConstants.DrawingLayerId);
851
+ query.result.subscribe((l) => action(l));
852
+ this.postboy.fire(query);
853
+ }
854
+ observeCancelation(ev, layer) {
855
+ return this.postboy
856
+ .subscribe(CancelFeatureModificationCommand.ID)
857
+ .pipe(first())
858
+ .subscribe(() => {
859
+ ev.finish(null);
860
+ this.clearInteraction(layer);
861
+ });
862
+ }
863
+ clearInteraction(layer) {
864
+ if (this.modify)
865
+ this.map?.removeInteraction(this.modify);
866
+ if (this.translate)
867
+ this.map?.removeInteraction(this.translate);
781
868
  }
782
869
  }
783
- FeatureService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FeatureService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
784
- FeatureService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FeatureService });
785
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FeatureService, decorators: [{
870
+ FeatureModificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FeatureModificationService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
871
+ FeatureModificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FeatureModificationService });
872
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FeatureModificationService, decorators: [{
786
873
  type: Injectable
787
874
  }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
788
875
 
789
876
  class MessageRegistratorService extends PostboyAbstractRegistrator {
790
- constructor(service, management, state, mapFeature, interaction, drawing, drawGenerator, feature) {
877
+ constructor(service, management, state, mapFeature, interaction, drawing, featureModification) {
791
878
  super(service);
792
- this.registerServices([management, state, interaction, mapFeature, drawing, drawGenerator, feature]);
879
+ this.registerServices([management, state, interaction, mapFeature, drawing, featureModification]);
793
880
  }
794
881
  _up() {
795
882
  this.registerReplay(MapRenderedEvent.ID);
@@ -806,17 +893,22 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
806
893
  this.registerSubject(StartDrawingCommand.ID);
807
894
  this.registerSubject(GetLayerQuery.ID);
808
895
  this.registerSubject(DrawingFinishedEvent.ID);
809
- this.registerSubject(GenerateDrawQuery.ID);
810
- this.registerSubject(FilterFeaturesInAreaQuery.ID);
811
896
  this.registerSubject(GetFeaturesInAreaQuery.ID);
812
897
  this.registerSubject(DrawSelectionAreaCommand.ID);
898
+ this.registerSubject(CancelFeatureModificationCommand.ID);
899
+ this.registerSubject(ModifyFeatureCommand.ID);
900
+ this.setExecutors();
901
+ }
902
+ setExecutors() {
903
+ this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
904
+ this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
813
905
  }
814
906
  }
815
- MessageRegistratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: DrawingGenerationService }, { token: FeatureService }], target: i0.ɵɵFactoryTarget.Injectable });
907
+ MessageRegistratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: FeatureModificationService }], target: i0.ɵɵFactoryTarget.Injectable });
816
908
  MessageRegistratorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageRegistratorService });
817
909
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageRegistratorService, decorators: [{
818
910
  type: Injectable
819
- }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: DrawingGenerationService }, { type: FeatureService }]; } });
911
+ }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }]; } });
820
912
 
821
913
  class TileLayerSettings {
822
914
  constructor() {
@@ -1370,6 +1462,7 @@ MapPlateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
1370
1462
  DrawingService,
1371
1463
  DrawingGenerationService,
1372
1464
  FeatureService,
1465
+ FeatureModificationService,
1373
1466
  ], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\r\n<lib-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></lib-osm-tile-layer>\r\n<lib-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></lib-feature-layer>\r\n", styles: ["lib-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OsmTileLayerComponent, selector: "lib-osm-tile-layer", inputs: ["url", "map"] }, { kind: "component", type: FeatureLayerComponent, selector: "lib-feature-layer", inputs: ["settings"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1374
1467
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapPlateComponent, decorators: [{
1375
1468
  type: Component,
@@ -1382,6 +1475,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1382
1475
  DrawingService,
1383
1476
  DrawingGenerationService,
1384
1477
  FeatureService,
1478
+ FeatureModificationService,
1385
1479
  ], template: "<ng-content></ng-content>\r\n<lib-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></lib-osm-tile-layer>\r\n<lib-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></lib-feature-layer>\r\n", styles: ["lib-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"] }]
1386
1480
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
1387
1481
  type: Input
@@ -1636,6 +1730,23 @@ class PolygonStyleHelper {
1636
1730
  }),
1637
1731
  });
1638
1732
  }
1733
+ static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
1734
+ return new Style({
1735
+ image: new Circle({
1736
+ fill: new Fill({
1737
+ color: stroke,
1738
+ }),
1739
+ radius: pinRadius,
1740
+ }),
1741
+ fill: new Fill({
1742
+ color: fill,
1743
+ }),
1744
+ stroke: new Stroke({
1745
+ color: stroke,
1746
+ width: strokeWidth,
1747
+ }),
1748
+ });
1749
+ }
1639
1750
  }
1640
1751
 
1641
1752
  class TextStyleHelper {
@@ -1710,5 +1821,5 @@ class StringifyFeatureHelper {
1710
1821
  * Generated bundle index. Do not edit.
1711
1822
  */
1712
1823
 
1713
- export { CancelDrawingCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, Dictionary, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, MapClickEvent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings };
1824
+ export { CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, Dictionary, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, MapClickEvent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings };
1714
1825
  //# sourceMappingURL=maps-components-src-map.mjs.map