@artstesh/maps 6.1.7 → 6.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.
Files changed (43) hide show
  1. package/dist/esm2022/map/helpers/text-style.helper.mjs +15 -7
  2. package/dist/esm2022/map/messages/commands/modify-feature.command.mjs +2 -2
  3. package/dist/esm2022/map/messages/commands/start-drawing.command.mjs +1 -1
  4. package/dist/esm2022/map/messages/executors/generate-draw.executor.mjs +1 -1
  5. package/dist/esm2022/map/messages/executors/get-geometry-length.executor.mjs +18 -0
  6. package/dist/esm2022/map/messages/index.mjs +2 -1
  7. package/dist/esm2022/map/models/drawing-type.enum.mjs +2 -1
  8. package/dist/esm2022/map/ol-proxy.mjs +4 -1
  9. package/dist/esm2022/map/services/drawing/drawing-generation.service.mjs +2 -2
  10. package/dist/esm2022/map/services/map-click.service.mjs +2 -2
  11. package/dist/esm2022/map/services/message-registrator.service.mjs +3 -1
  12. package/dist/esm2022/src/map/helpers/text-style.helper.mjs +15 -7
  13. package/dist/esm2022/src/map/messages/commands/modify-feature.command.mjs +2 -2
  14. package/dist/esm2022/src/map/messages/commands/start-drawing.command.mjs +1 -1
  15. package/dist/esm2022/src/map/messages/executors/generate-draw.executor.mjs +1 -1
  16. package/dist/esm2022/src/map/messages/executors/get-geometry-length.executor.mjs +18 -0
  17. package/dist/esm2022/src/map/messages/index.mjs +2 -1
  18. package/dist/esm2022/src/map/models/drawing-type.enum.mjs +2 -1
  19. package/dist/esm2022/src/map/ol-proxy.mjs +4 -1
  20. package/dist/esm2022/src/map/services/drawing/drawing-generation.service.mjs +2 -2
  21. package/dist/esm2022/src/map/services/map-click.service.mjs +2 -2
  22. package/dist/esm2022/src/map/services/message-registrator.service.mjs +3 -1
  23. package/dist/fesm2022/maps-components-src-map.mjs +45 -15
  24. package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
  25. package/dist/fesm2022/maps-components.mjs +45 -15
  26. package/dist/fesm2022/maps-components.mjs.map +1 -1
  27. package/dist/map/helpers/text-style.helper.d.ts +10 -6
  28. package/dist/map/messages/commands/modify-feature.command.d.ts +4 -4
  29. package/dist/map/messages/commands/start-drawing.command.d.ts +3 -3
  30. package/dist/map/messages/executors/generate-draw.executor.d.ts +3 -3
  31. package/dist/map/messages/executors/get-geometry-length.executor.d.ts +11 -0
  32. package/dist/map/messages/index.d.ts +1 -0
  33. package/dist/map/models/drawing-type.enum.d.ts +2 -1
  34. package/dist/map/ol-proxy.d.ts +4 -0
  35. package/dist/src/map/helpers/text-style.helper.d.ts +10 -6
  36. package/dist/src/map/messages/commands/modify-feature.command.d.ts +4 -4
  37. package/dist/src/map/messages/commands/start-drawing.command.d.ts +3 -3
  38. package/dist/src/map/messages/executors/generate-draw.executor.d.ts +3 -3
  39. package/dist/src/map/messages/executors/get-geometry-length.executor.d.ts +11 -0
  40. package/dist/src/map/messages/index.d.ts +1 -0
  41. package/dist/src/map/models/drawing-type.enum.d.ts +2 -1
  42. package/dist/src/map/ol-proxy.d.ts +4 -0
  43. package/package.json +1 -1
@@ -4,12 +4,16 @@ import { Text } from 'ol/style';
4
4
  */
5
5
  export declare class TextStyleHelper {
6
6
  /**
7
- * Creates a new instance of the Text class with the specified properties.
7
+ * Creates and returns a new Text instance with specified styling properties.
8
8
  *
9
- * @param {string} text - The text content of the Text object.
10
- * @param {string} font - The font style of the Text object.
11
- * @param {string} color - The color of the Text object.
12
- * @return {Text} A new instance of the Text class.
9
+ * @param {string} text - The text content to display.
10
+ * @param {string} font - The font style to use for the text.
11
+ * @param {string} color - The color of the text.
12
+ * @param {string|null|undefined} [backColor] - The background color of the text. Optional.
13
+ * @param {number[]|null|undefined} [padding] - The padding around the text in pixels. Optional.
14
+ * @param {string|null|undefined} [textBaseline] - The text baseline alignment. Optional.
15
+ * @param {number|null|undefined} [offsetY] - The vertical offset for the text. Optional.
16
+ * @return {Text} A new Text instance configured with the specified properties.
13
17
  */
14
- static get(text: string, font: string, color: string): Text;
18
+ static get(text: string, font: string, color: string, backColor?: string | null, padding?: number[] | null, textBaseline?: string | null, offsetY?: number | null): Text;
15
19
  }
