@artstesh/maps 1.0.10 → 1.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/bundles/maps-components-src-map.umd.js +242 -96
  2. package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
  3. package/dist/bundles/maps-components.umd.js +242 -96
  4. package/dist/bundles/maps-components.umd.js.map +1 -1
  5. package/dist/esm2015/map/helpers/polygon-style.helper.js +19 -2
  6. package/dist/esm2015/map/map-plate/map-plate.component.js +4 -1
  7. package/dist/esm2015/map/messages/commands/cancel-feature-modification.command.js +8 -0
  8. package/dist/esm2015/map/messages/commands/modify-feature.command.js +15 -0
  9. package/dist/esm2015/map/messages/executors/filter-features-in-area.executor.js +13 -0
  10. package/dist/esm2015/map/messages/executors/generate-draw.executor.js +14 -0
  11. package/dist/esm2015/map/messages/index.js +3 -1
  12. package/dist/esm2015/map/models/drawing-type.enum.js +2 -1
  13. package/dist/esm2015/map/services/drawing/drawing-generation.service.js +16 -21
  14. package/dist/esm2015/map/services/drawing/drawing.service.js +9 -13
  15. package/dist/esm2015/map/services/drawing/feature-modification.service.js +104 -0
  16. package/dist/esm2015/map/services/feature.service.js +4 -17
  17. package/dist/esm2015/map/services/map-management.service.js +5 -13
  18. package/dist/esm2015/map/services/message-registrator.service.js +19 -11
  19. package/dist/esm2015/src/map/helpers/polygon-style.helper.js +19 -2
  20. package/dist/esm2015/src/map/map-plate/map-plate.component.js +4 -1
  21. package/dist/esm2015/src/map/messages/commands/cancel-feature-modification.command.js +8 -0
  22. package/dist/esm2015/src/map/messages/commands/modify-feature.command.js +15 -0
  23. package/dist/esm2015/src/map/messages/executors/filter-features-in-area.executor.js +13 -0
  24. package/dist/esm2015/src/map/messages/executors/generate-draw.executor.js +14 -0
  25. package/dist/esm2015/src/map/messages/index.js +3 -1
  26. package/dist/esm2015/src/map/models/drawing-type.enum.js +2 -1
  27. package/dist/esm2015/src/map/services/drawing/drawing-generation.service.js +16 -21
  28. package/dist/esm2015/src/map/services/drawing/drawing.service.js +9 -13
  29. package/dist/esm2015/src/map/services/drawing/feature-modification.service.js +104 -0
  30. package/dist/esm2015/src/map/services/feature.service.js +4 -17
  31. package/dist/esm2015/src/map/services/map-management.service.js +5 -13
  32. package/dist/esm2015/src/map/services/message-registrator.service.js +19 -11
  33. package/dist/fesm2015/maps-components-src-map.js +197 -81
  34. package/dist/fesm2015/maps-components-src-map.js.map +1 -1
  35. package/dist/fesm2015/maps-components.js +197 -81
  36. package/dist/fesm2015/maps-components.js.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/esm2015/map/messages/queries/filter-features-in-area.query.js +0 -13
  62. package/dist/esm2015/map/messages/queries/generate-draw.query.js +0 -14
  63. package/dist/esm2015/src/map/messages/queries/filter-features-in-area.query.js +0 -13
  64. package/dist/esm2015/src/map/messages/queries/generate-draw.query.js +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 i6 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';
@@ -180,6 +180,7 @@ var DrawingType;
180
180
  (function (DrawingType) {
181
181
  DrawingType[DrawingType["Polygon"] = 1] = "Polygon";
182
182
  DrawingType[DrawingType["Circle"] = 2] = "Circle";
183
+ DrawingType[DrawingType["Square"] = 3] = "Square";
183
184
  })(DrawingType || (DrawingType = {}));
184
185
 
185
186
  var FeatureOutputFormat;
@@ -324,6 +325,26 @@ class DrawSelectionAreaCommand extends PostboyCallbackMessage {
324
325
  }
