@artstesh/maps 1.1.12 → 1.1.13

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 (31) hide show
  1. package/dist/bundles/maps-components-src-map.umd.js +85 -11
  2. package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
  3. package/dist/bundles/maps-components.umd.js +85 -11
  4. package/dist/bundles/maps-components.umd.js.map +1 -1
  5. package/dist/esm2015/map/messages/executors/filter-features-in-point.executor.js +17 -0
  6. package/dist/esm2015/map/messages/index.js +3 -1
  7. package/dist/esm2015/map/messages/queries/get-features-in-point.query.js +18 -0
  8. package/dist/esm2015/map/services/feature.service.js +5 -1
  9. package/dist/esm2015/map/services/map-management.service.js +31 -13
  10. package/dist/esm2015/map/services/message-registrator.service.js +5 -2
  11. package/dist/esm2015/src/map/messages/executors/filter-features-in-point.executor.js +17 -0
  12. package/dist/esm2015/src/map/messages/index.js +3 -1
  13. package/dist/esm2015/src/map/messages/queries/get-features-in-point.query.js +18 -0
  14. package/dist/esm2015/src/map/services/feature.service.js +5 -1
  15. package/dist/esm2015/src/map/services/map-management.service.js +31 -13
  16. package/dist/esm2015/src/map/services/message-registrator.service.js +5 -2
  17. package/dist/fesm2015/maps-components-src-map.js +68 -12
  18. package/dist/fesm2015/maps-components-src-map.js.map +1 -1
  19. package/dist/fesm2015/maps-components.js +68 -12
  20. package/dist/fesm2015/maps-components.js.map +1 -1
  21. package/dist/map/messages/executors/filter-features-in-point.executor.d.ts +14 -0
  22. package/dist/map/messages/index.d.ts +2 -0
  23. package/dist/map/messages/queries/get-features-in-point.query.d.ts +15 -0
  24. package/dist/map/services/feature.service.d.ts +2 -0
  25. package/dist/map/services/map-management.service.d.ts +2 -0
  26. package/dist/src/map/messages/executors/filter-features-in-point.executor.d.ts +14 -0
  27. package/dist/src/map/messages/index.d.ts +2 -0
  28. package/dist/src/map/messages/queries/get-features-in-point.query.d.ts +15 -0
  29. package/dist/src/map/services/feature.service.d.ts +2 -0
  30. package/dist/src/map/services/map-management.service.d.ts +2 -0
  31. package/package.json +1 -1
@@ -1037,6 +1037,54 @@
1037
1037
  }(postboy.PostboyExecutor));
1038
1038
  FilterFeaturesInAreaExecutor.ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
1039
1039
 
1040
+ /**
1041
+ * Represents a query to retrieve features located at a specific geographical point.
1042
+ * The query is defined by latitude, longitude, and an optional set of features to ignore.
1043
+ */
1044
+ var GetFeaturesInPointQuery = /** @class */ (function (_super) {
1045
+ __extends(GetFeaturesInPointQuery, _super);
1046
+ function GetFeaturesInPointQuery(lat, lng, ignore) {
1047
+ if (ignore === void 0) { ignore = new Set(); }
1048
+ var _this = _super.call(this) || this;
1049
+ _this.lat = lat;
1050
+ _this.lng = lng;
1051
+ _this.ignore = ignore;
1052
+ return _this;
1053
+ }
1054
+ Object.defineProperty(GetFeaturesInPointQuery.prototype, "id", {
1055
+ get: function () {
1056
+ return GetFeaturesInPointQuery.ID;
1057
+ },
1058
+ enumerable: false,
1059
+ configurable: true
1060
+ });
1061
+ return GetFeaturesInPointQuery;
1062
+ }(postboy.PostboyCallbackMessage));
1063
+ GetFeaturesInPointQuery.ID = '7c051c97-bbf1-47eb-baa3-4d1eef6f281f';
1064
+
1065
+ /**
1066
+ * The FilterFeaturesInPointExecutor class is responsible for filtering features within a given point.
1067
+ */
1068
+ var FilterFeaturesInPointExecutor = /** @class */ (function (_super) {
1069
+ __extends(FilterFeaturesInPointExecutor, _super);
1070
+ function FilterFeaturesInPointExecutor(lat, lng, features) {
1071
+ var _this = _super.call(this) || this;
1072
+ _this.lat = lat;
1073
+ _this.lng = lng;
1074
+ _this.features = features;
1075
+ return _this;
1076
+ }
1077
+ Object.defineProperty(FilterFeaturesInPointExecutor.prototype, "id", {
1078
+ get: function () {
1079
+ return FilterFeaturesInPointExecutor.ID;
1080
+ },
1081
+ enumerable: false,
1082
+ configurable: true
1083
+ });
1084
+ return FilterFeaturesInPointExecutor;
1085
+ }(postboy.PostboyExecutor));
1086
+ FilterFeaturesInPointExecutor.ID = '5b859282-5d5a-47ca-a6ad-863a66c8b82b';
1087
+
1040
1088
  var AddLayerCommand = /** @class */ (function (_super) {
1041
1089
  __extends(AddLayerCommand, _super);
1042
1090
  function AddLayerCommand(layer) {
@@ -1213,6 +1261,9 @@
1213
1261
  FeatureService.filterFeaturesInArea = function (query) {
1214
1262
  return query.features.filter(function (f) { return FeatureService.booleanIntersects(query.area, f.getGeometry()); });
1215
1263
  };
1264
+ FeatureService.filterFeaturesInPoint = function (query) {
1265
+ return query.features.filter(function (f) { return FeatureService.booleanIntersects(f.getGeometry(), new geom.Point([query.lng, query.lat])); });
1266
+ };
1216
1267
  FeatureService.calculateArea = function (g) {
1217
1268
  if (!g)
1218
1269
  return 0;
@@ -1312,6 +1363,7 @@
1312
1363
  this.observeRemoveTile();
1313
1364
  this.observeLayerQuery();
1314
1365
  this.observeFeaturesInArea();
1366
+ this.observeFeaturesInPoint();
1315
1367
  };
1316
1368
  MapManagementService.prototype.observeRemoveTile = function () {
1317
1369
  var _this = this;
@@ -1374,20 +1426,38 @@
1374
1426
  var _this = this;
1375
1427
  this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe(function (qr) {
1376
1428
  var result = new collections.Dictionary();
1377
- _this.layers.forEach(function (l) {
1378
- var _a, _b;
1379
- var layerName = l.get('name');
1380
- if (qr.ignore.has(layerName) || layerName === MapConstants.DrawingLayerId)
1381
- return;
1382
- var source = l.getSource();
1383
- if (!!source['getSource'])
1384
- source = (_a = source) === null || _a === void 0 ? void 0 : _a.getSource();
1385
- var features = _this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, (_b = source === null || source === void 0 ? void 0 : source.getFeatures()) !== null && _b !== void 0 ? _b : []));
1386
- result.put(layerName, features.map(function (e) { return (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo))); }));
1387
- });
1429
+ _this.forEachLayer(function (l, s) {
1430
+ var _a;
1431
+ var features = _this.postboy.execute(new FilterFeaturesInAreaExecutor(qr.area, (_a = s === null || s === void 0 ? void 0 : s.getFeatures()) !== null && _a !== void 0 ? _a : []));
1432
+ result.put(l.get('name'), features.map(function (e) { return (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo))); }));
1433
+ }, qr.ignore);
1388
1434
  qr.finish(result);
