@artstesh/maps 6.0.2 → 6.0.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.
Files changed (33) hide show
  1. package/dist/esm2022/map/messages/events/map-move-end.event.mjs +4 -6
  2. package/dist/esm2022/map/messages/executors/get-map-position.executor.mjs +16 -0
  3. package/dist/esm2022/map/messages/index.mjs +2 -1
  4. package/dist/esm2022/map/models/index.mjs +2 -1
  5. package/dist/esm2022/map/models/map-position.model.mjs +2 -0
  6. package/dist/esm2022/map/services/map-state.service.mjs +10 -4
  7. package/dist/esm2022/map/services/message-registrator.service.mjs +5 -1
  8. package/dist/esm2022/src/map/messages/events/map-move-end.event.mjs +4 -6
  9. package/dist/esm2022/src/map/messages/executors/get-map-position.executor.mjs +16 -0
  10. package/dist/esm2022/src/map/messages/index.mjs +2 -1
  11. package/dist/esm2022/src/map/models/index.mjs +2 -1
  12. package/dist/esm2022/src/map/models/map-position.model.mjs +2 -0
  13. package/dist/esm2022/src/map/services/map-state.service.mjs +10 -4
  14. package/dist/esm2022/src/map/services/message-registrator.service.mjs +5 -1
  15. package/dist/fesm2022/maps-components-src-map.mjs +31 -9
  16. package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
  17. package/dist/fesm2022/maps-components.mjs +31 -9
  18. package/dist/fesm2022/maps-components.mjs.map +1 -1
  19. package/dist/map/messages/events/map-move-end.event.d.ts +3 -3
  20. package/dist/map/messages/executors/get-map-position.executor.d.ts +12 -0
  21. package/dist/map/messages/index.d.ts +1 -0
  22. package/dist/map/models/index.d.ts +1 -0
  23. package/dist/map/models/map-position.model.d.ts +6 -0
  24. package/dist/map/services/map-state.service.d.ts +2 -0
  25. package/dist/map/services/message-registrator.service.d.ts +1 -0
  26. package/dist/src/map/messages/events/map-move-end.event.d.ts +3 -3
  27. package/dist/src/map/messages/executors/get-map-position.executor.d.ts +12 -0
  28. package/dist/src/map/messages/index.d.ts +1 -0
  29. package/dist/src/map/models/index.d.ts +1 -0
  30. package/dist/src/map/models/map-position.model.d.ts +6 -0
  31. package/dist/src/map/services/map-state.service.d.ts +2 -0
  32. package/dist/src/map/services/message-registrator.service.d.ts +1 -0
  33. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import { PostboyGenericMessage } from '@artstesh/postboy';
2
+ import { MapPosition } from '../../models';
2
3
  export declare class MapMoveEndEvent extends PostboyGenericMessage {
3
- zoom: number;
4
- extent: number[];
4
+ position: MapPosition | null;
5
5
  static readonly ID: string;
6
- constructor(zoom: number, extent: number[]);
6
+ constructor(position: MapPosition | null);
7
7
  get id(): string;
8
8
  }
@@ -0,0 +1,12 @@
1
+ import { PostboyExecutor } from '@artstesh/postboy';
2
+ import { MapPosition } from '../../models';
3
+ /**
4
+ * A message that allows to get the current state of the map.
5
+ * If the map's state is not defined yet, the executor would return null
6
+ * @returns {MapPosition | null}
7
+ */
8
+ export declare class GetMapPositionExecutor extends PostboyExecutor<MapPosition | null> {
9
+ static readonly ID = "52c95689-d09b-4082-ba58-9183ea96a213";
10
+ get id(): string;
11
+ constructor();
12
+ }
@@ -12,3 +12,4 @@ export * from './commands/remove-control.command';
12
12
  export * from './commands/set-map-center.command';
13
13
  export * from './executors/calculate-area.executor';
14
14
  export * from './commands/fit-to-polygons.command';
15
+ export * from './executors/get-map-position.executor';
@@ -5,3 +5,4 @@ export * from './polygon.model';
5
5
  export * from './drawing-type.enum';
6
6
  export * from './feature-format.enum';
7
7
  export * from './map-control';
8
+ export * from './map-position.model';
@@ -0,0 +1,6 @@
1
+ export interface MapPosition {
2
+ latitude: number;
3
+ longitude: number;
4
+ zoom: number;
5
+ extent: number[];
6
+ }
@@ -1,11 +1,13 @@
1
1
  import { MapPostboyService } from './map-postboy.service';