325
326
  DrawSelectionAreaCommand.ID = '573d8a0d-f25b-42b7-9ad7-0ac6d86ac362';
326
327
 
328
+ class ModifyFeatureCommand extends PostboyCallbackMessage {
329
+ constructor(model, style, format = FeatureOutputFormat.GeoJson) {
330
+ super();
331
+ this.model = model;
332
+ this.style = style;
333
+ this.format = format;
334
+ }
335
+ get id() {
336
+ return ModifyFeatureCommand.ID;
337
+ }
338
+ }
339
+ ModifyFeatureCommand.ID = 'ead85caa-24c6-4844-a68c-2cea91774c8c';
340
+
341
+ class CancelFeatureModificationCommand extends PostboyGenericMessage {
342
+ get id() {
343
+ return CancelFeatureModificationCommand.ID;
344
+ }
345
+ }
346
+ CancelFeatureModificationCommand.ID = '9c9fb40f-ea95-4704-8177-0e9ecabf36fa';
347
+
327
348
  class AddLayerCommand extends PostboyGenericMessage {
328
349
  constructor(layer) {
329
350
  super();
@@ -413,42 +434,78 @@ class DrawingFinishedEvent extends PostboyGenericMessage {
413
434
  }
414
435
  DrawingFinishedEvent.ID = 'c724b68e-b4eb-4783-90f1-a8e31973fd36';
415
436
 
416
- class GenerateDrawQuery extends PostboyCallbackMessage {
417
- constructor(layer, style, type) {
437
+ class DrawingGenerationService {
438
+ static getDraw(ev) {
439
+ return new Draw({
440
+ source: ev.layer.getSource(),
441
+ type: ev.type === DrawingType.Polygon ? 'Polygon' : 'Circle',
442
+ style: ev.style,
443
+ geometryFunction: DrawingGenerationService.geometryFunc(ev.type),
444
+ });
445
+ }
446
+ static geometryFunc(type) {
447
+ switch (type) {
448
+ case DrawingType.Circle:
449
+ return createRegularPolygon(32);
450
+ case DrawingType.Square:
451
+ return createRegularPolygon(4);
452
+ }
453
+ return undefined;
454
+ }
455
+ }
456
+
457
+ class FeatureService {
458
+ constructor() { }
459
+ static filterFeaturesInArea(query) {
460
+ return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
461
+ }
462
+ static booleanIntersects(g1, g2) {
463
+ if (g2.getType() === 'Point')
464
+ return g1.intersectsCoordinate(g2.getCoordinates());
465
+ if (g2.getType() === 'Circle')
466
+ return g1.intersectsCoordinate(g2.getCenter());
467
+ if (g2.getType() === 'Polygon')
468
+ return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
469
+ return false;
470
+ }
471
+ }
472
+
473
+ class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
474
+ constructor(area, ignore = new Set()) {
418
475
  super();
419
- this.layer = layer;
420
- this.style = style;
421
- this.type = type;
476
+ this.area = area;
477
+ this.ignore = ignore;
422
478
  }
423
479
  get id() {
424
- return GenerateDrawQuery.ID;
480
+ return GetFeaturesInAreaQuery.ID;
425
481
  }
426
482
  }
427
- GenerateDrawQuery.ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
483
+ GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
428
484
 
429
- class FilterFeaturesInAreaQuery extends PostboyCallbackMessage {
485
+ class FilterFeaturesInAreaExecutor extends PostboyExecutor {
430
486
  constructor(area, features) {
431
487
  super();
432
488
  this.area = area;
433
489
  this.features = features;
434
490
  }
435
491
  get id() {
436
- return FilterFeaturesInAreaQuery.ID;
492
+ return FilterFeaturesInAreaExecutor.ID;
437
493
  }
438
494
  }
439
- FilterFeaturesInAreaQuery.ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
495
+ FilterFeaturesInAreaExecutor.ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
440
496
 
441
- class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
442
- constructor(area, ignore = new Set()) {
497
+ class GenerateDrawExecutor extends PostboyExecutor {
498
+ constructor(layer, style, type) {
443
499
  super();
444
- this.area = area;
445
- this.ignore = ignore;
500
+ this.layer = layer;
501
+ this.style = style;
502
+ this.type = type;
446
503
  }
447
504
  get id() {
448
- return GetFeaturesInAreaQuery.ID;
505
+ return GenerateDrawExecutor.ID;
449
506
  }
450
507
  }
451
- GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
508
+ GenerateDrawExecutor.ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
452
509
 
453
510
  class MapPostboyService extends PostboyService {
454
511
  constructor() {
@@ -530,8 +587,6 @@ class MapManagementService {
530
587
  observeFeaturesInArea() {
531
588
  this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
532
589
  let result = new Dictionary();
533
- const queue = [];
534
- const queries = [];
535
590
  this.layers.forEach((l) => {
536
591
  var _a, _b;
537
592
  let layerName = l.get('name');
@@ -540,14 +595,10 @@ class MapManagementService {
540
595
  let source = l.getSource();
541
596
  if (!!source['getSource'])
542
597
  source = (_a = source) === null || _a === void 0 ? void 0 : _a.getSource();
543
- const query = new FilterFeaturesInAreaQuery(qr.area, (_b = source === null || source === void 0 ? void 0 : source.getFeatures()) !== null && _b !== void 0 ? _b : []);
544
- queue.push(query.result.pipe(tap((r) => {
545
- result.put(l.get('name'), r.map((e) => (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo)))));
546
- })));
547
- queries.push(query);
598
+ let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, (_b = source === null || source === void 0 ? void 0 : source.getFeatures()) !== null && _b !== void 0 ? _b : []));
599
+ result.put(layerName, features.map((e) => (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo)))));
548
600
  });
549
- forkJoin(queue).subscribe(() => qr.finish(result));
550
- queries.forEach((q) => this.postboy.fire(q));
601
+ qr.finish(result);
551
602
  });
552
603
  }
553
604
  }
