@artstesh/maps 4.1.9 → 4.1.11
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/events/map-move-end.event.mjs +3 -4
- package/dist/esm2020/map/messages/executors/get-map-position.executor.mjs +16 -0
- package/dist/esm2020/map/messages/index.mjs +3 -1
- package/dist/esm2020/map/models/index.mjs +2 -1
- package/dist/esm2020/map/models/map-position.model.mjs +2 -0
- package/dist/esm2020/map/services/map-state.service.mjs +10 -4
- package/dist/esm2020/map/services/message-registrator.service.mjs +4 -1
- package/dist/esm2020/src/map/messages/events/map-move-end.event.mjs +3 -4
- package/dist/esm2020/src/map/messages/executors/get-map-position.executor.mjs +16 -0
- package/dist/esm2020/src/map/messages/index.mjs +3 -1
- package/dist/esm2020/src/map/models/index.mjs +2 -1
- package/dist/esm2020/src/map/models/map-position.model.mjs +2 -0
- package/dist/esm2020/src/map/services/map-state.service.mjs +10 -4
- package/dist/esm2020/src/map/services/message-registrator.service.mjs +4 -1
- package/dist/fesm2015/maps-components-src-map.mjs +41 -20
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +41 -20
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +41 -19
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +41 -19
- package/dist/fesm2020/maps-components.mjs.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 +2 -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 +2 -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
|
@@ -234,10 +234,9 @@ class MapClickEvent extends PostboyGenericMessage {
|
|
|
234
234
|
MapClickEvent.ID = '323df526-8d9c-49c6-83e8-6e9a1e7762f7';
|
|
235
235
|
|
|
236
236
|
class MapMoveEndEvent extends PostboyGenericMessage {
|
|
237
|
-
constructor(
|
|
237
|
+
constructor(position) {
|
|
238
238
|
super();
|
|
239
|
-
this.
|
|
240
|
-
this.extent = extent;
|
|
239
|
+
this.position = position;
|
|
241
240
|
}
|
|
242
241
|
get id() {
|
|
243
242
|
return MapMoveEndEvent.ID;
|
|
@@ -376,6 +375,33 @@ class FitToPolygonsCommand extends PostboyGenericMessage {
|
|
|
376
375
|
}
|
|
377
376
|
FitToPolygonsCommand.ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
|
|
378
377
|
|
|
378
|
+
/**
|
|
379
|
+
* A message that allows to get the current state of the map.
|
|
380
|
+
* If the map's state is not defined yet, the executor would return null
|
|
381
|
+
* @returns {MapPosition | null}
|
|
382
|
+
*/
|
|
383
|
+
class GetMapPositionExecutor extends PostboyExecutor {
|
|
384
|
+
get id() {
|
|
385
|
+
return GetMapPositionExecutor.ID;
|
|
386
|
+
}
|
|
387
|
+
constructor() {
|
|
388
|
+
super();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
GetMapPositionExecutor.ID = '52c95689-d09b-4082-ba58-9183ea96a213';
|
|
392
|
+
|
|
393
|
+
class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
|
|
394
|
+
constructor(area, ignore = new Set()) {
|
|
395
|
+
super();
|
|
396
|
+
this.area = area;
|
|
397
|
+
this.ignore = ignore;
|
|
398
|
+
}
|
|
399
|
+
get id() {
|
|
400
|
+
return GetFeaturesInAreaQuery.ID;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
|
|
404
|
+
|
|
379
405
|
class AddLayerCommand extends PostboyGenericMessage {
|
|
380
406
|
constructor(layer) {
|
|
381
407
|
super();
|
|
@@ -508,18 +534,6 @@ class FeatureService {
|
|
|
508
534
|
}
|
|
509
535
|
}
|
|
510
536
|
|
|
511
|
-
class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
|
|
512
|
-
constructor(area, ignore = new Set()) {
|
|
513
|
-
super();
|
|
514
|
-
this.area = area;
|
|
515
|
-
this.ignore = ignore;
|
|
516
|
-
}
|
|
517
|
-
get id() {
|
|
518
|
-
return GetFeaturesInAreaQuery.ID;
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
|
|
522
|
-
|
|
523
537
|
class FilterFeaturesInAreaExecutor extends PostboyExecutor {
|
|
524
538
|
constructor(area, features) {
|
|
525
539
|
super();
|
|
@@ -677,6 +691,14 @@ class MapStateService {
|
|
|
677
691
|
this.observeMapRendering();
|
|
678
692
|
this.observeCenter();
|
|
679
693
|
}
|
|
694
|
+
getMapPosition() {
|
|
695
|
+
if (!this.map)
|
|
696
|
+
return null;
|
|
697
|
+
let [longitude, latitude] = this.map.getView().getCenter();
|
|
698
|
+
const zoom = Math.floor(this.map.getView().getZoom());
|
|
699
|
+
const extent = this.map.getView().calculateExtent();
|
|
700
|
+
return { longitude, latitude, zoom, extent };
|
|
701
|
+
}
|
|
680
702
|
observeMapRendering() {
|
|
681
703
|
this.postboy
|
|
682
704
|
.subscribe(MapRenderedEvent.ID)
|
|
@@ -685,10 +707,7 @@ class MapStateService {
|
|
|
685
707
|
var _a;
|
|
686
708
|
this.map = ev.map;
|
|
687
709
|
(_a = this.map) === null || _a === void 0 ? void 0 : _a.on('moveend', () => {
|
|
688
|
-
|
|
689
|
-
const zoom = Math.floor(((_a = this.map) === null || _a === void 0 ? void 0 : _a.getView().getZoom()) || -1);
|
|
690
|
-
const extent = ((_b = this.map) === null || _b === void 0 ? void 0 : _b.getView().calculateExtent()) || [];
|
|
691
|
-
this.postboy.fire(new MapMoveEndEvent(zoom, extent));
|
|
710
|
+
this.postboy.fire(new MapMoveEndEvent(this.getMapPosition()));
|
|
692
711
|
});
|
|
693
712
|
});
|
|
694
713
|
}
|
|
@@ -1011,6 +1030,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1011
1030
|
class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
1012
1031
|
constructor(service, management, state, mapFeature, interaction, drawing, featureModification, controls) {
|
|
1013
1032
|
super(service);
|
|
1033
|
+
this.state = state;
|
|
1014
1034
|
this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
|
|
1015
1035
|
}
|
|
1016
1036
|
_up() {
|
|
@@ -1043,6 +1063,7 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
1043
1063
|
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()); });
|
|
1044
1064
|
this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
|
|
1045
1065
|
this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
|
|
1066
|
+
this.registerExecutor(GetMapPositionExecutor.ID, () => this.state.getMapPosition());
|
|
1046
1067
|
}
|
|
1047
1068
|
}
|
|
1048
1069
|
MessageRegistratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: FeatureModificationService }, { token: ControlsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2462,5 +2483,5 @@ class StringifyFeatureHelper {
|
|
|
2462
2483
|
* Generated bundle index. Do not edit.
|
|
2463
2484
|
*/
|
|
2464
2485
|
|
|
2465
|
-
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FitToPolygonsCommand, 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 };
|
|
2486
|
+
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, 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 };
|
|
2466
2487
|
//# sourceMappingURL=maps-components.mjs.map
|