@@ -1,6 +1,6 @@
1
1
  import { PostboyCallbackMessage } from '@artstesh/postboy';
2
2
  import { FeatureOutputFormat, PolygonModel } from '../../models';
3
- import Style from 'ol/style/Style';
3
+ import { StyleLike } from 'ol/style/Style';
4
4
  /**
5
5
  * Represents a command to modify a feature with a specific style and output format
6
6
  * for a polygonal model.
@@ -9,7 +9,7 @@ import Style from 'ol/style/Style';
9
9
  */
10
10
  export declare class ModifyFeatureCommand extends PostboyCallbackMessage<string | null> {
11
11
  model: PolygonModel;
12
- style: Style;
12
+ style: StyleLike;
13
13
  format: FeatureOutputFormat;
14
14
  draggable: boolean;
15
15
  static readonly ID = "8f76507e-f18d-4232-bab7-f3d4e3d707bb";
@@ -17,9 +17,9 @@ export declare class ModifyFeatureCommand extends PostboyCallbackMessage<string
17
17
  * Constructs an instance of the class.
18
18
  *
19
19
  * @param {PolygonModel} model - The model representing the polygon data.
20
- * @param {Style} style - The style to be applied to the polygon.
20
+ * @param {StyleLike} style - The style to be applied to the polygon.
21
21
  * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The output format of the feature, defaults to GeoJson.
22
22
  * @param {boolean} [draggable=true] - Determines whether the polygon is draggable, defaults to true.
23
23
  */
24
- constructor(model: PolygonModel, style: Style, format?: FeatureOutputFormat, draggable?: boolean);
24
+ constructor(model: PolygonModel, style: StyleLike, format?: FeatureOutputFormat, draggable?: boolean);
25
25
  }
@@ -1,12 +1,12 @@
1
1
  import { PostboyCallbackMessage } from '@artstesh/postboy';
2
2
  import { DrawingType, FeatureOutputFormat } from '../../models';
3
- import Style from 'ol/style/Style';
3
+ import { StyleLike } from 'ol/style/Style';
4
4
  /**
5
5
  * Represents a command to start a drawing operation.
6
6
  */
7
7
  export declare class StartDrawingCommand extends PostboyCallbackMessage<string | null> {
8
8
  type: DrawingType;
9
- style: Style;
9
+ style: StyleLike;
10
10
  format: FeatureOutputFormat;
11
11
  static readonly ID = "4407e9ee-d6c3-4e77-8000-c1aae7433fb6";
12
12
  /**
@@ -16,5 +16,5 @@ export declare class StartDrawingCommand extends PostboyCallbackMessage<string |
16
16
  * @param {Style} style - The style defining visual appearance of the drawing.
17
17
  * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The format of the feature output. Defaults to GeoJson.
18
18
  */
19
- constructor(type: DrawingType, style: Style, format?: FeatureOutputFormat);
19
+ constructor(type: DrawingType, style: StyleLike, format?: FeatureOutputFormat);
20
20
  }
@@ -3,11 +3,11 @@ import { Vector as Layer } from 'ol/layer';
3
3
  import VectorSource from 'ol/source/Vector';
4
4
  import { Draw } from 'ol/interaction';
5
5
  import { DrawingType } from '../../models';
6
- import Style from 'ol/style/Style';
6
+ import { StyleLike } from 'ol/style/Style';
7
7
  export declare class GenerateDrawExecutor extends PostboyExecutor<Draw> {
8
8
  layer: Layer<VectorSource<any>>;
9
- style: Style;
9
+ style: StyleLike;
10
10
  type: DrawingType;
11
11
  static readonly ID = "5d5f0737-ff70-461e-9a2e-bf6166c914cb";
12
- constructor(layer: Layer<VectorSource<any>>, style: Style, type: DrawingType);
12
+ constructor(layer: Layer<VectorSource<any>>, style: StyleLike, type: DrawingType);
13
13
  }
