@artstesh/maps 1.1.1 → 1.1.3
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 +199 -15
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +199 -15
- package/dist/bundles/maps-components.umd.js.map +1 -1
- package/dist/esm2015/map/map-plate/features/markers/markers.component.js +3 -4
- package/dist/esm2015/map/map-plate/features/polygons/polygons.component.js +2 -2
- package/dist/esm2015/map/map-plate/layers/feature-layer/feature-layer.settings.js +44 -1
- package/dist/esm2015/map/map-plate/map-plate.component.js +4 -1
- package/dist/esm2015/map/messages/commands/add-control.command.js +12 -0
- package/dist/esm2015/map/messages/commands/remove-control.command.js +12 -0
- package/dist/esm2015/map/messages/commands/set-map-center.command.js +23 -0
- package/dist/esm2015/map/messages/index.js +4 -1
- package/dist/esm2015/map/models/index.js +2 -1
- package/dist/esm2015/map/models/map-control.js +15 -0
- package/dist/esm2015/map/services/controls/controls.service.js +37 -0
- package/dist/esm2015/map/services/map-management.service.js +3 -3
- package/dist/esm2015/map/services/map-state.service.js +20 -4
- package/dist/esm2015/map/services/message-registrator.service.js +12 -5
- package/dist/esm2015/src/map/map-plate/features/markers/markers.component.js +3 -4
- package/dist/esm2015/src/map/map-plate/features/polygons/polygons.component.js +2 -2
- package/dist/esm2015/src/map/map-plate/layers/feature-layer/feature-layer.settings.js +44 -1
- package/dist/esm2015/src/map/map-plate/map-plate.component.js +4 -1
- package/dist/esm2015/src/map/messages/commands/add-control.command.js +12 -0
- package/dist/esm2015/src/map/messages/commands/remove-control.command.js +12 -0
- package/dist/esm2015/src/map/messages/commands/set-map-center.command.js +23 -0
- package/dist/esm2015/src/map/messages/index.js +4 -1
- package/dist/esm2015/src/map/models/index.js +2 -1
- package/dist/esm2015/src/map/models/map-control.js +15 -0
- package/dist/esm2015/src/map/services/controls/controls.service.js +37 -0
- package/dist/esm2015/src/map/services/map-management.service.js +3 -3
- package/dist/esm2015/src/map/services/map-state.service.js +20 -4
- package/dist/esm2015/src/map/services/message-registrator.service.js +12 -5
- package/dist/fesm2015/maps-components-src-map.js +165 -13
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +165 -13
- package/dist/fesm2015/maps-components.js.map +1 -1
- package/dist/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +46 -0
- package/dist/map/messages/commands/add-control.command.d.ts +8 -0
- package/dist/map/messages/commands/remove-control.command.d.ts +8 -0
- package/dist/map/messages/commands/set-map-center.command.d.ts +18 -0
- package/dist/map/messages/index.d.ts +3 -0
- package/dist/map/models/index.d.ts +1 -0
- package/dist/map/models/map-control.d.ts +13 -0
- package/dist/map/services/controls/controls.service.d.ts +14 -0
- package/dist/map/services/map-state.service.d.ts +2 -0
- package/dist/map/services/message-registrator.service.d.ts +2 -1
- package/dist/src/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +46 -0
- package/dist/src/map/messages/commands/add-control.command.d.ts +8 -0
- package/dist/src/map/messages/commands/remove-control.command.d.ts +8 -0
- package/dist/src/map/messages/commands/set-map-center.command.d.ts +18 -0
- package/dist/src/map/messages/index.d.ts +3 -0
- package/dist/src/map/models/index.d.ts +1 -0
- package/dist/src/map/models/map-control.d.ts +13 -0
- package/dist/src/map/services/controls/controls.service.d.ts +14 -0
- package/dist/src/map/services/map-state.service.d.ts +2 -0
- package/dist/src/map/services/message-registrator.service.d.ts +2 -1
- package/package.json +1 -1
|
@@ -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/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('maps-components/src/map', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/proj', '@artstesh/postboy', 'ol/interaction', 'ol/interaction/Draw', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["maps-components"] = global["maps-components"] || {}, global["maps-components"].src = global["maps-components"].src || {}, global["maps-components"].src.map = {}), global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.proj, global.postboy, global.interaction, global.Draw, global.
|
|
5
|
-
})(this, (function (exports, i0, i6, ol, geom, format, extent, proj, postboy, interaction, Draw,
|
|
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/control'), require('ol/proj'), require('@artstesh/postboy'), require('ol/interaction'), require('ol/interaction/Draw'), require('rxjs/operators'), require('ol/source'), require('ol/layer/Tile'), require('ol/source/OSM'), require('ol/layer'), require('ol/loadingstrategy'), require('ol/geom/Polygon'), require('ol/source/Cluster'), require('rxjs'), 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/src/map', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/control', 'ol/proj', '@artstesh/postboy', 'ol/interaction', 'ol/interaction/Draw', 'rxjs/operators', 'ol/source', 'ol/layer/Tile', 'ol/source/OSM', 'ol/layer', 'ol/loadingstrategy', 'ol/geom/Polygon', 'ol/source/Cluster', 'rxjs', '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["maps-components"] || {}, global["maps-components"].src = global["maps-components"].src || {}, global["maps-components"].src.map = {}), global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.control, global.proj, global.postboy, global.interaction, global.Draw, global.rxjs.operators, global.source, global.TileLayer, global.OSM, global.layer, global.loadingstrategy, global.Polygon, global.Cluster, global.rxjs, global.Map, global.View, global.Overlay, global.Style, global.style, global.epsg4326));
|
|
5
|
+
})(this, (function (exports, i0, i6, ol, geom, format, extent, control, proj, postboy, interaction, Draw, operators, source, TileLayer, OSM, layer, loadingstrategy, Polygon, Cluster, rxjs, 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
|
|
|
@@ -752,6 +752,22 @@
|
|
|
752
752
|
return Dictionary;
|
|
753
753
|
}());
|
|
754
754
|
|
|
755
|
+
/**
|
|
756
|
+
*
|
|
757
|
+
* A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
|
|
758
|
+
* This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
|
|
759
|
+
* var myControl = new Control({element: myElement}); and then adding this to the map.
|
|
760
|
+
* The main advantage of having this as a control rather than a simple separate DOM element is that preventing propagation is handled for you. Controls will also be objects in a module:ol/Collection~Collection, so you can use their methods.
|
|
761
|
+
* You can also extend this base for your own control class. See examples/custom-controls for an example of how to do this.
|
|
762
|
+
*/
|
|
763
|
+
var MapControl = /** @class */ (function (_super) {
|
|
764
|
+
__extends(MapControl, _super);
|
|
765
|
+
function MapControl(options) {
|
|
766
|
+
return _super.call(this, options) || this;
|
|
767
|
+
}
|
|
768
|
+
return MapControl;
|
|
769
|
+
}(control.Control));
|
|
770
|
+
|
|
755
771
|
var MapRenderedEvent = /** @class */ (function (_super) {
|
|
756
772
|
__extends(MapRenderedEvent, _super);
|
|
757
773
|
function MapRenderedEvent(map) {
|
|
@@ -922,6 +938,71 @@
|
|
|
922
938
|
}(postboy.PostboyGenericMessage));
|
|
923
939
|
CancelFeatureModificationCommand.ID = '9c9fb40f-ea95-4704-8177-0e9ecabf36fa';
|
|
924
940
|
|
|
941
|
+
var AddControlCommand = /** @class */ (function (_super) {
|
|
942
|
+
__extends(AddControlCommand, _super);
|
|
943
|
+
function AddControlCommand(item) {
|
|
944
|
+
var _this = _super.call(this) || this;
|
|
945
|
+
_this.item = item;
|
|
946
|
+
return _this;
|
|
947
|
+
}
|
|
948
|
+
Object.defineProperty(AddControlCommand.prototype, "id", {
|
|
949
|
+
get: function () {
|
|
950
|
+
return AddControlCommand.ID;
|
|
951
|
+
},
|
|
952
|
+
enumerable: false,
|
|
953
|
+
configurable: true
|
|
954
|
+
});
|
|
955
|
+
return AddControlCommand;
|
|
956
|
+
}(postboy.PostboyGenericMessage));
|
|
957
|
+
AddControlCommand.ID = '8e1c06eb-b395-4fe1-929c-ebf0805eeb49';
|
|
958
|
+
|
|
959
|
+
var RemoveControlCommand = /** @class */ (function (_super) {
|
|
960
|
+
__extends(RemoveControlCommand, _super);
|
|
961
|
+
function RemoveControlCommand(item) {
|
|
962
|
+
var _this = _super.call(this) || this;
|
|
963
|
+
_this.item = item;
|
|
964
|
+
return _this;
|
|
965
|
+
}
|
|
966
|
+
Object.defineProperty(RemoveControlCommand.prototype, "id", {
|
|
967
|
+
get: function () {
|
|
968
|
+
return RemoveControlCommand.ID;
|
|
969
|
+
},
|
|
970
|
+
enumerable: false,
|
|
971
|
+
configurable: true
|
|
972
|
+
});
|
|
973
|
+
return RemoveControlCommand;
|
|
974
|
+
}(postboy.PostboyGenericMessage));
|
|
975
|
+
RemoveControlCommand.ID = '361641e0-804a-4930-8c27-0cea6330dbfc';
|
|
976
|
+
|
|
977
|
+
/**
|
|
978
|
+
* Forces map to move to a specific point
|
|
979
|
+
*/
|
|
980
|
+
var SetMapCenterCommand = /** @class */ (function (_super) {
|
|
981
|
+
__extends(SetMapCenterCommand, _super);
|
|
982
|
+
/**
|
|
983
|
+
*
|
|
984
|
+
* @param lat - the desired latitude
|
|
985
|
+
* @param lng - the desired longitude
|
|
986
|
+
* @param zoom - the desired zoom; doesn't change zoom if undefined
|
|
987
|
+
*/
|
|
988
|
+
function SetMapCenterCommand(lat, lng, zoom) {
|
|
989
|
+
var _this = _super.call(this) || this;
|
|
990
|
+
_this.lat = lat;
|
|
991
|
+
_this.lng = lng;
|
|
992
|
+
_this.zoom = zoom;
|
|
993
|
+
return _this;
|
|
994
|
+
}
|
|
995
|
+
Object.defineProperty(SetMapCenterCommand.prototype, "id", {
|
|
996
|
+
get: function () {
|
|
997
|
+
return SetMapCenterCommand.ID;
|
|
998
|
+
},
|
|
999
|
+
enumerable: false,
|
|
1000
|
+
configurable: true
|
|
1001
|
+
});
|
|
1002
|
+
return SetMapCenterCommand;
|
|
1003
|
+
}(postboy.PostboyGenericMessage));
|
|
1004
|
+
SetMapCenterCommand.ID = 'd50e89c9-6707-4f8c-ab57-65fcef232182';
|
|
1005
|
+
|
|
925
1006
|
var AddLayerCommand = /** @class */ (function (_super) {
|
|
926
1007
|
__extends(AddLayerCommand, _super);
|
|
927
1008
|
function AddLayerCommand(layer) {
|
|
@@ -1270,14 +1351,14 @@
|
|
|
1270
1351
|
MapManagementService.prototype.observePlaceFeatures = function () {
|
|
1271
1352
|
var _this = this;
|
|
1272
1353
|
this.postboy.subscribe(PlaceLayerFeaturesCommand.ID).subscribe(function (c) {
|
|
1273
|
-
var _a;
|
|
1354
|
+
var _a, _b;
|
|
1274
1355
|
if (!_this.layers.has(c.layer))
|
|
1275
1356
|
return;
|
|
1276
1357
|
var source = _this.layers.take(c.layer).getSource();
|
|
1277
1358
|
if (!!source['getSource'])
|
|
1278
1359
|
source = (_a = source) === null || _a === void 0 ? void 0 : _a.getSource();
|
|
1279
1360
|
source === null || source === void 0 ? void 0 : source.clear();
|
|
1280
|
-
source === null || source === void 0 ? void 0 : source.addFeatures(c.features);
|
|
1361
|
+
!!((_b = c.features) === null || _b === void 0 ? void 0 : _b.length) && (source === null || source === void 0 ? void 0 : source.addFeatures(c.features));
|
|
1281
1362
|
});
|
|
1282
1363
|
};
|
|
1283
1364
|
MapManagementService.prototype.observeRemoveLayer = function () {
|
|
@@ -1320,8 +1401,15 @@
|
|
|
1320
1401
|
this.postboy = postboy;
|
|
1321
1402
|
}
|
|
1322
1403
|
MapStateService.prototype.up = function () {
|
|
1404
|
+
this.observeMapRendering();
|
|
1405
|
+
this.observeCenter();
|
|
1406
|
+
};
|
|
1407
|
+
MapStateService.prototype.observeMapRendering = function () {
|
|
1323
1408
|
var _this = this;
|
|
1324
|
-
this.postboy
|
|
1409
|
+
this.postboy
|
|
1410
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1411
|
+
.pipe(operators.first())
|
|
1412
|
+
.subscribe(function (ev) {
|
|
1325
1413
|
var _a;
|
|
1326
1414
|
_this.map = ev.map;
|
|
1327
1415
|
(_a = _this.map) === null || _a === void 0 ? void 0 : _a.on('moveend', function () {
|
|
@@ -1332,6 +1420,15 @@
|
|
|
1332
1420
|
});
|
|
1333
1421
|
});
|
|
1334
1422
|
};
|
|
1423
|
+
MapStateService.prototype.observeCenter = function () {
|
|
1424
|
+
var _this = this;
|
|
1425
|
+
this.postboy.subscribe(SetMapCenterCommand.ID).subscribe(function (c) {
|
|
1426
|
+
var _a, _b;
|
|
1427
|
+
(_a = _this.map) === null || _a === void 0 ? void 0 : _a.getView().setCenter([c.lng, c.lat]);
|
|
1428
|
+
if (c.zoom)
|
|
1429
|
+
(_b = _this.map) === null || _b === void 0 ? void 0 : _b.getView().setZoom(c.zoom);
|
|
1430
|
+
});
|
|
1431
|
+
};
|
|
1335
1432
|
return MapStateService;
|
|
1336
1433
|
}());
|
|
1337
1434
|
MapStateService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapStateService, deps: [{ token: MapPostboyService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
@@ -1614,16 +1711,55 @@
|
|
|
1614
1711
|
type: i0.Injectable
|
|
1615
1712
|
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
1616
1713
|
|
|
1714
|
+
var ControlsService = /** @class */ (function () {
|
|
1715
|
+
function ControlsService(postboy) {
|
|
1716
|
+
this.postboy = postboy;
|
|
1717
|
+
}
|
|
1718
|
+
ControlsService.prototype.up = function () {
|
|
1719
|
+
this.observeMapRender();
|
|
1720
|
+
};
|
|
1721
|
+
ControlsService.prototype.observeMapRender = function () {
|
|
1722
|
+
var _this = this;
|
|
1723
|
+
this.postboy
|
|
1724
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1725
|
+
.pipe(operators.first())
|
|
1726
|
+
.subscribe(function (m) {
|
|
1727
|
+
_this.map = m.map;
|
|
1728
|
+
_this.observeAdding();
|
|
1729
|
+
_this.observeRemoving();
|
|
1730
|
+
});
|
|
1731
|
+
};
|
|
1732
|
+
ControlsService.prototype.observeAdding = function () {
|
|
1733
|
+
var _this = this;
|
|
1734
|
+
this.postboy.subscribe(AddControlCommand.ID).subscribe(function (c) { var _a; return (_a = _this.map) === null || _a === void 0 ? void 0 : _a.addControl(c.item); });
|
|
1735
|
+
};
|
|
1736
|
+
ControlsService.prototype.observeRemoving = function () {
|
|
1737
|
+
var _this = this;
|
|
1738
|
+
this.postboy
|
|
1739
|
+
.subscribe(RemoveControlCommand.ID)
|
|
1740
|
+
.subscribe(function (c) { var _a; return (_a = _this.map) === null || _a === void 0 ? void 0 : _a.removeControl(c.item); });
|
|
1741
|
+
};
|
|
1742
|
+
return ControlsService;
|
|
1743
|
+
}());
|
|
1744
|
+
ControlsService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlsService, deps: [{ token: MapPostboyService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1745
|
+
ControlsService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlsService });
|
|
1746
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ControlsService, decorators: [{
|
|
1747
|
+
type: i0.Injectable
|
|
1748
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }]; } });
|
|
1749
|
+
|
|
1617
1750
|
var MessageRegistratorService = /** @class */ (function (_super) {
|
|
1618
1751
|
__extends(MessageRegistratorService, _super);
|
|
1619
|
-
function MessageRegistratorService(service, management, state, mapFeature, interaction, drawing, featureModification) {
|
|
1752
|
+
function MessageRegistratorService(service, management, state, mapFeature, interaction, drawing, featureModification, controls) {
|
|
1620
1753
|
var _this = _super.call(this, service) || this;
|
|
1621
|
-
_this.registerServices([management, state, interaction, mapFeature, drawing, featureModification]);
|
|
1754
|
+
_this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
|
|
1622
1755
|
return _this;
|
|
1623
1756
|
}
|
|
1624
1757
|
MessageRegistratorService.prototype._up = function () {
|
|
1625
1758
|
this.registerReplay(MapRenderedEvent.ID);
|
|
1626
1759
|
this.registerReplay(PlaceLayerFeaturesCommand.ID);
|
|
1760
|
+
this.registerReplay(RemoveControlCommand.ID);
|
|
1761
|
+
this.registerReplay(AddControlCommand.ID);
|
|
1762
|
+
this.registerReplay(SetMapCenterCommand.ID);
|
|
1627
1763
|
this.registerSubject(AddLayerCommand.ID);
|
|
1628
1764
|
this.registerSubject(RemoveLayerCommand.ID);
|
|
1629
1765
|
this.registerSubject(AddTileCommand.ID);
|
|
@@ -1649,11 +1785,11 @@
|
|
|
1649
1785
|
};
|
|
1650
1786
|
return MessageRegistratorService;
|
|
1651
1787
|
}(postboy.PostboyAbstractRegistrator));
|
|
1652
|
-
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: FeatureModificationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1788
|
+
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: FeatureModificationService }, { token: ControlsService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1653
1789
|
MessageRegistratorService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MessageRegistratorService });
|
|
1654
1790
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MessageRegistratorService, decorators: [{
|
|
1655
1791
|
type: i0.Injectable
|
|
1656
|
-
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }]; } });
|
|
1792
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }, { type: MapManagementService }, { type: MapStateService }, { type: MapFeatureService }, { type: MapClickService }, { type: DrawingService }, { type: FeatureModificationService }, { type: ControlsService }]; } });
|
|
1657
1793
|
|
|
1658
1794
|
var TileLayerSettings = /** @class */ (function () {
|
|
1659
1795
|
function TileLayerSettings() {
|
|
@@ -1871,13 +2007,32 @@
|
|
|
1871
2007
|
type: i0.Input
|
|
1872
2008
|
}] } });
|
|
1873
2009
|
|
|
2010
|
+
/**
|
|
2011
|
+
* A layer that is responsible for showing and styling main features on the map, such as markers and polygons
|
|
2012
|
+
*/
|
|
1874
2013
|
var FeatureLayerSettings = /** @class */ (function () {
|
|
1875
2014
|
function FeatureLayerSettings() {
|
|
2015
|
+
/**
|
|
2016
|
+
* The identifier of the field, it is autogenerated by default, but can be set manually
|
|
2017
|
+
*/
|
|
1876
2018
|
this.name = IdGenerator.get();
|
|
2019
|
+
/**
|
|
2020
|
+
* The priority of showing - layers with higher zIndex cover others in case of collisions
|
|
2021
|
+
*/
|
|
1877
2022
|
this.zIndex = 1;
|
|
2023
|
+
/**
|
|
2024
|
+
* The maximum zoom at which the layer is visible. 19 by default
|
|
2025
|
+
*/
|
|
1878
2026
|
this.maxZoom = 19;
|
|
2027
|
+
/**
|
|
2028
|
+
* The minimum zoom at which the layer is visible. 0 by default
|
|
2029
|
+
*/
|
|
1879
2030
|
this.minZoom = 0;
|
|
1880
2031
|
}
|
|
2032
|
+
/**
|
|
2033
|
+
* Creates a clone of the existing settings
|
|
2034
|
+
* @param model
|
|
2035
|
+
*/
|
|
1881
2036
|
FeatureLayerSettings.copy = function (model) {
|
|
1882
2037
|
var result = new FeatureLayerSettings();
|
|
1883
2038
|
result.name = model.name;
|
|
@@ -1887,21 +2042,45 @@
|
|
|
1887
2042
|
result.style = model.style;
|
|
1888
2043
|
return result;
|
|
1889
2044
|
};
|
|
2045
|
+
/**
|
|
2046
|
+
Setter for {@link FeatureLayerSettings.zIndex}
|
|
2047
|
+
* @param zIndex
|
|
2048
|
+
*/
|
|
1890
2049
|
FeatureLayerSettings.prototype.setZIndex = function (zIndex) {
|
|
1891
2050
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { zIndex: zIndex }));
|
|
1892
2051
|
};
|
|
2052
|
+
/**
|
|
2053
|
+
* Setter for {@link FeatureLayerSettings.name}
|
|
2054
|
+
* @param name
|
|
2055
|
+
*/
|
|
1893
2056
|
FeatureLayerSettings.prototype.setName = function (name) {
|
|
1894
2057
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { name: name }));
|
|
1895
2058
|
};
|
|
2059
|
+
/**
|
|
2060
|
+
* Setter for {@link FeatureLayerSettings.maxZoom}
|
|
2061
|
+
* @param maxZoom
|
|
2062
|
+
*/
|
|
1896
2063
|
FeatureLayerSettings.prototype.setMaxZoom = function (maxZoom) {
|
|
1897
2064
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
|
|
1898
2065
|
};
|
|
2066
|
+
/**
|
|
2067
|
+
* Setter for {@link FeatureLayerSettings.minZoom}
|
|
2068
|
+
* @param minZoom
|
|
2069
|
+
*/
|
|
1899
2070
|
FeatureLayerSettings.prototype.setMinZoom = function (minZoom) {
|
|
1900
2071
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
|
|
1901
2072
|
};
|
|
2073
|
+
/**
|
|
2074
|
+
* Setter for {@link FeatureLayerSettings.style}
|
|
2075
|
+
* @param style
|
|
2076
|
+
*/
|
|
1902
2077
|
FeatureLayerSettings.prototype.setStyle = function (style) {
|
|
1903
2078
|
return FeatureLayerSettings.copy(Object.assign(Object.assign({}, this), { style: style }));
|
|
1904
2079
|
};
|
|
2080
|
+
/**
|
|
2081
|
+
* Checks if the model has the same content
|
|
2082
|
+
* @param model - the object to compare
|
|
2083
|
+
*/
|
|
1905
2084
|
FeatureLayerSettings.prototype.isSame = function (model) {
|
|
1906
2085
|
if (this.maxZoom !== model.maxZoom)
|
|
1907
2086
|
return false;
|
|
@@ -2296,6 +2475,7 @@
|
|
|
2296
2475
|
DrawingGenerationService,
|
|
2297
2476
|
FeatureService,
|
|
2298
2477
|
FeatureModificationService,
|
|
2478
|
+
ControlsService,
|
|
2299
2479
|
], usesInheritance: true, ngImport: i0__namespace, template: "<ng-content></ng-content>\r\n<art-osm-tile-layer *ngIf=\"osmUrl && map\" [map]=\"map\" [url]=\"osmUrl\"></art-osm-tile-layer>\r\n<art-feature-layer *ngIf=\"map\" [settings]=\"drawingLayerSettings\"></art-feature-layer>\r\n", styles: ["art-map-plate{position:relative;display:flex;flex-direction:column;height:100%}\n"], components: [{ type: OsmTileLayerComponent, selector: "art-osm-tile-layer", inputs: ["url", "map"] }, { type: FeatureLayerComponent, selector: "art-feature-layer", inputs: ["settings"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
2300
2480
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapPlateComponent, decorators: [{
|
|
2301
2481
|
type: i0.Component,
|
|
@@ -2314,6 +2494,7 @@
|
|
|
2314
2494
|
DrawingGenerationService,
|
|
2315
2495
|
FeatureService,
|
|
2316
2496
|
FeatureModificationService,
|
|
2497
|
+
ControlsService,
|
|
2317
2498
|
],
|
|
2318
2499
|
}]
|
|
2319
2500
|
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: MapPostboyService }, { type: MapPlateFactory }, { type: MessageRegistratorService }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { settings: [{
|
|
@@ -2331,7 +2512,7 @@
|
|
|
2331
2512
|
}
|
|
2332
2513
|
Object.defineProperty(MarkersComponent.prototype, "markers", {
|
|
2333
2514
|
set: function (value) {
|
|
2334
|
-
this._markers = value;
|
|
2515
|
+
this._markers = value !== null && value !== void 0 ? value : [];
|
|
2335
2516
|
this.putMarkers();
|
|
2336
2517
|
},
|
|
2337
2518
|
enumerable: false,
|
|
@@ -2345,8 +2526,7 @@
|
|
|
2345
2526
|
.subscribe(function () { return _this.putMarkers(); });
|
|
2346
2527
|
};
|
|
2347
2528
|
MarkersComponent.prototype.putMarkers = function () {
|
|
2348
|
-
|
|
2349
|
-
if (!((_a = this._markers) === null || _a === void 0 ? void 0 : _a.length))
|
|
2529
|
+
if (!this._markers)
|
|
2350
2530
|
return;
|
|
2351
2531
|
this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._markers.map(function (m) { return m.feature; })));
|
|
2352
2532
|
};
|
|
@@ -2494,7 +2674,7 @@
|
|
|
2494
2674
|
}
|
|
2495
2675
|
Object.defineProperty(PolygonsComponent.prototype, "polygons", {
|
|
2496
2676
|
set: function (value) {
|
|
2497
|
-
this._polygons = value;
|
|
2677
|
+
this._polygons = value !== null && value !== void 0 ? value : [];
|
|
2498
2678
|
this.putPolygons();
|
|
2499
2679
|
},
|
|
2500
2680
|
enumerable: false,
|
|
@@ -2832,6 +3012,7 @@
|
|
|
2832
3012
|
* Generated bundle index. Do not edit.
|
|
2833
3013
|
*/
|
|
2834
3014
|
|
|
3015
|
+
exports.AddControlCommand = AddControlCommand;
|
|
2835
3016
|
exports.CancelDrawingCommand = CancelDrawingCommand;
|
|
2836
3017
|
exports.CancelFeatureModificationCommand = CancelFeatureModificationCommand;
|
|
2837
3018
|
exports.CloseTooltipCommand = CloseTooltipCommand;
|
|
@@ -2842,6 +3023,7 @@
|
|
|
2842
3023
|
exports.FeatureLayerComponent = FeatureLayerComponent;
|
|
2843
3024
|
exports.FeatureLayerSettings = FeatureLayerSettings;
|
|
2844
3025
|
exports.MapClickEvent = MapClickEvent;
|
|
3026
|
+
exports.MapControl = MapControl;
|
|
2845
3027
|
exports.MapControlZoomComponent = MapControlZoomComponent;
|
|
2846
3028
|
exports.MapLyrsLabel = MapLyrsLabel;
|
|
2847
3029
|
exports.MapModule = MapModule;
|
|
@@ -2859,6 +3041,8 @@
|
|
|
2859
3041
|
exports.PolygonModel = PolygonModel;
|
|
2860
3042
|
exports.PolygonStyleHelper = PolygonStyleHelper;
|
|
2861
3043
|
exports.PolygonsComponent = PolygonsComponent;
|
|
3044
|
+
exports.RemoveControlCommand = RemoveControlCommand;
|
|
3045
|
+
exports.SetMapCenterCommand = SetMapCenterCommand;
|
|
2862
3046
|
exports.StartDrawingCommand = StartDrawingCommand;
|
|
2863
3047
|
exports.StringifyFeatureHelper = StringifyFeatureHelper;
|
|
2864
3048
|
exports.TextStyleHelper = TextStyleHelper;
|