1389
1435
  });
1390
1436
  };
1437
+ MapManagementService.prototype.observeFeaturesInPoint = function () {
1438
+ var _this = this;
1439
+ this.postboy.subscribe(GetFeaturesInPointQuery.ID).subscribe(function (qr) {
1440
+ var result = new collections.Dictionary();
1441
+ _this.forEachLayer(function (l, s) {
1442
+ var _a;
1443
+ var 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 : []));
1444
+ result.put(l.get('name'), features.map(function (e) { return (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo))); }));
1445
+ }, qr.ignore);
1446
+ qr.finish(result);
1447
+ });
1448
+ };
1449
+ MapManagementService.prototype.forEachLayer = function (action, ignore) {
1450
+ this.layers.forEach(function (l) {
1451
+ var _a;
1452
+ var layerName = l.get('name');
1453
+ if (ignore.has(layerName) || layerName === MapConstants.DrawingLayerId)
1454
+ return;
1455
+ var source = l.getSource();
1456
+ if (!!source['getSource'])
1457
+ source = (_a = source) === null || _a === void 0 ? void 0 : _a.getSource();
1458
+ action(l, source);
1459
+ });
1460
+ };
1391
1461
  return MapManagementService;
1392
1462
  }());
1393
1463
  MapManagementService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapManagementService, deps: [{ token: MapPostboyService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
@@ -1797,11 +1867,13 @@
1797
1867
  this.registerSubject(DrawSelectionAreaCommand.ID);
1798
1868
  this.registerSubject(CancelFeatureModificationCommand.ID);
1799
1869
  this.registerSubject(ModifyFeatureCommand.ID);
1870
+ this.registerSubject(GetFeaturesInPointQuery.ID);
1800
1871
  this.setExecutors();
1801
1872
  };
1802
1873
  MessageRegistratorService.prototype.setExecutors = function () {
1803
1874
  var _this = this;
1804
1875
  this.registerExecutor(FilterFeaturesInAreaExecutor.ID, function (e) { return FeatureService.filterFeaturesInArea(e); });
1876
+ this.registerExecutor(FilterFeaturesInPointExecutor.ID, function (e) { return FeatureService.filterFeaturesInPoint(e); });
1805
1877
  this.registerExecutor(CalculateAreaExecutor.ID, function (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()); });
1806
1878
  this.registerExecutor(GenerateDrawExecutor.ID, function (e) { return DrawingGenerationService.getDraw(e); });
1807
1879
  this.registerExecutor(GenerateZoomControlExecutor.ID, function (e) { return ZoomControlFactory.build(e.settings); });
@@ -3436,8 +3508,10 @@
3436
3508
  exports.FeatureLayerComponent = FeatureLayerComponent;
3437
3509
  exports.FeatureLayerSettings = FeatureLayerSettings;
3438
3510
  exports.FilterFeaturesInAreaExecutor = FilterFeaturesInAreaExecutor;
3511
+ exports.FilterFeaturesInPointExecutor = FilterFeaturesInPointExecutor;
3439
3512
  exports.FitToPolygonsCommand = FitToPolygonsCommand;
3440
3513
  exports.GetFeaturesInAreaQuery = GetFeaturesInAreaQuery;
3514
+ exports.GetFeaturesInPointQuery = GetFeaturesInPointQuery;
3441
3515
  exports.GetMapPositionExecutor = GetMapPositionExecutor;
3442
3516
  exports.MapClickEvent = MapClickEvent;
3443
3517
  exports.MapControl = MapControl;