@artstesh/maps 5.1.2 → 5.1.4

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 (45) hide show
  1. package/dist/esm2022/map/map-plate/map-plate.component.mjs +4 -1
  2. package/dist/esm2022/map/messages/commands/add-control.command.mjs +13 -0
  3. package/dist/esm2022/map/messages/commands/remove-control.command.mjs +13 -0
  4. package/dist/esm2022/map/messages/commands/set-map-center.command.mjs +26 -0
  5. package/dist/esm2022/map/messages/index.mjs +4 -1
  6. package/dist/esm2022/map/models/index.mjs +2 -1
  7. package/dist/esm2022/map/models/map-control.mjs +15 -0
  8. package/dist/esm2022/map/models/polygon.model.mjs +4 -1
  9. package/dist/esm2022/map/services/controls/controls.service.mjs +39 -0
  10. package/dist/esm2022/map/services/map-state.service.mjs +19 -4
  11. package/dist/esm2022/map/services/message-registrator.service.mjs +12 -5
  12. package/dist/esm2022/src/map/map-plate/map-plate.component.mjs +4 -1
  13. package/dist/esm2022/src/map/messages/commands/add-control.command.mjs +13 -0
  14. package/dist/esm2022/src/map/messages/commands/remove-control.command.mjs +13 -0
  15. package/dist/esm2022/src/map/messages/commands/set-map-center.command.mjs +26 -0
  16. package/dist/esm2022/src/map/messages/index.mjs +4 -1
  17. package/dist/esm2022/src/map/models/index.mjs +2 -1
  18. package/dist/esm2022/src/map/models/map-control.mjs +15 -0
  19. package/dist/esm2022/src/map/models/polygon.model.mjs +4 -1
  20. package/dist/esm2022/src/map/services/controls/controls.service.mjs +39 -0
  21. package/dist/esm2022/src/map/services/map-state.service.mjs +19 -4
  22. package/dist/esm2022/src/map/services/message-registrator.service.mjs +12 -5
  23. package/dist/fesm2022/maps-components-src-map.mjs +125 -7
  24. package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
  25. package/dist/fesm2022/maps-components.mjs +125 -7
  26. package/dist/fesm2022/maps-components.mjs.map +1 -1
  27. package/dist/map/messages/commands/add-control.command.d.ts +8 -0
  28. package/dist/map/messages/commands/remove-control.command.d.ts +8 -0
  29. package/dist/map/messages/commands/set-map-center.command.d.ts +18 -0
  30. package/dist/map/messages/index.d.ts +3 -0
  31. package/dist/map/models/index.d.ts +1 -0
  32. package/dist/map/models/map-control.d.ts +13 -0
  33. package/dist/map/services/controls/controls.service.d.ts +14 -0
  34. package/dist/map/services/map-state.service.d.ts +2 -0
  35. package/dist/map/services/message-registrator.service.d.ts +2 -1
  36. package/dist/src/map/messages/commands/add-control.command.d.ts +8 -0
  37. package/dist/src/map/messages/commands/remove-control.command.d.ts +8 -0
  38. package/dist/src/map/messages/commands/set-map-center.command.d.ts +18 -0
  39. package/dist/src/map/messages/index.d.ts +3 -0
  40. package/dist/src/map/models/index.d.ts +1 -0
  41. package/dist/src/map/models/map-control.d.ts +13 -0
  42. package/dist/src/map/services/controls/controls.service.d.ts +14 -0
  43. package/dist/src/map/services/map-state.service.d.ts +2 -0
  44. package/dist/src/map/services/message-registrator.service.d.ts +2 -1
  45. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import { PostboyGenericMessage } from '@artstesh/postboy';
