@artstesh/maps 4.1.13 → 4.1.14
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/messages/executors/filter-features-in-point.executor.mjs +17 -0
- package/dist/esm2020/map/messages/index.mjs +3 -1
- package/dist/esm2020/map/messages/queries/get-features-in-point.query.mjs +18 -0
- package/dist/esm2020/map/services/feature.service.mjs +5 -1
- package/dist/esm2020/map/services/map-management.service.mjs +28 -12
- package/dist/esm2020/map/services/message-registrator.service.mjs +5 -2
- package/dist/esm2020/src/map/messages/executors/filter-features-in-point.executor.mjs +17 -0
- package/dist/esm2020/src/map/messages/index.mjs +3 -1
- package/dist/esm2020/src/map/messages/queries/get-features-in-point.query.mjs +18 -0
- package/dist/esm2020/src/map/services/feature.service.mjs +5 -1
- package/dist/esm2020/src/map/services/map-management.service.mjs +28 -12
- package/dist/esm2020/src/map/services/message-registrator.service.mjs +5 -2
- package/dist/fesm2015/maps-components-src-map.mjs +66 -11
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +66 -11
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +65 -11
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +65 -11
- package/dist/fesm2020/maps-components.mjs.map +1 -1
- package/dist/map/messages/executors/filter-features-in-point.executor.d.ts +14 -0
- package/dist/map/messages/index.d.ts +2 -0
- package/dist/map/messages/queries/get-features-in-point.query.d.ts +15 -0
- package/dist/map/services/feature.service.d.ts +2 -0
- package/dist/map/services/map-management.service.d.ts +2 -0
- package/dist/src/map/messages/executors/filter-features-in-point.executor.d.ts +14 -0
- package/dist/src/map/messages/index.d.ts +2 -0
- package/dist/src/map/messages/queries/get-features-in-point.query.d.ts +15 -0
- package/dist/src/map/services/feature.service.d.ts +2 -0
- package/dist/src/map/services/map-management.service.d.ts +2 -0
- package/package.json +1 -1
|
@@ -414,6 +414,39 @@ class FilterFeaturesInAreaExecutor extends PostboyExecutor {
|
|
|
414
414
|
}
|
|
415
415
|
FilterFeaturesInAreaExecutor.ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
|
|
416
416
|
|
|
417
|
+
/**
|
|
418
|
+
* Represents a query to retrieve features located at a specific geographical point.
|
|
419
|
+
* The query is defined by latitude, longitude, and an optional set of features to ignore.
|
|
420
|
+
*/
|
|
421
|
+
class GetFeaturesInPointQuery extends PostboyCallbackMessage {
|
|
422
|
+
constructor(lat, lng, ignore = new Set()) {
|
|
423
|
+
super();
|
|
424
|
+
this.lat = lat;
|
|
425
|
+
this.lng = lng;
|
|
426
|
+
this.ignore = ignore;
|
|
427
|
+
}
|
|
428
|
+
get id() {
|
|
429
|
+
return GetFeaturesInPointQuery.ID;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
GetFeaturesInPointQuery.ID = '7c051c97-bbf1-47eb-baa3-4d1eef6f281f';
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* The FilterFeaturesInPointExecutor class is responsible for filtering features within a given point.
|
|
436
|
+
*/
|
|
437
|
+
class FilterFeaturesInPointExecutor extends PostboyExecutor {
|
|
438
|
+
get id() {
|
|
439
|
+
return FilterFeaturesInPointExecutor.ID;
|
|
440
|
+
}
|
|
441
|
+
constructor(lat, lng, features) {
|
|
442
|
+
super();
|
|
443
|
+
this.lat = lat;
|
|
444
|
+
this.lng = lng;
|
|
445
|
+
this.features = features;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
FilterFeaturesInPointExecutor.ID = '5b859282-5d5a-47ca-a6ad-863a66c8b82b';
|
|
449
|
+
|
|
417
450
|
class AddLayerCommand extends PostboyGenericMessage {
|
|
418
451
|
constructor(layer) {
|
|
419
452
|
super();
|
|
@@ -530,6 +563,9 @@ class FeatureService {
|
|
|
530
563
|
static filterFeaturesInArea(query) {
|
|
531
564
|
return query.features.filter((f) => FeatureService.booleanIntersects(query.area, f.getGeometry()));
|
|
532
565
|
}
|
|
566
|
+
static filterFeaturesInPoint(query) {
|
|
567
|
+
return query.features.filter((f) => FeatureService.booleanIntersects(f.getGeometry(), new Point([query.lng, query.lat])));
|
|
568
|
+
}
|
|
533
569
|
static calculateArea(g) {
|
|
534
570
|
if (!g)
|
|
535
571
|
return 0;
|
|
@@ -608,6 +644,7 @@ class MapManagementService {
|
|
|
608
644
|
this.observeRemoveTile();
|
|
609
645
|
this.observeLayerQuery();
|
|
610
646
|
this.observeFeaturesInArea();
|
|
647
|
+
this.observeFeaturesInPoint();
|
|
611
648
|
}
|
|
612
649
|
observeRemoveTile() {
|
|
613
650
|
this.postboy.subscribe(RemoveTileCommand.ID).subscribe((c) => {
|
|
@@ -662,20 +699,36 @@ class MapManagementService {
|
|
|
662
699
|
observeFeaturesInArea() {
|
|
663
700
|
this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe((qr) => {
|
|
664
701
|
let result = new Dictionary();
|
|
665
|
-
this.
|
|
702
|
+
this.forEachLayer((l, s) => {
|
|
666
703
|
var _a;
|
|
667
|
-
let
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
704
|
+
let features = this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, (_a = s === null || s === void 0 ? void 0 : s.getFeatures()) !== null && _a !== void 0 ? _a : []));
|
|
705
|
+
result.put(l.get('name'), features.map((e) => (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo)))));
|
|
706
|
+
}, qr.ignore);
|
|
707
|
+
qr.finish(result);
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
observeFeaturesInPoint() {
|
|
711
|
+
this.postboy.subscribe(GetFeaturesInPointQuery.ID).subscribe((qr) => {
|
|
712
|
+
let result = new Dictionary();
|
|
713
|
+
this.forEachLayer((l, s) => {
|
|
714
|
+
var _a;
|
|
715
|
+
let features = this.postboy.execute(new FilterFeaturesInPointExecutor(qr.lat, qr.lng, (_a = s === null || s === void 0 ? void 0 : s.getFeatures()) !== null && _a !== void 0 ? _a : []));
|
|
716
|
+
result.put(l.get('name'), features.map((e) => (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo)))));
|
|
717
|
+
}, qr.ignore);
|
|
676
718
|
qr.finish(result);
|
|
677
719
|
});
|
|
678
720
|
}
|
|
721
|
+
forEachLayer(action, ignore) {
|
|
722
|
+
this.layers.forEach((l) => {
|
|
723
|
+
let layerName = l.get('name');
|
|
724
|
+
if (ignore.has(layerName) || layerName === MapConstants.DrawingLayerId)
|
|
725
|
+
return;
|
|
726
|
+
let source = l.getSource();
|
|
727
|
+
if (!!source['getSource'])
|
|
728
|
+
source = source === null || source === void 0 ? void 0 : source.getSource();
|
|
729
|
+
action(l, source);
|
|
730
|
+
});
|
|
731
|
+
}
|
|
679
732
|
}
|
|
680
733
|
MapManagementService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapManagementService, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
681
734
|
MapManagementService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapManagementService });
|
|
@@ -1056,10 +1109,12 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
1056
1109
|
this.registerSubject(DrawSelectionAreaCommand.ID);
|
|
1057
1110
|
this.registerSubject(CancelFeatureModificationCommand.ID);
|
|
1058
1111
|
this.registerSubject(ModifyFeatureCommand.ID);
|
|
1112
|
+
this.registerSubject(GetFeaturesInPointQuery.ID);
|
|
1059
1113
|
this.setExecutors();
|
|
1060
1114
|
}
|
|
1061
1115
|
setExecutors() {
|
|
1062
1116
|
this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
|
|
1117
|
+
this.registerExecutor(FilterFeaturesInPointExecutor.ID, (e) => FeatureService.filterFeaturesInPoint(e));
|
|
1063
1118
|
this.registerExecutor(CalculateAreaExecutor.ID, (e) => { var _a, _b; return FeatureService.calculateArea((_b = (_a = e.polygon) === null || _a === void 0 ? void 0 : _a.feature) === null || _b === void 0 ? void 0 : _b.getGeometry()); });
|
|
1064
1119
|
this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
|
|
1065
1120
|
this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
|
|
@@ -2520,5 +2575,5 @@ class StringifyFeatureHelper {
|
|
|
2520
2575
|
* Generated bundle index. Do not edit.
|
|
2521
2576
|
*/
|
|
2522
2577
|
|
|
2523
|
-
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FilterFeaturesInAreaExecutor, FitToPolygonsCommand, GetFeaturesInAreaQuery, GetMapPositionExecutor, MapClickEvent, MapControl, MapControlZoomComponent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
|
|
2578
|
+
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FilterFeaturesInAreaExecutor, FilterFeaturesInPointExecutor, FitToPolygonsCommand, GetFeaturesInAreaQuery, GetFeaturesInPointQuery, GetMapPositionExecutor, MapClickEvent, MapControl, MapControlZoomComponent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
|
|
2524
2579
|
//# sourceMappingURL=maps-components.mjs.map
|