@@ -690,22 +741,18 @@ class DrawingService {
690
741
  observeDrawing() {
691
742
  this.postboy.subscribe(StartDrawingCommand.ID).subscribe((ev) => {
692
743
  this.draw((l) => {
744
+ var _a;
693
745
  if (!l || !this.map) {
694
746
  this.clearInteraction(l);
695
747
  return;
696
748
  }
697
- const drawQuery = new GenerateDrawQuery(l, ev.style, ev.type);
698
- drawQuery.result.subscribe((draw) => {
699
- var _a;
700
- const cancelSub = this.observeCancelation(ev, l);
701
- this.drawInteraction = draw;
702
- (_a = this.map) === null || _a === void 0 ? void 0 : _a.addInteraction(this.drawInteraction);
703
- this.drawInteraction.on('drawend', (evt) => {
704
- cancelSub.unsubscribe();
705
- this.onEnd(evt, ev, l);
706
- });
749
+ const cancelSub = this.observeCancelation(ev, l);
750
+ this.drawInteraction = this.postboy.execute(new GenerateDrawExecutor(l, ev.style, ev.type));
751
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.addInteraction(this.drawInteraction);
752
+ this.drawInteraction.on('drawend', (evt) => {
753
+ cancelSub.unsubscribe();
754
+ this.onEnd(evt, ev, l);
707
755
  });
708
- this.postboy.fire(drawQuery);
709
756
  });
710
757
  });
711
758
  }
@@ -749,56 +796,101 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
749
796
  type: Injectable
750
797
  }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
751
798
 
752
- class DrawingGenerationService {
799
+ class FeatureModificationService {
753
800
  constructor(postboy) {
754
801
  this.postboy = postboy;
755
802
  }
756
803
  up() {
757
- this.postboy.subscribe(GenerateDrawQuery.ID).subscribe((ev) => {
758
- ev.finish(new Draw({
759
- source: ev.layer.getSource(),
760
- type: DrawingType[ev.type],
761
- style: ev.style,
762
- geometryFunction: ev.type !== DrawingType.Circle ? undefined : createRegularPolygon(32),
763
- }));
804
+ this.observeModification();
805
+ this.observeMapRender();
806
+ }
807
+ observeModification() {
808
+ this.postboy.subscribe(ModifyFeatureCommand.ID).subscribe((ev) => {
809
+ this.defineLayer((l) => {
810
+ if (!l || !this.map) {
811
+ this.clearInteraction(l);
812
+ return;
813
+ }
814
+ this.observeCancelation(ev, l);
815
+ this.initFeature(l, ev.model.feature);
816
+ this.addModify(ev);
817
+ this.addDragging(ev);
818
+ });
764
819
  });
765
820
  }
766
- }
767
- DrawingGenerationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DrawingGenerationService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
768
- DrawingGenerationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DrawingGenerationService });
769
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DrawingGenerationService, decorators: [{
770
- type: Injectable
771
- }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
772
-
773
- class FeatureService {
774
- constructor(postboy) {
775
- this.postboy = postboy;
821
+ initFeature(layer, feature) {
822
+ var _a, _b;
823
+ (_a = layer.getSource()) === null || _a === void 0 ? void 0 : _a.clear();
824
+ (_b = layer.getSource()) === null || _b === void 0 ? void 0 : _b.addFeature(feature);
776
825
  }
777
- up() {
778
- this.postboy.subscribe(FilterFeaturesInAreaQuery.ID).subscribe((qr) => {
779
- qr.finish(qr.features.filter((f) => FeatureService.booleanIntersects(qr.area, f.getGeometry())));
826
+ addModify(command) {
827
+ var _a;
828
+ this.modify = new Modify({
829
+ features: new Collection([command.model.feature]),
830
+ style: command.style,
831
+ });
832
+ this.modify.on('modifyend', () => {
833
+ this.onModified(command);
834
+ command.model.feature.changed();
780
835
  });
836
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.addInteraction(this.modify);
781
837
  }
782
- static booleanIntersects(g1, g2) {
783
- if (g2.getType() === 'Point')
784
- return g1.intersectsCoordinate(g2.getCoordinates());
785
- if (g2.getType() === 'Circle')
786
- return g1.intersectsCoordinate(g2.getCenter());
787
- if (g2.getType() === 'Polygon')
788
- return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
789
- return false;
838
+ addDragging(command) {
839
+ var _a;
840
+ this.translate = new Translate({
841
+ features: new Collection([command.model.feature]),
842
+ condition: (ev) => {
843
+ var _a;
844
+ const clone = command.model.feature.clone();
845
+ (_a = clone.getGeometry()) === null || _a === void 0 ? void 0 : _a.scale(0.999);
846
+ return clone.getGeometry().intersectsCoordinate(ev.coordinate);
847
+ },
848
+ });
849
+ this.translate.on('translateend', () => this.onModified(command));
850
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.addInteraction(this.translate);
851
+ }
852
+ onModified(command) {
853
+ command.next(command.format === FeatureOutputFormat.GeoJson
854
+ ? new GeoJSON().writeFeature(command.model.feature)
855
+ : new WKT().writeFeature(command.model.feature));
856
+ }
857
+ observeMapRender() {
858
+ this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
859
+ this.map = m.map;
860
+ });
861
+ }
862
+ defineLayer(action) {
863
+ const query = new GetLayerQuery(MapConstants.DrawingLayerId);
864
+ query.result.subscribe((l) => action(l));
865
+ this.postboy.fire(query);
866
+ }
867
+ observeCancelation(ev, layer) {
868
+ return this.postboy
869
+ .subscribe(CancelFeatureModificationCommand.ID)
870
+ .pipe(first())
871
+ .subscribe(() => {
872
+ ev.finish(null);
873
+ this.clearInteraction(layer);
874
+ });
875
+ }
876
+ clearInteraction(layer) {
877
+ var _a, _b;
878
+ if (this.modify)
879
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.removeInteraction(this.modify);
880
+ if (this.translate)
881
+ (_b = this.map) === null || _b === void 0 ? void 0 : _b.removeInteraction(this.translate);
790
882
  }
791
883
  }
792
- FeatureService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FeatureService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
793
- FeatureService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FeatureService });
794
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FeatureService, decorators: [{
884
+ FeatureModificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FeatureModificationService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
885
+ FeatureModificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FeatureModificationService });
886
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FeatureModificationService, decorators: [{
795
887
  type: Injectable
796
888
  }], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
797
889
 
798
890
  class MessageRegistratorService extends PostboyAbstractRegistrator {
799
- constructor(service, management, state, mapFeature, interaction, drawing, drawGenerator, feature) {
891
+ constructor(service, management, state, mapFeature, interaction, drawing, featureModification) {
800
892
  super(service);
801
- this.registerServices([management, state, interaction, mapFeature, drawing, drawGenerator, feature]);
893
+ this.registerServices([management, state, interaction, mapFeature, drawing, featureModification]);
802
894
  }
803
895
  _up() {
804
896
  this.registerReplay(MapRenderedEvent.ID);
@@ -815,17 +907,22 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
815
907
  this.registerSubject(StartDrawingCommand.ID);
816
908
  this.registerSubject(GetLayerQuery.ID);
817
909
  this.registerSubject(DrawingFinishedEvent.ID);
818
- this.registerSubject(GenerateDrawQuery.ID);
819
- this.registerSubject(FilterFeaturesInAreaQuery.ID);
820
910
  this.registerSubject(GetFeaturesInAreaQuery.ID);
821
911
  this.registerSubject(DrawSelectionAreaCommand.ID);
912
+ this.registerSubject(CancelFeatureModificationCommand.ID);
913
+ this.registerSubject(ModifyFeatureCommand.ID);
914
+ this.setExecutors();
915
+ }
916
+ setExecutors() {
917
+ this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
918
+ this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
822
919
  }
823
920
  }
824
- MessageRegistratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", 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 });
921
+ MessageRegistratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: FeatureModificationService }], target: i0.ɵɵFactoryTarget.Injectable });
825
922
  MessageRegistratorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MessageRegistratorService });