@@ -0,0 +1,11 @@
1
+ import { PostboyExecutor } from '@artstesh/postboy';
2
+ import { Geometry } from 'ol/geom';
3
+ export declare class GetGeometryLengthExecutor extends PostboyExecutor<number> {
4
+ geometry: Geometry;
5
+ projection: string;
6
+ static readonly ID = "763146df-6d93-4dc2-a532-0e9ba2b2d023";
7
+ constructor(geometry: Geometry, projection?: string);
8
+ }
9
+ export declare class GetGeometryLengthExecutorHandler {
10
+ handle(executor: GetGeometryLengthExecutor): number;
11
+ }
@@ -21,3 +21,4 @@ export * from './executors/polygon-self-intersection.executor';
21
21
  export * from './queries/get-features-in-area.query';
22
22
  export * from './queries/get-features-in-point.query';
23
23
  export * from './commands/fit-to-features.command';
24
+ export { GetGeometryLengthExecutor } from './executors/get-geometry-length.executor';
@@ -15,5 +15,6 @@ export declare enum DrawingType {
15
15
  Polygon = 1,
16
16
  Circle = 2,
17
17
  Square = 3,
18
- Box = 4
18
+ Box = 4,
19
+ LineString = 5
19
20
  }
@@ -1,3 +1,7 @@
1
1
  export { FeatureLike } from 'ol/Feature';
2
2
  export { Feature } from 'ol';
3
3
  export { Style } from 'ol/style';
4
+ export { Fill, RegularShape, Stroke, Text } from 'ol/style';
5
+ export { StyleLike } from 'ol/style/Style';
6
+ export { Geometry, LineString, Point } from 'ol/geom';
7
+ export * as CircleStyle from 'ol/style/Circle';
@@ -4,12 +4,16 @@ import { Text } from 'ol/style';
4
4
  */
5
5
  export declare class TextStyleHelper {
6
6
  /**
7
- * Creates a new instance of the Text class with the specified properties.
7
+ * Creates and returns a new Text instance with specified styling properties.
8
8
  *
9
- * @param {string} text - The text content of the Text object.
10
- * @param {string} font - The font style of the Text object.
11
- * @param {string} color - The color of the Text object.
12
- * @return {Text} A new instance of the Text class.
9
+ * @param {string} text - The text content to display.
10
+ * @param {string} font - The font style to use for the text.
11
+ * @param {string} color - The color of the text.
12
+ * @param {string|null|undefined} [backColor] - The background color of the text. Optional.
13
+ * @param {number[]|null|undefined} [padding] - The padding around the text in pixels. Optional.
14
+ * @param {string|null|undefined} [textBaseline] - The text baseline alignment. Optional.
15
+ * @param {number|null|undefined} [offsetY] - The vertical offset for the text. Optional.
16
+ * @return {Text} A new Text instance configured with the specified properties.
13
17
  */
14
- static get(text: string, font: string, color: string): Text;
18
+ static get(text: string, font: string, color: string, backColor?: string | null, padding?: number[] | null, textBaseline?: string | null, offsetY?: number | null): Text;
15
19
  }
@@ -1,6 +1,6 @@
1
1
  import { PostboyCallbackMessage } from '@artstesh/postboy';
2
2
  import { FeatureOutputFormat, PolygonModel } from '../../models';
3
- import Style from 'ol/style/Style';
3
+ import { StyleLike } from 'ol/style/Style';
4
4
  /**
5
5
  * Represents a command to modify a feature with a specific style and output format
6
6
  * for a polygonal model.
@@ -9,7 +9,7 @@ import Style from 'ol/style/Style';
9
9
  */
10
10
  export declare class ModifyFeatureCommand extends PostboyCallbackMessage<string | null> {
11
11
  model: PolygonModel;
12
- style: Style;
12
+ style: StyleLike;
13
13
  format: FeatureOutputFormat;
14
14
  draggable: boolean;
15
15
  static readonly ID = "8f76507e-f18d-4232-bab7-f3d4e3d707bb";
@@ -17,9 +17,9 @@ export declare class ModifyFeatureCommand extends PostboyCallbackMessage<string
17
17
  * Constructs an instance of the class.
18
18
  *
19
19
  * @param {PolygonModel} model - The model representing the polygon data.
20
- * @param {Style} style - The style to be applied to the polygon.
20
+ * @param {StyleLike} style - The style to be applied to the polygon.
21
21
  * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The output format of the feature, defaults to GeoJson.
22
22
  * @param {boolean} [draggable=true] - Determines whether the polygon is draggable, defaults to true.
23
23
  */
24
- constructor(model: PolygonModel, style: Style, format?: FeatureOutputFormat, draggable?: boolean);
24
+ constructor(model: PolygonModel, style: StyleLike, format?: FeatureOutputFormat, draggable?: boolean);
25
25
  }
