@artstesh/maps 1.0.9 → 1.0.10
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/bundles/maps-components-src-map.umd.js +222 -17
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +222 -17
- package/dist/bundles/maps-components.umd.js.map +1 -1
- package/dist/esm2015/map/map-plate/map-plate.component.js +4 -1
- package/dist/esm2015/map/messages/commands/draw-selection-area.command.js +14 -0
- package/dist/esm2015/map/messages/index.js +2 -1
- package/dist/esm2015/map/messages/queries/filter-features-in-area.query.js +13 -0
- package/dist/esm2015/map/messages/queries/get-features-in-area.query.js +13 -0
- package/dist/esm2015/map/models/dictionary.js +56 -0
- package/dist/esm2015/map/models/index.js +2 -1
- package/dist/esm2015/map/services/drawing/drawing.service.js +25 -3
- package/dist/esm2015/map/services/feature.service.js +29 -0
- package/dist/esm2015/map/services/map-management.service.js +39 -9
- package/dist/esm2015/map/services/message-registrator.service.js +12 -5
- package/dist/esm2015/src/map/map-plate/map-plate.component.js +4 -1
- package/dist/esm2015/src/map/messages/commands/draw-selection-area.command.js +14 -0
- package/dist/esm2015/src/map/messages/index.js +2 -1
- package/dist/esm2015/src/map/messages/queries/filter-features-in-area.query.js +13 -0
- package/dist/esm2015/src/map/messages/queries/get-features-in-area.query.js +13 -0
- package/dist/esm2015/src/map/models/dictionary.js +56 -0
- package/dist/esm2015/src/map/models/index.js +2 -1
- package/dist/esm2015/src/map/services/drawing/drawing.service.js +25 -3
- package/dist/esm2015/src/map/services/feature.service.js +29 -0
- package/dist/esm2015/src/map/services/map-management.service.js +39 -9
- package/dist/esm2015/src/map/services/message-registrator.service.js +12 -5
- package/dist/fesm2015/maps-components-src-map.js +183 -16
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +183 -16
- package/dist/fesm2015/maps-components.js.map +1 -1
- package/dist/map/messages/commands/draw-selection-area.command.d.ts +12 -0
- package/dist/map/messages/index.d.ts +1 -0
- package/dist/map/messages/queries/filter-features-in-area.query.d.ts +10 -0
- package/dist/map/messages/queries/get-features-in-area.query.d.ts +11 -0
- package/dist/map/models/dictionary.d.ts +17 -0
- package/dist/map/models/index.d.ts +1 -0
- package/dist/map/services/drawing/drawing.service.d.ts +2 -0
- package/dist/map/services/feature.service.d.ts +11 -0
- package/dist/map/services/map-management.service.d.ts +1 -0
- package/dist/map/services/message-registrator.service.d.ts +2 -1
- package/dist/src/map/messages/commands/draw-selection-area.command.d.ts +12 -0
- package/dist/src/map/messages/index.d.ts +1 -0
- package/dist/src/map/messages/queries/filter-features-in-area.query.d.ts +10 -0
- package/dist/src/map/messages/queries/get-features-in-area.query.d.ts +11 -0
- package/dist/src/map/models/dictionary.d.ts +17 -0
- package/dist/src/map/models/index.d.ts +1 -0
- package/dist/src/map/services/drawing/drawing.service.d.ts +2 -0
- package/dist/src/map/services/feature.service.d.ts +11 -0
- package/dist/src/map/services/map-management.service.d.ts +1 -0
- package/dist/src/map/services/message-registrator.service.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ol'), require('ol/geom'), require('ol/format'), require('ol/extent'), require('ol/proj'), require('@artstesh/postboy'), require('rxjs/operators'), require('ol/source'), require('ol/interaction'), require('ol/interaction/Draw'), require('ol/layer/Tile'), require('ol/source/OSM'), require('ol/layer'), require('ol/loadingstrategy'), require('ol/geom/Polygon'), require('ol/source/Cluster'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('maps-components', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/proj', '@artstesh/postboy', 'rxjs/operators', 'ol/source', 'ol/interaction', 'ol/interaction/Draw', 'ol/layer/Tile', 'ol/source/OSM', 'ol/layer', 'ol/loadingstrategy', 'ol/geom/Polygon', 'ol/source/Cluster', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["maps-components"] = {}, global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.proj, global.postboy, global.rxjs.operators, global.source, global.interaction, global.Draw, global.TileLayer, global.OSM, global.layer, global.loadingstrategy, global.Polygon, global.Cluster, global.
|
|
5
|
-
})(this, (function (exports, i0, i6, ol, geom, format, extent, proj, postboy, operators, source, interaction, Draw, TileLayer, OSM, layer, loadingstrategy, Polygon, Cluster,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ol'), require('ol/geom'), require('ol/format'), require('ol/extent'), require('ol/proj'), require('@artstesh/postboy'), require('rxjs'), require('rxjs/operators'), require('ol/source'), require('ol/interaction'), require('ol/interaction/Draw'), require('ol/layer/Tile'), require('ol/source/OSM'), require('ol/layer'), require('ol/loadingstrategy'), require('ol/geom/Polygon'), require('ol/source/Cluster'), require('ol/Map'), require('ol/View'), require('ol/Overlay'), require('ol/style/Style'), require('ol/style'), require('ol/proj/epsg4326')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('maps-components', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/proj', '@artstesh/postboy', 'rxjs', 'rxjs/operators', 'ol/source', 'ol/interaction', 'ol/interaction/Draw', 'ol/layer/Tile', 'ol/source/OSM', 'ol/layer', 'ol/loadingstrategy', 'ol/geom/Polygon', 'ol/source/Cluster', 'ol/Map', 'ol/View', 'ol/Overlay', 'ol/style/Style', 'ol/style', 'ol/proj/epsg4326'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["maps-components"] = {}, global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.proj, global.postboy, global.rxjs, global.rxjs.operators, global.source, global.interaction, global.Draw, global.TileLayer, global.OSM, global.layer, global.loadingstrategy, global.Polygon, global.Cluster, global.Map, global.View, global.Overlay, global.Style, global.style, global.epsg4326));
|
|
5
|
+
})(this, (function (exports, i0, i6, ol, geom, format, extent, proj, postboy, rxjs, operators, source, interaction, Draw, TileLayer, OSM, layer, loadingstrategy, Polygon, Cluster, Map, View, Overlay, Style, style, epsg4326) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -684,6 +684,72 @@
|
|
|
684
684
|
FeatureOutputFormat[FeatureOutputFormat["WKT"] = 2] = "WKT";
|
|
685
685
|
})(exports.FeatureOutputFormat || (exports.FeatureOutputFormat = {}));
|
|
686
686
|
|
|
687
|
+
var Dictionary = /** @class */ (function () {
|
|
688
|
+
function Dictionary() {
|
|
689
|
+
var _this = this;
|
|
690
|
+
this.collection = {};
|
|
691
|
+
this._keys = new Set();
|
|
692
|
+
this.has = function (key) { return _this._keys.has(key); };
|
|
693
|
+
}
|
|
694
|
+
Object.defineProperty(Dictionary.prototype, "keys", {
|
|
695
|
+
get: function () {
|
|
696
|
+
return Array.from(this._keys);
|
|
697
|
+
},
|
|
698
|
+
enumerable: false,
|
|
699
|
+
configurable: true
|
|
700
|
+
});
|
|
701
|
+
Object.defineProperty(Dictionary.prototype, "size", {
|
|
702
|
+
get: function () {
|
|
703
|
+
return this._keys.size;
|
|
704
|
+
},
|
|
705
|
+
enumerable: false,
|
|
706
|
+
configurable: true
|
|
707
|
+
});
|
|
708
|
+
Dictionary.clone = function (dic, action) {
|
|
709
|
+
return Dictionary.create(dic.collection, action);
|
|
710
|
+
};
|
|
711
|
+
Dictionary.create = function (dic, action) {
|
|
712
|
+
var keyList = Object.keys(dic);
|
|
713
|
+
var result = new Dictionary();
|
|
714
|
+
for (var i = 0; i < keyList.length; i++) {
|
|
715
|
+
var key = keyList[i];
|
|
716
|
+
result._keys.add(key);
|
|
717
|
+
result.collection[key] = action ? action(dic[key], key) : dic[key];
|
|
718
|
+
}
|
|
719
|
+
return result;
|
|
720
|
+
};
|
|
721
|
+
Dictionary.prototype.find = function (predicate) {
|
|
722
|
+
var result = null;
|
|
723
|
+
this.forEach(function (e) {
|
|
724
|
+
if (result === null && predicate(e))
|
|
725
|
+
result = e;
|
|
726
|
+
});
|
|
727
|
+
return result;
|
|
728
|
+
};
|
|
729
|
+
Dictionary.prototype.take = function (key) {
|
|
730
|
+
return this._keys.has(key) ? this.collection[key] : null;
|
|
731
|
+
};
|
|
732
|
+
Dictionary.prototype.put = function (key, value) {
|
|
733
|
+
if (value == null)
|
|
734
|
+
return;
|
|
735
|
+
this.collection[key] = value;
|
|
736
|
+
this._keys.add(key);
|
|
737
|
+
};
|
|
738
|
+
Dictionary.prototype.rmv = function (key) {
|
|
739
|
+
if (!this._keys.has(key))
|
|
740
|
+
return;
|
|
741
|
+
delete this.collection[key];
|
|
742
|
+
this._keys.delete(key);
|
|
743
|
+
};
|
|
744
|
+
Dictionary.prototype.forEach = function (callback) {
|
|
745
|
+
var keys = Object.keys(this.collection);
|
|
746
|
+
for (var i = 0; i < keys.length; i++) {
|
|
747
|
+
callback(this.collection[keys[i]], i);
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
return Dictionary;
|
|
751
|
+
}());
|
|
752
|
+
|
|
687
753
|
var MapRenderedEvent = /** @class */ (function (_super) {
|
|
688
754
|
__extends(MapRenderedEvent, _super);
|
|
689
755
|
function MapRenderedEvent(map) {
|
|
@@ -796,6 +862,27 @@
|
|
|
796
862
|
}(postboy.PostboyGenericMessage));
|
|
797
863
|
CancelDrawingCommand.ID = '7d38d983-feba-4176-a66b-18175e5ecd6b';
|
|
798
864
|
|
|
865
|
+
var DrawSelectionAreaCommand = /** @class */ (function (_super) {
|
|
866
|
+
__extends(DrawSelectionAreaCommand, _super);
|
|
867
|
+
function DrawSelectionAreaCommand(type, style, ignore) {
|
|
868
|
+
if (ignore === void 0) { ignore = new Set(); }
|
|
869
|
+
var _this = _super.call(this) || this;
|
|
870
|
+
_this.type = type;
|
|
871
|
+
_this.style = style;
|
|
872
|
+
_this.ignore = ignore;
|
|
873
|
+
return _this;
|
|
874
|
+
}
|
|
875
|
+
Object.defineProperty(DrawSelectionAreaCommand.prototype, "id", {
|
|
876
|
+
get: function () {
|
|
877
|
+
return DrawSelectionAreaCommand.ID;
|
|
878
|
+
},
|
|
879
|
+
enumerable: false,
|
|
880
|
+
configurable: true
|
|
881
|
+
});
|
|
882
|
+
return DrawSelectionAreaCommand;
|
|
883
|
+
}(postboy.PostboyCallbackMessage));
|
|
884
|
+
DrawSelectionAreaCommand.ID = '573d8a0d-f25b-42b7-9ad7-0ac6d86ac362';
|
|
885
|
+
|
|
799
886
|
var AddLayerCommand = /** @class */ (function (_super) {
|
|
800
887
|
__extends(AddLayerCommand, _super);
|
|
801
888
|
function AddLayerCommand(layer) {
|
|
@@ -961,6 +1048,45 @@
|
|
|
961
1048
|
}(postboy.PostboyCallbackMessage));
|
|
962
1049
|
GenerateDrawQuery.ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
|
|
963
1050
|
|
|
1051
|
+
var FilterFeaturesInAreaQuery = /** @class */ (function (_super) {
|
|
1052
|
+
__extends(FilterFeaturesInAreaQuery, _super);
|
|
1053
|
+
function FilterFeaturesInAreaQuery(area, features) {
|
|
1054
|
+
var _this = _super.call(this) || this;
|
|
1055
|
+
_this.area = area;
|
|
1056
|
+
_this.features = features;
|
|
1057
|
+
return _this;
|
|
1058
|
+
}
|
|
1059
|
+
Object.defineProperty(FilterFeaturesInAreaQuery.prototype, "id", {
|
|
1060
|
+
get: function () {
|
|
1061
|
+
return FilterFeaturesInAreaQuery.ID;
|
|
1062
|
+
},
|
|
1063
|
+
enumerable: false,
|
|
1064
|
+
configurable: true
|
|
1065
|
+
});
|
|
1066
|
+
return FilterFeaturesInAreaQuery;
|
|
1067
|
+
}(postboy.PostboyCallbackMessage));
|
|
1068
|
+
FilterFeaturesInAreaQuery.ID = '36bb2d94-8028-4512-90dd-2386af3fc67c';
|
|
1069
|
+
|
|
1070
|
+
var GetFeaturesInAreaQuery = /** @class */ (function (_super) {
|
|
1071
|
+
__extends(GetFeaturesInAreaQuery, _super);
|
|
1072
|
+
function GetFeaturesInAreaQuery(area, ignore) {
|
|
1073
|
+
if (ignore === void 0) { ignore = new Set(); }
|
|
1074
|
+
var _this = _super.call(this) || this;
|
|
1075
|
+
_this.area = area;
|
|
1076
|
+
_this.ignore = ignore;
|
|
1077
|
+
return _this;
|
|
1078
|
+
}
|
|
1079
|
+
Object.defineProperty(GetFeaturesInAreaQuery.prototype, "id", {
|
|
1080
|
+
get: function () {
|
|
1081
|
+
return GetFeaturesInAreaQuery.ID;
|
|
1082
|
+
},
|
|
1083
|
+
enumerable: false,
|
|
1084
|
+
configurable: true
|
|
1085
|
+
});
|
|
1086
|
+
return GetFeaturesInAreaQuery;
|
|
1087
|
+
}(postboy.PostboyCallbackMessage));
|
|
1088
|
+
GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
|
|
1089
|
+
|
|
964
1090
|
var MapPostboyService = /** @class */ (function (_super) {
|
|
965
1091
|
__extends(MapPostboyService, _super);
|
|
966
1092
|
function MapPostboyService() {
|
|
@@ -979,7 +1105,7 @@
|
|
|
979
1105
|
var MapManagementService = /** @class */ (function () {
|
|
980
1106
|
function MapManagementService(postboy) {
|
|
981
1107
|
this.postboy = postboy;
|
|
982
|
-
this.layers =
|
|
1108
|
+
this.layers = new Dictionary();
|
|
983
1109
|
}
|
|
984
1110
|
MapManagementService.prototype.up = function () {
|
|
985
1111
|
this.observeMapRender();
|
|
@@ -989,6 +1115,7 @@
|
|
|
989
1115
|
this.observeAddTile();
|
|
990
1116
|
this.observeRemoveTile();
|
|
991
1117
|
this.observeLayerQuery();
|
|
1118
|
+
this.observeFeaturesInArea();
|
|
992
1119
|
};
|
|
993
1120
|
MapManagementService.prototype.observeRemoveTile = function () {
|
|
994
1121
|
var _this = this;
|
|
@@ -1000,7 +1127,7 @@
|
|
|
1000
1127
|
};
|
|
1001
1128
|
MapManagementService.prototype.observeLayerQuery = function () {
|
|
1002
1129
|
var _this = this;
|
|
1003
|
-
this.postboy.subscribe(GetLayerQuery.ID).subscribe(function (ev) {
|
|
1130
|
+
this.postboy.subscribe(GetLayerQuery.ID).subscribe(function (ev) { return ev.finish(_this.layers.take(ev.name)); });
|
|
1004
1131
|
};
|
|
1005
1132
|
MapManagementService.prototype.observeAddTile = function () {
|
|
1006
1133
|
var _this = this;
|
|
@@ -1021,19 +1148,19 @@
|
|
|
1021
1148
|
this.postboy.subscribe(AddLayerCommand.ID).subscribe(function (c) {
|
|
1022
1149
|
if (!_this.map)
|
|
1023
1150
|
return;
|
|
1024
|
-
_this.layers
|
|
1151
|
+
_this.layers.put(c.layer.get('name'), c.layer);
|
|
1025
1152
|
_this.map.addLayer(c.layer);
|
|
1026
1153
|
});
|
|
1027
1154
|
};
|
|
1028
1155
|
MapManagementService.prototype.observePlaceFeatures = function () {
|
|
1029
1156
|
var _this = this;
|
|
1030
1157
|
this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe(function (c) {
|
|
1031
|
-
var _a
|
|
1032
|
-
if (!_this.layers
|
|
1158
|
+
var _a;
|
|
1159
|
+
if (!_this.layers.has(c.layer))
|
|
1033
1160
|
return;
|
|
1034
|
-
var source =
|
|
1161
|
+
var source = _this.layers.take(c.layer).getSource();
|
|
1035
1162
|
if (!!source['getSource'])
|
|
1036
|
-
source = (
|
|
1163
|
+
source = (_a = source) === null || _a === void 0 ? void 0 : _a.getSource();
|
|
1037
1164
|
source === null || source === void 0 ? void 0 : source.clear();
|
|
1038
1165
|
source === null || source === void 0 ? void 0 : source.addFeatures(c.features);
|
|
1039
1166
|
});
|
|
@@ -1043,10 +1170,34 @@
|
|
|
1043
1170
|
this.postboy.subscribe(RemoveLayerCommand.ID).subscribe(function (c) {
|
|
1044
1171
|
if (!_this.map)
|
|
1045
1172
|
return;
|
|
1046
|
-
|
|
1173
|
+
_this.layers.rmv(c.layer.get('name'));
|
|
1047
1174
|
_this.map.removeLayer(c.layer);
|
|
1048
1175
|
});
|
|
1049
1176
|
};
|
|
1177
|
+
MapManagementService.prototype.observeFeaturesInArea = function () {
|
|
1178
|
+
var _this = this;
|
|
1179
|
+
this.postboy.subscribe(GetFeaturesInAreaQuery.ID).subscribe(function (qr) {
|
|
1180
|
+
var result = new Dictionary();
|
|
1181
|
+
var queue = [];
|
|
1182
|
+
var queries = [];
|
|
1183
|
+
_this.layers.forEach(function (l) {
|
|
1184
|
+
var _a, _b;
|
|
1185
|
+
var layerName = l.get('name');
|
|
1186
|
+
if (qr.ignore.has(layerName) || layerName === MapConstants.DrawingLayerId)
|
|
1187
|
+
return;
|
|
1188
|
+
var source = l.getSource();
|
|
1189
|
+
if (!!source['getSource'])
|
|
1190
|
+
source = (_a = source) === null || _a === void 0 ? void 0 : _a.getSource();
|
|
1191
|
+
var query = new FilterFeaturesInAreaQuery(qr.area, (_b = source === null || source === void 0 ? void 0 : source.getFeatures()) !== null && _b !== void 0 ? _b : []);
|
|
1192
|
+
queue.push(query.result.pipe(operators.tap(function (r) {
|
|
1193
|
+
result.put(l.get('name'), r.map(function (e) { return (Object.assign({ id: e.getId() }, e.get(MapConstants.FeatureInfo))); }));
|
|
1194
|
+
})));
|
|
1195
|
+
queries.push(query);
|
|
1196
|
+
});
|
|
1197
|
+
rxjs.forkJoin(queue).subscribe(function () { return qr.finish(result); });
|
|
1198
|
+
queries.forEach(function (q) { return _this.postboy.fire(q); });
|
|
1199
|
+
});
|
|
1200
|
+
};
|
|
1050
1201
|
return MapManagementService;
|
|
1051
1202
|
}());
|
|
1052
1203
|
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 });
|
|
@@ -1173,6 +1324,28 @@
|
|
|
1173
1324
|
this.postboy = postboy;
|
|
1174
1325
|
}
|
|
1175
1326
|
DrawingService.prototype.up = function () {
|
|
1327
|
+
this.observeDrawing();
|
|
1328
|
+
this.observeSelectArea();
|
|
1329
|
+
this.observeMapRender();
|
|
1330
|
+
};
|
|
1331
|
+
DrawingService.prototype.observeSelectArea = function () {
|
|
1332
|
+
var _this = this;
|
|
1333
|
+
this.postboy.subscribe(DrawSelectionAreaCommand.ID).subscribe(function (ev) {
|
|
1334
|
+
var drawingCommand = new StartDrawingCommand(ev.type, ev.style);
|
|
1335
|
+
drawingCommand.result.subscribe(function (r) {
|
|
1336
|
+
if (!r) {
|
|
1337
|
+
ev.finish(new Dictionary());
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
var area = PolygonModel.fromGeoJson(1, r).feature.getGeometry();
|
|
1341
|
+
var getFeaturesCommand = new GetFeaturesInAreaQuery(area, ev.ignore);
|
|
1342
|
+
getFeaturesCommand.result.subscribe(function (result) { return ev.finish(result); });
|
|
1343
|
+
_this.postboy.fire(getFeaturesCommand);
|
|
1344
|
+
});
|
|
1345
|
+
_this.postboy.fire(drawingCommand);
|
|
1346
|
+
});
|
|
1347
|
+
};
|
|
1348
|
+
DrawingService.prototype.observeDrawing = function () {
|
|
1176
1349
|
var _this = this;
|
|
1177
1350
|
this.postboy.subscribe(StartDrawingCommand.ID).subscribe(function (ev) {
|
|
1178
1351
|
_this.draw(function (l) {
|
|
@@ -1194,7 +1367,6 @@
|
|
|
1194
1367
|
_this.postboy.fire(drawQuery);
|
|
1195
1368
|
});
|
|
1196
1369
|
});
|
|
1197
|
-
this.observeMapRender();
|
|
1198
1370
|
};
|
|
1199
1371
|
DrawingService.prototype.onEnd = function (evt, command, layer) {
|
|
1200
1372
|
command.finish(command.format === exports.FeatureOutputFormat.GeoJson
|
|
@@ -1262,11 +1434,37 @@
|
|
|
1262
1434
|
type: i0.Injectable
|
|
1263
1435
|
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
1264
1436
|
|
|
1437
|
+
var FeatureService = /** @class */ (function () {
|
|
1438
|
+
function FeatureService(postboy) {
|
|
1439
|
+
this.postboy = postboy;
|
|
1440
|
+
}
|
|
1441
|
+
FeatureService.prototype.up = function () {
|
|
1442
|
+
this.postboy.subscribe(FilterFeaturesInAreaQuery.ID).subscribe(function (qr) {
|
|
1443
|
+
qr.finish(qr.features.filter(function (f) { return FeatureService.booleanIntersects(qr.area, f.getGeometry()); }));
|
|
1444
|
+
});
|
|
1445
|
+
};
|
|
1446
|
+
FeatureService.booleanIntersects = function (g1, g2) {
|
|
1447
|
+
if (g2.getType() === 'Point')
|
|
1448
|
+
return g1.intersectsCoordinate(g2.getCoordinates());
|
|
1449
|
+
if (g2.getType() === 'Circle')
|
|
1450
|
+
return g1.intersectsCoordinate(g2.getCenter());
|
|
1451
|
+
if (g2.getType() === 'Polygon')
|
|
1452
|
+
return g1.intersectsCoordinate(g2.getInteriorPoint().getCoordinates());
|
|
1453
|
+
return false;
|
|
1454
|
+
};
|
|
1455
|
+
return FeatureService;
|
|
1456
|
+
}());
|
|
1457
|
+
FeatureService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureService, deps: [{ token: MapPostboyService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1458
|
+
FeatureService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureService });
|
|
1459
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: FeatureService, decorators: [{
|
|
1460
|
+
type: i0.Injectable
|
|
1461
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
1462
|
+
|
|
1265
1463
|
var MessageRegistratorService = /** @class */ (function (_super) {
|
|
1266
1464
|
__extends(MessageRegistratorService, _super);
|
|
1267
|
-
function MessageRegistratorService(service, management, state,
|
|
1465
|
+
function MessageRegistratorService(service, management, state, mapFeature, interaction, drawing, drawGenerator, feature) {
|
|
1268
1466
|
var _this = _super.call(this, service) || this;
|
|
1269
|
-
_this.registerServices([management, state, interaction,
|
|
1467
|
+
_this.registerServices([management, state, interaction, mapFeature, drawing, drawGenerator, feature]);
|
|
1270
1468
|
return _this;
|
|
1271
1469
|
}
|
|
1272
1470
|
MessageRegistratorService.prototype._up = function () {
|
|
@@ -1285,14 +1483,17 @@
|
|
|
1285
1483
|
this.registerSubject(GetLayerQuery.ID);
|
|
1286
1484
|
this.registerSubject(DrawingFinishedEvent.ID);
|
|
1287
1485
|
this.registerSubject(GenerateDrawQuery.ID);
|
|
1486
|
+
this.registerSubject(FilterFeaturesInAreaQuery.ID);
|
|
1487
|
+
this.registerSubject(GetFeaturesInAreaQuery.ID);
|
|
1488
|
+
this.registerSubject(DrawSelectionAreaCommand.ID);
|
|
1288
1489
|
};
|
|
1289
1490
|
return MessageRegistratorService;
|
|
1290
1491
|
}(postboy.PostboyAbstractRegistrator));
|
|
1291
|
-
MessageRegistratorService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: DrawingGenerationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1492
|
+
MessageRegistratorService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: DrawingGenerationService }, { token: FeatureService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1292
1493
|
MessageRegistratorService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MessageRegistratorService });
|
|
1293
1494
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MessageRegistratorService, decorators: [{
|
|
1294
1495
|
type: i0.Injectable
|
|
1295
|
-
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: DrawingGenerationService }]; } });
|
|
1496
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: DrawingGenerationService }, { type: FeatureService }]; } });
|
|
1296
1497
|
|
|
1297
1498
|
var TileLayerSettings = /** @class */ (function () {
|
|
1298
1499
|
function TileLayerSettings() {
|
|
@@ -1933,6 +2134,7 @@
|
|
|
1933
2134
|
MapFeatureService,
|
|
1934
2135
|
DrawingService,
|
|
1935
2136
|
DrawingGenerationService,
|
|
2137
|
+
FeatureService,
|
|
1936
2138
|
], usesInheritance: true, ngImport: i0__namespace, 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__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1937
2139
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateComponent, decorators: [{
|
|
1938
2140
|
type: i0.Component,
|
|
@@ -1949,6 +2151,7 @@
|
|
|
1949
2151
|
MapFeatureService,
|
|
1950
2152
|
DrawingService,
|
|
1951
2153
|
DrawingGenerationService,
|
|
2154
|
+
FeatureService,
|
|
1952
2155
|
],
|
|
1953
2156
|
}]
|
|
1954
2157
|
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { settings: [{
|
|
@@ -2350,6 +2553,8 @@
|
|
|
2350
2553
|
exports.CloseTooltipCommand = CloseTooltipCommand;
|
|
2351
2554
|
exports.ClusterLayerComponent = ClusterLayerComponent;
|
|
2352
2555
|
exports.ClusterLayerSettings = ClusterLayerSettings;
|
|
2556
|
+
exports.Dictionary = Dictionary;
|
|
2557
|
+
exports.DrawSelectionAreaCommand = DrawSelectionAreaCommand;
|
|
2353
2558
|
exports.FeatureLayerComponent = FeatureLayerComponent;
|
|
2354
2559
|
exports.FeatureLayerSettings = FeatureLayerSettings;
|
|
2355
2560
|
exports.MapClickEvent = MapClickEvent;
|