@artstesh/maps 4.1.28 → 4.1.29
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/helpers/text-style.helper.mjs +15 -7
- package/dist/esm2020/map/messages/commands/start-drawing.command.mjs +1 -1
- package/dist/esm2020/map/messages/executors/generate-draw.executor.mjs +1 -1
- package/dist/esm2020/map/messages/executors/get-geometry-length.executor.mjs +16 -0
- package/dist/esm2020/map/messages/index.mjs +2 -1
- package/dist/esm2020/map/models/drawing-type.enum.mjs +2 -1
- package/dist/esm2020/map/ol-proxy.mjs +4 -1
- package/dist/esm2020/map/services/drawing/drawing-generation.service.mjs +2 -2
- package/dist/esm2020/map/services/message-registrator.service.mjs +3 -1
- package/dist/esm2020/src/map/helpers/text-style.helper.mjs +15 -7
- package/dist/esm2020/src/map/messages/commands/start-drawing.command.mjs +1 -1
- package/dist/esm2020/src/map/messages/executors/generate-draw.executor.mjs +1 -1
- package/dist/esm2020/src/map/messages/executors/get-geometry-length.executor.mjs +16 -0
- package/dist/esm2020/src/map/messages/index.mjs +2 -1
- package/dist/esm2020/src/map/models/drawing-type.enum.mjs +2 -1
- package/dist/esm2020/src/map/ol-proxy.mjs +4 -1
- package/dist/esm2020/src/map/services/drawing/drawing-generation.service.mjs +2 -2
- package/dist/esm2020/src/map/services/message-registrator.service.mjs +3 -1
- package/dist/fesm2015/maps-components-src-map.mjs +41 -13
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +41 -13
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +41 -13
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +41 -13
- package/dist/fesm2020/maps-components.mjs.map +1 -1
- package/dist/map/helpers/text-style.helper.d.ts +10 -6
- package/dist/map/messages/commands/start-drawing.command.d.ts +3 -3
- package/dist/map/messages/executors/generate-draw.executor.d.ts +3 -3
- package/dist/map/messages/executors/get-geometry-length.executor.d.ts +11 -0
- package/dist/map/messages/index.d.ts +1 -0
- package/dist/map/models/drawing-type.enum.d.ts +2 -1
- package/dist/map/ol-proxy.d.ts +4 -0
- package/dist/src/map/helpers/text-style.helper.d.ts +10 -6
- package/dist/src/map/messages/commands/start-drawing.command.d.ts +3 -3
- package/dist/src/map/messages/executors/generate-draw.executor.d.ts +3 -3
- package/dist/src/map/messages/executors/get-geometry-length.executor.d.ts +11 -0
- package/dist/src/map/messages/index.d.ts +1 -0
- package/dist/src/map/models/drawing-type.enum.d.ts +2 -1
- package/dist/src/map/ol-proxy.d.ts +4 -0
- package/package.json +1 -1
|
@@ -5,15 +5,17 @@ import { CommonModule } from '@angular/common';
|
|
|
5
5
|
import { Feature, Collection } from 'ol';
|
|
6
6
|
export { Feature } from 'ol';
|
|
7
7
|
import { Point, LineString } from 'ol/geom';
|
|
8
|
+
export { Geometry, LineString, Point } from 'ol/geom';
|
|
8
9
|
import { GeoJSON, WKT } from 'ol/format';
|
|
9
10
|
import { getCenter, createEmpty, extend } from 'ol/extent';
|
|
10
11
|
import Polygon, { circular, fromExtent } from 'ol/geom/Polygon';
|
|
11
12
|
import { Control, Zoom } from 'ol/control';
|
|
12
13
|
import { get, useGeographic, transform } from 'ol/proj';
|
|
13
14
|
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
15
|
+
import * as Sphere from 'ol/sphere';
|
|
16
|
+
import { getLength } from 'ol/sphere';
|
|
14
17
|
import { Draw, Modify, Translate, defaults } from 'ol/interaction';
|
|
15
18
|
import { createRegularPolygon, createBox } from 'ol/interaction/Draw';
|
|
16
|
-
import * as Sphere from 'ol/sphere';
|
|
17
19
|
import { Subject, combineLatest } from 'rxjs';
|
|
18
20
|
import { first, debounceTime, filter, auditTime } from 'rxjs/operators';
|
|
19
21
|
import { Dictionary } from '@artstesh/collections';
|
|
@@ -30,9 +32,11 @@ import Map from 'ol/Map';
|
|
|
30
32
|
import View from 'ol/View';
|
|
31
33
|
import Overlay from 'ol/Overlay';
|
|
32
34
|
import Style from 'ol/style/Style';
|
|
33
|
-
import { Icon, Circle, Fill, Stroke, Text } from 'ol/style';
|
|
34
|
-
export { Style } from 'ol/style';
|
|
35
|
+
import { Icon, Circle as Circle$1, Fill, Stroke, Text } from 'ol/style';
|
|
36
|
+
export { Fill, RegularShape, Stroke, Style, Text } from 'ol/style';
|
|
35
37
|
import { METERS_PER_UNIT } from 'ol/proj/epsg4326';
|
|
38
|
+
import * as Circle from 'ol/style/Circle';
|
|
39
|
+
export { Circle as CircleStyle };
|
|
36
40
|
|
|
37
41
|
class DestructibleComponent {
|
|
38
42
|
constructor() {
|
|
@@ -271,6 +275,7 @@ var DrawingType;
|
|
|
271
275
|
DrawingType[DrawingType["Circle"] = 2] = "Circle";
|
|
272
276
|
DrawingType[DrawingType["Square"] = 3] = "Square";
|
|
273
277
|
DrawingType[DrawingType["Box"] = 4] = "Box";
|
|
278
|
+
DrawingType[DrawingType["LineString"] = 5] = "LineString";
|
|
274
279
|
})(DrawingType || (DrawingType = {}));
|
|
275
280
|
|
|
276
281
|
/**
|
|
@@ -691,6 +696,20 @@ class FitToFeaturesCommand extends PostboyGenericMessage {
|
|
|
691
696
|
}
|
|
692
697
|
FitToFeaturesCommand.ID = '04d67609-0b4c-4f52-aa53-ad0a3db967dc';
|
|
693
698
|
|
|
699
|
+
class GetGeometryLengthExecutor extends PostboyExecutor {
|
|
700
|
+
constructor(geometry, projection = 'EPSG:4326') {
|
|
701
|
+
super();
|
|
702
|
+
this.geometry = geometry;
|
|
703
|
+
this.projection = projection;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
GetGeometryLengthExecutor.ID = '763146df-6d93-4dc2-a532-0e9ba2b2d023';
|
|
707
|
+
class GetGeometryLengthExecutorHandler {
|
|
708
|
+
handle(executor) {
|
|
709
|
+
return Math.round(getLength(executor.geometry, { projection: executor.projection }) * 100) / 100;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
694
713
|
class AddLayerCommand extends PostboyGenericMessage {
|
|
695
714
|
constructor(layer) {
|
|
696
715
|
super();
|
|
@@ -748,7 +767,7 @@ class DrawingGenerationService {
|
|
|
748
767
|
static getDraw(ev) {
|
|
749
768
|
return new Draw({
|
|
750
769
|
source: ev.layer.getSource(),
|
|
751
|
-
type: ev.type === DrawingType.Polygon ? 'Polygon' : 'Circle',
|
|
770
|
+
type: ev.type === DrawingType.Polygon ? 'Polygon' : ev.type === DrawingType.LineString ? 'LineString' : 'Circle',
|
|
752
771
|
style: ev.style,
|
|
753
772
|
geometryFunction: DrawingGenerationService.geometryFunc(ev.type),
|
|
754
773
|
});
|
|
@@ -1447,6 +1466,7 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
1447
1466
|
this.recordExecutor(GenerateDrawExecutor, (e) => DrawingGenerationService.getDraw(e));
|
|
1448
1467
|
this.recordExecutor(GenerateZoomControlExecutor, (e) => ZoomControlFactory.build(e.settings));
|
|
1449
1468
|
this.recordExecutor(GetMapPositionExecutor, () => this.state.getMapPosition());
|
|
1469
|
+
this.recordExecutor(GetGeometryLengthExecutor, (e) => new GetGeometryLengthExecutorHandler().handle(e));
|
|
1450
1470
|
}
|
|
1451
1471
|
}
|
|
1452
1472
|
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 });
|
|
@@ -3221,7 +3241,7 @@ class MarkerStyleHelper {
|
|
|
3221
3241
|
*/
|
|
3222
3242
|
static circle(radius, fill, strokeColor, strokeWidth = 1) {
|
|
3223
3243
|
return new Style({
|
|
3224
|
-
image: new Circle({
|
|
3244
|
+
image: new Circle$1({
|
|
3225
3245
|
radius,
|
|
3226
3246
|
fill: new Fill({ color: fill }),
|
|
3227
3247
|
stroke: new Stroke({ color: strokeColor, width: strokeWidth }),
|
|
@@ -3276,7 +3296,7 @@ class PolygonStyleHelper {
|
|
|
3276
3296
|
*/
|
|
3277
3297
|
static edit(fill, stroke, strokeWidth = 1, pinRadius = 5) {
|
|
3278
3298
|
return new Style({
|
|
3279
|
-
image: new Circle({
|
|
3299
|
+
image: new Circle$1({
|
|
3280
3300
|
fill: new Fill({
|
|
3281
3301
|
color: stroke,
|
|
3282
3302
|
}),
|
|
@@ -3298,14 +3318,18 @@ class PolygonStyleHelper {
|
|
|
3298
3318
|
*/
|
|
3299
3319
|
class TextStyleHelper {
|
|
3300
3320
|
/**
|
|
3301
|
-
* Creates a new
|
|
3321
|
+
* Creates and returns a new Text instance with specified styling properties.
|
|
3302
3322
|
*
|
|
3303
|
-
* @param {string} text - The text content
|
|
3304
|
-
* @param {string} font - The font style
|
|
3305
|
-
* @param {string} color - The color of the
|
|
3306
|
-
* @
|
|
3323
|
+
* @param {string} text - The text content to display.
|
|
3324
|
+
* @param {string} font - The font style to use for the text.
|
|
3325
|
+
* @param {string} color - The color of the text.
|
|
3326
|
+
* @param {string|null|undefined} [backColor] - The background color of the text. Optional.
|
|
3327
|
+
* @param {number[]|null|undefined} [padding] - The padding around the text in pixels. Optional.
|
|
3328
|
+
* @param {string|null|undefined} [textBaseline] - The text baseline alignment. Optional.
|
|
3329
|
+
* @param {number|null|undefined} [offsetY] - The vertical offset for the text. Optional.
|
|
3330
|
+
* @return {Text} A new Text instance configured with the specified properties.
|
|
3307
3331
|
*/
|
|
3308
|
-
static get(text, font, color) {
|
|
3332
|
+
static get(text, font, color, backColor, padding, textBaseline, offsetY) {
|
|
3309
3333
|
return new Text({
|
|
3310
3334
|
text: text,
|
|
3311
3335
|
font: font,
|
|
@@ -3313,6 +3337,10 @@ class TextStyleHelper {
|
|
|
3313
3337
|
fill: new Fill({
|
|
3314
3338
|
color: color,
|
|
3315
3339
|
}),
|
|
3340
|
+
backgroundFill: backColor ? new Fill({ color: backColor }) : undefined,
|
|
3341
|
+
padding: padding !== null && padding !== void 0 ? padding : undefined,
|
|
3342
|
+
textBaseline: textBaseline !== null && textBaseline !== void 0 ? textBaseline : undefined,
|
|
3343
|
+
offsetY: offsetY !== null && offsetY !== void 0 ? offsetY : undefined,
|
|
3316
3344
|
});
|
|
3317
3345
|
}
|
|
3318
3346
|
}
|
|
@@ -3384,5 +3412,5 @@ class StringifyFeatureHelper {
|
|
|
3384
3412
|
* Generated bundle index. Do not edit.
|
|
3385
3413
|
*/
|
|
3386
3414
|
|
|
3387
|
-
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FilterFeaturesInAreaExecutor, FilterFeaturesInPointExecutor, FitToFeaturesCommand, FitToPolygonsCommand, GetFeaturesInAreaQuery, GetFeaturesInPointQuery, GetMapPositionExecutor, ImageLayerComponent, ImageLayerSettings, MapClickEvent, MapConstants, MapControl, MapControlZoomComponent, MapFeatureHoveredEvent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPointerMoveEvent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonSelfIntersectionExecutor, PolygonStyleHelper, PolygonsComponent, RasterTileLayerComponent, RasterTileLayerSettings, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
|
|
3415
|
+
export { AddControlCommand, CalculateAreaExecutor, CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, FilterFeaturesInAreaExecutor, FilterFeaturesInPointExecutor, FitToFeaturesCommand, FitToPolygonsCommand, GetFeaturesInAreaQuery, GetFeaturesInPointQuery, GetGeometryLengthExecutor, GetMapPositionExecutor, ImageLayerComponent, ImageLayerSettings, MapClickEvent, MapConstants, MapControl, MapControlZoomComponent, MapFeatureHoveredEvent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPointerMoveEvent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonSelfIntersectionExecutor, PolygonStyleHelper, PolygonsComponent, RasterTileLayerComponent, RasterTileLayerSettings, RemoveControlCommand, SetMapCenterCommand, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
|
|
3388
3416
|
//# sourceMappingURL=maps-components.mjs.map
|