@artstesh/maps 1.1.8 → 1.1.9
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 +36 -7
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +36 -7
- package/dist/bundles/maps-components.umd.js.map +1 -1
- package/dist/esm2015/map/messages/events/map-move-end.event.js +3 -4
- package/dist/esm2015/map/messages/executors/get-map-position.executor.js +16 -0
- package/dist/esm2015/map/messages/index.js +2 -1
- package/dist/esm2015/map/models/index.js +2 -1
- package/dist/esm2015/map/models/map-position.model.js +2 -0
- package/dist/esm2015/map/services/map-state.service.js +10 -5
- package/dist/esm2015/map/services/message-registrator.service.js +4 -1
- package/dist/esm2015/src/map/messages/events/map-move-end.event.js +3 -4
- package/dist/esm2015/src/map/messages/executors/get-map-position.executor.js +16 -0
- package/dist/esm2015/src/map/messages/index.js +2 -1
- package/dist/esm2015/src/map/models/index.js +2 -1
- package/dist/esm2015/src/map/models/map-position.model.js +2 -0
- package/dist/esm2015/src/map/services/map-state.service.js +10 -5
- package/dist/esm2015/src/map/services/message-registrator.service.js +4 -1
- package/dist/fesm2015/maps-components-src-map.js +29 -8
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +29 -8
- package/dist/fesm2015/maps-components.js.map +1 -1
- package/dist/map/messages/events/map-move-end.event.d.ts +3 -3
- package/dist/map/messages/executors/get-map-position.executor.d.ts +12 -0
- package/dist/map/messages/index.d.ts +1 -0
- package/dist/map/models/index.d.ts +1 -0
- package/dist/map/models/map-position.model.d.ts +6 -0
- package/dist/map/services/map-state.service.d.ts +2 -0
- package/dist/map/services/message-registrator.service.d.ts +1 -0
- package/dist/src/map/messages/events/map-move-end.event.d.ts +3 -3
- package/dist/src/map/messages/executors/get-map-position.executor.d.ts +12 -0
- package/dist/src/map/messages/index.d.ts +1 -0
- package/dist/src/map/models/index.d.ts +1 -0
- package/dist/src/map/models/map-position.model.d.ts +6 -0
- package/dist/src/map/services/map-state.service.d.ts +2 -0
- package/dist/src/map/services/message-registrator.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -745,10 +745,9 @@
|
|
|
745
745
|
|
|
746
746
|
var MapMoveEndEvent = /** @class */ (function (_super) {
|
|
747
747
|
__extends(MapMoveEndEvent, _super);
|
|
748
|
-
function MapMoveEndEvent(
|
|
748
|
+
function MapMoveEndEvent(position) {
|
|
749
749
|
var _this = _super.call(this) || this;
|
|
750
|
-
_this.
|
|
751
|
-
_this.extent = extent;
|
|
750
|
+
_this.position = position;
|
|
752
751
|
return _this;
|
|
753
752
|
}
|
|
754
753
|
Object.defineProperty(MapMoveEndEvent.prototype, "id", {
|
|
@@ -978,6 +977,27 @@
|
|
|
978
977
|
}(postboy.PostboyGenericMessage));
|
|
979
978
|
FitToPolygonsCommand.ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
|
|
980
979
|
|
|
980
|
+
/**
|
|
981
|
+
* A message that allows to get the current state of the map.
|
|
982
|
+
* If the map's state is not defined yet, the executor would return null
|
|
983
|
+
* @returns {MapPosition | null}
|
|
984
|
+
*/
|
|
985
|
+
var GetMapPositionExecutor = /** @class */ (function (_super) {
|
|
986
|
+
__extends(GetMapPositionExecutor, _super);
|
|
987
|
+
function GetMapPositionExecutor() {
|
|
988
|
+
return _super.call(this) || this;
|
|
989
|
+
}
|
|
990
|
+
Object.defineProperty(GetMapPositionExecutor.prototype, "id", {
|
|
991
|
+
get: function () {
|
|
992
|
+
return GetMapPositionExecutor.ID;
|
|
993
|
+
},
|
|
994
|
+
enumerable: false,
|
|
995
|
+
configurable: true
|
|
996
|
+
});
|
|
997
|
+
return GetMapPositionExecutor;
|
|
998
|
+
}(postboy.PostboyExecutor));
|
|
999
|
+
GetMapPositionExecutor.ID = '52c95689-d09b-4082-ba58-9183ea96a213';
|
|
1000
|
+
|
|
981
1001
|
var AddLayerCommand = /** @class */ (function (_super) {
|
|
982
1002
|
__extends(AddLayerCommand, _super);
|
|
983
1003
|
function AddLayerCommand(layer) {
|
|
@@ -1384,6 +1404,14 @@
|
|
|
1384
1404
|
this.observeMapRendering();
|
|
1385
1405
|
this.observeCenter();
|
|
1386
1406
|
};
|
|
1407
|
+
MapStateService.prototype.getMapPosition = function () {
|
|
1408
|
+
if (!this.map)
|
|
1409
|
+
return null;
|
|
1410
|
+
var _c = __read(this.map.getView().getCenter(), 2), longitude = _c[0], latitude = _c[1];
|
|
1411
|
+
var zoom = Math.floor(this.map.getView().getZoom());
|
|
1412
|
+
var extent = this.map.getView().calculateExtent();
|
|
1413
|
+
return { longitude: longitude, latitude: latitude, zoom: zoom, extent: extent };
|
|
1414
|
+
};
|
|
1387
1415
|
MapStateService.prototype.observeMapRendering = function () {
|
|
1388
1416
|
var _this = this;
|
|
1389
1417
|
this.postboy
|
|
@@ -1393,10 +1421,7 @@
|
|
|
1393
1421
|
var _a;
|
|
1394
1422
|
_this.map = ev.map;
|
|
1395
1423
|
(_a = _this.map) === null || _a === void 0 ? void 0 : _a.on('moveend', function () {
|
|
1396
|
-
|
|
1397
|
-
var zoom = Math.floor(((_a = _this.map) === null || _a === void 0 ? void 0 : _a.getView().getZoom()) || -1);
|
|
1398
|
-
var extent = ((_b = _this.map) === null || _b === void 0 ? void 0 : _b.getView().calculateExtent()) || [];
|
|
1399
|
-
_this.postboy.fire(new MapMoveEndEvent(zoom, extent));
|
|
1424
|
+
_this.postboy.fire(new MapMoveEndEvent(_this.getMapPosition()));
|
|
1400
1425
|
});
|
|
1401
1426
|
});
|
|
1402
1427
|
};
|
|
@@ -1745,6 +1770,7 @@
|
|
|
1745
1770
|
__extends(MessageRegistratorService, _super);
|
|
1746
1771
|
function MessageRegistratorService(service, management, state, mapFeature, interaction, drawing, featureModification, controls) {
|
|
1747
1772
|
var _this = _super.call(this, service) || this;
|
|
1773
|
+
_this.state = state;
|
|
1748
1774
|
_this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
|
|
1749
1775
|
return _this;
|
|
1750
1776
|
}
|
|
@@ -1774,10 +1800,12 @@
|
|
|
1774
1800
|
this.setExecutors();
|
|
1775
1801
|
};
|
|
1776
1802
|
MessageRegistratorService.prototype.setExecutors = function () {
|
|
1803
|
+
var _this = this;
|
|
1777
1804
|
this.registerExecutor(FilterFeaturesInAreaExecutor.ID, function (e) { return FeatureService.filterFeaturesInArea(e); });
|
|
1778
1805
|
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()); });
|
|
1779
1806
|
this.registerExecutor(GenerateDrawExecutor.ID, function (e) { return DrawingGenerationService.getDraw(e); });
|
|
1780
1807
|
this.registerExecutor(GenerateZoomControlExecutor.ID, function (e) { return ZoomControlFactory.build(e.settings); });
|
|
1808
|
+
this.registerExecutor(GetMapPositionExecutor.ID, function () { return _this.state.getMapPosition(); });
|
|
1781
1809
|
};
|
|
1782
1810
|
return MessageRegistratorService;
|
|
1783
1811
|
}(postboy.PostboyAbstractRegistrator));
|
|
@@ -3370,6 +3398,7 @@
|
|
|
3370
3398
|
exports.FeatureLayerComponent = FeatureLayerComponent;
|
|
3371
3399
|
exports.FeatureLayerSettings = FeatureLayerSettings;
|
|
3372
3400
|
exports.FitToPolygonsCommand = FitToPolygonsCommand;
|
|
3401
|
+
exports.GetMapPositionExecutor = GetMapPositionExecutor;
|
|
3373
3402
|
exports.MapClickEvent = MapClickEvent;
|
|
3374
3403
|
exports.MapControl = MapControl;
|
|
3375
3404
|
exports.MapControlZoomComponent = MapControlZoomComponent;
|