2
+ import { MapControl } from '../../models/map-control';
3
+ export declare class AddControlCommand extends PostboyGenericMessage {
4
+ item: MapControl;
5
+ static readonly ID: string;
6
+ constructor(item: MapControl);
7
+ get id(): string;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { PostboyGenericMessage } from '@artstesh/postboy';
2
+ import { MapControl } from '../../models/map-control';
3
+ export declare class RemoveControlCommand extends PostboyGenericMessage {
4
+ item: MapControl;
5
+ static readonly ID: string;
6
+ constructor(item: MapControl);
7
+ get id(): string;
8
+ }
@@ -0,0 +1,18 @@
1
+ import { PostboyGenericMessage } from '@artstesh/postboy';
2
+ /**
3
+ * Forces map to move to a specific point
4
+ */
5
+ export declare class SetMapCenterCommand extends PostboyGenericMessage {
6
+ lat: number;
7
+ lng: number;
8
+ zoom?: number | undefined;
9
+ static readonly ID: string;
10
+ /**
11
+ *
12
+ * @param lat - the desired latitude
13
+ * @param lng - the desired longitude
14
+ * @param zoom - the desired zoom; doesn't change zoom if undefined
15
+ */
16
+ constructor(lat: number, lng: number, zoom?: number | undefined);
17
+ get id(): string;
18
+ }
@@ -7,3 +7,6 @@ export * from './commands/cancel-drawing.command';
7
7
  export * from './commands/draw-selection-area.command';
8
8
  export * from './commands/modify-feature.command';
9
9
  export * from './commands/cancel-feature-modification.command';
10
+ export * from './commands/add-control.command';
11
+ export * from './commands/remove-control.command';
12
+ export * from './commands/set-map-center.command';
@@ -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 './dictionary';
8
+ export * from './map-control';
@@ -0,0 +1,13 @@
1
+ import { Control } from 'ol/control';
2
+ import { Options } from 'ol/control/Control';
3
+ /**
4
+ *
5
+ * 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.
6
+ * This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
7
+ * var myControl = new Control({element: myElement}); and then adding this to the map.
8
+ * 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.
9
+ * You can also extend this base for your own control class. See examples/custom-controls for an example of how to do this.
10
+ */
11
+ export declare class MapControl extends Control {
12
+ constructor(options: Options);
13
+ }
@@ -0,0 +1,14 @@
1
+ import { MapPostboyService } from '../map-postboy.service';
2
+ import { IPostboyDependingService } from '@artstesh/postboy';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ControlsService implements IPostboyDependingService {
5
+ private postboy;
6
+ private map?;
7
+ constructor(postboy: MapPostboyService);
8
+ up(): void;
9
+ private observeMapRender;
10
+ private observeAdding;
11
+ private observeRemoving;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ControlsService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<ControlsService>;
14
+ }
@@ -6,6 +6,8 @@ export declare class MapStateService implements IPostboyDependingService {
6
6
  private map?;
7
7
  constructor(postboy: MapPostboyService);
8
8
  up(): void;
9
+ private observeMapRendering;
10
+ private observeCenter;
9
11
  static ɵfac: i0.ɵɵFactoryDeclaration<MapStateService, never>;
10
12
  static ɵprov: i0.ɵɵInjectableDeclaration<MapStateService>;
11
13
  }
@@ -6,9 +6,10 @@ import { MapClickService } from './map-click.service';
6
6
  import { MapFeatureService } from './map-feature.service';
7
7
  import { DrawingService } from './drawing/drawing.service';
8
8
  import { FeatureModificationService } from './drawing/feature-modification.service';
9
+ import { ControlsService } from './controls/controls.service';
9
10
  import * as i0 from "@angular/core";
10
11
  export declare class MessageRegistratorService extends PostboyAbstractRegistrator {
11
- constructor(service: MapPostboyService, management: MapManagementService, state: MapStateService, mapFeature: MapFeatureService, interaction: MapClickService, drawing: DrawingService, featureModification: FeatureModificationService);
12
+ constructor(service: MapPostboyService, management: MapManagementService, state: MapStateService, mapFeature: MapFeatureService, interaction: MapClickService, drawing: DrawingService, featureModification: FeatureModificationService, controls: ControlsService);
12
13
  protected _up(): void;
13
14
  private setExecutors;
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageRegistratorService, never>;
@@ -0,0 +1,8 @@
1
+ import { PostboyGenericMessage } from '@artstesh/postboy';
2
+ import { MapControl } from '../../models/map-control';
3
+ export declare class AddControlCommand extends PostboyGenericMessage {
4
+ item: MapControl;
5
+ static readonly ID: string;
6
+ constructor(item: MapControl);
7
+ get id(): string;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { PostboyGenericMessage } from '@artstesh/postboy';
2
+ import { MapControl } from '../../models/map-control';
3
+ export declare class RemoveControlCommand extends PostboyGenericMessage {
4
+ item: MapControl;
5
+ static readonly ID: string;
6
+ constructor(item: MapControl);
7
+ get id(): string;
8
+ }
@@ -0,0 +1,18 @@
1
+ import { PostboyGenericMessage } from '@artstesh/postboy';
2
+ /**
3
+ * Forces map to move to a specific point
4
+ */
5
+ export declare class SetMapCenterCommand extends PostboyGenericMessage {
6
+ lat: number;
7
+ lng: number;
8
+ zoom?: number | undefined;
9
+ static readonly ID: string;
10
+ /**
11
+ *
12
+ * @param lat - the desired latitude
13
+ * @param lng - the desired longitude
14
+ * @param zoom - the desired zoom; doesn't change zoom if undefined
15
+ */
16
+ constructor(lat: number, lng: number, zoom?: number | undefined);
17
+ get id(): string;
18
+ }
@@ -7,3 +7,6 @@ export * from './commands/cancel-drawing.command';
7
7
  export * from './commands/draw-selection-area.command';
8
8
  export * from './commands/modify-feature.command';
9
9
  export * from './commands/cancel-feature-modification.command';
10
+ export * from './commands/add-control.command';
11
+ export * from './commands/remove-control.command';
12
+ export * from './commands/set-map-center.command';
@@ -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 './dictionary';
8
+ export * from './map-control';
@@ -0,0 +1,13 @@
1
+ import { Control } from 'ol/control';
2
+ import { Options } from 'ol/control/Control';
3
+ /**
4
+ *
5
+ * 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.
6
+ * This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
7
+ * var myControl = new Control({element: myElement}); and then adding this to the map.
8
+ * 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.
9
+ * You can also extend this base for your own control class. See examples/custom-controls for an example of how to do this.
10
+ */
11
+ export declare class MapControl extends Control {
12
+ constructor(options: Options);
13
+ }
@@ -0,0 +1,14 @@
1
+ import { MapPostboyService } from '../map-postboy.service';
2
+ import { IPostboyDependingService } from '@artstesh/postboy';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ControlsService implements IPostboyDependingService {
5
+ private postboy;
6
+ private map?;
7
+ constructor(postboy: MapPostboyService);
8
+ up(): void;
9
+ private observeMapRender;
10
+ private observeAdding;
11
+ private observeRemoving;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ControlsService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<ControlsService>;
14
+ }
@@ -6,6 +6,8 @@ export declare class MapStateService implements IPostboyDependingService {
6
6
  private map?;
7
7
  constructor(postboy: MapPostboyService);
8
8
  up(): void;
9
+ private observeMapRendering;
10
+ private observeCenter;
9
11
  static ɵfac: i0.ɵɵFactoryDeclaration<MapStateService, never>;
10
12
  static ɵprov: i0.ɵɵInjectableDeclaration<MapStateService>;
11
13
  }
@@ -6,9 +6,10 @@ import { MapClickService } from './map-click.service';
6
6
  import { MapFeatureService } from './map-feature.service';
7
7
  import { DrawingService } from './drawing/drawing.service';
8
8
  import { FeatureModificationService } from './drawing/feature-modification.service';
9
+ import { ControlsService } from './controls/controls.service';
9
10
  import * as i0 from "@angular/core";
10
11
  export declare class MessageRegistratorService extends PostboyAbstractRegistrator {
11
- constructor(service: MapPostboyService, management: MapManagementService, state: MapStateService, mapFeature: MapFeatureService, interaction: MapClickService, drawing: DrawingService, featureModification: FeatureModificationService);
12
+ constructor(service: MapPostboyService, management: MapManagementService, state: MapStateService, mapFeature: MapFeatureService, interaction: MapClickService, drawing: DrawingService, featureModification: FeatureModificationService, controls: ControlsService);
12
13
  protected _up(): void;
13
14
  private setExecutors;
14
15
  static ɵfac: i0.ɵɵFactoryDeclaration<MessageRegistratorService, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artstesh/maps",
3
- "version": "5.1.2",
3
+ "version": "5.1.4",
4
4
  "author": "artstesh",
5
5
  "license": "MIT",
6
6
  "description": "Let's draw a map ;)",