2
2
  import { IPostboyDependingService } from '@artstesh/postboy';
3
+ import { MapPosition } from '../models';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class MapStateService implements IPostboyDependingService {
5
6
  private postboy;
6
7
  private map?;
7
8
  constructor(postboy: MapPostboyService);
8
9
  up(): void;
10
+ getMapPosition(): MapPosition | null;
9
11
  private observeMapRendering;
10
12
  private observeCenter;
11
13
  static ɵfac: i0.ɵɵFactoryDeclaration<MapStateService, never>;
@@ -9,6 +9,7 @@ import { FeatureModificationService } from './drawing/feature-modification.servi
9
9
  import { ControlsService } from './controls/controls.service';
10
10
  import * as i0 from "@angular/core";
11
11
  export declare class MessageRegistratorService extends PostboyAbstractRegistrator {
12
+ private state;
12
13
  constructor(service: MapPostboyService, management: MapManagementService, state: MapStateService, mapFeature: MapFeatureService, interaction: MapClickService, drawing: DrawingService, featureModification: FeatureModificationService, controls: ControlsService);
13
14
  protected _up(): void;
14
15
  private setExecutors;
@@ -1,8 +1,8 @@
1
1
  import { PostboyGenericMessage } from '@artstesh/postboy';
2
+ import { MapPosition } from '../../models';
2
3
  export declare class MapMoveEndEvent extends PostboyGenericMessage {
3
- zoom: number;
4
- extent: number[];
4
+ position: MapPosition | null;
5
5
  static readonly ID: string;
6
- constructor(zoom: number, extent: number[]);
6
+ constructor(position: MapPosition | null);
7
7
  get id(): string;
8
8
  }
@@ -0,0 +1,12 @@
1
+ import { PostboyExecutor } from '@artstesh/postboy';
2
+ import { MapPosition } from '../../models';
3
+ /**
4
+ * A message that allows to get the current state of the map.
5
+ * If the map's state is not defined yet, the executor would return null
6
+ * @returns {MapPosition | null}
7
+ */
8
+ export declare class GetMapPositionExecutor extends PostboyExecutor<MapPosition | null> {
9
+ static readonly ID = "52c95689-d09b-4082-ba58-9183ea96a213";
10
+ get id(): string;
11
+ constructor();
12
+ }
@@ -12,3 +12,4 @@ export * from './commands/remove-control.command';
12
12
  export * from './commands/set-map-center.command';
13
13
  export * from './executors/calculate-area.executor';
14
14
  export * from './commands/fit-to-polygons.command';
15
+ export * from './executors/get-map-position.executor';
@@ -5,3 +5,4 @@ export * from './polygon.model';
5
5
  export * from './drawing-type.enum';
6
6
  export * from './feature-format.enum';
7
7
  export * from './map-control';
8
+ export * from './map-position.model';
@@ -0,0 +1,6 @@
1
+ export interface MapPosition {
2
+ latitude: number;
3
+ longitude: number;
4
+ zoom: number;
5
+ extent: number[];
6
+ }
@@ -1,11 +1,13 @@
1
1
  import { MapPostboyService } from './map-postboy.service';
2
2
  import { IPostboyDependingService } from '@artstesh/postboy';
3
+ import { MapPosition } from '../models';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class MapStateService implements IPostboyDependingService {
5
6
  private postboy;
6
7
  private map?;
7
8
  constructor(postboy: MapPostboyService);
8
9
  up(): void;
10
+ getMapPosition(): MapPosition | null;
9
11
  private observeMapRendering;
10
12
  private observeCenter;
11
13
  static ɵfac: i0.ɵɵFactoryDeclaration<MapStateService, never>;
@@ -9,6 +9,7 @@ import { FeatureModificationService } from './drawing/feature-modification.servi
9
9
  import { ControlsService } from './controls/controls.service';
10
10
  import * as i0 from "@angular/core";
11
11
  export declare class MessageRegistratorService extends PostboyAbstractRegistrator {
12
+ private state;
12
13
  constructor(service: MapPostboyService, management: MapManagementService, state: MapStateService, mapFeature: MapFeatureService, interaction: MapClickService, drawing: DrawingService, featureModification: FeatureModificationService, controls: ControlsService);
13
14
  protected _up(): void;
14
15
  private setExecutors;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artstesh/maps",
3
- "version": "6.0.2",
3
+ "version": "6.0.3",
4
4
  "author": "artstesh",
5
5
  "license": "MIT",
6
6
  "description": "Let's draw a map ;)",