@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
|
@@ -233,10 +233,9 @@ class MapClickEvent extends PostboyGenericMessage {
|
|
|
233
233
|
MapClickEvent.ID = '323df526-8d9c-49c6-83e8-6e9a1e7762f7';
|
|
234
234
|
|
|
235
235
|
class MapMoveEndEvent extends PostboyGenericMessage {
|
|
236
|
-
constructor(
|
|
236
|
+
constructor(position) {
|
|
237
237
|
super();
|
|
238
|
-
this.
|
|
239
|
-
this.extent = extent;
|
|
238
|
+
this.position = position;
|
|
240
239
|
}
|
|
241
240
|
get id() {
|
|
242
241
|
return MapMoveEndEvent.ID;
|
|
@@ -375,6 +374,33 @@ class FitToPolygonsCommand extends PostboyGenericMessage {
|
|
|
375
374
|
}
|
|
376
375
|
FitToPolygonsCommand.ID = 'a9e42b23-ffaf-4c46-8370-e0432cd14d60';
|
|
377
376
|
|
|
377
|
+
/**
|
|
378
|
+
* A message that allows to get the current state of the map.
|
|
379
|
+
* If the map's state is not defined yet, the executor would return null
|
|
380
|
+
* @returns {MapPosition | null}
|
|
381
|
+
*/
|
|
382
|
+
class GetMapPositionExecutor extends PostboyExecutor {
|
|
383
|
+
get id() {
|
|
384
|
+
return GetMapPositionExecutor.ID;
|
|
385
|
+
}
|
|
386
|
+
constructor() {
|
|
387
|
+
super();
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
GetMapPositionExecutor.ID = '52c95689-d09b-4082-ba58-9183ea96a213';
|
|
391
|
+
|
|
392
|
+
class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
|
|
393
|
+
constructor(area, ignore = new Set()) {
|
|
394
|
+
super();
|
|
395
|
+
this.area = area;
|
|
396
|
+
this.ignore = ignore;
|
|
397
|
+
}
|
|
398
|
+
get id() {
|
|
399
|
+
return GetFeaturesInAreaQuery.ID;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
|
|
403
|
+
|
|
378
404
|
class AddLayerCommand extends PostboyGenericMessage {
|
|
379
405
|
constructor(layer) {
|
|
380
406
|
super();
|
|
@@ -507,18 +533,6 @@ class FeatureService {
|
|
|
507
533
|
}
|
|
508
534
|
}
|
|
509
535
|
|
|
510
|
-
class GetFeaturesInAreaQuery extends PostboyCallbackMessage {
|
|
511
|
-
constructor(area, ignore = new Set()) {
|
|
512
|
-
super();
|
|
513
|
-
this.area = area;
|
|
514
|
-
this.ignore = ignore;
|
|
515
|
-
}
|
|
516
|
-
get id() {
|
|
517
|
-
return GetFeaturesInAreaQuery.ID;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
GetFeaturesInAreaQuery.ID = 'efcf4271-a07a-40e0-9f02-d4dade40b8ac';
|
|
521
|
-
|
|
522
536
|
class FilterFeaturesInAreaExecutor extends PostboyExecutor {
|
|
523
537
|
constructor(area, features) {
|
|
524
538
|
super();
|
|
@@ -674,6 +688,14 @@ class MapStateService {
|
|
|
674
688
|
this.observeMapRendering();
|
|
675
689
|
this.observeCenter();
|
|
676
690
|
}
|
|
691
|
+
getMapPosition() {
|
|
692
|
+
if (!this.map)
|
|
693
|
+
return null;
|
|
694
|
+
let [longitude, latitude] = this.map.getView().getCenter();
|
|
695
|
+
const zoom = Math.floor(this.map.getView().getZoom());
|
|
696
|
+
const extent = this.map.getView().calculateExtent();
|
|
697
|
+
return { longitude, latitude, zoom, extent };
|
|
698
|
+
}
|
|
677
699
|
observeMapRendering() {
|
|
678
700
|
this.postboy
|
|
679
701
|
.subscribe(MapRenderedEvent.ID)
|
|
@@ -681,9 +703,7 @@ class MapStateService {
|
|
|
681
703
|
.subscribe((ev) => {
|
|
682
704
|
this.map = ev.map;
|
|
683
705
|
this.map?.on('moveend', () => {
|
|
684
|
-
|
|
685
|
-
const extent = this.map?.getView().calculateExtent() || [];
|
|
686
|
-
this.postboy.fire(new MapMoveEndEvent(zoom, extent));
|
|
706
|
+
this.postboy.fire(new MapMoveEndEvent(this.getMapPosition()));
|
|
687
707
|
});
|
|
688
708
|
});
|
|
689
709
|
}
|
|
@@ -996,6 +1016,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
996
1016
|
class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
997
1017
|
constructor(service, management, state, mapFeature, interaction, drawing, featureModification, controls) {
|
|
998
1018
|
super(service);
|
|
1019
|
+
this.state = state;
|
|
999
1020
|
this.registerServices([management, state, interaction, mapFeature, drawing, featureModification, controls]);
|
|
1000
1021
|
}
|
|
1001
1022
|
_up() {
|
|
@@ -1028,6 +1049,7 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
1028
1049
|
this.registerExecutor(CalculateAreaExecutor.ID, (e) => FeatureService.calculateArea(e.polygon?.feature?.getGeometry()));
|
|
1029
1050
|
this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
|
|
1030
1051
|
this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
|
|
1052
|
+
this.registerExecutor(GetMapPositionExecutor.ID, () => this.state.getMapPosition());
|
|
1031
1053
|
}
|
|
1032
1054
|
}
|
|
1033
1055
|
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 });
|
|
@@ -2439,5 +2461,5 @@ class StringifyFeatureHelper {
|
|
|
2439
2461
|
* Generated bundle index. Do not edit.
|
|
2440
2462
|
*/
|
|
2441
2463
|
|
|
2442
|
-
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 };
|
|
2464
|
+
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 };
|
|
2443
2465
|
//# sourceMappingURL=maps-components.mjs.map
|