@artstesh/maps 4.1.37 → 4.2.1
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/README.md +7 -0
- package/dist/README.md +24 -24
- package/dist/esm2020/map/messages/executors/calculate-area.executor.mjs +1 -1
- package/dist/esm2020/map/messages/executors/generate-zoom-control.executor.mjs +1 -1
- package/dist/esm2020/map/services/drawing/drawing.service.mjs +5 -2
- package/dist/esm2020/map/services/map-postboy.service.mjs +1 -9
- package/dist/esm2020/map/services/map-state.service.mjs +2 -2
- package/dist/esm2020/src/map/messages/executors/calculate-area.executor.mjs +1 -1
- package/dist/esm2020/src/map/messages/executors/generate-zoom-control.executor.mjs +1 -1
- package/dist/esm2020/src/map/services/drawing/drawing.service.mjs +5 -2
- package/dist/esm2020/src/map/services/map-postboy.service.mjs +1 -9
- package/dist/esm2020/src/map/services/map-state.service.mjs +2 -2
- package/dist/fesm2015/maps-components-src-map.mjs +4 -7
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +4 -7
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +4 -7
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +4 -7
- package/dist/fesm2020/maps-components.mjs.map +1 -1
- package/dist/map/messages/executors/calculate-area.executor.d.ts +1 -3
- package/dist/map/messages/executors/generate-zoom-control.executor.d.ts +2 -2
- package/dist/package.json +1 -1
- package/dist/src/map/messages/executors/calculate-area.executor.d.ts +1 -3
- package/dist/src/map/messages/executors/generate-zoom-control.executor.d.ts +2 -2
- package/package.json +13 -3
|
@@ -11,7 +11,7 @@ import { getCenter, createEmpty, extend } from 'ol/extent';
|
|
|
11
11
|
import Polygon, { circular, fromExtent } from 'ol/geom/Polygon';
|
|
12
12
|
import { Control, Zoom } from 'ol/control';
|
|
13
13
|
import { get, useGeographic, transform } from 'ol/proj';
|
|
14
|
-
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
14
|
+
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, LockMessage, UnlockMessage, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
15
15
|
import * as Sphere from 'ol/sphere';
|
|
16
16
|
import { getLength } from 'ol/sphere';
|
|
17
17
|
import { Draw, Modify, Translate, defaults } from 'ol/interaction';
|
|
@@ -937,11 +937,6 @@ RemoveRasterTileCommand.ID = 'd1c4bf6a-e2f2-4385-a7a2-cecb525f8939';
|
|
|
937
937
|
class MapPostboyService extends PostboyService {
|
|
938
938
|
constructor() {
|
|
939
939
|
super();
|
|
940
|
-
this.addLocker({
|
|
941
|
-
locker: StartDrawingCommand.ID,
|
|
942
|
-
unlocker: DrawingFinishedEvent.ID,
|
|
943
|
-
locking: [MapClickEvent.ID],
|
|
944
|
-
});
|
|
945
940
|
}
|
|
946
941
|
}
|
|
947
942
|
MapPostboyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapPostboyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1085,7 +1080,7 @@ class MapStateService {
|
|
|
1085
1080
|
if (!this.map)
|
|
1086
1081
|
return null;
|
|
1087
1082
|
let [longitude, latitude] = this.map.getView().getCenter();
|
|
1088
|
-
const zoom =
|
|
1083
|
+
const zoom = this.map.getView().getZoom();
|
|
1089
1084
|
const extent = this.map.getView().calculateExtent();
|
|
1090
1085
|
return { longitude, latitude, zoom, extent };
|
|
1091
1086
|
}
|
|
@@ -1247,6 +1242,7 @@ class DrawingService {
|
|
|
1247
1242
|
}
|
|
1248
1243
|
observeDrawing() {
|
|
1249
1244
|
this.postboy.sub(StartDrawingCommand).subscribe((ev) => {
|
|
1245
|
+
this.postboy.exec(new LockMessage(MapClickEvent));
|
|
1250
1246
|
this.draw((l) => {
|
|
1251
1247
|
if (!l || !this.map) {
|
|
1252
1248
|
this.clearInteraction(l);
|
|
@@ -1292,6 +1288,7 @@ class DrawingService {
|
|
|
1292
1288
|
this.map?.removeInteraction(this.drawInteraction);
|
|
1293
1289
|
layer?.setSource(new Vector({}));
|
|
1294
1290
|
}
|
|
1291
|
+
this.postboy.exec(new UnlockMessage(MapClickEvent));
|
|
1295
1292
|
setTimeout(() => this.postboy.fire(new DrawingFinishedEvent()), 300);
|
|
1296
1293
|
}
|
|
1297
1294
|
}
|