@artstesh/maps 5.0.10 → 5.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.
- package/dist/esm2022/map/helpers/polygon-style.helper.mjs +19 -2
- package/dist/esm2022/map/map-plate/map-plate.component.mjs +4 -1
- package/dist/esm2022/map/messages/commands/cancel-feature-modification.command.mjs +8 -0
- package/dist/esm2022/map/messages/commands/modify-feature.command.mjs +18 -0
- package/dist/esm2022/map/messages/executors/filter-features-in-area.executor.mjs +15 -0
- package/dist/esm2022/map/messages/executors/generate-draw.executor.mjs +17 -0
- package/dist/esm2022/map/messages/index.mjs +3 -1
- package/dist/esm2022/map/models/drawing-type.enum.mjs +2 -1
- package/dist/esm2022/map/services/drawing/drawing-generation.service.mjs +16 -22
- package/dist/esm2022/map/services/drawing/drawing.service.mjs +8 -12
- package/dist/esm2022/map/services/drawing/feature-modification.service.mjs +103 -0
- package/dist/esm2022/map/services/feature.service.mjs +4 -18
- package/dist/esm2022/map/services/map-management.service.mjs +5 -13
- package/dist/esm2022/map/services/message-registrator.service.mjs +19 -11
- package/dist/esm2022/src/map/helpers/polygon-style.helper.mjs +19 -2
- package/dist/esm2022/src/map/map-plate/map-plate.component.mjs +4 -1
- package/dist/esm2022/src/map/messages/commands/cancel-feature-modification.command.mjs +8 -0
- package/dist/esm2022/src/map/messages/commands/modify-feature.command.mjs +18 -0
- package/dist/esm2022/src/map/messages/executors/filter-features-in-area.executor.mjs +15 -0
- package/dist/esm2022/src/map/messages/executors/generate-draw.executor.mjs +17 -0
- package/dist/esm2022/src/map/messages/index.mjs +3 -1
- package/dist/esm2022/src/map/models/drawing-type.enum.mjs +2 -1
- package/dist/esm2022/src/map/services/drawing/drawing-generation.service.mjs +16 -22
- package/dist/esm2022/src/map/services/drawing/drawing.service.mjs +8 -12
- package/dist/esm2022/src/map/services/drawing/feature-modification.service.mjs +103 -0
- package/dist/esm2022/src/map/services/feature.service.mjs +4 -18
- package/dist/esm2022/src/map/services/map-management.service.mjs +5 -13
- package/dist/esm2022/src/map/services/message-registrator.service.mjs +19 -11
- package/dist/fesm2022/maps-components-src-map.mjs +201 -85
- package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2022/maps-components.mjs +201 -85
- package/dist/fesm2022/maps-components.mjs.map +1 -1
- package/dist/map/helpers/polygon-style.helper.d.ts +1 -0
- package/dist/map/messages/commands/cancel-feature-modification.command.d.ts +5 -0
- package/dist/map/messages/commands/modify-feature.command.d.ts +11 -0
- package/dist/map/messages/{queries/filter-features-in-area.query.d.ts → executors/filter-features-in-area.executor.d.ts} +2 -2
- package/dist/map/messages/{queries/generate-draw.query.d.ts → executors/generate-draw.executor.d.ts} +2 -2
- package/dist/map/messages/index.d.ts +2 -0
- package/dist/map/models/drawing-type.enum.d.ts +2 -1
- package/dist/map/services/drawing/drawing-generation.service.d.ts +5 -9
- package/dist/map/services/drawing/feature-modification.service.d.ts +22 -0
- package/dist/map/services/feature.service.d.ts +6 -9
- package/dist/map/services/message-registrator.service.d.ts +3 -3
- package/dist/package.json +1 -1
- package/dist/src/map/helpers/polygon-style.helper.d.ts +1 -0
- package/dist/src/map/messages/commands/cancel-feature-modification.command.d.ts +5 -0
- package/dist/src/map/messages/commands/modify-feature.command.d.ts +11 -0
- package/dist/src/map/messages/{queries/filter-features-in-area.query.d.ts → executors/filter-features-in-area.executor.d.ts} +2 -2
- package/dist/src/map/messages/{queries/generate-draw.query.d.ts → executors/generate-draw.executor.d.ts} +2 -2
- package/dist/src/map/messages/index.d.ts +2 -0
- package/dist/src/map/models/drawing-type.enum.d.ts +2 -1
- package/dist/src/map/services/drawing/drawing-generation.service.d.ts +5 -9
- package/dist/src/map/services/drawing/feature-modification.service.d.ts +22 -0
- package/dist/src/map/services/feature.service.d.ts +6 -9
- package/dist/src/map/services/message-registrator.service.d.ts +3 -3
- package/package.json +2 -2
- package/dist/esm2022/map/messages/queries/filter-features-in-area.query.mjs +0 -15
- package/dist/esm2022/map/messages/queries/generate-draw.query.mjs +0 -17
- package/dist/esm2022/src/map/messages/queries/filter-features-in-area.query.mjs +0 -15
- package/dist/esm2022/src/map/messages/queries/generate-draw.query.mjs +0 -17
|
@@ -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 {
|
|
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';
|
|
@@ -186,6 +186,7 @@ var DrawingType;
|
|
|
186
186
|
(function (DrawingType) {
|
|
187
187
|
DrawingType[DrawingType["Polygon"] = 1] = "Polygon";
|
|
188
188
|
DrawingType[DrawingType["Circle"] = 2] = "Circle";
|
|
189
|
+
DrawingType[DrawingType["Square"] = 3] = "Square";
|
|
189
190
|
})(DrawingType || (DrawingType = {}));
|
|
190
191
|
|
|
191
192
|
var FeatureOutputFormat;
|
|
@@ -341,6 +342,29 @@ class DrawSelectionAreaCommand extends PostboyCallbackMessage {
|
|
|
341
342
|
}
|
|
342
343
|
}
|
|
343
344
|
|
|
345
|
+
class ModifyFeatureCommand extends PostboyCallbackMessage {
|
|
346
|
+
model;
|
|
347
|
+
style;
|
|
348
|
+
format;
|
|
349
|
+
static ID = 'ead85caa-24c6-4844-a68c-2cea91774c8c';
|
|
350
|
+
constructor(model, style, format = FeatureOutputFormat.GeoJson) {
|
|
351
|
+
super();
|
|
352
|
+
this.model = model;
|
|
353
|
+
this.style = style;
|
|
354
|
+
this.format = format;
|
|
355
|
+
}
|
|
356
|
+
get id() {
|
|
357
|
+
return ModifyFeatureCommand.ID;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
class CancelFeatureModificationCommand extends PostboyGenericMessage {
|
|
362
|
+
static ID = '9c9fb40f-ea95-4704-8177-0e9ecabf36fa';
|
|
363
|
+
get id() {
|
|
364
|
+
return CancelFeatureModificationCommand.ID;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
344
368
|
class AddLayerCommand extends PostboyGenericMessage {
|
|
345
369
|
layer;
|
|
346
370
|
static ID = 'd93e250f-92bc-43ac-9c6a-46c521a1aaa5';
|
|
@@ -439,23 +463,57 @@ class DrawingFinishedEvent extends PostboyGenericMessage {
|
|
|
439
463
|
}
|
|
440
464
|
}
|
|
441
465
|
|
|
442
|
-
class
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
466
|
+
class DrawingGenerationService {
|
|
467
|
+
static getDraw(ev) {
|
|
468
|
+
return new Draw({
|
|
469
|
+
source: ev.layer.getSource(),
|
|
470
|
+
type: ev.type === DrawingType.Polygon ? 'Polygon' : 'Circle',
|
|
471
|
+
style: ev.style,
|
|
472
|
+
geometryFunction: DrawingGenerationService.geometryFunc(ev.type),
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
static geometryFunc(type) {
|
|
476
|
+
switch (type) {
|
|
477
|
+
case DrawingType.Circle:
|
|
478
|
+
return createRegularPolygon(32);
|
|
479
|
+
case DrawingType.Square:
|
|
480
|
+
return createRegularPolygon(4);
|
|
481
|
+
}
|
|
482
|
+
return undefined;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
class FeatureService {
|
|
487
|
+
constructor() { }
|
|
488
|
+
static filterFeaturesInArea(query) {
|
|
489
|
+
return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
|
|
490
|
+
}
|
|
491
|
+
static booleanIntersects(g1, g2) {
|
|
492
|
+
if (g2.getType() === 'Point')
|
|
493
|
+
return g1.intersectsCoordinate(g2.getCoordinates());
|
|
494
|
+
if (g2.getType() === 'Circle')
|
|
495
|
+
return g1.intersectsCoordinate(g2.getCenter());
|
|
496
|
+
if (g2.getType() === 'Polygon')
|
|
497
|
+
return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
|
|
498
|
+
return false;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
|
|
503
|
+
area;
|
|
504
|
+
ignore;
|
|
505
|
+
static ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
|
|
506
|
+
constructor(area, ignore = new Set()) {
|
|
448
507
|
super();
|
|
449
|
-
this.
|
|
450
|
-
this.
|
|
451
|
-
this.type = type;
|
|
508
|
+
this.area = area;
|
|
509
|
+
this.ignore = ignore;
|
|
452
510
|
}
|
|
453
511
|
get id() {
|
|
454
|
-
return
|
|
512
|
+
return GetFeaturesInAreaQuery.ID;
|
|
455
513
|
}
|
|
456
514
|
}
|
|
457
515
|
|
|
458
|
-
class
|
|
516
|
+
class FilterFeaturesInAreaExecutor extends PostboyExecutor {
|
|
459
517
|
area;
|
|
460
518
|
features;
|
|
461
519
|
static ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
|
|
@@ -465,21 +523,23 @@ class FilterFeaturesInAreaQuery extends PostboyCallbackMessage {
|
|
|
465
523
|
this.features = features;
|
|
466
524
|
}
|
|
467
525
|
get id() {
|
|
468
|
-
return
|
|
526
|
+
return FilterFeaturesInAreaExecutor.ID;
|
|
469
527
|
}
|
|
470
528
|
}
|
|
471
529
|
|
|
472
|
-
class
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
530
|
+
class GenerateDrawExecutor extends PostboyExecutor {
|
|
531
|
+
layer;
|
|
532
|
+
style;
|
|
533
|
+
type;
|
|
534
|
+
static ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
|
|
535
|
+
constructor(layer, style, type) {
|
|
477
536
|
super();
|
|
478
|
-
this.
|
|
479
|
-
this.
|
|
537
|
+
this.layer = layer;
|
|
538
|
+
this.style = style;
|
|
539
|
+
this.type = type;
|
|
480
540
|
}
|
|
481
541
|
get id() {
|
|
482
|
-
return
|
|
542
|
+
return GenerateDrawExecutor.ID;
|
|
483
543
|
}
|
|
484
544
|
}
|
|
485
545
|
|
|
@@ -564,8 +624,6 @@ class MapManagementService {
|
|
|
564
624
|
observeFeaturesInArea() {
|
|
565
625
|
this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
|
|
566
626
|
let result = new Dictionary();
|
|
567
|
-
const queue = [];
|
|
568
|
-
const queries = [];
|
|
569
627
|
this.layers.forEach((l) => {
|
|
570
628
|
let layerName = l.get('name');
|
|
571
629
|
if (qr.ignore.has(layerName) || layerName === MapConstants.DrawingLayerId)
|
|
@@ -573,14 +631,10 @@ class MapManagementService {
|
|
|
573
631
|
let source = l.getSource();
|
|
574
632
|
if (!!source['getSource'])
|
|
575
633
|
source = source?.getSource();
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
result.put(l.get('name'), r.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
|
|
579
|
-
})));
|
|
580
|
-
queries.push(query);
|
|
634
|
+
let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, source?.getFeatures() ?? []));
|
|
635
|
+
result.put(layerName, features.map((e) => ({ id: e.getId(), ...e.get(MapConstants.FeatureInfo) })));
|
|
581
636
|
});
|
|
582
|
-
|
|
583
|
-
queries.forEach((q) => this.postboy.fire(q));
|
|
637
|
+
qr.finish(result);
|
|
584
638
|
});
|
|
585
639
|
}
|
|
586
640
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapManagementService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -732,17 +786,13 @@ class DrawingService {
|
|
|
732
786
|
this.clearInteraction(l);
|
|
733
787
|
return;
|
|
734
788
|
}
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
this.
|
|
741
|
-
cancelSub.unsubscribe();
|
|
742
|
-
this.onEnd(evt, ev, l);
|
|
743
|
-
});
|
|
789
|
+
const cancelSub = this.observeCancelation(ev, l);
|
|
790
|
+
this.drawInteraction = this.postboy.execute(new GenerateDrawExecutor(l, ev.style, ev.type));
|
|
791
|
+
this.map?.addInteraction(this.drawInteraction);
|
|
792
|
+
this.drawInteraction.on('drawend', (evt) => {
|
|
793
|
+
cancelSub.unsubscribe();
|
|
794
|
+
this.onEnd(evt, ev, l);
|
|
744
795
|
});
|
|
745
|
-
this.postboy.fire(drawQuery);
|
|
746
796
|
});
|
|
747
797
|
});
|
|
748
798
|
}
|
|
@@ -785,58 +835,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
785
835
|
type: Injectable
|
|
786
836
|
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
787
837
|
|
|
788
|
-
class
|
|
838
|
+
class FeatureModificationService {
|
|
789
839
|
postboy;
|
|
840
|
+
modify;
|
|
841
|
+
translate;
|
|
842
|
+
map;
|
|
790
843
|
constructor(postboy) {
|
|
791
844
|
this.postboy = postboy;
|
|
792
845
|
}
|
|
793
846
|
up() {
|
|
794
|
-
this.
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
847
|
+
this.observeModification();
|
|
848
|
+
this.observeMapRender();
|
|
849
|
+
}
|
|
850
|
+
observeModification() {
|
|
851
|
+
this.postboy.subscribe(ModifyFeatureCommand.ID).subscribe((ev) => {
|
|
852
|
+
this.defineLayer((l) => {
|
|
853
|
+
if (!l || !this.map) {
|
|
854
|
+
this.clearInteraction(l);
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
this.observeCancelation(ev, l);
|
|
858
|
+
this.initFeature(l, ev.model.feature);
|
|
859
|
+
this.addModify(ev);
|
|
860
|
+
this.addDragging(ev);
|
|
861
|
+
});
|
|
801
862
|
});
|
|
802
863
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DrawingGenerationService, decorators: [{
|
|
807
|
-
type: Injectable
|
|
808
|
-
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
809
|
-
|
|
810
|
-
class FeatureService {
|
|
811
|
-
postboy;
|
|
812
|
-
constructor(postboy) {
|
|
813
|
-
this.postboy = postboy;
|
|
864
|
+
initFeature(layer, feature) {
|
|
865
|
+
layer.getSource()?.clear();
|
|
866
|
+
layer.getSource()?.addFeature(feature);
|
|
814
867
|
}
|
|
815
|
-
|
|
816
|
-
this.
|
|
817
|
-
|
|
868
|
+
addModify(command) {
|
|
869
|
+
this.modify = new Modify({
|
|
870
|
+
features: new Collection([command.model.feature]),
|
|
871
|
+
style: command.style,
|
|
872
|
+
});
|
|
873
|
+
this.modify.on('modifyend', () => {
|
|
874
|
+
this.onModified(command);
|
|
875
|
+
command.model.feature.changed();
|
|
876
|
+
});
|
|
877
|
+
this.map?.addInteraction(this.modify);
|
|
878
|
+
}
|
|
879
|
+
addDragging(command) {
|
|
880
|
+
this.translate = new Translate({
|
|
881
|
+
features: new Collection([command.model.feature]),
|
|
882
|
+
condition: (ev) => {
|
|
883
|
+
const clone = command.model.feature.clone();
|
|
884
|
+
clone.getGeometry()?.scale(0.999);
|
|
885
|
+
return clone.getGeometry().intersectsCoordinate(ev.coordinate);
|
|
886
|
+
},
|
|
818
887
|
});
|
|
888
|
+
this.translate.on('translateend', () => this.onModified(command));
|
|
889
|
+
this.map?.addInteraction(this.translate);
|
|
819
890
|
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
return g1.intersectsCoordinate(g2.getCenter());
|
|
825
|
-
if (g2.getType() === 'Polygon')
|
|
826
|
-
return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
|
|
827
|
-
return false;
|
|
891
|
+
onModified(command) {
|
|
892
|
+
command.next(command.format === FeatureOutputFormat.GeoJson
|
|
893
|
+
? new GeoJSON().writeFeature(command.model.feature)
|
|
894
|
+
: new WKT().writeFeature(command.model.feature));
|
|
828
895
|
}
|
|
829
|
-
|
|
830
|
-
|
|
896
|
+
observeMapRender() {
|
|
897
|
+
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
898
|
+
this.map = m.map;
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
defineLayer(action) {
|
|
902
|
+
const query = new GetLayerQuery(MapConstants.DrawingLayerId);
|
|
903
|
+
query.result.subscribe((l) => action(l));
|
|
904
|
+
this.postboy.fire(query);
|
|
905
|
+
}
|
|
906
|
+
observeCancelation(ev, layer) {
|
|
907
|
+
return this.postboy
|
|
908
|
+
.subscribe(CancelFeatureModificationCommand.ID)
|
|
909
|
+
.pipe(first())
|
|
910
|
+
.subscribe(() => {
|
|
911
|
+
ev.finish(null);
|
|
912
|
+
this.clearInteraction(layer);
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
clearInteraction(layer) {
|
|
916
|
+
if (this.modify)
|
|
917
|
+
this.map?.removeInteraction(this.modify);
|
|
918
|
+
if (this.translate)
|
|
919
|
+
this.map?.removeInteraction(this.translate);
|
|
920
|
+
}
|
|
921
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureModificationService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
922
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureModificationService });
|
|
831
923
|
}
|
|
832
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
924
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FeatureModificationService, decorators: [{
|
|
833
925
|
type: Injectable
|
|
834
926
|
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
835
927
|
|
|
836
928
|
class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
837
|
-
constructor(service, management, state, mapFeature, interaction, drawing,
|
|
929
|
+
constructor(service, management, state, mapFeature, interaction, drawing, featureModification) {
|
|
838
930
|
super(service);
|
|
839
|
-
this.registerServices([management, state, interaction, mapFeature, drawing,
|
|
931
|
+
this.registerServices([management, state, interaction, mapFeature, drawing, featureModification]);
|
|
840
932
|
}
|
|
841
933
|
_up() {
|
|
842
934
|
this.registerReplay(MapRenderedEvent.ID);
|
|
@@ -853,17 +945,22 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
853
945
|
this.registerSubject(StartDrawingCommand.ID);
|
|
854
946
|
this.registerSubject(GetLayerQuery.ID);
|
|
855
947
|
this.registerSubject(DrawingFinishedEvent.ID);
|
|
856
|
-
this.registerSubject(GenerateDrawQuery.ID);
|
|
857
|
-
this.registerSubject(FilterFeaturesInAreaQuery.ID);
|
|
858
948
|
this.registerSubject(GetFeaturesInAreaQuery.ID);
|
|
859
949
|
this.registerSubject(DrawSelectionAreaCommand.ID);
|
|
950
|
+
this.registerSubject(CancelFeatureModificationCommand.ID);
|
|
951
|
+
this.registerSubject(ModifyFeatureCommand.ID);
|
|
952
|
+
this.setExecutors();
|
|
953
|
+
}
|
|
954
|
+
setExecutors() {
|
|
955
|
+
this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
|
|
956
|
+
this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
|
|
860
957
|
}
|
|
861
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token:
|
|
958
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: FeatureModificationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
862
959
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MessageRegistratorService });
|
|
863
960
|
}
|
|
864
961
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MessageRegistratorService, decorators: [{
|
|
865
962
|
type: Injectable
|
|
866
|
-
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type:
|
|
963
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }]; } });
|
|
867
964
|
|
|
868
965
|
class TileLayerSettings {
|
|
869
966
|
maxZoom = 19;
|
|
@@ -1430,6 +1527,7 @@ class MapPlateComponent extends DestructibleComponent {
|
|
|
1430
1527
|
DrawingService,
|
|
1431
1528
|
DrawingGenerationService,
|
|
1432
1529
|
FeatureService,
|
|
1530
|
+
FeatureModificationService,
|
|
1433
1531
|
], 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 });
|
|
1434
1532
|
}
|
|
1435
1533
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MapPlateComponent, decorators: [{
|
|
@@ -1443,6 +1541,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1443
1541
|
DrawingService,
|
|
1444
1542
|
DrawingGenerationService,
|
|
1445
1543
|
FeatureService,
|
|
1544
|
+
FeatureModificationService,
|
|
1446
1545
|
], 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"] }]
|
|
1447
1546
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
|
|
1448
1547
|
type: Input
|
|
@@ -1705,6 +1804,23 @@ class PolygonStyleHelper {
|
|
|
1705
1804
|
}),
|
|
1706
1805
|
});
|
|
1707
1806
|
}
|
|
1807
|
+
static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
|
|
1808
|
+
return new Style({
|
|
1809
|
+
image: new Circle({
|
|
1810
|
+
fill: new Fill({
|
|
1811
|
+
color: stroke,
|
|
1812
|
+
}),
|
|
1813
|
+
radius: pinRadius,
|
|
1814
|
+
}),
|
|
1815
|
+
fill: new Fill({
|
|
1816
|
+
color: fill,
|
|
1817
|
+
}),
|
|
1818
|
+
stroke: new Stroke({
|
|
1819
|
+
color: stroke,
|
|
1820
|
+
width: strokeWidth,
|
|
1821
|
+
}),
|
|
1822
|
+
});
|
|
1823
|
+
}
|
|
1708
1824
|
}
|
|
1709
1825
|
|
|
1710
1826
|
class TextStyleHelper {
|
|
@@ -1783,5 +1899,5 @@ class StringifyFeatureHelper {
|
|
|
1783
1899
|
* Generated bundle index. Do not edit.
|
|
1784
1900
|
*/
|
|
1785
1901
|
|
|
1786
|
-
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 };
|
|
1902
|
+
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 };
|
|
1787
1903
|
//# sourceMappingURL=maps-components.mjs.map
|