@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.
- package/dist/esm2020/map/helpers/polygon-style.helper.mjs +19 -2
- package/dist/esm2020/map/map-plate/map-plate.component.mjs +4 -1
- package/dist/esm2020/map/messages/commands/cancel-feature-modification.command.mjs +8 -0
- package/dist/esm2020/map/messages/commands/modify-feature.command.mjs +15 -0
- package/dist/esm2020/map/messages/executors/filter-features-in-area.executor.mjs +13 -0
- package/dist/esm2020/map/messages/executors/generate-draw.executor.mjs +14 -0
- package/dist/esm2020/map/messages/index.mjs +3 -1
- package/dist/esm2020/map/models/drawing-type.enum.mjs +2 -1
- package/dist/esm2020/map/services/drawing/drawing-generation.service.mjs +16 -21
- package/dist/esm2020/map/services/drawing/drawing.service.mjs +8 -12
- package/dist/esm2020/map/services/drawing/feature-modification.service.mjs +99 -0
- package/dist/esm2020/map/services/feature.service.mjs +4 -17
- package/dist/esm2020/map/services/map-management.service.mjs +5 -13
- package/dist/esm2020/map/services/message-registrator.service.mjs +19 -11
- package/dist/esm2020/src/map/helpers/polygon-style.helper.mjs +19 -2
- package/dist/esm2020/src/map/map-plate/map-plate.component.mjs +4 -1
- package/dist/esm2020/src/map/messages/commands/cancel-feature-modification.command.mjs +8 -0
- package/dist/esm2020/src/map/messages/commands/modify-feature.command.mjs +15 -0
- package/dist/esm2020/src/map/messages/executors/filter-features-in-area.executor.mjs +13 -0
- package/dist/esm2020/src/map/messages/executors/generate-draw.executor.mjs +14 -0
- package/dist/esm2020/src/map/messages/index.mjs +3 -1
- package/dist/esm2020/src/map/models/drawing-type.enum.mjs +2 -1
- package/dist/esm2020/src/map/services/drawing/drawing-generation.service.mjs +16 -21
- package/dist/esm2020/src/map/services/drawing/drawing.service.mjs +8 -12
- package/dist/esm2020/src/map/services/drawing/feature-modification.service.mjs +99 -0
- package/dist/esm2020/src/map/services/feature.service.mjs +4 -17
- package/dist/esm2020/src/map/services/map-management.service.mjs +5 -13
- package/dist/esm2020/src/map/services/message-registrator.service.mjs +19 -11
- package/dist/fesm2015/maps-components-src-map.mjs +197 -81
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +197 -81
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +191 -80
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +191 -80
- package/dist/fesm2020/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/esm2020/map/messages/queries/filter-features-in-area.query.mjs +0 -13
- package/dist/esm2020/map/messages/queries/generate-draw.query.mjs +0 -14
- package/dist/esm2020/src/map/messages/queries/filter-features-in-area.query.mjs +0 -13
- 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 {
|
|
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
|
|
417
|
-
|
|
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.
|
|
420
|
-
this.
|
|
421
|
-
this.type = type;
|
|
476
|
+
this.area = area;
|
|
477
|
+
this.ignore = ignore;
|
|
422
478
|
}
|
|
423
479
|
get id() {
|
|
424
|
-
return
|
|
480
|
+
return GetFeaturesInAreaQuery.ID;
|
|
425
481
|
}
|
|
426
482
|
}
|
|
427
|
-
|
|
483
|
+
GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
|
|
428
484
|
|
|
429
|
-
class
|
|
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
|
|
492
|
+
return FilterFeaturesInAreaExecutor.ID;
|
|
437
493
|
}
|
|
438
494
|
}
|
|
439
|
-
|
|
495
|
+
FilterFeaturesInAreaExecutor.ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
|
|
440
496
|
|
|
441
|
-
class
|
|
442
|
-
constructor(
|
|
497
|
+
class GenerateDrawExecutor extends PostboyExecutor {
|
|
498
|
+
constructor(layer, style, type) {
|
|
443
499
|
super();
|
|
444
|
-
this.
|
|
445
|
-
this.
|
|
500
|
+
this.layer = layer;
|
|
501
|
+
this.style = style;
|
|
502
|
+
this.type = type;
|
|
446
503
|
}
|
|
447
504
|
get id() {
|
|
448
|
-
return
|
|
505
|
+
return GenerateDrawExecutor.ID;
|
|
449
506
|
}
|
|
450
507
|
}
|
|
451
|
-
|
|
508
|
+
GenerateDrawExecutor.ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
|
|
452
509
|
|
|
453
510
|
class MapPostboyService extends PostboyService {
|
|
454
511
|
constructor() {
|
|
@@ -529,8 +586,6 @@ class MapManagementService {
|
|
|
529
586
|
observeFeaturesInArea() {
|
|
530
587
|
this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
|
|
531
588
|
let result = new Dictionary();
|
|
532
|
-
const queue = [];
|
|
533
|
-
const queries = [];
|
|
534
589
|
this.layers.forEach((l) => {
|
|
535
590
|
var _a;
|
|
536
591
|
let layerName = l.get('name');
|
|
@@ -539,14 +594,10 @@ class MapManagementService {
|
|
|
539
594
|
let source = l.getSource();
|
|
540
595
|
if (!!source['getSource'])
|
|
541
596
|
source = source === null || source === void 0 ? void 0 : source.getSource();
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
result.put(l.get('name'), r.map((e) => (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo)))));
|
|
545
|
-
})));
|
|
546
|
-
queries.push(query);
|
|
597
|
+
let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, (_a = source === null || source === void 0 ? void 0 : source.getFeatures()) !== null && _a !== void 0 ? _a : []));
|
|
598
|
+
result.put(layerName, features.map((e) => (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo)))));
|
|
547
599
|
});
|
|
548
|
-
|
|
549
|
-
queries.forEach((q) => this.postboy.fire(q));
|
|
600
|
+
qr.finish(result);
|
|
550
601
|
});
|
|
551
602
|
}
|
|
552
603
|
}
|
|
@@ -689,22 +740,18 @@ class DrawingService {
|
|
|
689
740
|
observeDrawing() {
|
|
690
741
|
this.postboy.subscribe(StartDrawingCommand.ID).subscribe((ev) => {
|
|
691
742
|
this.draw((l) => {
|
|
743
|
+
var _a;
|
|
692
744
|
if (!l || !this.map) {
|
|
693
745
|
this.clearInteraction(l);
|
|
694
746
|
return;
|
|
695
747
|
}
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
this.drawInteraction.on('drawend', (evt) => {
|
|
703
|
-
cancelSub.unsubscribe();
|
|
704
|
-
this.onEnd(evt, ev, l);
|
|
705
|
-
});
|
|
748
|
+
const cancelSub = this.observeCancelation(ev, l);
|
|
749
|
+
this.drawInteraction = this.postboy.execute(new GenerateDrawExecutor(l, ev.style, ev.type));
|
|
750
|
+
(_a = this.map) === null || _a === void 0 ? void 0 : _a.addInteraction(this.drawInteraction);
|
|
751
|
+
this.drawInteraction.on('drawend', (evt) => {
|
|
752
|
+
cancelSub.unsubscribe();
|
|
753
|
+
this.onEnd(evt, ev, l);
|
|
706
754
|
});
|
|
707
|
-
this.postboy.fire(drawQuery);
|
|
708
755
|
});
|
|
709
756
|
});
|
|
710
757
|
}
|
|
@@ -748,56 +795,101 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
748
795
|
type: Injectable
|
|
749
796
|
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
750
797
|
|
|
751
|
-
class
|
|
798
|
+
class FeatureModificationService {
|
|
752
799
|
constructor(postboy) {
|
|
753
800
|
this.postboy = postboy;
|
|
754
801
|
}
|
|
755
802
|
up() {
|
|
756
|
-
this.
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
803
|
+
this.observeModification();
|
|
804
|
+
this.observeMapRender();
|
|
805
|
+
}
|
|
806
|
+
observeModification() {
|
|
807
|
+
this.postboy.subscribe(ModifyFeatureCommand.ID).subscribe((ev) => {
|
|
808
|
+
this.defineLayer((l) => {
|
|
809
|
+
if (!l || !this.map) {
|
|
810
|
+
this.clearInteraction(l);
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
this.observeCancelation(ev, l);
|
|
814
|
+
this.initFeature(l, ev.model.feature);
|
|
815
|
+
this.addModify(ev);
|
|
816
|
+
this.addDragging(ev);
|
|
817
|
+
});
|
|
763
818
|
});
|
|
764
819
|
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
type: Injectable
|
|
770
|
-
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
771
|
-
|
|
772
|
-
class FeatureService {
|
|
773
|
-
constructor(postboy) {
|
|
774
|
-
this.postboy = postboy;
|
|
820
|
+
initFeature(layer, feature) {
|
|
821
|
+
var _a, _b;
|
|
822
|
+
(_a = layer.getSource()) === null || _a === void 0 ? void 0 : _a.clear();
|
|
823
|
+
(_b = layer.getSource()) === null || _b === void 0 ? void 0 : _b.addFeature(feature);
|
|
775
824
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
825
|
+
addModify(command) {
|
|
826
|
+
var _a;
|
|
827
|
+
this.modify = new Modify({
|
|
828
|
+
features: new Collection([command.model.feature]),
|
|
829
|
+
style: command.style,
|
|
830
|
+
});
|
|
831
|
+
this.modify.on('modifyend', () => {
|
|
832
|
+
this.onModified(command);
|
|
833
|
+
command.model.feature.changed();
|
|
779
834
|
});
|
|
835
|
+
(_a = this.map) === null || _a === void 0 ? void 0 : _a.addInteraction(this.modify);
|
|
780
836
|
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
837
|
+
addDragging(command) {
|
|
838
|
+
var _a;
|
|
839
|
+
this.translate = new Translate({
|
|
840
|
+
features: new Collection([command.model.feature]),
|
|
841
|
+
condition: (ev) => {
|
|
842
|
+
var _a;
|
|
843
|
+
const clone = command.model.feature.clone();
|
|
844
|
+
(_a = clone.getGeometry()) === null || _a === void 0 ? void 0 : _a.scale(0.999);
|
|
845
|
+
return clone.getGeometry().intersectsCoordinate(ev.coordinate);
|
|
846
|
+
},
|
|
847
|
+
});
|
|
848
|
+
this.translate.on('translateend', () => this.onModified(command));
|
|
849
|
+
(_a = this.map) === null || _a === void 0 ? void 0 : _a.addInteraction(this.translate);
|
|
850
|
+
}
|
|
851
|
+
onModified(command) {
|
|
852
|
+
command.next(command.format === FeatureOutputFormat.GeoJson
|
|
853
|
+
? new GeoJSON().writeFeature(command.model.feature)
|
|
854
|
+
: new WKT().writeFeature(command.model.feature));
|
|
855
|
+
}
|
|
856
|
+
observeMapRender() {
|
|
857
|
+
this.postboy.subscribe(MapRenderedEvent.ID).subscribe((m) => {
|
|
858
|
+
this.map = m.map;
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
defineLayer(action) {
|
|
862
|
+
const query = new GetLayerQuery(MapConstants.DrawingLayerId);
|
|
863
|
+
query.result.subscribe((l) => action(l));
|
|
864
|
+
this.postboy.fire(query);
|
|
865
|
+
}
|
|
866
|
+
observeCancelation(ev, layer) {
|
|
867
|
+
return this.postboy
|
|
868
|
+
.subscribe(CancelFeatureModificationCommand.ID)
|
|
869
|
+
.pipe(first())
|
|
870
|
+
.subscribe(() => {
|
|
871
|
+
ev.finish(null);
|
|
872
|
+
this.clearInteraction(layer);
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
clearInteraction(layer) {
|
|
876
|
+
var _a, _b;
|
|
877
|
+
if (this.modify)
|
|
878
|
+
(_a = this.map) === null || _a === void 0 ? void 0 : _a.removeInteraction(this.modify);
|
|
879
|
+
if (this.translate)
|
|
880
|
+
(_b = this.map) === null || _b === void 0 ? void 0 : _b.removeInteraction(this.translate);
|
|
789
881
|
}
|
|
790
882
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
883
|
+
FeatureModificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FeatureModificationService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
884
|
+
FeatureModificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FeatureModificationService });
|
|
885
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FeatureModificationService, decorators: [{
|
|
794
886
|
type: Injectable
|
|
795
887
|
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
796
888
|
|
|
797
889
|
class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
798
|
-
constructor(service, management, state, mapFeature, interaction, drawing,
|
|
890
|
+
constructor(service, management, state, mapFeature, interaction, drawing, featureModification) {
|
|
799
891
|
super(service);
|
|
800
|
-
this.registerServices([management, state, interaction, mapFeature, drawing,
|
|
892
|
+
this.registerServices([management, state, interaction, mapFeature, drawing, featureModification]);
|
|
801
893
|
}
|
|
802
894
|
_up() {
|
|
803
895
|
this.registerReplay(MapRenderedEvent.ID);
|
|
@@ -814,17 +906,22 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
814
906
|
this.registerSubject(StartDrawingCommand.ID);
|
|
815
907
|
this.registerSubject(GetLayerQuery.ID);
|
|
816
908
|
this.registerSubject(DrawingFinishedEvent.ID);
|
|
817
|
-
this.registerSubject(GenerateDrawQuery.ID);
|
|
818
|
-
this.registerSubject(FilterFeaturesInAreaQuery.ID);
|
|
819
909
|
this.registerSubject(GetFeaturesInAreaQuery.ID);
|
|
820
910
|
this.registerSubject(DrawSelectionAreaCommand.ID);
|
|
911
|
+
this.registerSubject(CancelFeatureModificationCommand.ID);
|
|
912
|
+
this.registerSubject(ModifyFeatureCommand.ID);
|
|
913
|
+
this.setExecutors();
|
|
914
|
+
}
|
|
915
|
+
setExecutors() {
|
|
916
|
+
this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
|
|
917
|
+
this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
|
|
821
918
|
}
|
|
822
919
|
}
|
|
823
|
-
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:
|
|
920
|
+
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 });
|
|
824
921
|
MessageRegistratorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageRegistratorService });
|
|
825
922
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageRegistratorService, decorators: [{
|
|
826
923
|
type: Injectable
|
|
827
|
-
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type:
|
|
924
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }]; } });
|
|
828
925
|
|
|
829
926
|
class TileLayerSettings {
|
|
830
927
|
constructor() {
|
|
@@ -1383,6 +1480,7 @@ MapPlateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
1383
1480
|
DrawingService,
|
|
1384
1481
|
DrawingGenerationService,
|
|
1385
1482
|
FeatureService,
|
|
1483
|
+
FeatureModificationService,
|
|
1386
1484
|
], 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 });
|
|
1387
1485
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapPlateComponent, decorators: [{
|
|
1388
1486
|
type: Component,
|
|
@@ -1395,6 +1493,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1395
1493
|
DrawingService,
|
|
1396
1494
|
DrawingGenerationService,
|
|
1397
1495
|
FeatureService,
|
|
1496
|
+
FeatureModificationService,
|
|
1398
1497
|
], 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"] }]
|
|
1399
1498
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { settings: [{
|
|
1400
1499
|
type: Input
|
|
@@ -1653,6 +1752,23 @@ class PolygonStyleHelper {
|
|
|
1653
1752
|
}),
|
|
1654
1753
|
});
|
|
1655
1754
|
}
|
|
1755
|
+
static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
|
|
1756
|
+
return new Style({
|
|
1757
|
+
image: new Circle({
|
|
1758
|
+
fill: new Fill({
|
|
1759
|
+
color: stroke,
|
|
1760
|
+
}),
|
|
1761
|
+
radius: pinRadius,
|
|
1762
|
+
}),
|
|
1763
|
+
fill: new Fill({
|
|
1764
|
+
color: fill,
|
|
1765
|
+
}),
|
|
1766
|
+
stroke: new Stroke({
|
|
1767
|
+
color: stroke,
|
|
1768
|
+
width: strokeWidth,
|
|
1769
|
+
}),
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1656
1772
|
}
|
|
1657
1773
|
|
|
1658
1774
|
class TextStyleHelper {
|
|
@@ -1731,5 +1847,5 @@ class StringifyFeatureHelper {
|
|
|
1731
1847
|
* Generated bundle index. Do not edit.
|
|
1732
1848
|
*/
|
|
1733
1849
|
|
|
1734
|
-
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 };
|
|
1850
|
+
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 };
|
|
1735
1851
|
//# sourceMappingURL=maps-components.mjs.map
|