@@ -1,12 +1,12 @@
1
1
  import { PostboyCallbackMessage } from '@artstesh/postboy';
2
2
  import { DrawingType, FeatureOutputFormat } from '../../models';
3
- import Style from 'ol/style/Style';
3
+ import { StyleLike } from 'ol/style/Style';
4
4
  /**
5
5
  * Represents a command to start a drawing operation.
6
6
  */
7
7
  export declare class StartDrawingCommand extends PostboyCallbackMessage<string | null> {
8
8
  type: DrawingType;
9
- style: Style;
9
+ style: StyleLike;
10
10
  format: FeatureOutputFormat;
11
11
  static readonly ID = "4407e9ee-d6c3-4e77-8000-c1aae7433fb6";
12
12
  /**
@@ -16,5 +16,5 @@ export declare class StartDrawingCommand extends PostboyCallbackMessage<string |
16
16
  * @param {Style} style - The style defining visual appearance of the drawing.
17
17
  * @param {FeatureOutputFormat} [format=FeatureOutputFormat.GeoJson] - The format of the feature output. Defaults to GeoJson.
18
18
  */
19
- constructor(type: DrawingType, style: Style, format?: FeatureOutputFormat);
19
+ constructor(type: DrawingType, style: StyleLike, format?: FeatureOutputFormat);
20
20
  }
@@ -3,11 +3,11 @@ import { Vector as Layer } from 'ol/layer';
3
3
  import VectorSource from 'ol/source/Vector';
4
4
  import { Draw } from 'ol/interaction';
5
5
  import { DrawingType } from '../../models';
6
- import Style from 'ol/style/Style';
6
+ import { StyleLike } from 'ol/style/Style';
7
7
  export declare class GenerateDrawExecutor extends PostboyExecutor<Draw> {
8
8
  layer: Layer<VectorSource<any>>;
9
- style: Style;
9
+ style: StyleLike;
10
10
  type: DrawingType;
11
11
  static readonly ID = "5d5f0737-ff70-461e-9a2e-bf6166c914cb";
12
- constructor(layer: Layer<VectorSource<any>>, style: Style, type: DrawingType);
12
+ constructor(layer: Layer<VectorSource<any>>, style: StyleLike, type: DrawingType);
13
13
  }
@@ -0,0 +1,11 @@
1
+ import { PostboyExecutor } from '@artstesh/postboy';
2
+ import { Geometry } from 'ol/geom';
3
+ export declare class GetGeometryLengthExecutor extends PostboyExecutor<number> {
4
+ geometry: Geometry;
5
+ projection: string;
6
+ static readonly ID = "763146df-6d93-4dc2-a532-0e9ba2b2d023";
7
+ constructor(geometry: Geometry, projection?: string);
8
+ }
9
+ export declare class GetGeometryLengthExecutorHandler {
10
+ handle(executor: GetGeometryLengthExecutor): number;
11
+ }
@@ -21,3 +21,4 @@ export * from './executors/polygon-self-intersection.executor';
21
21
  export * from './queries/get-features-in-area.query';
22
22
  export * from './queries/get-features-in-point.query';
23
23
  export * from './commands/fit-to-features.command';
24
+ export { GetGeometryLengthExecutor } from './executors/get-geometry-length.executor';
@@ -15,5 +15,6 @@ export declare enum DrawingType {
15
15
  Polygon = 1,
16
16
  Circle = 2,
17
17
  Square = 3,
18
- Box = 4
18
+ Box = 4,
19
+ LineString = 5
19
20
  }
@@ -1,3 +1,7 @@
1
1
  export { FeatureLike } from 'ol/Feature';
2
2
  export { Feature } from 'ol';
3
3
  export { Style } from 'ol/style';
4
+ export { Fill, RegularShape, Stroke, Text } from 'ol/style';
5
+ export { StyleLike } from 'ol/style/Style';
6
+ export { Geometry, LineString, Point } from 'ol/geom';
7
+ export * as CircleStyle from 'ol/style/Circle';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artstesh/maps",
3
- "version": "6.1.7",
3
+ "version": "6.1.9",
4
4
  "author": "artstesh",
5
5
  "license": "MIT",
6
6
  "description": "Let's draw a map ;)",