826
923
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MessageRegistratorService, decorators: [{
827
924
  type: Injectable
828
- }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: DrawingGenerationService }, { type: FeatureService }]; } });
925
+ }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }]; } });
829
926
 
830
927
  class TileLayerSettings {
831
928
  constructor() {
@@ -1404,6 +1501,7 @@ MapPlateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
1404
1501
  DrawingService,
1405
1502
  DrawingGenerationService,
1406
1503
  FeatureService,
1504
+ FeatureModificationService,
1407
1505
  ], 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"], components: [{ type: OsmTileLayerComponent, selector: "lib-osm-tile-layer", inputs: ["url", "map"] }, { type: FeatureLayerComponent, selector: "lib-feature-layer", inputs: ["settings"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1408
1506
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapPlateComponent, decorators: [{
1409
1507
  type: Component,
@@ -1421,6 +1519,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1421
1519
  DrawingService,
1422
1520
  DrawingGenerationService,
1423
1521
  FeatureService,
1522
+ FeatureModificationService,
1424
1523
  ],
1425
1524
  }]
1426
1525
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
@@ -1695,6 +1794,23 @@ class PolygonStyleHelper {
1695
1794
  }),
1696
1795
  });
1697
1796
  }
1797
+ static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
1798
+ return new Style({
1799
+ image: new Circle({
1800
+ fill: new Fill({
1801
+ color: stroke,
1802
+ }),
1803
+ radius: pinRadius,
1804
+ }),
1805
+ fill: new Fill({
1806
+ color: fill,
1807
+ }),
1808
+ stroke: new Stroke({
1809
+ color: stroke,
1810
+ width: strokeWidth,
1811
+ }),
1812
+ });
1813
+ }
1698
1814
  }
1699
1815
 
1700
1816
  class TextStyleHelper {
@@ -1773,5 +1889,5 @@ class StringifyFeatureHelper {
1773
1889
  * Generated bundle index. Do not edit.
1774
1890
  */
1775
1891
 
1776
- 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 };
1892
+ 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 };
1777
1893
  //# sourceMappingURL=maps-components.js.map